From 38c9ab06150e2fc322357705f8c40c13b1915648 Mon Sep 17 00:00:00 2001 From: Qingsong Chen Date: Wed, 4 Jun 2025 02:15:25 +0000 Subject: [PATCH] Add LTP syscall tests --- .github/actions/test/action.yml | 4 + .github/workflows/test_x86.yml | 20 +- .typos.toml | 8 +- Makefile | 3 +- test/syscall_test/Makefile | 119 +- test/syscall_test/gvisor/Makefile | 119 ++ .../{ => gvisor}/blocklists.exfat/access_test | 0 .../{ => gvisor}/blocklists.exfat/chmod_test | 0 .../blocklists.exfat/fallocate_test | 0 .../{ => gvisor}/blocklists.exfat/link_test | 0 .../{ => gvisor}/blocklists.exfat/mkdir_test | 0 .../{ => gvisor}/blocklists.exfat/mknod_test | 0 .../blocklists.exfat/open_create_test | 0 .../{ => gvisor}/blocklists.exfat/open_test | 0 .../{ => gvisor}/blocklists.exfat/stat_test | 0 .../blocklists.exfat/stat_times_test | 0 .../blocklists.exfat/symlink_test | 0 .../{ => gvisor}/blocklists.exfat/utimes_test | 0 .../{ => gvisor}/blocklists.exfat/xattr_test | 0 .../{ => gvisor}/blocklists/chmod_test | 0 .../{ => gvisor}/blocklists/chown_test | 0 .../{ => gvisor}/blocklists/chroot_test | 0 .../{ => gvisor}/blocklists/epoll_test | 0 .../{ => gvisor}/blocklists/eventfd_test | 0 .../{ => gvisor}/blocklists/fallocate_test | 0 .../{ => gvisor}/blocklists/fcntl_test | 0 .../{ => gvisor}/blocklists/flock_test | 0 .../{ => gvisor}/blocklists/futex_test | 0 .../{ => gvisor}/blocklists/getdents_test | 0 .../{ => gvisor}/blocklists/ioctl_test | 0 .../{ => gvisor}/blocklists/link_test | 0 .../{ => gvisor}/blocklists/lseek_test | 0 .../{ => gvisor}/blocklists/mknod_test | 0 .../{ => gvisor}/blocklists/mmap_test | 0 .../{ => gvisor}/blocklists/mount_test | 0 .../{ => gvisor}/blocklists/open_create_test | 0 .../{ => gvisor}/blocklists/open_test | 0 .../{ => gvisor}/blocklists/ppoll_test | 0 .../{ => gvisor}/blocklists/prctl_setuid_test | 0 .../{ => gvisor}/blocklists/pread64_test | 0 .../{ => gvisor}/blocklists/preadv2_test | 0 .../{ => gvisor}/blocklists/proc_test | 0 .../{ => gvisor}/blocklists/pselect_test | 0 .../{ => gvisor}/blocklists/pty_test | 0 .../{ => gvisor}/blocklists/pwritev2_test | 0 .../{ => gvisor}/blocklists/read_test | 0 .../{ => gvisor}/blocklists/readv_test | 0 .../{ => gvisor}/blocklists/rename_test | 0 .../{ => gvisor}/blocklists/rlimits_test | 0 .../{ => gvisor}/blocklists/semaphore_test | 0 .../{ => gvisor}/blocklists/sendfile_test | 0 .../{ => gvisor}/blocklists/sigaltstack_test | 0 .../{ => gvisor}/blocklists/signalfd_test | 0 .../blocklists/socket_netlink_route_test | 0 .../{ => gvisor}/blocklists/stat_test | 0 .../{ => gvisor}/blocklists/statfs_test | 0 .../{ => gvisor}/blocklists/symlink_test | 0 .../{ => gvisor}/blocklists/sync_test | 0 .../{ => gvisor}/blocklists/sysinfo_test | 0 .../{ => gvisor}/blocklists/tcp_socket_test | 0 .../{ => gvisor}/blocklists/timers_test | 0 .../{ => gvisor}/blocklists/truncate_test | 0 .../{ => gvisor}/blocklists/uidgid_test | 0 .../{ => gvisor}/blocklists/unlink_test | 0 .../{ => gvisor}/blocklists/write_test | 0 .../{ => gvisor}/blocklists/xattr_test | 0 test/syscall_test/gvisor/run_gvisor_test.sh | 74 + test/syscall_test/ltp/Makefile | 52 + test/syscall_test/ltp/run_ltp_test.sh | 21 + test/syscall_test/ltp/testcases/all.txt | 1848 +++++++++++++++++ .../ltp/testcases/blocked/exfat.txt | 89 + .../ltp/testcases/blocked/ext2.txt | 55 + test/syscall_test/run_syscall_test.sh | 85 +- tools/docker/Dockerfile | 10 +- 74 files changed, 2327 insertions(+), 180 deletions(-) create mode 100644 test/syscall_test/gvisor/Makefile rename test/syscall_test/{ => gvisor}/blocklists.exfat/access_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/chmod_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/fallocate_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/link_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/mkdir_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/mknod_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/open_create_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/open_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/stat_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/stat_times_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/symlink_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/utimes_test (100%) rename test/syscall_test/{ => gvisor}/blocklists.exfat/xattr_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/chmod_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/chown_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/chroot_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/epoll_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/eventfd_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/fallocate_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/fcntl_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/flock_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/futex_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/getdents_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/ioctl_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/link_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/lseek_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/mknod_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/mmap_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/mount_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/open_create_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/open_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/ppoll_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/prctl_setuid_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/pread64_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/preadv2_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/proc_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/pselect_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/pty_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/pwritev2_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/read_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/readv_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/rename_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/rlimits_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/semaphore_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/sendfile_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/sigaltstack_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/signalfd_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/socket_netlink_route_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/stat_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/statfs_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/symlink_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/sync_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/sysinfo_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/tcp_socket_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/timers_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/truncate_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/uidgid_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/unlink_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/write_test (100%) rename test/syscall_test/{ => gvisor}/blocklists/xattr_test (100%) create mode 100755 test/syscall_test/gvisor/run_gvisor_test.sh create mode 100644 test/syscall_test/ltp/Makefile create mode 100755 test/syscall_test/ltp/run_ltp_test.sh create mode 100644 test/syscall_test/ltp/testcases/all.txt create mode 100644 test/syscall_test/ltp/testcases/blocked/exfat.txt create mode 100644 test/syscall_test/ltp/testcases/blocked/ext2.txt diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 4a9d9828..2f908a6a 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -36,6 +36,9 @@ inputs: extra_blocklists: description: 'Extra blocklists directories' required: false + syscall_test_suite: + description: 'Selected syscall test suite' + required: false syscall_test_workdir: description: 'Syscall test working directory' required: false @@ -85,6 +88,7 @@ runs: [[ -n "${{ inputs.scheme }}" ]] && CMD+=" SCHEME=${{ inputs.scheme }}" [[ -n "${{ inputs.arch }}" ]] && CMD+=" ARCH=${{ inputs.arch }}" [[ -n "${{ inputs.extra_blocklists }}" ]] && CMD+=" EXTRA_BLOCKLISTS_DIRS=${{ inputs.extra_blocklists }}" + [[ -n "${{ inputs.syscall_test_suite }}" ]] && CMD+=" SYSCALL_TEST_SUITE=${{ inputs.syscall_test_suite }}" [[ -n "${{ inputs.syscall_test_workdir }}" ]] && CMD+=" SYSCALL_TEST_WORKDIR=${{ inputs.syscall_test_workdir }}" [[ -n "${{ inputs.boot_protocol }}" ]] && CMD+=" BOOT_PROTOCOL=${{ inputs.boot_protocol }}" diff --git a/.github/workflows/test_x86.yml b/.github/workflows/test_x86.yml index a9ad3b63..9576d01f 100644 --- a/.github/workflows/test_x86.yml +++ b/.github/workflows/test_x86.yml @@ -76,10 +76,10 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v4 - - name: Run integration tests + - name: Run integration tests ${{ (startsWith(matrix.test_id, 'syscall') && 'with LTP') || '' }} uses: ./.github/actions/test with: - auto_test: ${{ (startsWith(matrix.test_id, 'boot') && 'boot') || + auto_test: ${{ (startsWith(matrix.test_id, 'boot') && 'boot') || (startsWith(matrix.test_id, 'syscall') && 'syscall') || 'test' }} release: ${{ matrix.release || true }} enable_kvm: ${{ matrix.enable_kvm || true }} @@ -87,6 +87,22 @@ jobs: netdev: ${{ matrix.netdev || 'tap' }} scheme: ${{ matrix.scheme }} extra_blocklists: ${{ matrix.extra_blocklists }} + syscall_test_suite: 'ltp' + syscall_test_workdir: ${{ matrix.syscall_test_workdir }} + boot_protocol: ${{ matrix.boot_protocol || 'linux-efi-handover64' }} + - name: Run integration tests ${{ (startsWith(matrix.test_id, 'syscall') && 'with gVisor') || '' }} + if: ${{ startsWith(matrix.test_id, 'syscall') }} + uses: ./.github/actions/test + with: + auto_test: ${{ (startsWith(matrix.test_id, 'boot') && 'boot') || + (startsWith(matrix.test_id, 'syscall') && 'syscall') || 'test' }} + release: ${{ matrix.release || true }} + enable_kvm: ${{ matrix.enable_kvm || true }} + smp: ${{ matrix.smp }} + netdev: ${{ matrix.netdev || 'tap' }} + scheme: ${{ matrix.scheme }} + extra_blocklists: ${{ matrix.extra_blocklists }} + syscall_test_suite: 'gvisor' syscall_test_workdir: ${{ matrix.syscall_test_workdir }} boot_protocol: ${{ matrix.boot_protocol || 'linux-efi-handover64' }} diff --git a/.typos.toml b/.typos.toml index cdb70977..48d1ff53 100644 --- a/.typos.toml +++ b/.typos.toml @@ -28,8 +28,8 @@ check-file = false # Files listed below are ignored to check. [files] extend-exclude = [ - "test/syscall_test/blocklists/pty_test", - "test/build/initramfs/opt/syscall_test/blocklists/pty_test", - "test/syscall_test/blocklists/sync_test", - "test/build/initramfs/opt/syscall_test/blocklists/sync_test", + "test/syscall_test/gvisor/blocklists/pty_test", + "test/build/initramfs/opt/gvisor/blocklists/pty_test", + "test/syscall_test/gvisor/blocklists/sync_test", + "test/build/initramfs/opt/gvisor/blocklists/sync_test", ] \ No newline at end of file diff --git a/Makefile b/Makefile index fb70a7f6..9b981bb1 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,7 @@ CARGO_OSDK_ARGS := --target-arch=$(ARCH) --kcmd-args="ostd.log_level=$(LOG_LEVEL ifeq ($(AUTO_TEST), syscall) BUILD_SYSCALL_TEST := 1 +CARGO_OSDK_ARGS += --kcmd-args="SYSCALL_TEST_SUITE=$(SYSCALL_TEST_SUITE)" CARGO_OSDK_ARGS += --kcmd-args="SYSCALL_TEST_WORKDIR=$(SYSCALL_TEST_WORKDIR)" CARGO_OSDK_ARGS += --kcmd-args="EXTRA_BLOCKLISTS_DIRS=$(EXTRA_BLOCKLISTS_DIRS)" CARGO_OSDK_ARGS += --init-args="/opt/syscall_test/run_syscall_test.sh" @@ -229,7 +230,7 @@ run: initramfs $(CARGO_OSDK) @cd kernel && cargo osdk run $(CARGO_OSDK_ARGS) # Check the running status of auto tests from the QEMU log ifeq ($(AUTO_TEST), syscall) - @tail --lines 100 qemu.log | grep -q "^.* of .* test cases passed." \ + @tail --lines 100 qemu.log | grep -q "^All syscall tests passed." \ || (echo "Syscall test failed" && exit 1) else ifeq ($(AUTO_TEST), test) @tail --lines 100 qemu.log | grep -q "^All general tests passed." \ diff --git a/test/syscall_test/Makefile b/test/syscall_test/Makefile index fe1d0870..e96c789e 100644 --- a/test/syscall_test/Makefile +++ b/test/syscall_test/Makefile @@ -1,119 +1,32 @@ # SPDX-License-Identifier: MPL-2.0 -# A list of enabled system call test suites from Gvisor. -# Each test suite consists of multiple test cases, -# some of which are disabled by the blocklists. -# -# Please keep the list sorted by name. -TESTS ?= \ - access_test \ - chown_test \ - creat_test \ - dup_test \ - epoll_test \ - eventfd_test \ - fallocate_test \ - fcntl_test \ - flock_test \ - fsync_test \ - futex_test \ - getdents_test \ - ioctl_test \ - link_test \ - lseek_test \ - mkdir_test \ - mknod_test \ - mmap_test \ - mount_test \ - open_create_test \ - open_test \ - ppoll_test \ - prctl_setuid_test \ - pread64_test \ - preadv2_test \ - proc_test \ - pselect_test \ - pwrite64_test \ - pwritev2_test \ - pty_test \ - read_test \ - readv_test \ - rename_test \ - rlimits_test \ - sched_test \ - sched_yield_test \ - semaphore_test \ - sendfile_test \ - sigaction_test \ - sigaltstack_test \ - signalfd_test \ - socket_netlink_route_test \ - stat_test \ - stat_times_test \ - statfs_test \ - symlink_test \ - sync_test \ - sysinfo_test \ - tcp_socket_test \ - timerfd_test \ - timers_test \ - truncate_test \ - uidgid_test \ - unlink_test \ - utimes_test \ - vdso_clock_gettime_test \ - vfork_test \ - write_test \ - xattr_test \ - # The end of the list - MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) CUR_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH))) -BUILD_DIR ?= $(CUR_DIR)/../build -ifdef ASTER_PREBUILT_SYSCALL_TEST - BIN_DIR := $(ASTER_PREBUILT_SYSCALL_TEST) -else - BIN_DIR := $(BUILD_DIR)/syscall_test_bins - SRC_DIR := $(BUILD_DIR)/gvisor_src -endif INITRAMFS ?= $(CUR_DIR)/../build/initramfs -TARGET_DIR := $(INITRAMFS)/opt/syscall_test RUN_BASH := $(CUR_DIR)/run_syscall_test.sh -BLOCK_LIST := $(CUR_DIR)/blocklists -EXFAT_BLOCK_LIST := $(CUR_DIR)/blocklists.exfat +TARGET_DIR := $(INITRAMFS)/opt/syscall_test +SYSCALL_TEST_SUITE ?= ltp +GVISOR_DIR := $(INITRAMFS)/opt/gvisor +LTP_DIR := $(INITRAMFS)/opt/ltp .PHONY: all -all: $(TESTS) +all: $(TARGET_DIR) -$(TESTS): $(BIN_DIR) $(TARGET_DIR) - @cp -f $ /dev/null; then \ - echo "bazel is not installed, please run tools/install_bazel.sh with sudo permission to install it."; \ - exit 1; \ - fi +$(TARGET_DIR): $(RUN_BASH) $(GVISOR_DIR) $(LTP_DIR) @rm -rf $@ && mkdir -p $@ - @cd $(SRC_DIR) && bazel build --test_tag_filters=native //test/syscalls/... - @cp $(SRC_DIR)/bazel-bin/test/syscalls/linux/*_test $@ - -$(SRC_DIR): - @rm -rf $@ && mkdir -p $@ - @cd $@ && git clone -b 20200921.0 https://github.com/asterinas/gvisor.git . -endif - -$(TARGET_DIR): $(RUN_BASH) $(BLOCK_LIST) $(EXFAT_BLOCK_LIST) - @rm -rf $@ && mkdir -p $@ - @# Prepare tests dir for test binaries - @mkdir $@/tests - @# Copy blocklists - @cp -rf $(BLOCK_LIST) $@ - @# Copy exFAT specific blocklists - @cp -rf $(EXFAT_BLOCK_LIST) $@ @# Copy bash script @cp -f $(RUN_BASH) $@ +$(GVISOR_DIR): +ifeq ($(SYSCALL_TEST_SUITE), gvisor) + @$(MAKE) --no-print-directory -C gvisor +endif + +$(LTP_DIR): +ifeq ($(SYSCALL_TEST_SUITE), ltp) + @$(MAKE) --no-print-directory -C ltp +endif + .PHONY: clean clean: @rm -rf $(TARGET_DIR) diff --git a/test/syscall_test/gvisor/Makefile b/test/syscall_test/gvisor/Makefile new file mode 100644 index 00000000..583d55be --- /dev/null +++ b/test/syscall_test/gvisor/Makefile @@ -0,0 +1,119 @@ +# SPDX-License-Identifier: MPL-2.0 + +# A list of enabled system call test suites from Gvisor. +# Each test suite consists of multiple test cases, +# some of which are disabled by the blocklists. +# +# Please keep the list sorted by name. +TESTS ?= \ + access_test \ + chown_test \ + creat_test \ + dup_test \ + epoll_test \ + eventfd_test \ + fallocate_test \ + fcntl_test \ + flock_test \ + fsync_test \ + futex_test \ + getdents_test \ + ioctl_test \ + link_test \ + lseek_test \ + mkdir_test \ + mknod_test \ + mmap_test \ + mount_test \ + open_create_test \ + open_test \ + ppoll_test \ + prctl_setuid_test \ + pread64_test \ + preadv2_test \ + proc_test \ + pselect_test \ + pwrite64_test \ + pwritev2_test \ + pty_test \ + read_test \ + readv_test \ + rename_test \ + rlimits_test \ + sched_test \ + sched_yield_test \ + semaphore_test \ + sendfile_test \ + sigaction_test \ + sigaltstack_test \ + signalfd_test \ + socket_netlink_route_test \ + stat_test \ + stat_times_test \ + statfs_test \ + symlink_test \ + sync_test \ + sysinfo_test \ + tcp_socket_test \ + timerfd_test \ + timers_test \ + truncate_test \ + uidgid_test \ + unlink_test \ + utimes_test \ + vdso_clock_gettime_test \ + vfork_test \ + write_test \ + xattr_test \ + # The end of the list + +MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +CUR_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH))) +BUILD_DIR ?= $(CUR_DIR)/../../build +ifdef ASTER_PREBUILT_SYSCALL_TEST + BIN_DIR := $(ASTER_PREBUILT_SYSCALL_TEST) +else + BIN_DIR := $(BUILD_DIR)/syscall_test_bins + SRC_DIR := $(BUILD_DIR)/gvisor_src +endif +INITRAMFS ?= $(CUR_DIR)/../../build/initramfs +TARGET_DIR := $(INITRAMFS)/opt/gvisor +RUN_BASH := $(CUR_DIR)/run_gvisor_test.sh +BLOCK_LIST := $(CUR_DIR)/blocklists +EXFAT_BLOCK_LIST := $(CUR_DIR)/blocklists.exfat + +.PHONY: all +all: $(TESTS) + +$(TESTS): $(BIN_DIR) $(TARGET_DIR) + @cp -f $ /dev/null; then \ + echo "bazel is not installed, please run tools/install_bazel.sh with sudo permission to install it."; \ + exit 1; \ + fi + @rm -rf $@ && mkdir -p $@ + @cd $(SRC_DIR) && bazel build --test_tag_filters=native //test/syscalls/... + @cp $(SRC_DIR)/bazel-bin/test/syscalls/linux/*_test $@ + +$(SRC_DIR): + @rm -rf $@ && mkdir -p $@ + @cd $@ && git clone -b 20200921.0 https://github.com/asterinas/gvisor.git . +endif + +$(TARGET_DIR): $(RUN_BASH) $(BLOCK_LIST) $(EXFAT_BLOCK_LIST) + @rm -rf $@ && mkdir -p $@ + @# Prepare tests dir for test binaries + @mkdir $@/tests + @# Copy blocklists + @cp -rf $(BLOCK_LIST) $@ + @# Copy exFAT specific blocklists + @cp -rf $(EXFAT_BLOCK_LIST) $@ + @# Copy bash script + @cp -f $(RUN_BASH) $@ + +.PHONY: clean +clean: + @rm -rf $(TARGET_DIR) diff --git a/test/syscall_test/blocklists.exfat/access_test b/test/syscall_test/gvisor/blocklists.exfat/access_test similarity index 100% rename from test/syscall_test/blocklists.exfat/access_test rename to test/syscall_test/gvisor/blocklists.exfat/access_test diff --git a/test/syscall_test/blocklists.exfat/chmod_test b/test/syscall_test/gvisor/blocklists.exfat/chmod_test similarity index 100% rename from test/syscall_test/blocklists.exfat/chmod_test rename to test/syscall_test/gvisor/blocklists.exfat/chmod_test diff --git a/test/syscall_test/blocklists.exfat/fallocate_test b/test/syscall_test/gvisor/blocklists.exfat/fallocate_test similarity index 100% rename from test/syscall_test/blocklists.exfat/fallocate_test rename to test/syscall_test/gvisor/blocklists.exfat/fallocate_test diff --git a/test/syscall_test/blocklists.exfat/link_test b/test/syscall_test/gvisor/blocklists.exfat/link_test similarity index 100% rename from test/syscall_test/blocklists.exfat/link_test rename to test/syscall_test/gvisor/blocklists.exfat/link_test diff --git a/test/syscall_test/blocklists.exfat/mkdir_test b/test/syscall_test/gvisor/blocklists.exfat/mkdir_test similarity index 100% rename from test/syscall_test/blocklists.exfat/mkdir_test rename to test/syscall_test/gvisor/blocklists.exfat/mkdir_test diff --git a/test/syscall_test/blocklists.exfat/mknod_test b/test/syscall_test/gvisor/blocklists.exfat/mknod_test similarity index 100% rename from test/syscall_test/blocklists.exfat/mknod_test rename to test/syscall_test/gvisor/blocklists.exfat/mknod_test diff --git a/test/syscall_test/blocklists.exfat/open_create_test b/test/syscall_test/gvisor/blocklists.exfat/open_create_test similarity index 100% rename from test/syscall_test/blocklists.exfat/open_create_test rename to test/syscall_test/gvisor/blocklists.exfat/open_create_test diff --git a/test/syscall_test/blocklists.exfat/open_test b/test/syscall_test/gvisor/blocklists.exfat/open_test similarity index 100% rename from test/syscall_test/blocklists.exfat/open_test rename to test/syscall_test/gvisor/blocklists.exfat/open_test diff --git a/test/syscall_test/blocklists.exfat/stat_test b/test/syscall_test/gvisor/blocklists.exfat/stat_test similarity index 100% rename from test/syscall_test/blocklists.exfat/stat_test rename to test/syscall_test/gvisor/blocklists.exfat/stat_test diff --git a/test/syscall_test/blocklists.exfat/stat_times_test b/test/syscall_test/gvisor/blocklists.exfat/stat_times_test similarity index 100% rename from test/syscall_test/blocklists.exfat/stat_times_test rename to test/syscall_test/gvisor/blocklists.exfat/stat_times_test diff --git a/test/syscall_test/blocklists.exfat/symlink_test b/test/syscall_test/gvisor/blocklists.exfat/symlink_test similarity index 100% rename from test/syscall_test/blocklists.exfat/symlink_test rename to test/syscall_test/gvisor/blocklists.exfat/symlink_test diff --git a/test/syscall_test/blocklists.exfat/utimes_test b/test/syscall_test/gvisor/blocklists.exfat/utimes_test similarity index 100% rename from test/syscall_test/blocklists.exfat/utimes_test rename to test/syscall_test/gvisor/blocklists.exfat/utimes_test diff --git a/test/syscall_test/blocklists.exfat/xattr_test b/test/syscall_test/gvisor/blocklists.exfat/xattr_test similarity index 100% rename from test/syscall_test/blocklists.exfat/xattr_test rename to test/syscall_test/gvisor/blocklists.exfat/xattr_test diff --git a/test/syscall_test/blocklists/chmod_test b/test/syscall_test/gvisor/blocklists/chmod_test similarity index 100% rename from test/syscall_test/blocklists/chmod_test rename to test/syscall_test/gvisor/blocklists/chmod_test diff --git a/test/syscall_test/blocklists/chown_test b/test/syscall_test/gvisor/blocklists/chown_test similarity index 100% rename from test/syscall_test/blocklists/chown_test rename to test/syscall_test/gvisor/blocklists/chown_test diff --git a/test/syscall_test/blocklists/chroot_test b/test/syscall_test/gvisor/blocklists/chroot_test similarity index 100% rename from test/syscall_test/blocklists/chroot_test rename to test/syscall_test/gvisor/blocklists/chroot_test diff --git a/test/syscall_test/blocklists/epoll_test b/test/syscall_test/gvisor/blocklists/epoll_test similarity index 100% rename from test/syscall_test/blocklists/epoll_test rename to test/syscall_test/gvisor/blocklists/epoll_test diff --git a/test/syscall_test/blocklists/eventfd_test b/test/syscall_test/gvisor/blocklists/eventfd_test similarity index 100% rename from test/syscall_test/blocklists/eventfd_test rename to test/syscall_test/gvisor/blocklists/eventfd_test diff --git a/test/syscall_test/blocklists/fallocate_test b/test/syscall_test/gvisor/blocklists/fallocate_test similarity index 100% rename from test/syscall_test/blocklists/fallocate_test rename to test/syscall_test/gvisor/blocklists/fallocate_test diff --git a/test/syscall_test/blocklists/fcntl_test b/test/syscall_test/gvisor/blocklists/fcntl_test similarity index 100% rename from test/syscall_test/blocklists/fcntl_test rename to test/syscall_test/gvisor/blocklists/fcntl_test diff --git a/test/syscall_test/blocklists/flock_test b/test/syscall_test/gvisor/blocklists/flock_test similarity index 100% rename from test/syscall_test/blocklists/flock_test rename to test/syscall_test/gvisor/blocklists/flock_test diff --git a/test/syscall_test/blocklists/futex_test b/test/syscall_test/gvisor/blocklists/futex_test similarity index 100% rename from test/syscall_test/blocklists/futex_test rename to test/syscall_test/gvisor/blocklists/futex_test diff --git a/test/syscall_test/blocklists/getdents_test b/test/syscall_test/gvisor/blocklists/getdents_test similarity index 100% rename from test/syscall_test/blocklists/getdents_test rename to test/syscall_test/gvisor/blocklists/getdents_test diff --git a/test/syscall_test/blocklists/ioctl_test b/test/syscall_test/gvisor/blocklists/ioctl_test similarity index 100% rename from test/syscall_test/blocklists/ioctl_test rename to test/syscall_test/gvisor/blocklists/ioctl_test diff --git a/test/syscall_test/blocklists/link_test b/test/syscall_test/gvisor/blocklists/link_test similarity index 100% rename from test/syscall_test/blocklists/link_test rename to test/syscall_test/gvisor/blocklists/link_test diff --git a/test/syscall_test/blocklists/lseek_test b/test/syscall_test/gvisor/blocklists/lseek_test similarity index 100% rename from test/syscall_test/blocklists/lseek_test rename to test/syscall_test/gvisor/blocklists/lseek_test diff --git a/test/syscall_test/blocklists/mknod_test b/test/syscall_test/gvisor/blocklists/mknod_test similarity index 100% rename from test/syscall_test/blocklists/mknod_test rename to test/syscall_test/gvisor/blocklists/mknod_test diff --git a/test/syscall_test/blocklists/mmap_test b/test/syscall_test/gvisor/blocklists/mmap_test similarity index 100% rename from test/syscall_test/blocklists/mmap_test rename to test/syscall_test/gvisor/blocklists/mmap_test diff --git a/test/syscall_test/blocklists/mount_test b/test/syscall_test/gvisor/blocklists/mount_test similarity index 100% rename from test/syscall_test/blocklists/mount_test rename to test/syscall_test/gvisor/blocklists/mount_test diff --git a/test/syscall_test/blocklists/open_create_test b/test/syscall_test/gvisor/blocklists/open_create_test similarity index 100% rename from test/syscall_test/blocklists/open_create_test rename to test/syscall_test/gvisor/blocklists/open_create_test diff --git a/test/syscall_test/blocklists/open_test b/test/syscall_test/gvisor/blocklists/open_test similarity index 100% rename from test/syscall_test/blocklists/open_test rename to test/syscall_test/gvisor/blocklists/open_test diff --git a/test/syscall_test/blocklists/ppoll_test b/test/syscall_test/gvisor/blocklists/ppoll_test similarity index 100% rename from test/syscall_test/blocklists/ppoll_test rename to test/syscall_test/gvisor/blocklists/ppoll_test diff --git a/test/syscall_test/blocklists/prctl_setuid_test b/test/syscall_test/gvisor/blocklists/prctl_setuid_test similarity index 100% rename from test/syscall_test/blocklists/prctl_setuid_test rename to test/syscall_test/gvisor/blocklists/prctl_setuid_test diff --git a/test/syscall_test/blocklists/pread64_test b/test/syscall_test/gvisor/blocklists/pread64_test similarity index 100% rename from test/syscall_test/blocklists/pread64_test rename to test/syscall_test/gvisor/blocklists/pread64_test diff --git a/test/syscall_test/blocklists/preadv2_test b/test/syscall_test/gvisor/blocklists/preadv2_test similarity index 100% rename from test/syscall_test/blocklists/preadv2_test rename to test/syscall_test/gvisor/blocklists/preadv2_test diff --git a/test/syscall_test/blocklists/proc_test b/test/syscall_test/gvisor/blocklists/proc_test similarity index 100% rename from test/syscall_test/blocklists/proc_test rename to test/syscall_test/gvisor/blocklists/proc_test diff --git a/test/syscall_test/blocklists/pselect_test b/test/syscall_test/gvisor/blocklists/pselect_test similarity index 100% rename from test/syscall_test/blocklists/pselect_test rename to test/syscall_test/gvisor/blocklists/pselect_test diff --git a/test/syscall_test/blocklists/pty_test b/test/syscall_test/gvisor/blocklists/pty_test similarity index 100% rename from test/syscall_test/blocklists/pty_test rename to test/syscall_test/gvisor/blocklists/pty_test diff --git a/test/syscall_test/blocklists/pwritev2_test b/test/syscall_test/gvisor/blocklists/pwritev2_test similarity index 100% rename from test/syscall_test/blocklists/pwritev2_test rename to test/syscall_test/gvisor/blocklists/pwritev2_test diff --git a/test/syscall_test/blocklists/read_test b/test/syscall_test/gvisor/blocklists/read_test similarity index 100% rename from test/syscall_test/blocklists/read_test rename to test/syscall_test/gvisor/blocklists/read_test diff --git a/test/syscall_test/blocklists/readv_test b/test/syscall_test/gvisor/blocklists/readv_test similarity index 100% rename from test/syscall_test/blocklists/readv_test rename to test/syscall_test/gvisor/blocklists/readv_test diff --git a/test/syscall_test/blocklists/rename_test b/test/syscall_test/gvisor/blocklists/rename_test similarity index 100% rename from test/syscall_test/blocklists/rename_test rename to test/syscall_test/gvisor/blocklists/rename_test diff --git a/test/syscall_test/blocklists/rlimits_test b/test/syscall_test/gvisor/blocklists/rlimits_test similarity index 100% rename from test/syscall_test/blocklists/rlimits_test rename to test/syscall_test/gvisor/blocklists/rlimits_test diff --git a/test/syscall_test/blocklists/semaphore_test b/test/syscall_test/gvisor/blocklists/semaphore_test similarity index 100% rename from test/syscall_test/blocklists/semaphore_test rename to test/syscall_test/gvisor/blocklists/semaphore_test diff --git a/test/syscall_test/blocklists/sendfile_test b/test/syscall_test/gvisor/blocklists/sendfile_test similarity index 100% rename from test/syscall_test/blocklists/sendfile_test rename to test/syscall_test/gvisor/blocklists/sendfile_test diff --git a/test/syscall_test/blocklists/sigaltstack_test b/test/syscall_test/gvisor/blocklists/sigaltstack_test similarity index 100% rename from test/syscall_test/blocklists/sigaltstack_test rename to test/syscall_test/gvisor/blocklists/sigaltstack_test diff --git a/test/syscall_test/blocklists/signalfd_test b/test/syscall_test/gvisor/blocklists/signalfd_test similarity index 100% rename from test/syscall_test/blocklists/signalfd_test rename to test/syscall_test/gvisor/blocklists/signalfd_test diff --git a/test/syscall_test/blocklists/socket_netlink_route_test b/test/syscall_test/gvisor/blocklists/socket_netlink_route_test similarity index 100% rename from test/syscall_test/blocklists/socket_netlink_route_test rename to test/syscall_test/gvisor/blocklists/socket_netlink_route_test diff --git a/test/syscall_test/blocklists/stat_test b/test/syscall_test/gvisor/blocklists/stat_test similarity index 100% rename from test/syscall_test/blocklists/stat_test rename to test/syscall_test/gvisor/blocklists/stat_test diff --git a/test/syscall_test/blocklists/statfs_test b/test/syscall_test/gvisor/blocklists/statfs_test similarity index 100% rename from test/syscall_test/blocklists/statfs_test rename to test/syscall_test/gvisor/blocklists/statfs_test diff --git a/test/syscall_test/blocklists/symlink_test b/test/syscall_test/gvisor/blocklists/symlink_test similarity index 100% rename from test/syscall_test/blocklists/symlink_test rename to test/syscall_test/gvisor/blocklists/symlink_test diff --git a/test/syscall_test/blocklists/sync_test b/test/syscall_test/gvisor/blocklists/sync_test similarity index 100% rename from test/syscall_test/blocklists/sync_test rename to test/syscall_test/gvisor/blocklists/sync_test diff --git a/test/syscall_test/blocklists/sysinfo_test b/test/syscall_test/gvisor/blocklists/sysinfo_test similarity index 100% rename from test/syscall_test/blocklists/sysinfo_test rename to test/syscall_test/gvisor/blocklists/sysinfo_test diff --git a/test/syscall_test/blocklists/tcp_socket_test b/test/syscall_test/gvisor/blocklists/tcp_socket_test similarity index 100% rename from test/syscall_test/blocklists/tcp_socket_test rename to test/syscall_test/gvisor/blocklists/tcp_socket_test diff --git a/test/syscall_test/blocklists/timers_test b/test/syscall_test/gvisor/blocklists/timers_test similarity index 100% rename from test/syscall_test/blocklists/timers_test rename to test/syscall_test/gvisor/blocklists/timers_test diff --git a/test/syscall_test/blocklists/truncate_test b/test/syscall_test/gvisor/blocklists/truncate_test similarity index 100% rename from test/syscall_test/blocklists/truncate_test rename to test/syscall_test/gvisor/blocklists/truncate_test diff --git a/test/syscall_test/blocklists/uidgid_test b/test/syscall_test/gvisor/blocklists/uidgid_test similarity index 100% rename from test/syscall_test/blocklists/uidgid_test rename to test/syscall_test/gvisor/blocklists/uidgid_test diff --git a/test/syscall_test/blocklists/unlink_test b/test/syscall_test/gvisor/blocklists/unlink_test similarity index 100% rename from test/syscall_test/blocklists/unlink_test rename to test/syscall_test/gvisor/blocklists/unlink_test diff --git a/test/syscall_test/blocklists/write_test b/test/syscall_test/gvisor/blocklists/write_test similarity index 100% rename from test/syscall_test/blocklists/write_test rename to test/syscall_test/gvisor/blocklists/write_test diff --git a/test/syscall_test/blocklists/xattr_test b/test/syscall_test/gvisor/blocklists/xattr_test similarity index 100% rename from test/syscall_test/blocklists/xattr_test rename to test/syscall_test/gvisor/blocklists/xattr_test diff --git a/test/syscall_test/gvisor/run_gvisor_test.sh b/test/syscall_test/gvisor/run_gvisor_test.sh new file mode 100755 index 00000000..24445888 --- /dev/null +++ b/test/syscall_test/gvisor/run_gvisor_test.sh @@ -0,0 +1,74 @@ +#!/bin/sh + +# SPDX-License-Identifier: MPL-2.0 + +SCRIPT_DIR=$(dirname "$0") +TEST_TMP_DIR=${SYSCALL_TEST_WORKDIR:-/tmp} +TEST_BIN_DIR=$SCRIPT_DIR/tests +BLOCKLIST_DIR=$SCRIPT_DIR/blocklists +FAIL_CASES=$SCRIPT_DIR/fail_cases +BLOCK="" +TESTS=0 +PASSED_TESTS=0 +RESULT=0 +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' + +get_blocklist_subtests(){ + if [ -f $BLOCKLIST_DIR/$1 ]; then + BLOCK=$(grep -v '^#' $BLOCKLIST_DIR/$1 | tr '\n' ':') + else + BLOCK="" + fi + + for extra_dir in $EXTRA_BLOCKLISTS_DIRS ; do + if [ -f $SCRIPT_DIR/$extra_dir/$1 ]; then + BLOCK="${BLOCK}:$(grep -v '^#' $SCRIPT_DIR/$extra_dir/$1 | tr '\n' ':')" + fi + done + + return 0 +} + +run_one_test(){ + echo -e "Run Test Case: $1" + # The gvisor test framework utilizes the "TEST_TMPDIR" environment variable to dictate the directory's location. + export TEST_TMPDIR=$TEST_TMP_DIR + ret=0 + if [ -f $TEST_BIN_DIR/$1 ]; then + get_blocklist_subtests $1 + cd $TEST_BIN_DIR && ./$1 --gtest_filter=-$BLOCK + ret=$? + #After executing the test, it is necessary to clean the directory to ensure no residual data remains + rm -rf $TEST_TMP_DIR/* + else + echo -e "Warning: $1 test does not exit" + ret=1 + fi + echo "" + return $ret +} + +rm -f $FAIL_CASES && touch $FAIL_CASES +rm -rf $TEST_TMP_DIR/* + +for syscall_test in $(find $TEST_BIN_DIR/. -name \*_test) ; do + test_name=$(basename "$syscall_test") + run_one_test $test_name + if [ $? -eq 0 ] && PASSED_TESTS=$((PASSED_TESTS+1));then + TESTS=$((TESTS+1)) + else + echo -e "$test_name" >> $FAIL_CASES + TESTS=$((TESTS+1)) + fi +done + +echo -e "$GREEN$PASSED_TESTS$NC of $GREEN$TESTS$NC test cases passed." +[ $PASSED_TESTS -ne $TESTS ] && RESULT=1 +if [ $TESTS != $PASSED_TESTS ]; then + echo -e "The $RED$(($TESTS-$PASSED_TESTS))$NC failed test cases are as follows:" + cat $FAIL_CASES +fi + +exit $RESULT diff --git a/test/syscall_test/ltp/Makefile b/test/syscall_test/ltp/Makefile new file mode 100644 index 00000000..504a9bed --- /dev/null +++ b/test/syscall_test/ltp/Makefile @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: MPL-2.0 + +LTP_DIR ?= /opt/ltp +MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +CUR_DIR := $(patsubst %/,%,$(dir $(MKFILE_PATH))) +INITRAMFS ?= $(CUR_DIR)/../../build/initramfs +TARGET_DIR := $(INITRAMFS)/opt/ltp +RUN_BASH := $(CUR_DIR)/run_ltp_test.sh +ALL_TESTS := $(CUR_DIR)/testcases/all.txt +EXT2_BLOCKLIST := $(CUR_DIR)/testcases/blocked/ext2.txt +EXFAT_BLOCKLIST := $(CUR_DIR)/testcases/blocked/exfat.txt + +.PHONY: all +all: $(TARGET_DIR) + +$(TARGET_DIR): $(RUN_BASH) $(ALL_TESTS) $(EXT2_BLOCKLIST) $(EXFAT_BLOCKLIST) + @rm -rf $@ && mkdir -p $@ + @# Prepare tests dir for test binaries + @mkdir -p $@/testcases/bin + @mkdir -p $@/runtest + @awk '!/^#/ && NF' $(ALL_TESTS) > $@/all.txt + @if [ "$(SYSCALL_TEST_WORKDIR)" = "/ext2" ]; then \ + grep -vxF -f $(EXT2_BLOCKLIST) $@/all.txt > $@/filtered.txt; \ + elif [ "$(SYSCALL_TEST_WORKDIR)" = "/exfat" ]; then \ + grep -vxF -f $(EXFAT_BLOCKLIST) $@/all.txt > $@/filtered.txt; \ + else \ + cp -f $@/all.txt $@/filtered.txt; \ + fi; + @# Process syscall testcases and copy binaries + @while read -r syscall binary params; do \ + if grep -q "^$$syscall$$" $@/filtered.txt; then \ + if [ -f $(LTP_DIR)/testcases/bin/$$binary ]; then \ + cp -f $(LTP_DIR)/testcases/bin/$$binary $@/testcases/bin; \ + echo "$$syscall $$binary $$params" >> $@/runtest/syscalls; \ + else \ + echo "Warning: $$binary not found (skipping)"; \ + fi; \ + fi; \ + done < $(LTP_DIR)/runtest/syscalls + @# Remove intermediate files + @rm -f $@/all.txt $@/filtered.txt + @# Copy bash scripts + @cp -r $(LTP_DIR)/bin $@ + @cp -f $(LTP_DIR)/runltp $@ + @cp -f $(LTP_DIR)/Version $@ + @cp -f $(LTP_DIR)/ver_linux $@ + @cp -f $(LTP_DIR)/IDcheck.sh $@ + @cp -f $(RUN_BASH) $@ + +.PHONY: clean +clean: + @rm -rf $(TARGET_DIR) diff --git a/test/syscall_test/ltp/run_ltp_test.sh b/test/syscall_test/ltp/run_ltp_test.sh new file mode 100755 index 00000000..91599b87 --- /dev/null +++ b/test/syscall_test/ltp/run_ltp_test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# SPDX-License-Identifier: MPL-2.0 + +LTP_DIR=$(dirname "$0") +TEST_TMP_DIR=${SYSCALL_TEST_WORKDIR:-/tmp} +LOG_FILE=$TEST_TMP_DIR/result.log +RESULT=0 + +rm -f $LOG_FILE +CREATE_ENTRIES=1 $LTP_DIR/runltp -f syscalls -p -d $TEST_TMP_DIR -l $LOG_FILE +if [ $? -ne 0 ]; then + RESULT=1 +fi + +cat $LOG_FILE +if ! grep -q "Total Failures: 0" $LOG_FILE; then + RESULT=1 +fi + +exit $RESULT diff --git a/test/syscall_test/ltp/testcases/all.txt b/test/syscall_test/ltp/testcases/all.txt new file mode 100644 index 00000000..dd411e98 --- /dev/null +++ b/test/syscall_test/ltp/testcases/all.txt @@ -0,0 +1,1848 @@ +#DESCRIPTION:Kernel system calls +# abort01 + +# accept01 +# accept02 +# accept03 + +# accept4_01 + +# access01 +# access02 +# access03 +# access04 + +# acct01 +# acct02 + +# add_key01 +# add_key02 +# add_key03 +# add_key04 +# add_key05 + +# adjtimex01 +# adjtimex02 +# adjtimex03 + +# alarm02 +alarm03 +alarm05 +alarm06 +alarm07 + +# arch_prctl01 + +# bind01 +# bind02 +bind03 +bind04 +# bind05 +# bind06 + +# bpf_map01 +# bpf_prog01 +# bpf_prog02 +# bpf_prog03 +# bpf_prog04 +# bpf_prog05 +# bpf_prog06 +# bpf_prog07 + +# brk01 +# brk02 + +# capget01 +# capget02 + +# capset01 +# capset02 +capset03 +# capset04 + +# cacheflush01 + +# cachestat01 +# cachestat02 +# cachestat03 +# cachestat04 + +# chdir01 +chdir01A +chdir04 + +chmod01 +chmod01A +# chmod03 +# chmod05 +# chmod06 +# chmod07 +chmod08 +# chmod09 + +chown01 +# chown01_16 +# chown02 +# chown02_16 +# chown03 +# chown03_16 +# chown04 +# chown04_16 +chown05 +# chown05_16 + +# chroot01 +chroot02 +# chroot03 +# chroot04 + +# clock_adjtime01 +# clock_adjtime02 + +# clock_getres01 +# clock_nanosleep01 +# clock_nanosleep02 +# clock_nanosleep03 +clock_nanosleep04 + +# clock_gettime01 +clock_gettime02 +# clock_gettime03 +# clock_gettime04 +# leapsec01 + +# clock_settime01 +# clock_settime02 +# clock_settime03 + +clone01 +clone02 +clone03 +clone04 +clone05 +clone06 +clone07 +# clone08 +# clone09 + +# clone301 +# clone302 +# clone303 + +close01 +close02 + +# close_range01 +# close_range02 + +confstr01 + +# connect01 +# connect02 + +creat01 +creat03 +# creat04 +# creat05 +# creat06 +# creat07 +# creat08 +# creat09 + +# delete_module01 +# delete_module02 +# delete_module03 + +dup01 +# dup02 +# dup03 +dup04 +dup05 +# dup06 +dup07 + +# dup201 +dup202 +dup203 +dup204 +dup205 +dup206 +dup207 + +dup3_01 +dup3_02 + +epoll_create01 +epoll_create02 +epoll_create1_01 +epoll_create1_02 +epoll01 +epoll_ctl01 +# epoll_ctl02 +epoll_ctl03 +# epoll_ctl04 +# epoll_ctl05 +# epoll_wait01 +# epoll_wait02 +epoll_wait03 +epoll_wait04 +# epoll_wait05 +# epoll_wait06 +epoll_wait07 +# epoll_pwait01 +# epoll_pwait02 +# epoll_pwait03 +# epoll_pwait04 +# epoll_pwait05 + +# eventfd01 +# eventfd02 +# eventfd03 +# eventfd04 +# eventfd05 +# eventfd06 + +eventfd2_01 +eventfd2_02 +eventfd2_03 + +# execl01 +# execle01 +# execlp01 + +# execv01 +# execve01 +# execve02 +# execve03 +# execve04 +# execve05 +# execve06 +# execvp01 +# execveat01 +# execveat02 +# execveat03 + +exit01 +exit02 + +exit_group01 + +#faccessat test cases +faccessat01 +faccessat02 + +#faccessat2 test cases +# faccessat201 +# faccessat202 + +#fallocate test cases +fallocate01 +# fallocate02 +fallocate03 +# fallocate04 +# fallocate05 +# fallocate06 + +# fsetxattr01 +# fsetxattr02 + +#posix_fadvise test cases +# posix_fadvise01 +# posix_fadvise01_64 +# posix_fadvise02 +# posix_fadvise02_64 +# posix_fadvise03 +# posix_fadvise03_64 +# posix_fadvise04 +# posix_fadvise04_64 + +fchdir01 +fchdir02 +# fchdir03 + +fchmod01 +# fchmod02 +# fchmod03 +# fchmod04 +# fchmod05 +# fchmod06 + +#fchmodat test cases +fchmodat01 +# fchmodat02 + +# fchmodat2_01 +# fchmodat2_02 + +fchown01 +# fchown01_16 +# fchown02 +# fchown02_16 +# fchown03 +# fchown03_16 +# fchown04 +# fchown04_16 +fchown05 +# fchown05_16 + +#fchownat test case +fchownat01 +fchownat02 + +fcntl01 +fcntl01_64 +fcntl02 +fcntl02_64 +fcntl03 +fcntl03_64 +fcntl04 +fcntl04_64 +fcntl05 +fcntl05_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 +fcntl29 +fcntl29_64 +# fcntl30 +# fcntl30_64 +# fcntl31 +# fcntl31_64 +# fcntl32 +# fcntl32_64 +# fcntl33 +# fcntl33_64 +# fcntl34 +# fcntl34_64 +# fcntl35 +# fcntl35_64 +# fcntl36 +# fcntl36_64 +# fcntl37 +# fcntl37_64 +# fcntl38 +# fcntl38_64 +# fcntl39 +# fcntl39_64 + +fdatasync01 +# fdatasync02 +# fdatasync03 + +# fgetxattr01 +# fgetxattr02 +fgetxattr03 + +# finit_module01 +# finit_module02 + +flistxattr01 +flistxattr02 +flistxattr03 + +flock01 +flock02 +flock03 +flock04 +flock06 + +fmtmsg01 + +fork01 +fork03 +fork04 +# fork05 +fork06 +fork07 +fork08 +fork09 +fork10 +fork11 +# fork13 +# fork14 + +fpathconf01 + +# fremovexattr01 +# fremovexattr02 + +# fsconfig01 +# fsconfig02 +# fsconfig03 + +# fsmount01 +# fsmount02 + +# fsopen01 +# fsopen02 + +# fspick01 +# fspick02 + +fstat02 +fstat02_64 +fstat03 +fstat03_64 + +#fstatat64/newfstatat test cases +fstatat01 + +# fstatfs01 +# fstatfs01_64 +fstatfs02 +fstatfs02_64 + +# fsync01 +fsync02 +# fsync03 +# fsync04 + +ftruncate01 +ftruncate01_64 +ftruncate03 +ftruncate03_64 +# ftruncate04 +# ftruncate04_64 + +#futimesat test cases +futimesat01 + +getcontext01 + +# getcpu01 +getcpu02 + +# getcwd01 +getcwd02 +getcwd03 +# getcwd04 + +# getdents01 +# getdents02 + +getdomainname01 + +# getegid01 +# getegid01_16 +# getegid02 +# getegid02_16 + +geteuid01 +# geteuid01_16 +# geteuid02 +# geteuid02_16 + +# getgid01 +# getgid01_16 +# getgid03 +# getgid03_16 + +getgroups01 +# getgroups01_16 +getgroups03 +# getgroups03_16 + +gethostbyname_r01 + +gethostid01 + +gethostname01 +gethostname02 + +getitimer01 +getitimer02 + +getpagesize01 + +# getpeername01 + +getpgid01 +# getpgid02 + +getpgrp01 + +# getpid01 +getpid02 + +# getppid01 +getppid02 + +getpriority01 +getpriority02 + +getrandom01 +getrandom02 +getrandom03 +getrandom04 +# getrandom05 + +getresgid01 +# getresgid01_16 +# getresgid02 +# getresgid02_16 +# getresgid03 +# getresgid03_16 + +getresuid01 +# getresuid01_16 +# getresuid02 +# getresuid02_16 +# getresuid03 +# getresuid03_16 + +getrlimit01 +getrlimit02 +getrlimit03 + +# get_mempolicy01 +# get_mempolicy02 +# get_robust_list01 + +# getrusage01 +getrusage02 +# getrusage03 +# getrusage04 + +getsid01 +# getsid02 + +# getsockname01 + +# getsockopt01 +# getsockopt02 + +gettid01 +gettid02 + +# gettimeofday01 +gettimeofday02 + +getuid01 +# getuid01_16 +# getuid03 +# getuid03_16 + +getxattr01 +# getxattr02 +# getxattr03 +# getxattr04 +# getxattr05 + +# init_module01 +# init_module02 + +# Introducing ioctl tests for all /dev/tty* devices +# ioctl01 +# ioctl02 +# ioctl03 +# ioctl04 +# ioctl05 +# ioctl06 +# ioctl07 +# ioctl08 +# ioctl09 + +# ioctl_loop01 +# ioctl_loop02 +# ioctl_loop03 +# ioctl_loop04 +# ioctl_loop05 +# ioctl_loop06 +# ioctl_loop07 + +# ioctl_ns01 +# ioctl_ns02 +# ioctl_ns03 +# ioctl_ns04 +# ioctl_ns05 +# ioctl_ns06 +# ioctl_ns07 + +# ioctl_sg01 + +# ioctl_ficlone01 +# ioctl_ficlone02 +# ioctl_ficlone03 +# ioctl_ficlonerange01 +# ioctl_ficlonerange02 + +# inotify_init1_01 +# inotify_init1_02 + +# inotify01 +# inotify02 +# inotify03 +# inotify04 +# inotify05 +# inotify06 +# inotify07 +# inotify08 +# inotify09 +# inotify10 +# inotify11 +# inotify12 + +# fanotify01 +# fanotify02 +# fanotify03 +# fanotify04 +# fanotify05 +# fanotify06 +# fanotify07 +# fanotify08 +# fanotify09 +# fanotify10 +# fanotify11 +# fanotify12 +# fanotify13 +# fanotify14 +# fanotify15 +# fanotify16 +# fanotify17 +# fanotify18 +# fanotify19 +# fanotify20 +# fanotify21 +# fanotify22 +# fanotify23 + +# ioperm01 +# ioperm02 + +# iopl01 +# iopl02 + +# ioprio_get01 +# ioprio_set01 +# ioprio_set02 +# ioprio_set03 + +# io_cancel01 +# io_cancel02 +# io_destroy01 +# io_destroy02 +# io_getevents01 +# io_getevents02 + +# io_pgetevents01 +# io_pgetevents02 + +# io_setup01 +# io_setup02 +# io_submit01 +# io_submit02 +# io_submit03 + +# keyctl01 +# keyctl02 +# keyctl03 +# keyctl04 +# keyctl05 +# keyctl06 +# keyctl07 +# keyctl08 +# keyctl09 + +# kcmp01 +# kcmp02 +# kcmp03 + +kill02 +# kill03 +# kill05 +kill06 +# kill07 +kill08 +kill09 +# kill10 +# kill11 +kill12 +# kill13 + +# landlock01 +# landlock02 +# landlock03 +# landlock04 +# landlock05 +# landlock06 +# landlock07 +# landlock08 + +lchown01 +# lchown01_16 +# lchown02 +# lchown03 +# lchown02_16 +# lchown03_16 + +# lgetxattr01 +# lgetxattr02 + +link01 +link02 +# link04 +link05 +# link08 + +#linkat test cases +linkat01 +# linkat02 + +listen01 + +# listmount01 +# listmount02 +# listmount03 +# listmount04 + +listxattr01 +# listxattr02 +listxattr03 + +# llistxattr01 +# llistxattr02 +llistxattr03 + +# llseek01 +llseek02 +llseek03 + +# lremovexattr01 + +lseek01 +# lseek02 +lseek07 +# lseek11 + +lstat01 +lstat01_64 +# lstat02 +# lstat02_64 +# lstat03 +# lstat03_64 + +mallinfo02 + +mallinfo2_01 + +mallopt01 + +# mbind01 +# mbind02 +# mbind03 +# mbind04 + +memset01 +memcmp01 +memcpy01 + +# migrate_pages01 +# migrate_pages02 +# migrate_pages03 + +# mlockall01 +# mlockall02 +# mlockall03 + +# mkdir02 +# mkdir03 +mkdir04 +# mkdir05 +# mkdir09 + +#mkdirat test cases +mkdirat01 +# mkdirat02 + +mknod01 +# mknod02 +# mknod03 +# mknod04 +# mknod05 +# mknod06 +# mknod07 +# mknod08 +mknod09 + +#mknodat test cases +mknodat01 +# mknodat02 + +# mlock01 +# mlock02 +# mlock03 +# mlock04 +# mlock05 + +# mlock201 +# mlock202 +# mlock203 + +qmm01 +mmap01 +mmap02 +mmap03 +# mmap04 +mmap05 +mmap06 +# mmap08 +mmap09 +# mmap12 +# mmap13 +# mmap14 +# test is broken, mask it for now. +#mmap11 mmap11 -i 30000 +mmap15 +# mmap16 +# mmap17 +# mmap18 +mmap19 +# mmap20 + +# modify_ldt01 +# modify_ldt02 +# modify_ldt03 + +# mount01 +# mount02 +# mount03 +# mount04 +# mount05 +# mount06 +# mount07 + +# mount_setattr01 + +# move_mount01 +# move_mount02 + +# move_pages01 +# move_pages02 +# move_pages03 +# move_pages04 +# move_pages05 +# move_pages06 +# move_pages07 +# move_pages09 +# move_pages10 +# move_pages11 +# move_pages12 + +# mprotect01 +mprotect02 +mprotect03 +# mprotect04 +mprotect05 + +# pkey01 + +# mq_notify01 +# mq_notify02 +# mq_notify03 +# mq_open01 +# mq_timedreceive01 +# mq_timedsend01 +# mq_unlink01 + +# mremap01 +# mremap02 +# mremap03 +# mremap04 +# mremap05 +# mremap06 + +# mseal01 +# mseal02 + +# msgctl01 +# msgctl02 +# msgctl03 +# msgctl04 +# msgctl05 +# msgctl06 +# msgctl12 + +# msgstress01 + +# msgget01 +# msgget02 +# msgget03 +# msgget04 +# msgget05 + +# msgrcv01 +# msgrcv02 +# msgrcv03 +# msgrcv05 +# msgrcv06 +# msgrcv07 +# msgrcv08 + +# msgsnd01 +# msgsnd02 +# msgsnd05 +# msgsnd06 + +msync01 +msync02 +# msync03 +# msync04 + +# munlock01 +# munlock02 + +# munlockall01 + +munmap01 +munmap02 +munmap03 + +# nanosleep01 +nanosleep02 +# nanosleep04 + +# name_to_handle_at01 +# name_to_handle_at02 + +# nftw01 +# nftw6401 + +# nice01 +nice02 +nice03 +# nice04 +# nice05 + +open01 +# open02 +open03 +# open04 +# open06 +open07 +# open08 +open09 +# open10 +# open11 +# open12 +# open13 +# open14 +open15 + +openat01 +# openat02 +# openat03 +# openat04 + +# openat201 +# openat202 +# openat203 + +# open_by_handle_at01 +# open_by_handle_at02 + +# open_tree01 +# open_tree02 + +# mincore01 +# mincore02 +# mincore03 +# mincore04 + +# madvise01 +# madvise02 +# madvise03 +# madvise05 +# madvise06 +# madvise07 +# madvise08 +# madvise09 +# madvise10 +# madvise11 +# madvise12 + +newuname01 + +pathconf01 +# pathconf02 + +# pause01 +# pause02 +# pause03 + +# personality01 +# personality02 + +# pidfd_getfd01 +# pidfd_getfd02 + +# pidfd_open01 +# pidfd_open02 +# pidfd_open03 +# pidfd_open04 + +# pidfd_send_signal01 +# pidfd_send_signal02 +# pidfd_send_signal03 + +pipe01 +# pipe02 +pipe03 +pipe04 +pipe05 +# pipe06 +# pipe07 +# pipe08 +pipe09 +pipe10 +pipe11 +# pipe12 +# pipe13 +pipe14 +# pipe15 + +# pipe2_01 +# pipe2_02 +# pipe2_04 + +# pivot_root01 + +poll01 +# poll02 + +ppoll01 + +prctl01 +# prctl02 +prctl03 +# prctl05 +# prctl06 +# prctl07 +# prctl08 +# prctl09 +# prctl10 + +pread01 +pread01_64 +pread02 +pread02_64 + +preadv01 +preadv01_64 +# preadv02 +# preadv02_64 +# preadv03 +# preadv03_64 + +preadv201 +preadv201_64 +# preadv202 +# preadv202_64 +# preadv203 +# preadv203_64 + +# profil01 + +# process_vm_readv01 +# process_vm_readv02 +# process_vm_readv03 +# process_vm_writev01 +# process_vm_writev02 + +# process_madvise01 + +# prot_hsymlinks +# dirtyc0w +# dirtyc0w_shmem +# dirtypipe + +# pselect01 +# pselect01_64 +pselect02 +pselect02_64 +pselect03 +pselect03_64 + +# ptrace01 +# ptrace02 +# ptrace03 +# ptrace04 +# ptrace05 +# ptrace06 +# ptrace07 +# ptrace08 +# ptrace09 +# ptrace10 +# ptrace11 + +pwrite01 +pwrite02 +pwrite03 +pwrite04 + +pwrite01_64 +pwrite02_64 +pwrite03_64 +pwrite04_64 + +pwritev01 +pwritev01_64 +# pwritev02 +# pwritev02_64 +# pwritev03 +# pwritev03_64 + +pwritev201 +pwritev201_64 +# pwritev202 +# pwritev202_64 + +# quotactl01 +# quotactl02 +# quotactl03 +# quotactl04 +# quotactl05 +# quotactl06 +# quotactl07 +# quotactl08 +# quotactl09 + +read01 +read02 +# read03 +read04 + +# readahead01 +# readahead02 + +# readdir01 +# readdir21 + +# readlink01A +# readlink01 +# readlink03 + +#readlinkat test cases +# readlinkat01 +# readlinkat02 + +readv01 +# readv02 + +# realpath01 + +# reboot01 +# reboot02 + +# recv01 + +# recvfrom01 + +# recvmsg01 +# recvmsg02 +# recvmsg03 + +# recvmmsg01 + +# remap_file_pages01 +# remap_file_pages02 + +removexattr01 +# removexattr02 + +# rename01 +rename01A +# rename03 +# rename04 +# rename05 +# rename06 +# rename07 +# rename08 +# rename09 +# rename10 +# rename11 +# rename12 +# rename13 +rename14 +# rename15 + +#renameat test cases +# renameat01 + +# renameat201 +# renameat202 + +# request_key01 +# request_key02 +# request_key03 +# request_key04 +# request_key05 +# request_key06 + +rmdir01 +# rmdir02 +# rmdir03 +rmdir03A + +rt_sigaction01 +rt_sigaction02 +rt_sigaction03 +rt_sigprocmask01 +rt_sigprocmask02 +# rt_sigqueueinfo01 +# rt_sigqueueinfo02 +rt_sigsuspend01 +# rt_sigtimedwait01 +# rt_tgsigqueueinfo01 + +sbrk01 +sbrk02 +# sbrk03 + +sched_get_priority_max01 +sched_get_priority_max02 + +sched_get_priority_min01 +sched_get_priority_min02 + +sched_getparam01 +# sched_getparam03 + +# sched_rr_get_interval01 +# sched_rr_get_interval02 +# sched_rr_get_interval03 + +sched_setparam01 +sched_setparam02 +sched_setparam03 +# sched_setparam04 +# sched_setparam05 + +sched_getscheduler01 +# sched_getscheduler02 + +# sched_setscheduler01 +# sched_setscheduler02 +# sched_setscheduler03 +sched_setscheduler04 + +sched_yield01 + +# sched_setaffinity01 +# sched_getaffinity01 + +# sched_setattr01 +# sched_getattr01 +# sched_getattr02 + +# seccomp01 + +select01 +# select02 +select03 +# select04 + +# semctl01 +# semctl02 +# semctl03 +# semctl04 +# semctl05 +# semctl06 +# semctl07 +# semctl08 +# semctl09 + +# semget01 +# semget02 +# semget05 + +# semop01 +# semop02 +# semop03 +# semop04 +# semop05 + +# send01 +# send02 + +sendfile02 +sendfile02_64 +# sendfile03 +# sendfile03_64 +# sendfile04 +# sendfile04_64 +sendfile05 +sendfile05_64 +sendfile06 +sendfile06_64 +# sendfile07 +# sendfile07_64 +sendfile08 +sendfile08_64 +# sendfile09 +# sendfile09_64 + +# sendmsg01 +# sendmsg02 +# sendmsg03 + +# sendmmsg01 +# sendmmsg02 + +# sendto01 +# sendto02 +# sendto03 + +# set_mempolicy01 +# set_mempolicy02 +# set_mempolicy03 +# set_mempolicy04 + +set_robust_list01 +# set_thread_area01 +# set_tid_address01 + +# setdomainname01 +# setdomainname02 +# setdomainname03 + +# setfsgid01 +# setfsgid01_16 +# setfsgid02 +# setfsgid02_16 +# setfsgid03 +# setfsgid03_16 + +# setfsuid01 +# setfsuid01_16 +setfsuid02 +# setfsuid02_16 +# setfsuid03 +# setfsuid03_16 +# setfsuid04 +# setfsuid04_16 + +setgid01 +# setgid01_16 +# setgid02 +# setgid02_16 +# setgid03 +# setgid03_16 + +# setegid01 +# setegid02 + +# sgetmask01 + +setgroups01 +# setgroups01_16 +setgroups02 +# setgroups02_16 +# setgroups03 +# setgroups03_16 + +# sethostname01 +# sethostname02 +# sethostname03 + +# setitimer01 +setitimer02 + +# setns01 +# setns02 + +setpgid01 +# setpgid02 +# setpgid03 + +setpgrp01 +setpgrp02 + +# setpriority01 +# setpriority02 + +setregid01 +# setregid01_16 +# setregid02 +# setregid02_16 +# setregid03 +# setregid03_16 +# setregid04 +# setregid04_16 + +# setresgid01 +# setresgid01_16 +# setresgid02 +# setresgid02_16 +# setresgid03 +# setresgid03_16 +# setresgid04 +# setresgid04_16 + +# setresuid01 +# setresuid01_16 +# setresuid02 +# setresuid02_16 +setresuid03 +# setresuid03_16 +# setresuid04 +# setresuid04_16 +# setresuid05 +# setresuid05_16 + +setreuid01 +# setreuid01_16 +# setreuid02 +# setreuid02_16 +# setreuid03 +# setreuid03_16 +# setreuid04 +# setreuid04_16 +# setreuid05 +# setreuid05_16 +# setreuid06 +# setreuid06_16 +# setreuid07 +# setreuid07_16 + +# setrlimit01 +# setrlimit02 +# setrlimit03 +setrlimit04 +setrlimit05 +# setrlimit06 + +setsid01 + +# setsockopt01 +# setsockopt02 +setsockopt03 +# setsockopt04 +# setsockopt05 +# setsockopt06 +# setsockopt07 +# setsockopt08 +# setsockopt09 +# setsockopt10 + +# settimeofday01 +# settimeofday02 + +setuid01 +# setuid01_16 +# setuid03 +# setuid03_16 +# setuid04 +# setuid04_16 + +# setxattr01 +# setxattr02 +# setxattr03 + +# shmat01 +# shmat02 +# shmat03 +# shmat04 + +# shmctl01 +# shmctl02 +# shmctl03 +# shmctl04 +# shmctl05 +# shmctl06 +# shmctl07 +# shmctl08 + +# shmdt01 +# shmdt02 + +# shmget02 +# shmget03 +# shmget04 +# shmget05 +# shmget06 + +# shutdown01 +# shutdown02 + +# sigaction01 +sigaction02 + +sigaltstack01 +sigaltstack02 + +# sighold02 + +# signal01 +signal02 +signal03 +signal04 +signal05 +signal06 + +signalfd01 +signalfd02 + +signalfd4_01 +signalfd4_02 + +sigpending02 + +sigprocmask01 + +sigrelse01 + +# sigsuspend01 +sigsuspend02 + +# sigtimedwait01 + +# sigwait01 +# sigwaitinfo01 + +# socket01 +socket02 + +# socketcall01 +# socketcall02 +# socketcall03 + +# socketpair01 +socketpair02 + +# sockioctl01 + +# splice01 +# splice02 +# splice03 +# splice04 +# splice05 +# splice06 +# splice07 +# splice08 +# splice09 + +# tee01 +# tee02 + +# ssetmask01 + +# stat01 +# stat01_64 +stat02 +stat02_64 +# stat03 +# stat03_64 +# stat04 +# stat04_64 + +# statmount01 +# statmount02 +# statmount03 +# statmount04 +# statmount05 +# statmount06 +# statmount07 +# statmount08 + +# statfs01 +# statfs01_64 +# statfs02 +# statfs02_64 +# statfs03 +# statfs03_64 + +# statvfs01 +# statvfs02 + +# stime01 +# stime02 + +string01 + +# swapoff01 +# swapoff02 + +# swapon01 +# swapon02 +# swapon03 + +#Exclusive syscall() for POWER6 machines only +# switch01 + +# symlink01 +symlink02 +# symlink03 +symlink04 + +#symlinkat test cases +symlinkat01 + +# sync01 + +# syncfs01 + +#testcases for sync_file_range +# sync_file_range01 +# sync_file_range02 + +syscall01 + +sysconf01 + +# sysctl01 +# sysctl03 +# sysctl04 + +# sysfs01 +# sysfs02 +# sysfs03 +# sysfs04 +# sysfs05 + +sysinfo01 +sysinfo02 +# sysinfo03 + +# syslog11 +# syslog12 + +# tgkill01 +# tgkill02 +# tgkill03 + +time01 + +times01 +# times03 + +# New syscall support from 2.6.25 kernel onwards + +timerfd01 +timerfd02 +# timerfd04 +timerfd_create01 +# timerfd_gettime01 +# timerfd_settime01 +# timerfd_settime02 + +# timer_create01 +timer_create02 +timer_create03 + +# timer_delete01 +timer_delete02 + +# timer_getoverrun01 +# timer_gettime01 + +# timer_settime01 +# timer_settime02 +# timer_settime03 + +# tkill01 +# tkill02 + +truncate02 +truncate02_64 +# truncate03 +# truncate03_64 + +# 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 + +umask01 + +uname01 +uname02 +# uname04 + +unlink01 +unlink05 +# unlink07 +# unlink08 +# unlink09 +# unlink10 + +#unlinkat test cases +unlinkat01 + +# unshare01 +# unshare02 + +# +# These tests require an unmounted block device +# to run correctly. Please see individual test +# code for more information. +# +# umount01 +# umount02 +# umount03 + +# umount2_01 +# umount2_02 + +# userfaultfd01 + +# ustat01 +# ustat02 + +# utime01 +# utime02 +# utime03 +# utime04 +# utime05 +# utime06 +utime07 + +# utimes01 + +# Introduced from Kernel 2.6.22 onwards +# utimensat01 + +vfork01 +vfork02 + +# vhangup01 +# vhangup02 + +#vmsplice test cases +# vmsplice01 +# vmsplice02 +# vmsplice03 +# vmsplice04 + +wait01 +wait02 + +# wait401 +# wait402 +# wait403 + +# waitpid01 +waitpid03 +# waitpid04 +waitpid06 +waitpid07 +# waitpid08 +waitpid09 +# waitpid10 +waitpid11 +waitpid12 +# waitpid13 + +# waitid01 +# waitid02 +waitid03 +waitid04 +# waitid05 +# waitid06 +# waitid07 +# waitid08 +waitid09 +# waitid10 +# waitid11 + +write01 +write02 +write03 +# write04 +# write05 +write06 + +# writev01 +writev02 +# writev03 +writev05 +writev06 +# writev07 + +# perf_event_open01 +# perf_event_open02 + +# futex_cmp_requeue01 +# futex_cmp_requeue02 +futex_wait01 +futex_wait02 +# futex_wait03 +futex_wait04 +# futex_wait05 +# futex_waitv01 +# futex_waitv02 +# futex_waitv03 +futex_wake01 +# futex_wake02 +# futex_wake03 +# futex_wake04 +futex_wait_bitset01 + +# memfd_create01 +# memfd_create02 +# memfd_create03 +# memfd_create04 + +# copy_file_range01 +# copy_file_range02 +# copy_file_range03 + +# statx01 +statx02 +statx03 +# statx04 +# statx05 +# statx06 +# statx07 +# statx08 +# statx09 +# statx10 +# statx11 +# statx12 + +# membarrier01 + +# io_uring01 +# io_uring02 + +# Tests below may cause kernel memory leak +# perf_event_open03 diff --git a/test/syscall_test/ltp/testcases/blocked/exfat.txt b/test/syscall_test/ltp/testcases/blocked/exfat.txt new file mode 100644 index 00000000..181fc380 --- /dev/null +++ b/test/syscall_test/ltp/testcases/blocked/exfat.txt @@ -0,0 +1,89 @@ +bind04 +chdir01A +chmod01 +chmod01A +chmod08 +chown05 +creat03 +dup05 +dup203 +dup205 +fallocate03 +fchmod01 +fchmodat01 +fchown05 +fchownat02 +fstat02 +fstat02_64 +fsync02 +ftruncate01 +ftruncate01_64 +getcwd03 +lchown01 +link01 +link02 +link05 +linkat01 +lstat01 +lstat01_64 +mkdir04 +mknod01 +mmap06 +mmap19 +mprotect02 +mprotect03 +msync01 +msync02 +munmap01 +munmap02 +open07 +open15 +openat01 +pread01 +pread01_64 +preadv01 +preadv01_64 +preadv201 +preadv201_64 +pwrite01 +pwrite02 +pwrite04 +pwrite01_64 +pwrite02_64 +pwrite04_64 +pwritev01 +pwritev01_64 +pwritev201 +pwritev201_64 +read01 +read02 +read04 +readv01 +rename01A +rmdir03A +select01 +sendfile02 +sendfile02_64 +sendfile06 +sendfile06_64 +sendfile08 +sendfile08_64 +stat02 +stat02_64 +symlink02 +symlink04 +symlinkat01 +truncate02 +truncate02_64 +umask01 +unlink01 +unlink05 +unlinkat01 +utime07 +write01 +write03 +write06 +writev02 +writev05 +writev06 +statx02 diff --git a/test/syscall_test/ltp/testcases/blocked/ext2.txt b/test/syscall_test/ltp/testcases/blocked/ext2.txt new file mode 100644 index 00000000..a3c6e026 --- /dev/null +++ b/test/syscall_test/ltp/testcases/blocked/ext2.txt @@ -0,0 +1,55 @@ +dup05 +getcwd02 +linkat01 +mknod01 +# FIXME: The inode number of ext2 will be exhausted by `rename14`. +rename14 +rmdir01 +rmdir03A +rt_sigaction01 +rt_sigaction02 +rt_sigaction03 +rt_sigprocmask01 +rt_sigprocmask02 +select01 +select03 +sendfile02 +sendfile02_64 +sendfile05 +sendfile05_64 +sendfile06 +sendfile06_64 +sendfile08 +sendfile08_64 +sigaltstack02 +signalfd02 +signalfd4_01 +signalfd4_02 +sigrelse01 +stat02 +stat02_64 +symlink02 +symlink04 +symlinkat01 +truncate02 +truncate02_64 +umask01 +unlink01 +unlink05 +unlinkat01 +utime07 +waitpid06 +waitpid07 +waitpid09 +waitpid11 +waitpid12 +waitid04 +write01 +write02 +write03 +write06 +writev02 +writev05 +writev06 +statx02 +statx03 diff --git a/test/syscall_test/run_syscall_test.sh b/test/syscall_test/run_syscall_test.sh index 24445888..ec59a393 100755 --- a/test/syscall_test/run_syscall_test.sh +++ b/test/syscall_test/run_syscall_test.sh @@ -2,73 +2,28 @@ # SPDX-License-Identifier: MPL-2.0 -SCRIPT_DIR=$(dirname "$0") -TEST_TMP_DIR=${SYSCALL_TEST_WORKDIR:-/tmp} -TEST_BIN_DIR=$SCRIPT_DIR/tests -BLOCKLIST_DIR=$SCRIPT_DIR/blocklists -FAIL_CASES=$SCRIPT_DIR/fail_cases -BLOCK="" -TESTS=0 -PASSED_TESTS=0 -RESULT=0 -GREEN='\033[0;32m' -RED='\033[0;31m' -NC='\033[0m' +set -e -get_blocklist_subtests(){ - if [ -f $BLOCKLIST_DIR/$1 ]; then - BLOCK=$(grep -v '^#' $BLOCKLIST_DIR/$1 | tr '\n' ':') - else - BLOCK="" +SYSCALL_TEST_SUITE=${SYSCALL_TEST_SUITE:-ltp} +LTP_DIR=/opt/ltp +GVISOR_DIR=/opt/gvisor + +if [ "${SYSCALL_TEST_SUITE}" == "ltp" ]; then + echo "Running LTP syscall tests..." + if ! "${LTP_DIR}/run_ltp_test.sh"; then + echo "Error: LTP syscall tests failed." >&2 + exit 1 fi - - for extra_dir in $EXTRA_BLOCKLISTS_DIRS ; do - if [ -f $SCRIPT_DIR/$extra_dir/$1 ]; then - BLOCK="${BLOCK}:$(grep -v '^#' $SCRIPT_DIR/$extra_dir/$1 | tr '\n' ':')" - fi - done - - return 0 -} - -run_one_test(){ - echo -e "Run Test Case: $1" - # The gvisor test framework utilizes the "TEST_TMPDIR" environment variable to dictate the directory's location. - export TEST_TMPDIR=$TEST_TMP_DIR - ret=0 - if [ -f $TEST_BIN_DIR/$1 ]; then - get_blocklist_subtests $1 - cd $TEST_BIN_DIR && ./$1 --gtest_filter=-$BLOCK - ret=$? - #After executing the test, it is necessary to clean the directory to ensure no residual data remains - rm -rf $TEST_TMP_DIR/* - else - echo -e "Warning: $1 test does not exit" - ret=1 +elif [ "${SYSCALL_TEST_SUITE}" == "gvisor" ]; then + echo "Running gVisor syscall tests..." + if ! "${GVISOR_DIR}/run_gvisor_test.sh"; then + echo "Error: gVisor syscall tests failed." >&2 + exit 2 fi - echo "" - return $ret -} - -rm -f $FAIL_CASES && touch $FAIL_CASES -rm -rf $TEST_TMP_DIR/* - -for syscall_test in $(find $TEST_BIN_DIR/. -name \*_test) ; do - test_name=$(basename "$syscall_test") - run_one_test $test_name - if [ $? -eq 0 ] && PASSED_TESTS=$((PASSED_TESTS+1));then - TESTS=$((TESTS+1)) - else - echo -e "$test_name" >> $FAIL_CASES - TESTS=$((TESTS+1)) - fi -done - -echo -e "$GREEN$PASSED_TESTS$NC of $GREEN$TESTS$NC test cases passed." -[ $PASSED_TESTS -ne $TESTS ] && RESULT=1 -if [ $TESTS != $PASSED_TESTS ]; then - echo -e "The $RED$(($TESTS-$PASSED_TESTS))$NC failed test cases are as follows:" - cat $FAIL_CASES +else + echo "Error: Unknown test suite '${SYSCALL_TEST_SUITE}'." >&2 + exit 3 fi -exit $RESULT +echo "All syscall tests passed." +exit 0 diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 73ad6833..42d5d7f0 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -283,11 +283,11 @@ RUN apt clean && rm -rf /var/lib/apt/lists/* WORKDIR /root RUN rm -rf bazel -FROM build-bazel AS syscall_test +FROM build-bazel AS build-gvisor -# Build the syscall test binaries -COPY test/syscall_test /root/syscall_test -WORKDIR /root/syscall_test +# Build the gvisor syscall test binaries +COPY test/syscall_test/gvisor /root/gvisor +WORKDIR /root/gvisor RUN export BUILD_DIR=build && \ make ${BUILD_DIR}/syscall_test_bins @@ -368,7 +368,7 @@ RUN apt clean && rm -rf /var/lib/apt/lists/* # Prepare the system call test suite COPY --from=build-ltp /opt/ltp /opt/ltp -COPY --from=syscall_test /root/syscall_test/build/syscall_test_bins /root/syscall_test_bins +COPY --from=build-gvisor /root/gvisor/build/syscall_test_bins /root/syscall_test_bins ENV ASTER_PREBUILT_SYSCALL_TEST=/root/syscall_test_bins # Install Busybox built from the previous stages